/* ═══ Header Component ═══ */
.header {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(1rem, 3vw, 1.5rem);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
    flex: 1; /* Ocupa o espaço necessário */
}

.header-title {
    margin: 0;
    font-size: var(--font-lg);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.toggle-btn {
    display: flex !important; /* Força exibição no mobile */
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    flex-shrink: 0;
    border-radius: 0.5rem;
    background-color: var(--color-primary) !important; /* Azul sólido para visibilidade total */
    color: white !important; /* Ícone branco para contraste máximo */
    border: none !important;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: 50;
}

.toggle-btn:hover {
    background-color: #1d4ed8 !important;
}

.toggle-btn i {
    font-size: 1.25rem;
}

.header-right {
    display: flex;
    align-items: center;
}

/* ═══ Sidebar Component (Offcanvas Mobile) ═══ */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--bg-overlay);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0.75rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    
    /* Scrollbar discreta (Firefox) */
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
}

/* Scrollbar discreta (Chrome/Safari/Edge) */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 10px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.6);
}

.nav-group-label {
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 1.5rem 0.75rem 0.5rem;
    letter-spacing: 0.1em;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--font-sm);
    font-weight: 500;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    gap: 0.75rem;
}

.nav-item i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.nav-item:hover {
    background-color: var(--color-primary-soft);
    color: var(--color-primary);
}

.nav-item.active {
    background-color: var(--color-primary-soft);
    color: var(--color-primary);
    font-weight: 600;
}

/* ═══ Dash Cards ═══ */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile default */
    gap: 1rem;
    margin-bottom: 2rem;
}

.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: default;
}

.dash-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.dash-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    background-color: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 1.25rem;
}

.dash-card-info {
    display: flex;
    flex-direction: column;
}

.dash-card-label {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.dash-card-value {
    font-size: var(--font-xl);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

/* ═══ User Profile ═══ */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

/* ═══ Alerts ═══ */
.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--font-sm);
    border: 1px solid transparent;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══ Modal System ═══ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--bg-overlay);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 1rem;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalFadeUp 0.3s ease-out;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-weight: 700;
    font-size: var(--font-lg);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    background-color: #F8FAFC;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

@keyframes modalFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══ Badges ═══ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success { background: #DCFCE7; color: #15803d; }
.badge-info { background: #DBEAFE; color: #1d4ed8; }
.badge-warning { background: #FEF3C7; color: #b45309; }
.badge-danger { background: #FEE2E2; color: #b91c1c; }
.badge-neutral { background: #F1F5F9; color: #475569; }

/* ═══ Section Card ═══ */
.section-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: clamp(1rem, 5vw, 1.5rem);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

