:root {
    --ac-radius: 16px;
    --ac-shadow-sm: 0 4px 14px rgba(16, 24, 40, .06);
    --ac-shadow: 0 16px 40px rgba(16, 24, 40, .12);
    /* ---- Paleta oficial AlunoCertificado ---- */
    --ac-primary: #2563EB;
    --ac-primary-dark: #1D4ED8;
    --ac-primary-active: #1E40AF;
    --ac-primary-rgb: 37, 99, 235;
    --ac-success: #16A34A;
    --ac-success-hover: #15803D;
    --ac-success-active: #166534;
    --ac-success-rgb: 22, 163, 74;
    --ac-accent: #F59E0B;
    --ac-accent-hover: #D97706;
    --ac-danger: #DC2626;
    --ac-danger-hover: #B91C1C;
    --ac-danger-rgb: 220, 38, 38;
    --ac-info: #0891B2;
    --ac-info-hover: #0E7490;
    --ac-muted: #64748b;
    --ac-gradient: linear-gradient(135deg, #2563EB 0%, #6610f2 100%);
    --ac-gradient-cert: linear-gradient(90deg, #16A34A 0%, #22C55E 100%);
}

body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background-color: #f5f7fb;
}

/* ==========================================================================
   Header — ícones de sino e tema (sempre brancos) + badge de notificações
   ========================================================================== */
.ac-icon {
    width: 1.2rem;
    height: 1.2rem;
    vertical-align: -0.18em;
    color: #ffffff;
}

.ac-bell-link .ac-bell { color: #ffffff; transition: transform .25s ease; }
.ac-bell-link:hover .ac-bell { transform: rotate(-10deg) scale(1.05); }

.ac-noti-badge {
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #dc3545;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.62rem;
    line-height: 1;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

#btnThemeToggle { font-size: 1.1rem; line-height: 1; padding: 0.25rem 0.5rem; }
.ac-theme-toggle {
    border-radius: 10px;
    transition: background-color .2s ease, transform .2s ease;
}
.ac-theme-toggle:hover { background-color: rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
.ac-theme-toggle:focus,
.ac-theme-toggle:active,
.ac-theme-toggle:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}
.ac-theme-icon { display: inline-flex; align-items: center; }
.ac-theme-icon .ac-icon { transition: transform .3s ease, opacity .3s ease; }
.ac-theme-toggle:hover .ac-theme-icon .ac-icon { transform: rotate(15deg); }

.ac-theme-icon .ac-icon-sun { display: none; }
.ac-theme-icon .ac-icon-moon { display: inline-block; }
[data-bs-theme="dark"] .ac-theme-icon .ac-icon-sun { display: inline-block; }
[data-bs-theme="dark"] .ac-theme-icon .ac-icon-moon { display: none; }

[data-bs-theme="dark"] body {
    background-color: #16181d;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #25282c;
    border-color: #3d4248;
    color: #e9ecef;
    --bs-dropdown-color: #e9ecef;
    --bs-dropdown-link-color: #e9ecef;
    --bs-dropdown-link-hover-color: #fff;
    --bs-dropdown-link-hover-bg: #3d4248;
    --bs-dropdown-divider-bg: #3d4248;
}

[data-bs-theme="dark"] .dropdown-menu .text-primary {
    color: #6ea0ff !important;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: #3d4248;
    opacity: 1;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #e9ecef;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #3d4248;
    color: #fff;
}

.ac-noti-dropdown__title {
    color: inherit;
}

/* --- Cards --- */
.card {
    border-radius: var(--ac-radius);
    border-color: rgba(16, 24, 40, .08);
}

.shadow-sm {
    box-shadow: var(--ac-shadow-sm) !important;
}

[data-bs-theme="dark"] .card {
    border-color: #2c2f36;
}

/* --- Hero --- */
.ac-hero {
    border-radius: 22px;
    background: var(--ac-gradient);
    color: #fff;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: var(--ac-shadow);
    position: relative;
    overflow: hidden;
}

.ac-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 240px;
    height: 240px;
    background: rgba(255, 255, 255, .12);
    border-radius: 50%;
}

.ac-hero h1,
.ac-hero h2 {
    color: #fff;
}

/* --- KPI --- */
.ac-kpi {
    border-radius: var(--ac-radius);
    background: var(--bs-body-bg);
    border: 1px solid rgba(16, 24, 40, .08);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--ac-shadow-sm);
    height: 100%;
    transition: transform .15s ease, box-shadow .15s ease;
    text-decoration: none;
    display: block;
    color: inherit;
}

a.ac-kpi:hover {
    transform: translateY(-3px);
    box-shadow: var(--ac-shadow);
}

[data-bs-theme="dark"] .ac-kpi {
    background: #20232a;
    border-color: #2c2f36;
}

.ac-kpi__value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.ac-kpi__label {
    color: var(--bs-secondary-color);
    font-size: .85rem;
    margin-top: .35rem;
}

.ac-kpi__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.ac-kpi__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* --- Avatar initials --- */
.ac-initial {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: var(--ac-gradient);
    flex: 0 0 auto;
}

/* --- Tables --- */
.table > :not(caption) > * > * {
    padding: .8rem .9rem;
}

.table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--bs-secondary-color);
}

/* --- Login split --- */
.ac-split__media {
    border-radius: var(--ac-radius);
    background: var(--ac-gradient);
    min-height: 420px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.ac-split__media::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 55%);
}

.ac-split__media-overlay {
    position: relative;
    z-index: 1;
    padding: 2rem;
    color: #fff;
    display: flex;
    flex-direction: column;
}

.ac-eyebrow {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .25rem .65rem;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
}

/* --- Audit badges --- */
.ac-audit-badge {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
}

[data-bs-theme="dark"] .card-header.bg-white {
    background-color: #2d3136 !important;
    color: #e8eaed;
    border-bottom-color: #3d4249;
}

/* Cabeçalho de tabelas (.table-light) legível no tema escuro */
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light > th,
[data-bs-theme="dark"] .table-light > td,
[data-bs-theme="dark"] thead.table-light th {
    background-color: #2d3136 !important;
    color: #e8eaed !important;
    border-color: #3d4249 !important;
}

/* ============================================================
   BOTÕES PADRONIZADOS — contraste acessível (mesmo padrão do app principal)
   ============================================================ */
.btn { font-weight: 600; }

/* Sólidos com texto sempre legível */
.btn-primary,
.btn-success,
.btn-danger,
.btn-secondary,
.btn-dark { color: #fff !important; }

/* warning/info têm fundo claro: texto SEMPRE escuro */
.btn-warning, .btn-info,
.btn-warning:hover, .btn-warning:focus, .btn-warning:active,
.btn-info:hover, .btn-info:focus, .btn-info:active { color: #1f2937 !important; }

/* Outline legível no tema escuro */
[data-bs-theme="dark"] .btn-outline-primary   { color: #6ea0ff; border-color: #6ea0ff; }
[data-bs-theme="dark"] .btn-outline-secondary { color: #c2c9d2; border-color: #6c757d; }
[data-bs-theme="dark"] .btn-outline-success   { color: #4ade80; border-color: #4ade80; }
[data-bs-theme="dark"] .btn-outline-danger    { color: #f87171; border-color: #f87171; }
[data-bs-theme="dark"] .btn-outline-warning   { color: #fbbf24; border-color: #fbbf24; }
[data-bs-theme="dark"] .btn-outline-info      { color: #38bdf8; border-color: #38bdf8; }
[data-bs-theme="dark"] .btn-outline-dark      { color: #d6dae0; border-color: #6c757d; }
[data-bs-theme="dark"] .btn-outline-primary:hover   { background-color: #6ea0ff; border-color: #6ea0ff; color: #0b1220 !important; }
[data-bs-theme="dark"] .btn-outline-secondary:hover { background-color: #6c757d; border-color: #6c757d; color: #fff !important; }
[data-bs-theme="dark"] .btn-outline-success:hover   { background-color: #4ade80; border-color: #4ade80; color: #0b1220 !important; }
[data-bs-theme="dark"] .btn-outline-danger:hover    { background-color: #f87171; border-color: #f87171; color: #0b1220 !important; }
[data-bs-theme="dark"] .btn-outline-warning:hover   { background-color: #fbbf24; border-color: #fbbf24; color: #1f2937 !important; }
[data-bs-theme="dark"] .btn-outline-info:hover      { background-color: #38bdf8; border-color: #38bdf8; color: #0b1220 !important; }
[data-bs-theme="dark"] .btn-outline-dark:hover      { background-color: #d6dae0; border-color: #d6dae0; color: #0b1220 !important; }

/* ==========================================================================
   DESIGN SYSTEM — Padrão de cores das ações (mesma paleta do app principal)
   Azul = principal · Verde = sucesso/certificação · Laranja = atenção
   Vermelho = perigo · Cinza = secundário. Bloco final = maior prioridade.
   ========================================================================== */

/* ---- Primário (Azul) ---- */
.btn-primary {
    background-color: var(--ac-primary);
    border-color: var(--ac-primary);
    color: #fff !important;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--ac-primary-dark) !important;
    border-color: var(--ac-primary-dark) !important;
    color: #fff !important;
}
.btn-primary:active, .btn-primary.active {
    background-color: var(--ac-primary-active) !important;
    border-color: var(--ac-primary-active) !important;
    color: #fff !important;
}

/* ---- Sucesso (Verde) ---- */
.btn-success {
    background-color: var(--ac-success);
    border-color: var(--ac-success);
    color: #fff !important;
}
.btn-success:hover, .btn-success:focus {
    background-color: var(--ac-success-hover) !important;
    border-color: var(--ac-success-hover) !important;
    color: #fff !important;
}
.btn-success:active, .btn-success.active {
    background-color: var(--ac-success-active) !important;
    border-color: var(--ac-success-active) !important;
    color: #fff !important;
}

/* ---- Perigo (Vermelho) ---- */
.btn-danger {
    background-color: var(--ac-danger);
    border-color: var(--ac-danger);
    color: #fff !important;
}
.btn-danger:hover, .btn-danger:focus, .btn-danger:active {
    background-color: var(--ac-danger-hover) !important;
    border-color: var(--ac-danger-hover) !important;
    color: #fff !important;
}

/* ---- Atenção (Laranja) — texto branco conforme paleta ---- */
.btn-warning {
    background-color: var(--ac-accent);
    border-color: var(--ac-accent);
    color: #fff !important;
}
.btn-warning:hover, .btn-warning:focus, .btn-warning:active {
    background-color: var(--ac-accent-hover) !important;
    border-color: var(--ac-accent-hover) !important;
    color: #fff !important;
}

/* ---- Informação (Ciano) ---- */
.btn-info {
    background-color: var(--ac-info);
    border-color: var(--ac-info);
    color: #fff !important;
}
.btn-info:hover, .btn-info:focus, .btn-info:active {
    background-color: var(--ac-info-hover) !important;
    border-color: var(--ac-info-hover) !important;
    color: #fff !important;
}

/* ---- Secundário (Cinza) ---- */
.btn-outline-secondary {
    color: var(--ac-muted);
    border-color: #cbd5e1;
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-secondary:active {
    background-color: var(--ac-muted) !important;
    border-color: var(--ac-muted) !important;
    color: #fff !important;
}

/* ---- Outline Azul ---- */
.btn-outline-primary { color: var(--ac-primary); border-color: var(--ac-primary); }
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background-color: var(--ac-primary) !important;
    border-color: var(--ac-primary) !important;
    color: #fff !important;
}

/* ---- Botão exclusivo de Certificado (gradiente verde) ---- */
.btn-certificado {
    background: var(--ac-gradient-cert);
    border: none;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(var(--ac-success-rgb), .35);
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-certificado:hover, .btn-certificado:focus {
    color: #fff !important;
    filter: brightness(1.05);
    transform: translateY(-1px);
}
.btn-certificado:active { filter: brightness(.96); transform: translateY(0); }

/* ==========================================================================
   TEMA ESCURO — fundo #111827, cards #1F2937, botões mais luminosos
   ========================================================================== */
[data-bs-theme="dark"] body { background-color: #111827; color: #e5e7eb; }
[data-bs-theme="dark"] .card {
    background-color: #1F2937;
    border-color: #374151;
    color: #e5e7eb;
}
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer {
    background-color: #1b2533;
    border-color: #374151;
}

[data-bs-theme="dark"] .btn-primary { background-color: #3B82F6; border-color: #3B82F6; color: #fff !important; }
[data-bs-theme="dark"] .btn-primary:hover, [data-bs-theme="dark"] .btn-primary:focus {
    background-color: #2563EB !important; border-color: #2563EB !important;
}
[data-bs-theme="dark"] .btn-success { background-color: #22C55E; border-color: #22C55E; color: #06210f !important; }
[data-bs-theme="dark"] .btn-success:hover, [data-bs-theme="dark"] .btn-success:focus {
    background-color: #16A34A !important; border-color: #16A34A !important; color: #fff !important;
}
[data-bs-theme="dark"] .btn-danger { background-color: #EF4444; border-color: #EF4444; color: #fff !important; }
[data-bs-theme="dark"] .btn-danger:hover, [data-bs-theme="dark"] .btn-danger:focus {
    background-color: #DC2626 !important; border-color: #DC2626 !important;
}
[data-bs-theme="dark"] .btn-warning { background-color: #FBBF24; border-color: #FBBF24; color: #1f2937 !important; }
[data-bs-theme="dark"] .btn-warning:hover, [data-bs-theme="dark"] .btn-warning:focus {
    background-color: #F59E0B !important; border-color: #F59E0B !important; color: #1f2937 !important;
}
[data-bs-theme="dark"] .btn-info { background-color: #22D3EE; border-color: #22D3EE; color: #08313b !important; }
[data-bs-theme="dark"] .btn-info:hover, [data-bs-theme="dark"] .btn-info:focus {
    background-color: #0891B2 !important; border-color: #0891B2 !important; color: #fff !important;
}
[data-bs-theme="dark"] .btn-certificado {
    background: linear-gradient(90deg, #16A34A 0%, #22C55E 100%);
    color: #fff !important;
}
