/* =========================================
   GLOBAL.CSS - Ghost UI (todas as páginas)
   ========================================= */
@import url('/libs/inter/inter.css');

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

:root {
    --primary-color: #8b5cf6;
    --theme-rgb: 139, 92, 246;
    --theme-accent: #8b5cf6;
    --theme-accent-rgb: 139, 92, 246;
    --bg-body: #050505;
    --bg-glass: rgba(15, 15, 20, 0.3);
    --bg-glass-strong: rgba(20, 20, 25, 0.70);
    --border-glass: 1px solid rgba(255, 255, 255, 0.08);
    --border-highlight: 1px solid rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --text-secondary: #94a3b8;
    --shadow-hard: 0 20px 50px rgba(0,0,0,0.8);
    /* Botões: classificação visual à prova de falhas */
    --btn-primary-bg: rgba(var(--theme-rgb), 0.25);
    --btn-primary-border: rgba(var(--theme-rgb), 0.5);
    --btn-primary-color: #fff;
    --btn-cancel-bg: rgba(251, 146, 60, 0.15);
    --btn-cancel-border: rgba(251, 146, 60, 0.4);
    --btn-cancel-color: #fb923c;
    --btn-secondary-bg: rgba(255, 255, 255, 0.05);
    --btn-secondary-border: rgba(255, 255, 255, 0.1);
    --btn-secondary-color: rgba(255, 255, 255, 0.85);
    /* AÇÃO DISPONÍVEL, EM AZUL SUAVE (29/08/2026) — ver o bloco do tema claro para o porquê. */
    --btn-suave-bg: rgba(96, 165, 250, 0.10);
    --btn-suave-borda: rgba(96, 165, 250, 0.30);
    --btn-suave-bg-hover: rgba(96, 165, 250, 0.20);
    --btn-suave-borda-hover: rgba(96, 165, 250, 0.60);
    --btn-suave-texto-hover: #bfdbfe;
    --btn-suave-texto: #93c5fd;
    /* DESLIGADO de verdade: sem tinta nenhuma, para não disputar com o de cima. */
    --btn-off-bg: rgba(255, 255, 255, 0.04);
    --btn-off-borda: rgba(255, 255, 255, 0.08);
    --btn-off-texto: rgba(255, 255, 255, 0.38);
    /* Pesos tipográficos (usados no style guide e componentes) */
    --w-regular: 400;
    --w-medium: 500;
    --w-semibold: 600;
    --w-bold: 700;
    /* Cores de texto secundárias */
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-dark: rgba(255, 255, 255, 0.3);
    /* Card genérico (background sutil) */
    --bg-card: rgba(255, 255, 255, 0.03);
    /* Superfícies e bordas (dark) */
    --bg-elevated: #111;
    --bg-input: rgba(0, 0, 0, 0.3);
    --bg-overlay: rgba(0, 0, 0, 0.6);
    --bg-sidebar: rgba(0, 0, 0, 0.06);
    --bg-dropdown: rgba(18, 18, 24, 0.98);
    --bg-modal: rgba(20, 20, 25, 0.7);
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-hover-strong: rgba(255, 255, 255, 0.08);
    --bg-active: rgba(255, 255, 255, 0.08);
    --border-subtle: #1f1f1f;
    --border-input: rgba(255, 255, 255, 0.08);
    --border-input-hover: rgba(255, 255, 255, 0.15);
    --border-divider: rgba(255, 255, 255, 0.06);
    /* Glass tint: branco no dark, preto no light */
    --glass-rgb: 255, 255, 255;
    --shadow-rgb: 0, 0, 0;
    /* Scrollbar */
    --scrollbar-thumb: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.2);
    /* Select option background */
    --bg-select-option: #1a1a1a;
    /* Orbs */
    --orb-opacity-1: 0.9;
    --orb-opacity-2: 0.8;
    --orb-intensity-1: 0.5;
    --orb-intensity-2: 0.35;
    /* Background image overlay */
    --bg-image-opacity: 0.7;
    --main-container-bg: rgba(10, 10, 10, 0.7);
    /* Star/rating empty */
    --star-empty: rgba(255, 255, 255, 0.15);
}

/* =========================================
   LIGHT THEME
   ========================================= */
[data-theme="light"] {
    --bg-body: #f0f1f5;
    --bg-glass: rgba(255, 255, 255, 0.55);
    --bg-glass-strong: rgba(255, 255, 255, 0.85);
    --border-glass: 1px solid rgba(0, 0, 0, 0.08);
    --border-highlight: 1px solid rgba(0, 0, 0, 0.12);
    --text-main: #1a1a2e;
    --text-secondary: #475569;
    --shadow-hard: 0 20px 50px rgba(0, 0, 0, 0.12);
    --btn-primary-color: #fff;
    --btn-cancel-bg: rgba(251, 146, 60, 0.12);
    --btn-cancel-border: rgba(251, 146, 60, 0.35);
    --btn-cancel-color: #c2410c;
    --btn-secondary-bg: rgba(0, 0, 0, 0.04);
    --btn-secondary-border: rgba(0, 0, 0, 0.1);
    --btn-secondary-color: rgba(0, 0, 0, 0.7);
    /* ⛔ AÇÃO DISPONÍVEL, EM AZUL SUAVE (29/08/2026, cobrança do Marcos: "esse cinza tem me
       incomodado demais... tudo parece desabilitado no sistema"). O botão secundário era cinza
       sobre fundo quase branco — a MESMA pele de um botão apagado. Quem olha não distingue o que
       pode clicar do que não pode.
       AZUL, não verde: nas telas da professora o verde já quer dizer "aconteceu e deu certo"
       (pacote entregue, selo EM DIA) e o âmbar quer dizer "tem algo a fazer". Pintar botão comum
       de verde diria que ele já foi usado. O azul é a cor que o sistema já usava para "isto é
       clicável / isto informa" — é a mesma receita do `.btn-ajuda` da tela do Assistente, que foi
       medida em contraste 5,2 quando nasceu.
       TINTA FRACA de propósito: a hierarquia é roxo cheio (A ação da tela) > azul forte (o que
       precisa ser ENCONTRADO, como "Como funciona") > este azul suave (ação secundária, viva) >
       cinza (desligado). Se este subir de tom, engole os dois de cima. */
    --btn-suave-bg: rgba(37, 99, 235, 0.07);
    --btn-suave-borda: rgba(37, 99, 235, 0.28);
    --btn-suave-bg-hover: rgba(37, 99, 235, 0.15);
    --btn-suave-borda-hover: rgba(37, 99, 235, 0.55);
    --btn-suave-texto-hover: #1d4ed8;
    --btn-suave-texto: #1d4ed8;
    /* DESLIGADO de verdade: sem tinta nenhuma. Metade do conserto é esta — não basta acender o
       botão vivo, o apagado tem de ficar visivelmente apagado, senão os dois voltam a se parecer. */
    --btn-off-bg: rgba(0, 0, 0, 0.045);
    --btn-off-borda: rgba(0, 0, 0, 0.07);
    --btn-off-texto: rgba(0, 0, 0, 0.35);
    --text-muted: rgba(0, 0, 0, 0.45);
    --text-dark: rgba(0, 0, 0, 0.3);
    --bg-card: rgba(0, 0, 0, 0.02);
    --bg-elevated: #ffffff;
    --bg-input: rgba(0, 0, 0, 0.04);
    --bg-overlay: rgba(0, 0, 0, 0.4);
    --bg-sidebar: rgba(0, 0, 0, 0.03);
    --bg-dropdown: rgba(255, 255, 255, 0.98);
    --bg-modal: rgba(255, 255, 255, 0.85);
    --bg-hover: rgba(0, 0, 0, 0.04);
    --bg-hover-strong: rgba(0, 0, 0, 0.06);
    --bg-active: rgba(0, 0, 0, 0.06);
    --border-subtle: #e2e8f0;
    --border-input: rgba(0, 0, 0, 0.1);
    --border-input-hover: rgba(0, 0, 0, 0.2);
    --border-divider: rgba(0, 0, 0, 0.06);
    --glass-rgb: 0, 0, 0;
    --shadow-rgb: 0, 0, 0;
    --scrollbar-thumb: rgba(0, 0, 0, 0.15);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.25);
    --bg-select-option: #ffffff;
    --orb-opacity-1: 0.25;
    --orb-opacity-2: 0.15;
    --orb-intensity-1: 0.2;
    --orb-intensity-2: 0.12;
    --bg-image-opacity: 0.15;
    --main-container-bg: rgba(255, 255, 255, 0.6);
    --star-empty: rgba(0, 0, 0, 0.12);
}

/* Select: destaque (hover/foco) no dropdown usa a cor do tema (fallback para selects nativos) */
select { accent-color: var(--primary-color); }

/* =========================================
   BOTÕES - classificação à prova de falhas
   1. .btn-primary / .btn-action = executar ação (cor do tema)
   2. .btn-cancel = cancelar (laranja translúcido)
   3. .btn-secondary = outras ações (cinza translúcido)
   ========================================= */
.btn-primary,
.btn-action {
    background: var(--btn-primary-bg);
    border: 1px solid var(--btn-primary-border);
    color: var(--btn-primary-color);
    transition: background 0.2s, border-color 0.2s, filter 0.2s;
}
.btn-primary:hover,
.btn-action:hover {
    background: rgba(var(--theme-rgb), 0.35);
    border-color: var(--primary-color);
    filter: brightness(1.05);
}
.btn-cancel {
    background: var(--btn-cancel-bg);
    border: 1px solid var(--btn-cancel-border);
    color: var(--btn-cancel-color);
    transition: background 0.2s, border-color 0.2s;
}
.btn-cancel:hover {
    background: rgba(251, 146, 60, 0.25);
    border-color: rgba(251, 146, 60, 0.6);
}
.btn-secondary {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
    color: var(--btn-secondary-color);
    transition: background 0.2s, border-color 0.2s;
}
.btn-secondary:hover {
    background: var(--bg-hover-strong);
    border-color: var(--border-input-hover);
    color: var(--text-main);
}
.btn-primary:disabled,
.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
}

/* =========================================
   CUSTOM SELECT - dropdown com hover na cor do tema
   Use: .custom-select > select.custom-select-native + .custom-select-trigger + .custom-select-dropdown
   Inicialização: initCustomSelects() em global.js
   ========================================= */
.custom-select { position: relative; width: 100%; z-index: 1; }
.custom-select.open { z-index: 200; }
.custom-select-native {
    position: absolute; left: 0; top: 0; width: 100%; height: 100%;
    opacity: 0; pointer-events: none; margin: 0; border: 0;
    font-size: 16px; /* evita zoom no iOS */
}
.custom-select-trigger {
    width: 100%;
    padding: 12px 36px 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-input);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(var(--glass-rgb),0.5)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.custom-select-trigger:hover { border-color: var(--border-input-hover); }
.custom-select-trigger:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--theme-rgb), 0.15); }
.custom-select.open .custom-select-trigger { border-color: var(--primary-color); }
.custom-select-dropdown {
    position: fixed;
    max-height: 220px; overflow-y: auto;
    background: var(--bg-dropdown);
    border: 1px solid var(--border-input);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(var(--shadow-rgb), 0.5);
    z-index: 9999;
    display: none;
    min-width: 280px;
}
.custom-select.open .custom-select-dropdown { display: block; }
.custom-select-option {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border: none;
    width: 100%;
    text-align: left;
    background: transparent;
}
.custom-select-option:hover,
.custom-select-option:focus {
    background: rgba(var(--theme-rgb), 0.25);
    color: var(--text-main);
    outline: none;
}
.custom-select-option.selected { background: rgba(var(--theme-rgb), 0.15); color: var(--text-main); }

/* =========================================
   ORBS - Padrão único (intensidade e posição)
   ========================================= */
.ambient-light,
.page-ambient-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: orb-float 20s infinite ease-in-out;
    transition: background 0.5s ease;
}

.orb-1 {
    width: 900px;
    height: 900px;
    top: -280px;
    left: -180px;
    opacity: var(--orb-opacity-1);
    background: radial-gradient(circle, rgba(139, 92, 246, var(--orb-intensity-1)) 0%, transparent 65%);
}

.orb-2 {
    width: 800px;
    height: 800px;
    bottom: -200px;
    right: -80px;
    animation-delay: -5s;
    opacity: var(--orb-opacity-2);
    background: radial-gradient(circle, rgba(139, 92, 246, var(--orb-intensity-2)) 0%, transparent 65%);
}

@keyframes orb-float {
    0% { transform: translate(0, 0); }
    50% { transform: translate(30px, 50px) scale(1.05); }
    100% { transform: translate(0, 0); }
}

/* =========================================
   HEADER PÁGINAS (iframe) - único padrão: .header
   Altura e padding centralizados aqui; alterar aqui afeta todas as páginas.
   Estrutura: .header > .brand (esquerda) + .actions (direita, filtros/btns)
   ========================================= */
.main-container > .header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(var(--glass-rgb), 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.main-container > .header .brand {
    flex-shrink: 0;
}
.main-container > .header .actions {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.main-container > .header .brand h1 {
    font-weight: 300;
    font-size: 24px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-main);
}
.main-container > .header .brand span,
.main-container > .header .brand h1 span { font-weight: 600; }
.main-container > .header .brand-subtitle,
.main-container > .header .forms-subtitle {
    font-size: 11px;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}
.theme-accent { color: var(--theme-accent, #8b5cf6); transition: color 0.4s ease; }
.theme-accent.glow { text-shadow: 0 0 20px rgba(var(--theme-accent-rgb, 139, 92, 246), 0.4); }
.main-container > .header .btn-ghost {
    background: transparent;
    border: 1px solid rgba(var(--glass-rgb), 0.2);
    color: var(--text-main);
    padding: 10px 25px;
    border-radius: 50px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.main-container > .header .btn-ghost:hover {
    border-color: var(--text-main);
    background: var(--bg-hover);
}
.main-container > .header .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(var(--glass-rgb), 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}
.main-container > .header .btn-icon:hover {
    border-color: var(--text-main);
    background: rgba(var(--glass-rgb), 0.1);
}
@media (max-width: 768px) {
    .main-container > .header {
        padding: 20px;
    }
}

/* Margem padrão do conteúdo abaixo da linha do header (alterar aqui afeta todas as páginas) */
.main-container > .header + * {
    padding-top: 24px;
}

/* Data/hora por extenso no lugar do título da página (dentro do iframe) */
.page-datetime-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-datetime-icon {
    font-size: 13px;
    color: var(--text-dark);
    flex-shrink: 0;
}
.page-datetime {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    font-weight: 400;
}

/* =========================================
   PÁGINAS DO IFRAME - fundo (bg.jpg) + painel + orbs suaves
   Aplicado quando body tem class="page-with-bg"
   ========================================= */
body.page-with-bg {
    color: var(--text-main);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-body);
    position: relative;
}
body.page-with-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../../bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: var(--bg-image-opacity);
    z-index: -1;
    pointer-events: none;
}
body.page-with-bg .ambient-light .orb-1,
body.page-with-bg .ambient-light .orb-2,
body.page-with-bg .page-ambient-light .orb-1,
body.page-with-bg .page-ambient-light .orb-2 {
    opacity: 0.6;
}

/* Painel principal (telas internas): overlay escuro + blur leve + layout flex padrão */
.main-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--main-container-bg);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(var(--glass-rgb), 0.1);
    border-radius: 30px;
    box-shadow: 0 0 50px rgba(var(--shadow-rgb), 0.5);
    animation: page-entry 0.45s ease-out forwards;
}

/* Animação de entrada: quadros sobem suavemente com fade-in (telas internas do iframe) */
@keyframes page-entry {
    from {
        opacity: 0;
        transform: translateY(38px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tabelas: listras pares/ímpares na cor do tema; hover preservado */
.main-container tbody tr:nth-child(odd) td {
    background: rgba(var(--theme-rgb), 0.06);
}
.main-container tbody tr:nth-child(even) td {
    background: transparent;
}
.main-container tbody tr:hover td {
    background: rgba(var(--theme-rgb), 0.12);
}

/* =========================================
   PÁGINAS IFRAME - body, content-area, scrollbar
   ========================================= */
.content-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 40px;
}
.content-area::-webkit-scrollbar { width: 4px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb-hover); border-radius: 2px; }

/* =========================================
   FILTROS - barra de filtros com tabs
   ========================================= */
.filters {
    padding: 24px 40px;
    display: flex;
    gap: 30px;
    border-bottom: 1px solid var(--border-divider);
}
.filter-item {
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
}
.filter-item:hover, .filter-item.active {
    color: var(--text-main);
    border-bottom-color: var(--theme-accent, #fff);
}
.filter-item.active { color: var(--theme-accent, #fff); }

/* =========================================
   CARDS KPI - grid + card base
   ========================================= */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 6px 18px rgba(var(--shadow-rgb), 0.25);
}
.card:hover {
    border-color: var(--border-input-hover);
    box-shadow: 0 8px 24px rgba(var(--shadow-rgb), 0.35);
}
.card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
}
.card-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 5px;
}
.card-cat {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dark);
}
.card-cat.theme-accent { color: var(--theme-accent, #8b5cf6); }
.card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 10px;
}
.card-change {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}
.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* =========================================
   CHARTS - card, header, container
   ========================================= */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}
.chart-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.15s ease;
    box-shadow: 0 6px 18px rgba(var(--shadow-rgb), 0.25);
}
.chart-card:hover {
    border-color: var(--border-input);
    box-shadow: 0 8px 24px rgba(var(--shadow-rgb), 0.35);
}
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.chart-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
}
.chart-title .theme-accent { color: var(--theme-accent, #8b5cf6); }
.chart-subtitle {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dark);
}
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* =========================================
   TABELAS - section, header, wrapper, table, badges
   ========================================= */
.table-section {
    margin-bottom: 40px;
}
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.table-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
}
.table-title .theme-accent { color: var(--theme-accent, #8b5cf6); }
.table-subtitle {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dark);
}
.table-wrapper {
    background: transparent;
    border: 1px solid var(--border-input);
    border-radius: 20px;
    padding: 25px;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
thead {
    border-bottom: 1px solid var(--border-input);
}
th {
    text-align: left;
    padding: 15px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dark);
    font-weight: 500;
}
th.th-actions {
    text-align: center;
    width: 140px;
}
td {
    padding: 15px 10px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-divider);
}
td.td-actions {
    text-align: center;
    white-space: nowrap;
}
tr:hover td {
    background: var(--bg-card);
}
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(var(--glass-rgb), 0.2);
}
.status-badge.ok {
    color: var(--text-main);
    border-color: rgba(var(--glass-rgb), 0.3);
    background: rgba(var(--glass-rgb), 0.05);
}
.status-badge.warning {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.05);
}
.status-badge.critical {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

/* =========================================
   BTN-TABLE-ACTION - botões de ação em tabelas (escopo .td-actions)
   Não conflita com .btn-action global (= .btn-primary, cor do tema)
   ========================================= */
.td-actions .btn-action {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border-input);
    background: var(--bg-hover);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 3px;
    transition: all 0.2s ease;
}
.td-actions .btn-action:hover {
    border-color: var(--theme-accent, rgba(var(--glass-rgb),0.3));
    color: var(--text-main);
    background: rgba(var(--theme-accent-rgb, 139, 92, 246), 0.15);
}
.td-actions .btn-action-danger:hover {
    border-color: rgba(244, 63, 94, 0.6);
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.1);
}
.td-actions .btn-action i {
    font-size: 13px;
}

/* =========================================
   UTILITÁRIOS COMUNS
   ========================================= */
.glow-text { text-shadow: 0 0 20px rgba(var(--glass-rgb), 0.3); }
.hidden { display: none; }

/* Star Rating Component */
.star-rating { display: inline-flex; gap: 4px; direction: rtl; }
.star-rating input { display: none; }
.star-rating label {
    font-size: 24px;
    color: var(--star-empty);
    cursor: pointer;
    transition: all 0.15s;
    direction: ltr;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251,191,36,0.4);
}
.star-rating.readonly label { cursor: default; }
.star-rating-sm label { font-size: 16px; }
.star-rating-lg label { font-size: 32px; }

.star-display { display: inline-flex; gap: 2px; }
.star-display i { font-size: 12px; }
.star-display .star-filled { color: #fbbf24; }
.star-display .star-empty { color: var(--star-empty); }

.rating-prompt {
    text-align: center;
    padding: 20px;
    margin-top: 16px;
    border-top: 1px solid var(--border-divider);
}
.rating-prompt p { color: var(--text-secondary); font-size: 13px; margin: 0 0 10px; }
.rating-saved { color: var(--primary-color); font-size: 13px; margin-top: 8px; }

/* ===== MOBILE RESPONSIVENESS (global) ===== */

@media (max-width: 768px) {
    /* Header */
    .main-container > .header {
        padding: 16px;
        gap: 12px;
    }
    .main-container > .header .brand h1 {
        font-size: 20px;
        letter-spacing: 1px;
    }
    .main-container > .header .actions {
        gap: 10px;
    }
    .main-container > .header .btn-ghost {
        padding: 8px 16px;
        font-size: 11px;
    }

    /* Content area */
    .content-area {
        padding: 20px;
    }

    /* Filters */
    .filters {
        padding: 16px 20px;
        gap: 16px;
        flex-wrap: wrap;
    }

    /* KPI grid */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        margin-bottom: 24px;
    }

    /* Charts */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .chart-container { height: 220px; }

    /* Tables */
    .table-wrapper { padding: 16px; border-radius: 14px; }
    th { padding: 10px 8px; font-size: 10px; }
    td { padding: 10px 8px; font-size: 12px; }

    /* Cards */
    .card { padding: 16px; border-radius: 14px; gap: 10px; }
    .card-value { font-size: 26px; }

    /* Main container border-radius */
    .main-container { border-radius: 0; }
}

@media (max-width: 480px) {
    /* Header */
    .main-container > .header {
        padding: 12px;
    }
    .main-container > .header .brand h1 {
        font-size: 17px;
        letter-spacing: 0.5px;
    }
    .main-container > .header .brand-subtitle,
    .main-container > .header .forms-subtitle {
        font-size: 10px;
    }
    .main-container > .header .btn-ghost {
        padding: 6px 12px;
        font-size: 10px;
    }
    .main-container > .header .btn-icon {
        width: 34px;
        height: 34px;
    }

    /* Content area */
    .content-area {
        padding: 12px;
    }

    /* Filters */
    .filters {
        padding: 12px;
        gap: 12px;
    }
    .filter-item { font-size: 12px; }

    /* KPI grid single column */
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Charts */
    .chart-card { padding: 16px; border-radius: 14px; }
    .chart-container { height: 180px; }
    .chart-title { font-size: 14px; }

    /* Tables */
    .table-wrapper { padding: 10px; border-radius: 12px; }

    /* Cards */
    .card { padding: 14px; border-radius: 12px; }
    .card-title { font-size: 14px; }
    .card-value { font-size: 22px; }

    /* Page datetime */
    .page-datetime { font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PADRÃO DE LAYOUT — LINHA DE AÇÃO DE CARD
   Botão de ação fica SEMPRE alinhado à direita do card. Botão à esquerda
   contraria a expectativa de quem lê da esquerda para a direita: o olho
   termina a leitura do card à direita, e é ali que a ação tem de estar.

   Use `.linha-acoes` em toda linha de botões que ENCERRA um card ou painel.

   NÃO se aplica a:
     · barra de filtro / abas  → continua à esquerda, é navegação e não ação;
     · botão de largura cheia  → ocupa o card inteiro, não há o que alinhar;
     · barra flutuante de seleção → centralizada de propósito.

   Quando a linha mistura controles (switch, select) com botões, envolva SÓ os
   botões em `.linha-acoes` — assim o grupo huga a direita mesmo quando a linha
   quebra, coisa que um <span> espaçador com flex:1 não faz (na quebra ele fica
   na linha de cima e os botões voltam para a esquerda).
   ═══════════════════════════════════════════════════════════════════════════ */
.linha-acoes {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;   /* huga a direita também dentro de uma linha mista */
}

/* ═══════════════════════════════════════════════════════════════════════════
   DIÁLOGO DO SISTEMA — substitui alert() / confirm() do navegador
   O diálogo nativo mostra "localhost:3100" no topo, ignora o tema e não tem a
   tipografia nem os botões do produto. Num sistema que a professora usa para
   gerar documento que ela assina, aquilo lê como erro de página.

   Mesma linguagem visual do painel de turma (overlay escuro, cartão com topo,
   corpo e rodapé). Classes PRÓPRIAS de botão: as páginas definem `.btn` local
   com estilos diferentes, e o diálogo não pode depender disso.

   Uso: ekConfirmar({...}) / ekAvisar({...}) — assets/pages/js/ek-dialogo.js
   ═══════════════════════════════════════════════════════════════════════════ */
.ek-dlg-fundo {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.ek-dlg {
    background: var(--bg-body); border: 1px solid var(--border-input); border-radius: 14px;
    width: 100%; max-width: 440px; max-height: 90vh; overflow: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.ek-dlg-topo {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--border-input);
}
.ek-dlg-topo h3 { color: var(--text-main); font-size: 16px; margin: 0; }
.ek-dlg-fechar {
    background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 7px;
    color: var(--text-secondary); font-size: 15px; line-height: 1;
}
.ek-dlg-fechar:hover { color: var(--text-main); background: var(--bg-input); }
.ek-dlg-corpo { padding: 18px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; }
.ek-dlg-corpo strong { color: var(--text-main); }
.ek-dlg-rodape {
    display: flex; gap: 9px; justify-content: flex-end; flex-wrap: wrap;
    padding: 13px 18px; border-top: 1px solid var(--border-input);
}
.ek-dlg-btn {
    padding: 10px 15px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border-input); background: var(--bg-input); color: var(--text-main);
    font-family: inherit;
}
.ek-dlg-btn:hover { background: var(--bg-hover); }
.ek-dlg-btn-primary {
    background: var(--primary-color); border-color: var(--primary-color); color: #fff;
}
.ek-dlg-btn-primary:hover { filter: brightness(1.12); background: var(--primary-color); color: #fff; }
.ek-dlg-btn-perigo { border-color: #dc2626; color: #dc2626; background: transparent; }
.ek-dlg-btn-perigo:hover { background: rgba(220,38,38,.12); color: #dc2626; }

/* ═══════════════════════════════════════════════════════════════════════════
   TELA QUE NÃO CABE NO CELULAR — degradação honesta
   Mapa da turma, edição de planejamento e admin são de trabalho, não de socorro:
   têm tabela larga, muitos campos e edição longa. Tentar espremer em 360px daria
   layout quebrado com esforço alto. Melhor dizer a verdade e apontar o caminho.

   Uso: <body class="so-no-computador"> + o bloco .aviso-desktop no topo do body.
   ═══════════════════════════════════════════════════════════════════════════ */
.aviso-desktop { display: none; }

@media (max-width: 768px) {
    .so-no-computador > .page-content,
    .so-no-computador > .container { display: none !important; }

    .aviso-desktop {
        display: block; margin: 18px auto; max-width: 420px; padding: 22px 20px;
        border-radius: 14px; text-align: center;
        background: var(--bg-input); border: 1px solid var(--border-input);
    }
    .aviso-desktop i.aviso-icone { font-size: 30px; color: var(--text-secondary); }
    .aviso-desktop h2 { color: var(--text-main); font-size: 17px; margin: 12px 0 8px; }
    .aviso-desktop p { color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; margin: 0 0 16px; }
    .aviso-desktop a.aviso-voltar {
        display: inline-flex; align-items: center; justify-content: center; gap: 8px;
        min-height: 44px; padding: 12px 18px; border-radius: 9px; text-decoration: none;
        background: var(--primary-color); color: #fff; font-size: 14px; font-weight: 600;
    }
}
