.premium-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.goal-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #eff6ff;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px dashed #3b82f6;
}

.goal-progress-bar {
    width: 170px;
    height: 8px;
    background: #dbeafe;
    border-radius: 4px;
    overflow: hidden;
}

.goal-fill {
    height: 100%;
    background: #3b82f6;
    width: 0%;
    transition: width 0.5s ease;
}

.metric-card.highlight-success {
    border-bottom: 4px solid var(--success);
}

.metric-card.highlight-danger {
    border-bottom: 4px solid var(--danger);
}

.metric-card.highlight-primary {
    border-bottom: 4px solid var(--primary);
}

.metric-card.highlight-warning {
    border-bottom: 4px solid var(--warning);
}

.subdiscipline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.subdiscipline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.subdiscipline-item:last-child {
    border-bottom: none;
}

.badge-error {
    background: #fee2e2;
    color: #ef4444;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}




/* ── Sidebar collapsed (desktop) ── */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .user-details,
.sidebar.collapsed .sidebar-user-arrow,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-logout span {
    display: none;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 1.3rem 0;
    gap: 0;
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
    margin: 0.75rem 0.5rem;
    padding: 0.75rem 0.5rem;
    gap: 0;
}

.sidebar.collapsed .sidebar-nav { padding: 0.4rem 0.5rem; }

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.7rem;
    gap: 0;
}

.sidebar.collapsed .sidebar-footer { padding: 0.7rem 0.5rem; }

.sidebar.collapsed .sidebar-logout {
    justify-content: center;
    padding: 0.7rem;
    gap: 0;
}

.sidebar.collapsed .collapse-btn i { transform: rotate(180deg); }

/* Main content margin */
.main-content { transition: margin-left 0.35s cubic-bezier(0.4,0,0.2,1); }

.sidebar.collapsed + .main-content { margin-left: var(--sidebar-collapsed-width); }

@media (min-width: 901px) {
    .main-content { margin-left: var(--sidebar-width); }
}


.periodo-btn {
    background: #f1f5f9;
    border: 2px solid transparent;
    color: #475569;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s;
    font-family: inherit;
}

.periodo-btn:hover {
    background: #e2e8f0;
    color: #334155;
}

.periodo-btn.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Top disciplinas */
.top-disc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.top-disc-name {
    font-size: 0.82rem;
    color: #e2e8f0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-disc-bar-wrap {
    flex: 1.2;
    background: #1e293b;
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
}

.top-disc-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #3b82f6, #0ea5e9);
    transition: width 0.8s ease;
}

.top-disc-pct {
    font-size: 0.78rem;
    font-weight: 700;
    color: #38bdf8;
    min-width: 36px;
    text-align: right;
}

/* ============================================================
   EVOLUÇÃO NOS SIMULADOS — cores em classe (não inline) pra
   funcionar corretamente no modo escuro
   ============================================================ */
.simulados-evo-title { color: #0369a1; }
/* Selector com 2 classes (não só 1) pra ter especificidade maior que a
   regra genérica "[data-theme=dark] .card-header h3" e realmente vencer. */
[data-theme="dark"] .simulados-evo-card .simulados-evo-title { color: #7dd3fc; }

.simulados-evo-select {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
}
[data-theme="dark"] .simulados-evo-card .simulados-evo-select {
    border-color: #334155;
    background: #0f172a;
}

.simulados-stat-box {
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid;
}
.simulados-stat-box .stat-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}
.simulados-stat-box .stat-value { font-weight: 800; }
.simulados-stat-box .stat-sub { font-size: 0.8rem; margin-top: 0.2rem; }

.simulados-stat-blue { background: #f0f9ff; border-color: #bae6fd; }
.simulados-stat-blue .stat-label { color: #0284c7; }
.simulados-stat-blue .stat-value { font-size: 2rem; color: #0369a1; }
[data-theme="dark"] .simulados-stat-blue { background: rgba(2, 132, 199, 0.12); border-color: #0c4a6e; }
[data-theme="dark"] .simulados-stat-blue .stat-label { color: #38bdf8; }
[data-theme="dark"] .simulados-stat-blue .stat-value { color: #7dd3fc; }

.simulados-stat-green { background: #f0fdf4; border-color: #bbf7d0; }
.simulados-stat-green .stat-label { color: #166534; }
.simulados-stat-green .stat-value { font-size: 1.5rem; color: #15803d; }
.simulados-stat-green .stat-sub { color: #22c55e; }
[data-theme="dark"] .simulados-stat-green { background: rgba(22, 163, 74, 0.12); border-color: #14532d; }
[data-theme="dark"] .simulados-stat-green .stat-label { color: #4ade80; }
[data-theme="dark"] .simulados-stat-green .stat-value { color: #86efac; }
[data-theme="dark"] .simulados-stat-green .stat-sub { color: #4ade80; }

/* Grids inline responsivos */
@media (max-width: 900px) {
    #analise-grid-row1 {
        grid-template-columns: 1fr !important;
    }

    .simulados-stats-grid,
    .analise-main-grid {
        grid-template-columns: 1fr !important;
    }

    /* O botão hamburguer é fixed no canto superior direito da tela; quando
       este card é rolado até essa faixa, o texto do cabeçalho colide com
       ele. padding-right não resolve aqui porque o texto já satura a
       largura disponível do flex item (fit-content) — precisa de um
       max-width explícito pra realmente encolher a caixa. */
    .simulados-evo-header-text { max-width: calc(100% - 56px); }

    .premium-header {
        flex-direction: column;
        align-items: stretch;
    }

    .goal-box {
        width: 100%;
    }

    .goal-progress-bar {
        width: 100%;
    }
}

@media (max-width: 600px) {
    #periodo-filter-btns {
        justify-content: flex-start;
    }

    .periodo-btn {
        font-size: 0.78rem;
        padding: 0.35rem 0.7rem;
    }
}

/* ── Filtros Globais mobile ── */
@media (max-width: 640px) {
    /* Container dos filtros empilha verticalmente */
    #periodo-filter-btns {
        width: 100%;
    }

    /* Separa o container de filtros para ocupar largura total */
    #custom-period-container {
        width: 100%;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    #custom-period-container input[type="date"] {
        width: 100%;
        box-sizing: border-box;
    }

    #custom-period-container span {
        display: none; /* oculta "até" — fica implícito no layout vertical */
    }

    /* Select de disciplina não overflow */
    #disciplina-filter {
        min-width: 0 !important;
        max-width: 100%;
        width: auto;
    }

    /* Separador vertical some no mobile */
    #disciplina-filter-sep {
        display: none;
    }
}

/* ── Comparação de Períodos mobile ── */
@media (max-width: 640px) {
    /* Evita overflow do card inteiro */
    #card-comparacao {
        overflow: hidden;
    }

    /* Grid picker: 1 coluna, min-width:0 em cada célula */
    #cmp-pickers-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    #cmp-pickers-grid > div {
        min-width: 0;
        width: 100%;
    }

    /* Badge VS fica horizontal entre os dois blocos */
    #cmp-vs-badge {
        flex-direction: row !important;
        justify-content: center;
        padding: 0.25rem 0 !important;
        gap: 0.5rem !important;
    }

    #cmp-vs-badge > div:first-child,
    #cmp-vs-badge > div:last-child {
        width: 40px !important;
        height: 1px !important;
    }

    /* Inputs de data empilham verticalmente */
    .cmp-date-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.4rem !important;
    }

    .cmp-date-input {
        width: 100%;
        box-sizing: border-box;
    }

    /* Presets: scroll horizontal sem quebrar */
    #cmp-presets-a,
    #cmp-presets-b {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 4px;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none;
        max-width: 100%;
    }

    #cmp-presets-a::-webkit-scrollbar,
    #cmp-presets-b::-webkit-scrollbar {
        display: none;
    }

    /* Botão comparar largura total */
    #btn-comparar {
        width: 100%;
        justify-content: center;
    }

    /* Resultados: coluna única */
    #cmp-results-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    #cmp-results-grid > div {
        min-width: 0;
    }

    /* Delta central fica horizontal */
    #cmp-delta-col {
        flex-direction: row !important;
        padding-top: 0 !important;
        justify-content: center;
        gap: 0.75rem;
        flex-wrap: wrap;
    }
}


@media (max-width: 640px) {
    #notif-wrapper {
        position: absolute !important;
        top: 12px;
        right: 12px;
    }

    #notif-panel {
        position: fixed !important;
        top: auto !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
        width: calc(100vw - 32px) !important;
        max-width: 360px;
        max-height: 70vh;
        top: 68px !important;
        z-index: 1001;
    }

    #notif-list {
        max-height: calc(70vh - 110px);
    }
}

/* ── Grid de colunas do ranking (explicação de pontos) ── */
.ranking-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.2rem 0;
}

@media (max-width: 520px) {
    .ranking-cols {
        grid-template-columns: 1fr;
    }
}

/* ── Premium header em telas muito pequenas ── */
@media (max-width: 480px) {
    .premium-header {
        padding: 1rem;
        gap: 0.75rem;
    }

    .goal-box {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.875rem 1rem;
    }

    .goal-progress-bar {
        width: 100%;
    }
}

/* ── Grade de métricas compacta em phone ── */
@media (max-width: 640px) {
    .metric-card {
        padding: 1rem;
    }
}

/* ── Análise: ajustes finos ── */
@media (max-width: 480px) {
    .analise-main-grid,
    .simulados-stats-grid {
        gap: 1rem !important;
    }
}

/* ================================================================
   CONSTÂNCIA NOS ESTUDOS
   ================================================================ */
.constancia-card {
    padding: 1.25rem 1.5rem 1rem;
    margin-bottom: 1.5rem;
}

.constancia-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.constancia-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.constancia-text {
    font-size: 0.92rem;
    color: #334155;
    margin: 0 0 0.9rem 0;
    line-height: 1.5;
}

.constancia-days-row {
    display: flex;
    gap: 0.22rem;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
    -webkit-overflow-scrolling: touch;
}

.constancia-days-row::-webkit-scrollbar { height: 3px; }
.constancia-days-row::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

.cday {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: transform 0.15s;
    cursor: default;
}

.cday:hover { box-shadow: 0 0 0 3px rgba(59,130,246,0.28); filter: brightness(1.08); }

.cday-ok {
    background: #dcfce7;
    color: #15803d;
    border: 2px solid #86efac;
}

.cday-fail {
    background: #fee2e2;
    color: #dc2626;
    border: 2px solid #fca5a5;
}

.cday-today-ok {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: 2px solid #16a34a;
    box-shadow: 0 2px 10px rgba(34,197,94,0.45);
    width: 38px;
    height: 38px;
    font-size: 0.78rem;
}

.cday-today-pending {
    background: #eff6ff;
    color: #2563eb;
    border: 2px dashed #93c5fd;
    width: 38px;
    height: 38px;
    font-size: 0.78rem;
}

@media (max-width: 480px) {
    .constancia-card { padding: 1rem; }
    .cday { width: 26px; height: 26px; font-size: 0.6rem; gap: 0.15rem; }
    .cday-today-ok, .cday-today-pending { width: 30px; height: 30px; font-size: 0.68rem; }
    .constancia-days-row { gap: 0.18rem; }
}

/* ================================================================
   DARK MODE — dashboard.css
   ================================================================ */
[data-theme="dark"] .constancia-text { color: #cbd5e1; }
[data-theme="dark"] .cday-ok { background: rgba(34,197,94,0.12); border-color: #15803d; color: #4ade80; }
[data-theme="dark"] .cday-fail { background: rgba(239,68,68,0.1); border-color: #b91c1c; color: #f87171; }
[data-theme="dark"] .cday-today-pending { background: rgba(37,99,235,0.12); border-color: #2563eb; color: #60a5fa; }
[data-theme="dark"] .constancia-days-row::-webkit-scrollbar-thumb { background: #1e3550; }

[data-theme="dark"] .premium-header {
    background: linear-gradient(135deg, #1e293b, #243451);
    border: 1px solid #334155;
    box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
[data-theme="dark"] .premium-header h1,
[data-theme="dark"] .premium-header h2,
[data-theme="dark"] .premium-header p { color: #e2e8f0; }

[data-theme="dark"] .goal-box {
    background: rgba(59,130,246,0.07);
    border-color: rgba(59,130,246,0.25);
}

[data-theme="dark"] .goal-progress-bar { background: #1e3550; }

[data-theme="dark"] .badge-error {
    background: rgba(239,68,68,0.1);
    color: #f87171;
}

[data-theme="dark"] .subdiscipline-item { border-bottom-color: #1e3550; }

[data-theme="dark"] .top-disc-bar-wrap { background: #1e3550; }

[data-theme="dark"] .metric-card.highlight-success { border-bottom-color: #10b981; }
[data-theme="dark"] .metric-card.highlight-danger  { border-bottom-color: #ef4444; }
[data-theme="dark"] .metric-card.highlight-primary { border-bottom-color: #3b82f6; }
[data-theme="dark"] .metric-card.highlight-warning { border-bottom-color: #f59e0b; }

[data-theme="dark"] .premium-header h1,
[data-theme="dark"] .premium-header h2,
[data-theme="dark"] .premium-header h3 {
    color: #f8fafc;
}

[data-theme="dark"] .premium-header p,
[data-theme="dark"] .premium-header span {
    color: #cbd5e1;
}

[data-theme="dark"] .goal-box {
    background: #16243a;
    border: 1px solid #2563eb;
}

[data-theme="dark"] .goal-progress-bar {
    background: #334155;
}

[data-theme="dark"] .goal-fill {
    background: linear-gradient(90deg,#3b82f6,#60a5fa);
}

[data-theme="dark"] .subdiscipline-item span {
    color: #e2e8f0;
}

[data-theme="dark"] .badge-error {
    background: rgba(239,68,68,.15);
    color: #fca5a5;
}

[data-theme="dark"] {
    --gray-700: #e2e8f0;
}

[data-theme="dark"] {
    --gray-700: #cbd5e1;
    --gray-800: #f8fafc;
}

[data-theme="dark"] #embaixador-card label {
    color: #cbd5e1 !important;
}

[data-theme="dark"] #embaixador-card input,
[data-theme="dark"] #embaixador-card textarea {
    background: #1a2742 !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] #embaixador-card input::placeholder,
[data-theme="dark"] #embaixador-card textarea::placeholder {
    color: #64748b !important;
}

/* ================================================================
   FLASHCARDS + QUESTÕES RECENTES
   ================================================================ */
.fc-dash-section { margin-bottom: 1.5rem; padding: 0; overflow: hidden; }

.fc-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.fc-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    padding: 0.9rem 0.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
}
.fc-stat-box:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }

.fc-stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}
.fc-num-revisados { color: #22c55e; }
.fc-num-pendentes { color: #f59e0b; }
.fc-num-atrasados { color: #dc2626; }

.fc-stat-lbl {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.fc-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #f1f5f9;
}

.fc-badge {
    background: #f59e0b;
    color: white;
    border-radius: 20px;
    padding: 0.1rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.fc-pending-list {
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fc-pending-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: inherit;
}
.fc-pending-card:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(245,158,11,0.18);
}

.fc-pending-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #f59e0b;
}

.fc-pending-q {
    flex: 1;
    font-size: 0.88rem;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.fc-pending-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.fc-pending-subject {
    font-size: 0.7rem;
    background: #fef9c3;
    color: #92400e;
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    font-weight: 600;
    white-space: nowrap;
}

.fc-pending-due {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}

.fc-empty-state {
    text-align: center;
    padding: 1.5rem;
    color: #64748b;
    font-size: 0.88rem;
}

.fc-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.5rem 1rem;
    flex-wrap: wrap;
}

.fc-page-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
}
.fc-page-btn:hover:not(:disabled) { background: #e2e8f0; }
.fc-page-btn.active { background: #2563eb; color: white; border-color: #2563eb; }
.fc-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Questões recentes */
.dash-recent-q-list {
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dash-q-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: background 0.15s;
}
.dash-q-item:hover { background: #f1f5f9; }

.dash-q-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.dash-q-icon--correct { background: #dcfce7; color: #16a34a; }
.dash-q-icon--wrong   { background: #fee2e2; color: #dc2626; }

.dash-q-text {
    flex: 1;
    font-size: 0.85rem;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.dash-q-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.dash-q-disc {
    font-size: 0.7rem;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    font-weight: 600;
    white-space: nowrap;
}

.dash-q-date {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .fc-stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; padding: 0.75rem; }
    .fc-stat-num { font-size: 1.5rem; }
    .fc-pending-list, .dash-recent-q-list { padding: 0.5rem 0.75rem; }
    .fc-section-title { padding: 0.65rem 0.75rem 0.4rem; }
    .fc-pagination { padding: 0.5rem 0.75rem; }
    .fc-pending-due, .dash-q-date { display: none; }
}

/* ── Dark mode – flashcards + questões ── */
[data-theme="dark"] .fc-stats-row { border-bottom-color: #1e3550; }
[data-theme="dark"] .fc-stat-box { background: #19273a; border-color: #1e3550; }
[data-theme="dark"] .fc-stat-num { color: #e2e8f0; }
[data-theme="dark"] .fc-num-revisados { color: #4ade80; }
[data-theme="dark"] .fc-num-pendentes { color: #f59e0b; }
[data-theme="dark"] .fc-stat-lbl { color: #64748b; }
[data-theme="dark"] .fc-section-title { color: #94a3b8; border-bottom-color: #1e3550; }
[data-theme="dark"] .fc-pending-card { background: rgba(234,179,8,0.06); border-color: rgba(234,179,8,0.22); }
[data-theme="dark"] .fc-pending-card:hover { background: rgba(234,179,8,0.12); border-color: rgba(234,179,8,0.4); }
[data-theme="dark"] .fc-pending-q { color: #e2e8f0; }
[data-theme="dark"] .fc-pending-subject { background: rgba(234,179,8,0.1); color: #fbbf24; }
[data-theme="dark"] .fc-empty-state { color: #64748b; }
[data-theme="dark"] .fc-page-btn { background: #19273a; border-color: #1e3550; color: #94a3b8; }
[data-theme="dark"] .fc-page-btn:hover:not(:disabled) { background: #1f3145; }
[data-theme="dark"] .fc-page-btn.active { background: #2563eb; color: white; border-color: #2563eb; }
[data-theme="dark"] .dash-q-item { background: #19273a; border-color: #1e3550; }
[data-theme="dark"] .dash-q-item:hover { background: #1f3145; }
[data-theme="dark"] .dash-q-text { color: #e2e8f0; }
[data-theme="dark"] .dash-q-icon--correct { background: rgba(34,197,94,0.1); color: #4ade80; }
[data-theme="dark"] .dash-q-icon--wrong { background: rgba(239,68,68,0.08); color: #f87171; }
[data-theme="dark"] .dash-q-disc { background: rgba(37,99,235,0.12); color: #60a5fa; }
[data-theme="dark"] .fc-dash-section > div:first-child { border-bottom-color: #1e3550 !important; }

[data-theme="dark"] #notif-bell {
    background: #1e293b !important;
    border-color: #334155 !important;
}
[data-theme="dark"] #notif-bell i { color: #94a3b8 !important; }
[data-theme="dark"] #notif-badge { border-color: #1e293b !important; }

[data-theme="dark"] #notif-panel {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}
[data-theme="dark"] #notif-panel > div:first-child { border-bottom-color: #334155 !important; }
[data-theme="dark"] #notif-panel > div:first-child span { color: #e2e8f0 !important; }
[data-theme="dark"] #notif-panel > div:last-child { border-top-color: #334155 !important; }

[data-theme="dark"] #newGoalInput {
    background: #0d1828 !important;
    border-color: #1e3550 !important;
    color: #60a5fa !important;
}
[data-theme="dark"] #goalModal .card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] #goalModal h3 { color: #e2e8f0 !important; }
[data-theme="dark"] #goalModal p { color: #94a3b8 !important; }

[data-theme="dark"] #ajustarAtrasadoInput {
    background: #0d1828 !important;
    border-color: #1e3550 !important;
    color: #fbbf24 !important;
}
[data-theme="dark"] #ajustarAtrasadoModal .card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] #ajustarAtrasadoModal h3 { color: #e2e8f0 !important; }
[data-theme="dark"] #ajustarAtrasadoModal p { color: #94a3b8 !important; }
[data-theme="dark"] .fc-num-atrasados { color: #f87171; }
[data-theme="dark"] #dash-my-position { border-top-color: #334155 !important; }
/* ===== HEATMAP ===== */
.heatmap-card {
    margin-top: 1.5rem;
}
.heatmap-year-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.hm-nav-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem;
    transition: background 0.15s, border-color 0.15s;
}
.hm-nav-btn:hover { background: #2563eb; border-color: #2563eb; color: #fff; }
.heatmap-scroll-wrap {
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
.heatmap-grid {
    display: flex;
    gap: 3px;
    min-width: max-content;
}
.hm-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.hm-month-label {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 600;
    height: 14px;
    line-height: 14px;
    padding-left: 1px;
    white-space: nowrap;
}
.hm-day-label {
    font-size: 0.65rem;
    color: #94a3b8;
    width: 24px;
    height: 12px;
    line-height: 12px;
    text-align: right;
    padding-right: 4px;
    flex-shrink: 0;
}
.hm-cell {
    width: 12px; height: 12px;
    border-radius: 2px;
    background: #f1f5f9;
    cursor: default;
    flex-shrink: 0;
    transition: transform 0.1s;
    position: relative;
}
.hm-cell:hover { transform: scale(1.4); z-index: 2; }
.hm-l0, .hm-cell.hm-l0 { background: #e2e8f0; }
.hm-l1, .hm-cell.hm-l1 { background: #bfdbfe; }
.hm-l2, .hm-cell.hm-l2 { background: #60a5fa; }
.hm-l3, .hm-cell.hm-l3 { background: #2563eb; }
.hm-l4, .hm-cell.hm-l4 { background: #1e40af; }
.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 0.75rem;
    justify-content: flex-end;
}
.hm-leg-box {
    width: 12px; height: 12px;
    border-radius: 2px;
    display: inline-block;
}
.hm-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.7rem;
    white-space: nowrap;
    padding: 3px 7px;
    border-radius: 5px;
    pointer-events: none;
    z-index: 100;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
/* Nas duas últimas fileiras (Sex/Sáb) não há mais espaço abaixo antes da legenda —
   nesses casos o tooltip abre para cima em vez de para baixo. */
.hm-cell:nth-child(7) .hm-tooltip,
.hm-cell:nth-child(8) .hm-tooltip {
    top: auto;
    bottom: calc(100% + 6px);
}
.hm-cell:hover .hm-tooltip { display: block; }

/* dark mode */
[data-theme="dark"] .heatmap-card { background: #111d2e !important; border-color: #1e3550 !important; }
[data-theme="dark"] .hm-nav-btn { background: #19273a; border-color: #1e3550; color: #94a3b8; }
[data-theme="dark"] .hm-nav-btn:hover { background: #2563eb; border-color: #2563eb; color: #fff; }
[data-theme="dark"] .hm-cell.hm-l0 { background: #1e3550; }
[data-theme="dark"] .heatmap-grid { --hm-label-color: #475569; }

/* ══════════════════════════════════════════════
   DARK MODE — dashboard.css (heatmap levels)
   ══════════════════════════════════════════════ */
[data-theme="dark"] .hm-cell.hm-l1 { background: #1e3a5f; }
[data-theme="dark"] .hm-cell.hm-l2 { background: #1d4ed8; }
[data-theme="dark"] .hm-cell.hm-l3 { background: #2563eb; }
[data-theme="dark"] .hm-cell.hm-l4 { background: #3b82f6; }
