/* =========================================================
   Portal da Dança — visual baseado no protótipo v3
   Fontes: DM Sans (texto) e Manrope (títulos)
========================================================= */

:root {
    color-scheme: light;
    --canvas: #f5f7fc;
    --surface: #ffffff;
    --surface-soft: #eef2ff;
    --border: #e1e6f1;
    --border-strong: #cbd3e6;
    --text: #17203f;
    --muted: #626b82;
    --subtle: #69738a;
    --primary: #3157d5;
    --primary-dark: #2445b6;
    --primary-soft: #e8edff;
    --secondary: #f04f5f;
    --accent: #f6c945;
    --success: #14795e;
    --success-bg: #e3f6f0;
    --warning: #8c6700;
    --warning-bg: #fff5cf;
    --danger: #bd3343;
    --danger-bg: #ffeaec;
    --tag: #5b3aa6;
    --tag-bg: #f0eafb;
    --hover: #f3f6fd;
    --shadow-panel: 0 8px 30px rgba(28, 47, 94, .05);
    --shadow: 0 14px 34px rgba(28, 47, 94, .11);
    --sidebar-bg: rgba(255, 255, 255, .97);
    --topbar-bg: rgba(250, 252, 255, .9);
    --role-card: #172e7e;
    --code-bg: #eef1f8;

    /* aliases usados pelos componentes antigos */
    --background: var(--canvas);
    --sidebar: var(--surface);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --canvas: #0e1324;
    --surface: #171e33;
    --surface-soft: #202a46;
    --border: #2c3858;
    --border-strong: #435276;
    --text: #f0f3fb;
    --muted: #b5bfd6;
    --subtle: #8e9ab7;
    --primary: #8ea7ff;
    --primary-dark: #a9bcff;
    --primary-soft: #263760;
    --success: #73d8b9;
    --success-bg: #173e35;
    --warning: #f3d06a;
    --warning-bg: #3d331a;
    --danger: #ff9aa5;
    --danger-bg: #4b252d;
    --tag: #cdb8ff;
    --tag-bg: #2e2850;
    --hover: #1d263e;
    --shadow-panel: 0 10px 34px rgba(0, 0, 0, .22);
    --shadow: 0 14px 34px rgba(0, 0, 0, .35);
    --sidebar-bg: #12192b;
    --topbar-bg: rgba(18, 25, 43, .92);
    --role-card: #263f9e;
    --code-bg: #202a46;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    min-width: 320px;
    font-family: "DM Sans", system-ui, sans-serif;
    font-synthesis: none;
    background: var(--canvas);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, .brand h2, .topbar-title, .login-headline {
    font-family: "Manrope", "DM Sans", sans-serif;
    letter-spacing: -.035em;
}
::selection { background: #d6defb; color: #17203f; }
:focus-visible { outline: 3px solid rgba(49, 87, 213, .35); outline-offset: 2px; }
.icone { flex-shrink: 0; display: block; }

/* =========================
   LAYOUT
========================= */
.dashboard { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: 272px; height: 100dvh;
    display: flex; flex-direction: column;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    box-shadow: 10px 0 40px rgba(26, 41, 83, .04);
    transition: transform .2s ease;
}
.main-content { margin-left: 272px; min-width: 0; }
.page { max-width: 1320px; margin: 0 auto; padding: 32px 40px 56px; }

/* Marca */
.brand, .sidebar-brand { display: flex; align-items: center; gap: 12px; }
.sidebar-brand { min-height: 82px; padding: 12px 22px; border-bottom: 1px solid var(--border); }
.brand-icon {
    width: 40px; height: 40px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 12px;
    color: #fff; font: 800 19px "Manrope", sans-serif;
    background: linear-gradient(145deg, #18358f, #3157d5 68%, #4868dc);
    box-shadow: 0 8px 18px rgba(49, 87, 213, .28);
}
.brand h2 { font-size: 17px; font-weight: 800; }
.brand span { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }

/* Navegação */
.sidebar-scroll {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
    padding: 22px 14px;
    scrollbar-width: thin; scrollbar-color: #bac5e9 transparent;
}
.navigation { display: flex; flex-direction: column; gap: 3px; }
.nav-section {
    margin: 0 12px 12px;
    color: var(--subtle); font-size: 10px; font-weight: 700;
    letter-spacing: .18em; text-transform: uppercase;
}
.nav-item {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 14px; font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-item.active::before {
    content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
}

/* Rodapé do menu */
.sidebar-footer { flex: 0 0 auto; padding: 12px 14px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.role-card {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 13px; border-radius: 14px;
    background: var(--role-card); color: #fff;
}
.role-card-dot {
    width: 10px; height: 10px; flex: 0 0 auto; box-sizing: content-box;
    border: 3px solid rgba(255,255,255,.3); border-radius: 50%; background: #55d6ae;
}
.role-card p { color: rgba(255,255,255,.65); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.role-card strong { display: block; margin-top: 2px; font-size: 12px; }
.sidebar-user { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 0 2px; }
.sidebar-user form { margin: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong, .sidebar-user-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info strong { font-size: 12px; }
.sidebar-user-info small { font-size: 10px; color: var(--muted); }
.avatar {
    width: 34px; height: 34px; flex-shrink: 0;
    display: grid; place-items: center; border-radius: 50%;
    background: var(--tag-bg); color: var(--tag);
    font-size: 12px; font-weight: 700;
}
.icon-action {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border: 1px solid var(--border); border-radius: 9px;
    background: var(--surface); color: var(--muted);
    cursor: pointer; transition: .15s;
}
.icon-action:hover { border-color: var(--border-strong); color: var(--primary); }
.icon-action.logout:hover { color: var(--danger); }

/* Barra superior */
.topbar {
    position: sticky; top: 0; z-index: 20;
    height: 72px; padding: 0 40px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--topbar-bg);
    backdrop-filter: blur(10px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-eyebrow { color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.topbar-title { font-size: 14px; font-weight: 700; }
.nav-button, .theme-toggle {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border: 1px solid var(--border); border-radius: 11px;
    background: var(--surface); color: var(--primary);
    cursor: pointer; transition: .15s;
}
.nav-button:hover, .theme-toggle:hover { border-color: var(--border-strong); background: var(--hover); transform: translateY(-1px); }
.menu-abrir, .menu-fechar { display: none; }
.menu-fechar { margin-left: auto; width: 36px; height: 36px; }
.tema-sol { display: none; }
:root[data-theme="dark"] .tema-lua { display: none; }
:root[data-theme="dark"] .tema-sol { display: block; }
.menu-fundo { position: fixed; inset: 0; z-index: 30; background: rgba(10, 16, 35, .35); }
.menu-fundo[hidden] { display: none; }

/* =========================
   UTILITÁRIOS
========================= */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 60; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); font-size: 14px; }
.note { margin: 10px 0 0; font-size: 12px; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mb { margin-bottom: 14px; }
.mt { margin-top: 14px; }
.link { color: var(--primary); font-weight: 600; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--danger); margin-left: 10px; }
.empty { color: var(--muted); padding: 14px 0; font-size: 14px; }
.eyebrow, .form-label { color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* =========================
   CABEÇALHO DE PÁGINA
========================= */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 0 0 22px; }
.page-header h1 { font-size: clamp(25px, 3vw, 32px); font-weight: 700; margin-top: 4px; }
.page-header p { margin-top: 6px; }
.section-label { color: var(--primary); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.section { margin-top: 36px; }
.section-header { margin-bottom: 18px; }
.section-header h2 { margin-top: 5px; font-size: 22px; }

/* =========================
   CARTÃO DE BOAS-VINDAS (hero)
========================= */
.welcome {
    position: relative; overflow: hidden;
    min-height: 190px;
    display: flex; align-items: center;
    padding: 30px 32px;
    border-radius: 26px;
    color: #fff;
    background: linear-gradient(125deg, #18358f 0%, #3157d5 56%, #566fe0 100%);
    box-shadow: 0 18px 42px rgba(32, 61, 157, .22);
}
.welcome > div:first-child { position: relative; z-index: 2; }
.welcome-label { display: inline-block; margin-bottom: 8px; color: rgba(255,255,255,.72); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.welcome h1 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 700; line-height: 1.12; }
.welcome h1 span { color: #fff; }
.welcome p { max-width: 600px; margin-top: 10px; color: rgba(255,255,255,.82); font-size: 14px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-button {
    display: inline-flex; align-items: center; gap: 7px;
    height: 38px; padding: 0 14px; border-radius: 10px;
    font-size: 12px; font-weight: 700;
    background: #fff; color: #2445b6; transition: .15s;
}
.hero-button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.15); }
.hero-button-secundario { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.welcome-decoration {
    position: absolute; top: 50%; right: 6%;
    width: 180px; height: 180px; transform: translateY(-50%);
    border: 1px solid rgba(255,255,255,.13); border-radius: 50%;
}
.welcome-decoration::before, .welcome-decoration::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; inset: 22px; }
.welcome-decoration::after { inset: 50px; }
.circle { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: 0 0 18px rgba(255,255,255,.5); }
.circle-one { top: 18px; left: 36px; }
.circle-two { right: 13px; bottom: 52px; }
.circle-three { bottom: 16px; left: 65px; }

/* =========================
   BOTÕES
========================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; padding: 9px 16px;
    border-radius: 12px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text);
    font: 700 13px "DM Sans", sans-serif;
    cursor: pointer; transition: .15s;
}
.btn:hover { border-color: var(--border-strong); background: var(--hover); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(49, 87, 213, .22); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0e1324; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: var(--danger-bg); }
.btn-ghost { background: transparent; }
.btn-small { min-height: 32px; padding: 6px 12px; font-size: 12px; border-radius: 10px; }
.btn-block { width: 100%; margin-top: 8px; }
.btn-grande { min-height: 48px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* =========================
   PAINÉIS E CARTÕES
========================= */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-panel);
}
.panel h2 { font-size: 17px; font-weight: 700; }
.panel h3 { font-size: 15px; margin-bottom: 8px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 4px; }
.three-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.list-row:last-child { border-bottom: 0; }
.list-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }

/* Indicadores (rótulo em caixa-alta e ícone à direita, como na v3) */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 22px 0 20px; }
.summary-card {
    position: relative; overflow: hidden;
    display: flex; flex-direction: row-reverse; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 17px 18px;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: 18px;
    box-shadow: var(--shadow-panel);
    transition: .18s ease;
}
.summary-card:hover { border-color: #b9c6ed; box-shadow: var(--shadow); transform: translateY(-2px); }
.summary-icon {
    width: 40px; height: 40px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 12px; background: var(--primary-soft); color: var(--primary);
    font-size: 17px;
}
.summary-card span { color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.summary-card > div { min-width: 0; }
.summary-card strong { display: block; margin-top: 8px; font: 700 clamp(19px, 1.9vw, 26px) "Manrope", sans-serif; letter-spacing: -.04em; white-space: nowrap; }
.summary-card strong.small { font-size: 17px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.stats dt { color: var(--subtle); font-size: 11px; font-weight: 600; }
.stats dd { font: 700 21px "Manrope", sans-serif; margin-top: 2px; letter-spacing: -.03em; }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.big-number { text-align: center; padding: 34px; }
.big-number span { color: var(--muted); }
.big-number strong { display: block; font: 800 clamp(32px, 6vw, 48px) "Manrope", sans-serif; letter-spacing: -.04em; margin: 8px 0; }
.calc-line { font-size: 17px; margin: 10px 0 16px; }

/* Selos */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700;
    background: var(--hover); color: var(--muted);
}
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-yellow { background: var(--warning-bg); color: var(--warning); }
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.tag { display: inline-flex; padding: 3px 9px; border-radius: 999px; background: var(--tag-bg); color: var(--tag); font-size: 11px; font-weight: 700; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
    text-align: left; padding: 11px 12px;
    color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--hover); }
td small.resposta { display: block; margin-top: 5px; color: var(--muted); }

/* =========================
   FORMULÁRIOS
========================= */
input, select, textarea {
    width: 100%;
    min-height: 44px; padding: 10px 12px;
    font: 500 14px "DM Sans", sans-serif;
    border: 1px solid var(--border-strong); border-radius: 12px;
    background: var(--surface); color: var(--text);
    outline: none; transition: .15s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(49, 87, 213, .14); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--primary); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.filters input, .filters select { width: auto; min-width: 160px; flex: 1 1 160px; }
.filters label:not(.sr-only) { font-size: 12px; font-weight: 700; color: var(--subtle); }
.filters form { margin: 0; }
.form-panel { max-width: 860px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 4px; }
.field label { font-size: 12px; font-weight: 700; color: var(--subtle); letter-spacing: .02em; }
.field-check { flex-direction: row-reverse; justify-content: flex-end; align-items: center; }
.field-check input { width: 18px; }
.req { color: var(--danger); }
.help { color: var(--muted); font-size: 12px; }
.help ul { margin: 2px 0 0; padding-left: 16px; }
.help li { margin: 1px 0; }
.error { color: var(--danger); font-size: 12px; font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.form-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.checklist ul, .checklist div { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.checklist label { display: flex; gap: 8px; align-items: center; padding: 9px 11px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-size: 14px; background: var(--surface); }
.radio { display: inline-flex; padding: 6px; cursor: pointer; }
.estorno-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.estorno-form input { min-height: 32px; padding: 5px 10px; font-size: 12px; min-width: 150px; }

/* Mensagens */
.messages { margin-bottom: 16px; }
.message { padding: 12px 16px; border-radius: 12px; margin-bottom: 8px; font-size: 14px; font-weight: 600; background: var(--primary-soft); color: var(--primary); }
.message-success { background: var(--success-bg); color: var(--success); }
.message-error { background: var(--danger-bg); color: var(--danger); }
.message-warning { background: var(--warning-bg); color: var(--warning); }

/* Abas e paginação */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--primary); border-color: var(--primary); }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 10px 0 20px; font-size: 14px; }

/* Comunicados */
.comunicado h2 { margin-top: 8px; }
.comunicado-texto { font-size: 14px; line-height: 1.65; color: var(--text); }

/* =========================
   LOGIN (duas colunas, como a v3)
========================= */
.login-body { background: var(--canvas); }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr); }
.login-brand {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; align-items: center;
    padding: 9vw;
    background: linear-gradient(145deg, #18358f, #3157d5 68%, #4868dc);
    color: #fff;
}
.login-orbit {
    position: absolute; z-index: -1;
    width: 500px; height: 500px; right: -220px; bottom: -180px;
    border: 70px solid #f04f5f; border-radius: 50%;
    box-shadow: -145px -170px 0 -75px #f6c945, -270px 85px 0 -120px #20a87e;
    opacity: .94;
}
.login-brand-texto { position: relative; max-width: 470px; }
.brand-claro .brand-icon { background: #fff; color: #2445b6; box-shadow: none; }
.brand-claro h2 { color: #fff; font-size: 30px; }
.login-eyebrow { margin-top: 64px; color: rgba(255,255,255,.62); font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.login-headline { margin-top: 18px; font-size: clamp(36px, 4vw, 50px); font-weight: 700; line-height: 1.06; }
.login-sub { margin-top: 18px; color: rgba(255,255,255,.78); font-size: 14px; line-height: 1.8; }
.login-form-area { display: grid; place-items: center; padding: 48px; }
.login-card { width: 100%; max-width: 450px; }
.login-card h1 { margin-top: 8px; font-size: 30px; font-weight: 700; }
.login-card .muted { margin-top: 6px; }
.login-card .message { margin-top: 18px; }
.login-card .field { margin-top: 22px; }
.senha-campo { position: relative; }
.senha-campo input { padding-right: 46px; }
.senha-ver { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.senha-ver:hover { color: var(--primary); background: var(--hover); }
.login-card .btn-block { margin-top: 24px; }

/* =========================
   DOCUMENTAÇÃO (Markdown)
========================= */
.markdown { max-width: 980px; line-height: 1.65; font-size: 15px; }
.markdown h1 { font-size: 24px; margin: 4px 0 14px; }
.markdown h2 { font-size: 19px; margin: 28px 0 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.markdown h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.markdown h3 { font-size: 16px; margin: 20px 0 8px; }
.markdown p { margin: 10px 0; max-width: 75ch; }
.markdown ul { margin: 8px 0 12px 22px; }
.markdown li { margin: 4px 0; }
.markdown code { font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; font-size: .88em; background: var(--code-bg); padding: 1px 6px; border-radius: 6px; }
.markdown pre { background: #171927; color: #e8e9f0; padding: 16px; border-radius: 12px; overflow-x: auto; margin: 12px 0; }
.markdown pre code { background: none; padding: 0; color: inherit; }
.markdown table { margin: 10px 0 16px; font-size: 14px; }
.markdown td { vertical-align: top; }
.markdown a { color: var(--primary); font-weight: 600; }

/* =========================
   CHAMADA: alunos avulsos
========================= */
.avulsos { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px 10px; margin-top: 18px; display: grid; gap: 10px; max-width: 560px; }
.avulsos legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.avulsos-lista { display: grid; gap: 8px; }
.avulso-linha { display: flex; gap: 8px; align-items: center; }
.avulso-linha select { flex: 1; min-width: 0; }
.btn-icone { width: 40px; padding: 7px 0; font-size: 18px; line-height: 1; color: var(--danger); }
.avulsos #avulso-mais { justify-self: start; }
.avulsos .note { margin: 0; min-height: 1em; }
.remover-avulso { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--danger); cursor: pointer; white-space: nowrap; }

/* =========================
   AGENDA: colunas alinhadas entre os dias
========================= */
.agenda-table { table-layout: fixed; min-width: 760px; }
.agenda-table th:nth-child(1) { width: 13%; }
.agenda-table th:nth-child(2) { width: 33%; }
.agenda-table th:nth-child(3) { width: 11%; }
.agenda-table th:nth-child(4) { width: 18%; }
.agenda-table th:nth-child(5) { width: 11%; }
.agenda-table th:nth-child(6) { width: 14%; }
.agenda-table td { overflow-wrap: anywhere; }

/* =========================
   CONSULTAS — temperatura das aulas
========================= */
:root {
    --temp-quente: #e5484d; --temp-quente-bg: #ffe5e7;
    --temp-morna: #14a37f; --temp-morna-bg: #dcf5ee;
    --temp-fria: #3157d5; --temp-fria-bg: #e3e9ff;
    --temp-gelada: #64748b; --temp-gelada-bg: #e2e8f0;
    --temp-sem_dados: #a1a5b7; --temp-sem_dados-bg: #f1f2f6;
}
:root[data-theme="dark"] {
    --temp-quente-bg: #4b252d; --temp-morna-bg: #173e35; --temp-fria-bg: #263760;
    --temp-gelada-bg: #2a3348; --temp-sem_dados-bg: #232a3f;
    --temp-fria: #8ea7ff; --temp-quente: #ff8f9a; --temp-morna: #73d8b9; --temp-gelada: #aab4c8;
}
.temp-quente { --t: var(--temp-quente); --t-bg: var(--temp-quente-bg); }
.temp-morna { --t: var(--temp-morna); --t-bg: var(--temp-morna-bg); }
.temp-fria { --t: var(--temp-fria); --t-bg: var(--temp-fria-bg); }
.temp-gelada { --t: var(--temp-gelada); --t-bg: var(--temp-gelada-bg); }
.temp-sem_dados { --t: var(--temp-sem_dados); --t-bg: var(--temp-sem_dados-bg); }
.temp-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--t-bg); color: var(--t); }
.summary-card.temp-quente strong, .summary-card.temp-morna strong,
.summary-card.temp-fria strong, .summary-card.temp-gelada strong { color: var(--t); }
.temp-legenda { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.heatmap { width: 100%; border-collapse: separate; border-spacing: 6px; }
.heatmap th { font-size: 10px; color: var(--subtle); text-align: center; border: 0; }
.heatmap th[scope="row"] { text-align: right; padding-right: 6px; white-space: nowrap; }
.heatmap td { vertical-align: top; min-width: 110px; padding: 0; border: 0; }
.heatmap tbody tr:hover { background: none; }
.heat-cell { display: block; padding: 8px 10px; border-radius: 10px; margin-bottom: 4px; background: var(--t-bg); border-left: 4px solid var(--t); font-size: 12px; transition: transform .1s; }
.heat-cell:hover { transform: translateY(-1px); }
.heat-cell strong { display: block; font-size: 13px; }
.heat-cell span { color: var(--t); font-weight: 700; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr auto; gap: 12px; align-items: center; padding: 8px 0; font-size: 14px; }
.bar-label small { display: block; color: var(--muted); font-size: 12px; }
.bar-track { height: 12px; border-radius: 999px; background: var(--hover); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--t, var(--primary)); }
.bar-value { font-weight: 700; white-space: nowrap; text-align: right; }
.bar-value small { color: var(--muted); font-weight: 500; }
.colchart { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 8px; }
.colchart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.col-bar { width: 100%; max-width: 40px; min-height: 2px; border-radius: 6px 6px 0 0; background: var(--primary); }
.col-value { font-size: 11px; font-weight: 700; margin-bottom: 4px; }
.col-label { font-size: 10px; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.op-card { border-top: 4px solid var(--t); }
.op-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.op-top h3 { margin-bottom: 2px; }
.op-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.op-stats dt { font-size: 11px; color: var(--muted); }
.op-stats dd { font-weight: 700; }
.op-acao { margin-top: 12px; font-size: 14px; }
.op-recs { margin: 8px 0 0 18px; font-size: 13px; color: var(--muted); }
.op-recs li { margin-bottom: 4px; }
.termometro-escala { position: relative; height: 12px; border-radius: 999px;
    background: linear-gradient(90deg, var(--temp-gelada) 0%, var(--temp-fria) 40%, var(--temp-morna) 70%, var(--temp-morna) 85%, var(--temp-quente) 100%); }
.termometro-marcador { position: absolute; top: -4px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--surface); border: 4px solid var(--t); box-shadow: var(--shadow); }
.termometro-rotulos { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.termometro-rotulos span:nth-child(2) { color: var(--t); font-weight: 700; }
.mini-serie { display: flex; align-items: flex-end; gap: 3px; height: 40px; margin-top: 4px; }
.mini-bar { flex: 1; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--t); opacity: .8; }

/* =========================
   RESPONSIVO
========================= */
@media (max-width: 1100px) {
    .three-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1023px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.aberto { transform: none; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
    .main-content { margin-left: 0; }
    .menu-abrir, .menu-fechar { display: grid; }
    .topbar { padding: 0 20px; }
    .page { padding: 24px 20px 48px; }
}
@media (max-width: 860px) {
    .two-cols, .three-cols, .form-grid { grid-template-columns: 1fr; }
    .welcome { padding: 26px 22px; }
    .welcome-decoration { display: none; }
    .login-page { grid-template-columns: 1fr; }
    .login-brand { padding: 40px 28px; min-height: 260px; }
    .login-eyebrow { margin-top: 28px; }
    .login-form-area { padding: 32px 20px 48px; }
}
@media (max-width: 700px) {
    .page { padding: 20px 16px 40px; }
    .topbar { padding: 0 16px; }
    .bar-row { grid-template-columns: 1fr auto; }
    .bar-track { grid-column: 1 / -1; grid-row: 2; }
    .op-stats { grid-template-columns: repeat(2, 1fr); }
    .summary { grid-template-columns: 1fr 1fr; gap: 12px; }
    .summary-card strong { font-size: 21px; }
    .estorno-form { flex-wrap: wrap; }
}
.estorno-form .btn { white-space: nowrap; }
.acoes-linha { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.acoes-linha form { margin: 0; }
.menu-acao summary { cursor: pointer; list-style: none; }
.menu-acao summary::-webkit-details-marker { display: none; }
.menu-acao[open] { flex-basis: 100%; }
.menu-acao[open] .estorno-form { margin-top: 8px; }
.subtitulo { margin: 18px 0 4px; font-size: 13px; color: var(--subtle); text-transform: uppercase; letter-spacing: .08em; }
.dias-semana { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.dias-semana label { display: inline-flex; gap: 6px; align-items: center; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; font-weight: 600; font-size: 13px; color: var(--text); cursor: pointer; }
fieldset.sem-borda { border: 0; min-width: 0; padding: 0; margin: 0; }
fieldset.sem-borda[disabled] { opacity: .75; }
.ambientes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.ambiente-opcao { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.ambiente-opcao h2 { margin-top: 4px; }
.trocar-ambiente { margin-bottom: 8px; }
.backup-acoes { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
.backup-acoes input[type=file] { min-height: 32px; padding: 4px 8px; font-size: 12px; }
.field-largo { grid-column: 1 / -1; }
.opcoes-linha > div { display: flex; flex-wrap: wrap; gap: 8px; }
.opcoes-linha > div > div { display: contents; }
.opcoes-linha label:has(input) { display: inline-flex; gap: 7px; align-items: center; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; background: var(--surface); }
.opcoes-linha label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.stats-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) { .stats-4 { grid-template-columns: 1fr 1fr; } }
/* Atalhos de situação (Mensalidades e Relatórios) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; transition: .15s; }
.chip strong { color: var(--text); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip-ativo { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-ativo strong { color: #fff; }
:root[data-theme="dark"] .chip-ativo, :root[data-theme="dark"] .chip-ativo strong { color: #0e1324; }
.chip-paga:not(.chip-ativo) strong { color: var(--success); }
.chip-atrasada:not(.chip-ativo) strong { color: var(--danger); }
.chip-parcial:not(.chip-ativo) strong, .chip-pendente:not(.chip-ativo) strong { color: var(--warning); }
a.badge:hover { filter: brightness(.95); text-decoration: underline; }
