:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --bg-dark: #0f172a;
    --sidebar-bg: #1e293b;
}
body {
    font-family: 'Inter', sans-serif;
    background-color: #f1f5f9;
    color: #1e293b;
}
.navbar {
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
}
.sidebar {
    height: calc(100dvh - 60px);
    height: calc(100vh - 60px); /* fallback para navegadores antigos */
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #f8fafc;
    position: fixed;
    padding: 1.5rem 1rem;
    padding-bottom: 2rem;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE e Edge antigo */
    transform: translateX(0);
    transition: transform 0.3s ease-in-out;
    z-index: 1040;
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge moderno */
}

/* Sidebar hidden by default on mobile */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}

@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0) !important;
    }
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}
.sidebar-link:hover, .sidebar-link.active {
    background-color: rgba(14, 165, 233, 0.1);
    color: var(--primary);
}
.sidebar-link i { font-size: 1.25rem; margin-right: 0.75rem; }
.main-content { margin-left: 260px; padding: 2rem; }

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1030;
}

@media (max-width: 991.98px) {
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1030;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

/* Small utility & components moved from inline styles */
.stat-card { padding: 1rem; }
.stat-icon {
    width: 48px; height: 48px; border-radius: 0.75rem;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.date-badge { min-width: 60px; }
.text-truncate-max300 { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-order { width: 80px; }
.avatar-sm { width: 40px; height: 40px; }
.avatar-xs { width: 32px; height: 32px; }
.email-small { font-size: 0.75rem; }
.card-hover:hover { transform: translateY(-5px); background-color: #f8f9fa; }
.transition-all { transition: all 0.2s ease-in-out; }

/* Auth / login specific - Bootstrap Sign-in style */
body.auth-page {
    background-color: #f5f5f5;
    min-height: 100vh;
}

.auth-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 2.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    width: 100%;
}

.brand-logo {
    font-size: 2rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: -0.025em;
}

.auth-card .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.auth-card .form-control-lg {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
}

.auth-card .form-control-lg:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.auth-card .btn-primary {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.auth-card .btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.auth-card a {
    color: #0d6efd;
    text-decoration: none;
}

.auth-card a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 575.98px) {
    .auth-card {
        padding: 1.5rem;
        border-radius: 0.5rem;
    }
    
    .brand-logo {
        font-size: 1.75rem;
    }
}

/* Focus visible for accessibility */
.auth-card .form-control:focus,
.auth-card .btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Navigation Buttons Styling (from escala_dia.php) */
.nav-buttons {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    border-radius: 50px !important;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn i {
    font-size: 1rem;
}

/* Loading Overlay Styling (from planejar.php) */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-overlay.show {
    display: flex;
}

.loading-content {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #495057;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.loading-subtext {
    color: #6c757d;
    font-size: 0.9rem;
}

/* JSON Syntax Highlighting */
.json-display {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}
.json-key {
    color: #d73a49;
    font-weight: 600;
}
.json-string {
    color: #032f62;
}
.json-number {
    color: #005cc5;
}
.json-bool {
    color: #e36209;
    font-weight: 600;
}
.json-null {
    color: #6f42c1;
    font-style: italic;
}

/* --- Planejamento em Matriz --- */
.matrix-container {
    overflow-x: auto;
    padding-bottom: 20px;
}
.matrix-table {
    min-width: 800px;
    border-collapse: separate;
    border-spacing: 0;
}
.matrix-table th, .matrix-table td {
    border: 1px solid #dee2e6;
    padding: 12px;
    min-width: 250px;
    vertical-align: top;
}
.matrix-table th:first-child, .matrix-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    background: #f8f9fa;
    min-width: 220px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}
.member-tag {
    display: flex;
    align-items: center;
    background: #f1f3f5;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    border: 1px solid #dee2e6;
    transition: all 0.2s;
}
.member-tag:hover {
    background: #e9ecef;
}
.member-tag .remove-btn {
    margin-left: auto;
    cursor: pointer;
    color: #dc3545;
    font-weight: bold;
    padding: 0 4px;
    font-size: 1.1rem;
    line-height: 1;
}
.warning-label {
    font-size: 0.7rem;
    display: block;
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    font-weight: 500;
}
.blocked-item {
    opacity: 0.6;
    text-decoration: line-through;
    pointer-events: none;
    background-color: #fff5f5 !important;
}
.search-box {
    position: relative;
}
.search-results {
    position: fixed;
    z-index: 9999;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover {
    background: #f8f9fa;
    color: #0d6efd;
}
.search-result-item small {
    display: block;
    color: #6c757d;
}

/* Global Card Styling */

/* Custom Utility Classes */
.scrollable-area-200 { max-height: 200px; overflow-y: auto; }
.scrollable-area-300 { max-height: 300px; overflow-y: auto; }
.w-150 { width: 150px; }
.w-15 { width: 15%; }
.w-20 { width: 20%; }
.w-30 { width: 30%; }
.w-60p { width: 60%; }

.checkbox-lg { width: 1.3em; height: 1.3em; }

.icon-box-32 {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo {
    max-height: 80px;
    width: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.custom-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-content-sm {
    width: 100%;
    max-width: 450px;
}

