/* Tatame — identidade visual unificada (preto obsidiana + vermelho Tatame + Plus Jakarta Sans).
   Alinhada ao Portal do Aluno e ao Portal da Família, calibrada para densidade operacional de Administrador e Professor. */
:root {
  --bg: #0A0A0B;            /* fundo base obsidiana (igual ao Portal) */
  --surface: #121214;       /* cards, sidebar, superfícies principais */
  --surface-2: #1A1A1D;     /* campos, hover, sub-blocos */
  --surface-3: #232327;     /* selecionado neutro, tooltips */
  --raised: #141417;        /* sheets, modais e painéis elevados */
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --line-3: rgba(255,255,255,.22);
  --track: #26262B;
  --text: #F2F2F3; --text-2: #BDBDC4; --muted: #8E8E97; --faint: #62626B;
  --accent: #E5383B;        /* vermelho Tatame: marca, foco, progresso, item ativo */
  --accent-2: #C8191F;      /* fundo de botão primário (contraste 5,9:1 com branco) */
  --accent-hover: #DC2228;  /* hover de botão primário */
  --accent-fg: #FF6B6E;     /* texto vermelho legível sobre escuro */
  --accent-soft: rgba(229,56,59,.13);
  --accent-line: rgba(229,56,59,.40);
  --good: #3CC08E; --warn: #E8B44C; --bad: #FF5C6C;
  --good-soft: rgba(60,192,142,.12); --warn-soft: rgba(232,180,76,.12); --bad-soft: rgba(255,92,108,.12);
  --r-xs: 5px; --r-sm: 7px; --r: 10px; --r-lg: 14px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display: 'Plus Jakarta Sans', 'Archivo', -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  --nav-h: 62px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14.5px; line-height: 1.5; }
body { min-height: 100dvh; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
b, strong { font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: rgba(229,56,59,.35); }
.mono, .stat-value, .heat .c { font-variant-numeric: tabular-nums; }
.num, .mono { font-variant-numeric: tabular-nums; }

/* ---------- Marca compartilhada (selo T vermelho) ---------- */
.mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff;
  font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.04em; flex: none; box-shadow: 0 4px 14px rgba(200,25,31,.32); }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }

/* ---------- Layout ---------- */
.app { max-width: 640px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 34px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .app { max-width: 1140px; padding: 34px 40px 88px; }
}
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 18px; margin-bottom: 22px; }
.top > :last-child:not(:first-child) { margin-left: auto; }
.top h1 { font-family: var(--display); font-size: 27px; line-height: 1.1; letter-spacing: -.03em; margin: 0; font-weight: 800; }
.top .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; white-space: nowrap; }
@media (min-width: 900px) { .top h1 { font-size: 32px; } }

/* Título de seção: hierarquia grotesk limpa com régua sutil e ação à direita */
.section-title { display: flex; align-items: center; gap: 14px; margin: 32px 0 12px; min-height: 24px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); order: 1; }
.section-title > :not(h2) { order: 2; }
.section-title h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: -.015em; color: var(--text); white-space: nowrap; }
.section-title .link, .link { color: var(--accent-fg); font-size: 13px; font-weight: 600; text-decoration: none; transition: color .15s; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 12px; }
.card.tight { padding: 13px 15px; }
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; letter-spacing: -.015em; }
/* Cartão que é um link (ex.: Produtos e estoque e Graduação em Ajustes): sem o sublinhado e a cor padrão do navegador. */
a.card { color: inherit; text-decoration: none; transition: background .15s; }
@media (hover: hover) { a.card:hover { background: var(--surface-2); } }
.card .meta { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .xs { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Indicadores: cards estruturados em grade (alinhados ao Portal) ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; color: inherit; text-decoration: none; min-width: 0; transition: border-color .15s, background .15s; }
a.stat:hover { border-color: var(--accent-line); background: var(--surface-2); }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-label svg { display: none; }
.stat-value { font-family: var(--display); font-size: 26px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.delta { font-size: 12px; margin-top: 6px; color: var(--muted); line-height: 1.35; }
.delta.up { color: var(--good); font-weight: 600; } .delta.down { color: var(--bad); font-weight: 600; }
.stat.accent-glow { background: linear-gradient(155deg, rgba(229,56,59,.14), rgba(229,56,59,0) 65%), var(--surface); border-color: rgba(229,56,59,.24); }
@media (min-width: 900px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 16px 18px; }
  .stat-value { font-size: 28px; }
}

/* ---------- Progresso ---------- */
.bar { height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 99px; transform-origin: left; animation: grow .7s var(--ease) both; }
.bar.thin { height: 5px; }
@keyframes grow { from { transform: scaleX(0); } }
.macro { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; align-items: center; }
.macro + .macro { margin-top: 14px; }
.macro .bar { grid-column: 1 / -1; }

/* ---------- Botões e formulários ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 9px; background: var(--accent-2); color: #fff; font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; border: 1px solid rgba(255,255,255,.06); transition: background .15s, border-color .15s, transform .1s, opacity .15s; }
.btn:active { transform: scale(.985); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-2); font-weight: 600; }
.btn.danger { background: transparent; color: var(--bad); border-color: rgba(255,92,108,.36); font-weight: 600; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.loading::after { content: ''; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--text-2); flex: none; text-decoration: none; border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s; }
.icon-btn svg { width: 17px; height: 17px; }

/* Filtros e segmentos */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 600; border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s; }
.chip.on { color: var(--text); background: var(--accent-soft); border-color: var(--accent-line); }
.chip .muted { font-variant-numeric: tabular-nums; font-size: 12px; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; padding: 3px; gap: 3px; }
.seg button { flex: 1; height: 30px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.seg button.on { background: var(--accent-2); color: #fff; }

label.field { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
label.field > span { display: block; margin-bottom: 6px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 68px; }
.peek { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 32px; padding: 0 10px; border-radius: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; transition: color .15s, background .15s; }
.peek:hover { color: var(--text); background: var(--surface-3); }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; outline: none; font-size: 14px; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s; }
.input::placeholder { color: #767680; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229,56,59,.18); background: var(--surface-2); }
.input:disabled { opacity: .5; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8E97' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
select.input option { background: var(--surface); }
textarea.input { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.form-grid .full { grid-column: 1 / -1; }
.err { color: var(--bad); font-size: 13px; font-weight: 500; margin-top: 2px; }
.err:empty { display: none; }
@media (max-width: 899px) {
  .btn { height: 44px; } .btn.sm { height: 36px; }
  .icon-btn { width: 40px; height: 40px; }
  .input, select.input { height: 46px; font-size: 16px; }
  textarea.input { font-size: 16px; }
  .chip { height: 36px; }
  .seg button { height: 34px; }
}

/* ---------- Listas e superfícies ---------- */
.list { margin: 0 -10px 10px; }
.card > .list { margin: 0 -10px; }
.item { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 10px; width: 100%; text-align: left; border-radius: var(--r); color: inherit; text-decoration: none; transition: background .15s; }
.item + .item::before { content: ''; position: absolute; top: 0; left: 10px; right: 10px; height: 1px; background: var(--line); transition: opacity .15s; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--text-2); border: 1px solid var(--line-2); background: var(--surface-2); }
.tag.accent { color: var(--accent-fg); border-color: var(--accent-line); background: var(--accent-soft); }
.tag.good { color: #9BE8C9; border-color: rgba(60,192,142,.4); background: var(--good-soft); }
.tag.warn { color: #F5D88F; border-color: rgba(232,180,76,.4); background: var(--warn-soft); }
.tag.bad { color: #FFB3BA; border-color: rgba(255,92,108,.4); background: var(--bad-soft); }
.empty { padding: 24px 14px; color: var(--muted); font-size: 13.5px; }
.empty b { display: block; color: var(--text); font-size: 14.5px; font-weight: 700; margin-bottom: 4px; }
.card.empty { padding: 28px 22px; }

/* ---------- Gráficos ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .cross { stroke: var(--line-3); stroke-width: 1; }
.chart .bar { transition: opacity .15s; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text-2); font-size: 12px; padding: 6px 10px; border-radius: var(--r-sm); white-space: nowrap; opacity: 0; transition: opacity .12s; z-index: 5; box-shadow: 0 10px 28px rgba(0,0,0,.55); }
.chart-tip b { color: var(--text); }
.chart-empty { height: 120px; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 0 20px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface); }

/* ---------- Navegação (Desktop: sidebar integrada; Celular: topbar + barra 5 abas + menu Mais) ---------- */
.nav a, .nav button.nav-more { text-decoration: none; position: relative; }
.nav a[hidden] { display: none !important; }   /* itens só do administrador (data-admin), ocultados até o perfil ser conhecido */
.nav-count { font-style: normal; }
.side-brand, .side-foot, .nav-sep { display: none; }
.role-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2); }
.role-pill.admin { background: var(--accent-soft); color: var(--accent-fg); border-color: var(--accent-line); }

/* Mobile: topbar fixa com marca T + barra inferior de 5 itens (Painel, Alunos, Agenda, Diário, Mais) */
.mob-bar { display: none; }
@media (max-width: 899px) {
  .side { display: contents; }
  .mob-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(10,10,11,.90); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
  .mob-brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
  .mob-brand b { display: block; font-family: var(--display); font-size: 16px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
  .mob-brand small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
  .mob-me { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px 0 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; flex: none; }
  .mob-me .avatar { width: 28px; height: 28px; font-size: 11px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(6, 1fr); padding: 0 4px env(safe-area-inset-bottom); height: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: rgba(10,10,11,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .nav a.desk-only { display: none; }
  .nav a, .nav button.nav-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--nav-h); color: var(--muted); font-size: 11px; font-weight: 600; transition: color .2s; }
  .nav a svg, .nav button.nav-more svg { width: 21px; height: 21px; transition: transform .2s var(--ease), color .2s; }
  .nav a:active svg, .nav button.nav-more:active svg { transform: scale(.9); }
  .nav a.on, .nav button.nav-more.on { color: var(--text); }
  .nav a.on svg, .nav button.nav-more.on svg { color: var(--accent); }
  .nav a::before, .nav button.nav-more::before { content: ''; position: absolute; top: 0; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--accent); transform: scaleX(0); transition: transform .25s var(--ease); }
  .nav a.on::before, .nav button.nav-more.on::before { transform: scaleX(1); }
  .nav-count { display: none; }
  .nav-count.due { display: block; position: absolute; top: 10px; left: calc(50% + 7px); width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); font-size: 0; }
}

/* Menu "Mais" no celular (bottom sheet) */
.more-list { display: grid; gap: 8px; }
.more-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; text-align: left; color: var(--text); transition: border-color .15s, background .15s; }
.more-item.on { border-color: var(--accent-line); background: var(--accent-soft); }
.more-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent-fg); flex: none; }
.more-item b { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.2; }
.more-item small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.more-item.danger .more-ic { background: var(--bad-soft); color: var(--bad); }

/* Desktop: sidebar fixa em --surface (igual ao Portal), sem janela flutuante recortada */
@media (min-width: 900px) {
  body { background: var(--bg); }
  .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
  .side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 20px 14px 16px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
  .side-brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 22px; text-decoration: none; }
  .side-brand b { display: block; font-family: var(--display); font-size: 17px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
  .side-acad { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; font-size: 12px; line-height: 1.3; color: var(--muted); margin-top: 2px; }
  .nav { display: flex; flex-direction: column; gap: 3px; }
  .nav button.nav-more { display: none; }
  .nav-sep { display: block; padding: 14px 10px 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }
  .nav a { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: var(--r); color: var(--text-2); font-size: 14px; font-weight: 600; transition: background .15s, color .15s; }
  .nav a svg { width: 18px; height: 18px; color: var(--muted); transition: color .15s; flex: none; }
  .nav a.on { background: var(--accent-soft); color: var(--text); }
  .nav a.on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
  .nav a.on svg { color: var(--accent); }
  .nav-count { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600; color: var(--muted); }
  .nav-count.due { color: var(--accent-fg); }
  .nav-count.due::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
  .side-foot { display: block; margin-top: auto; padding-top: 14px; }
  .side-date { padding: 0 10px 10px; font-size: 11.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
  .side-me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; transition: background .15s, border-color .15s; }
  .side-me .avatar { width: 32px; height: 32px; font-size: 11.5px; }
  .side-me b { display: block; font-size: 13px; font-weight: 700; line-height: 1.25; }
  .side-me small { display: inline-flex; margin-top: 3px; }
  .shell > .app { max-width: none; width: 100%; margin: 0; min-height: 100dvh; background: var(--bg); padding: 34px max(40px, calc((100% - 1100px) / 2)) 88px; }
}

/* Entrada de tela */
.enter > * { animation: rise .36s var(--ease) both; }
.enter > :nth-child(2) { animation-delay: .03s; } .enter > :nth-child(3) { animation-delay: .06s; }
.enter > :nth-child(4) { animation-delay: .09s; } .enter > :nth-child(n+5) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Sheets e telas cheias ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.68); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 16px 16px 0 0; padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -16px 52px rgba(0,0,0,.6); animation: up .3s var(--ease); }
.sheet .grab { width: 38px; height: 4px; border-radius: 99px; background: var(--line-3); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-head h2 { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { border-radius: var(--r-lg); border-bottom: 1px solid var(--line-2); padding: 22px 24px 24px; box-shadow: 0 30px 90px rgba(0,0,0,.7); animation: pop .22s var(--ease); }
  .sheet .grab { display: none; }
}
.full-screen { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; animation: fade .18s ease; }
.full-screen .app { max-width: 740px; padding-bottom: 40px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: translateY(6px) scale(.985); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 90; background: var(--surface-2); border: 1px solid var(--line-2); padding: 11px 16px; border-radius: var(--r); font-size: 13.5px; font-weight: 600; display: flex; gap: 10px; align-items: center; box-shadow: 0 14px 36px rgba(0,0,0,.6); animation: toast .28s var(--ease); max-width: calc(100vw - 32px); }
.toast .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.toast.error .dot { background: var(--bad); } .toast.success .dot { background: var(--good); }
@keyframes toast { from { transform: translate(-50%, -8px); opacity: 0; } }

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.3s ease-in-out infinite; border-radius: var(--r-lg); height: 90px; margin-bottom: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Entrada (alinhada ao Portal do Aluno: marca no topo + headline expressiva) ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; padding: max(26px, env(safe-area-inset-top)) 20px 26px;
  background: radial-gradient(90% 50% at 50% 0%, rgba(229,56,59,.11), transparent 62%), var(--bg); }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand b { display: block; font-family: var(--display); font-size: 17px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.auth-brand small { display: block; font-size: 12px; color: var(--muted); }
.auth-box { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 400px; margin: 0 auto; padding: 28px 0; }
.auth-box.card { flex: 0; background: var(--surface); margin: auto; }
.auth-head { margin-bottom: 24px; }
.auth-head h1 { margin: 0 0 8px; font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.auth-head h1 em { font-style: normal; color: var(--accent); }
.auth-head p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.auth .input { height: 48px; background: var(--surface); }
.auth .btn:not(.sm) { height: 48px; font-size: 15px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12.5px; max-width: 400px; margin: 0 auto; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ===================== Domínio: faixas, alunos, técnicas ===================== */
.belt { --c: #F1F1F1; --tab: #111; position: relative; display: inline-flex; width: 60px; height: 12px; border-radius: 3px; background: linear-gradient(rgba(255,255,255,.12), transparent 45%, rgba(0,0,0,.18)), var(--c); outline: 1px solid rgba(255,255,255,.14); outline-offset: -1px; flex: none; overflow: hidden; vertical-align: middle; }
.belt::after { content: ''; position: absolute; right: 8px; top: 0; bottom: 0; width: 22px; background: var(--tab); }
.belt i { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; z-index: 1; }
.belt.lg { width: 120px; height: 22px; border-radius: 4px; } .belt.lg::after { width: 40px; right: 14px; }
.belt.lg i { width: 4px; }
[data-b=branca] { --c: #F1F1F1; } [data-b=cinza] { --c: #8C8F96; } [data-b=amarela] { --c: #E9C33B; }
[data-b=laranja] { --c: #E8833A; } [data-b=verde] { --c: #3E9A4E; } [data-b=azul] { --c: #2F6FD6; }
[data-b=roxa] { --c: #7C3FBF; } [data-b=marrom] { --c: #7A4A2A; } [data-b=preta] { --c: #111214; --tab: #C8191F; outline-color: rgba(255,255,255,.26); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line-2); display: grid; place-items: center; font-weight: 700; color: var(--text-2); flex: none; font-size: 12px; letter-spacing: .02em; }
.avatar.brand { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-fg); }
.stu { display: flex; align-items: center; gap: 12px; }
.stu .meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.mini-ring { --p: 0; --rc: var(--accent); position: relative; width: 36px; height: 36px; display: grid; place-items: center; flex: none; }
.mini-ring::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--rc) calc(var(--p) * 1%), var(--track) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); }
.mini-ring > span { position: relative; display: grid; place-items: center; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.crit { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 12px 0; }
.crit + .crit { border-top: 1px solid var(--line); }
.crit .bar { grid-column: 1 / -1; }
.crit .ok { color: var(--good); } .crit .no { color: var(--faint); }
.crit svg { vertical-align: -2px; }
.lvl { display: flex; gap: 4px; }
.lvl button { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; border: 1px solid var(--line); transition: background .15s, color .15s, border-color .15s, transform .1s; }
.lvl button:active { transform: scale(.92); }
.lvl button.on { color: #fff; border-color: transparent; }
.lvl button.on[data-l="0"] { background: var(--surface-3); color: var(--text-2); border-color: var(--line-2); }
.lvl button.on[data-l="1"] { background: #362225; color: #F0B6B8; } .lvl button.on[data-l="2"] { background: #7D1E22; } .lvl button.on[data-l="3"] { background: var(--accent-2); }
.lvl button.on[data-l="4"] { background: #1E7A5B; } .lvl button.on[data-l="5"] { background: var(--good); color: #052A1C; }
@media (max-width: 899px) { .lvl button { width: 36px; height: 36px; } }
.tech-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 12px 10px; position: relative; }
.tech-row + .tech-row::before { content: ''; position: absolute; top: 0; left: 10px; right: 10px; height: 1px; background: var(--line); }
@media (max-width: 520px) { .tech-row { grid-template-columns: 1fr; } }
.diff { display: inline-flex; gap: 3px; vertical-align: middle; }
.diff i { width: 6px; height: 6px; border-radius: 1.5px; background: var(--track); }
.diff i.on { background: var(--accent); }
.att { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 10px; width: 100%; text-align: left; border-radius: var(--r); transition: background .15s; }
.att + .att::before { content: ''; position: absolute; top: 0; left: 10px; right: 10px; height: 1px; background: var(--line); }
.att .box { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-3); display: grid; place-items: center; color: transparent; flex: none; transition: background .15s, border-color .15s, color .15s, transform .15s var(--ease); }
.att .box svg { width: 14px; height: 14px; }
.att.on .box { background: var(--accent-2); border-color: var(--accent-2); color: #fff; transform: scale(1.05); }
.att.on { background: rgba(229,56,59,.08); }
.sticky-bar { position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); z-index: 5; }
.heat { display: grid; gap: 4px; font-size: 12px; }
.heat .c { height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text); font-weight: 700; }
.heat .h { color: var(--muted); display: grid; place-items: center; font-size: 11.5px; font-weight: 600; }
.table-wrap { overflow-x: auto; margin: 0 -2px; }
table.rules { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
table.rules th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 9px 8px; vertical-align: bottom; border-bottom: 1px solid var(--line-2); }
table.rules td { padding: 7px 8px; border-top: 1px solid var(--line); }
table.rules input { height: 34px; padding: 0 6px; text-align: center; font-variant-numeric: tabular-nums; font-size: 13.5px; }
table.rules.rules-ro td.num { text-align: center; font-weight: 600; color: var(--text-2); }
table.rules.rules-ro td.num.empty-val { color: var(--faint); font-weight: 400; }

/* Consulta limpa de Técnica (Professor) */
.tech-ro-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tech-ro-desc { margin: 0 0 16px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.tech-ro-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.tech-ro-meta > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.tech-ro-meta b { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tech-ro-meta span { font-size: 11.5px; color: var(--muted); }

/* ===================== Telas ===================== */
.dash { display: flex; flex-direction: column; }
.dash-col { display: contents; }
.dash section { order: var(--o); min-width: 0; }
@media (min-width: 900px) {
  .dash { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 0 36px; align-items: start; }
  .dash-col { display: block; }
}
.slot { gap: 14px; padding-block: 13px; }
.slot-time { width: 52px; flex: none; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; line-height: 1.25; }
.slot-time b { font-family: var(--display); font-size: 16px; font-weight: 800; color: var(--text); }
.slot-time span { font-size: 12px; color: var(--muted); }
.slot.done .slot-time b { color: var(--muted); }
.slot .grow > b { font-weight: 700; }
.belt-dist { display: flex; gap: 2px; height: 10px; border-radius: 3px; overflow: hidden; margin: 8px 0 14px; }
.belt-dist i { min-width: 3px; transform-origin: left; animation: grow .9s var(--ease) both; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.belt-legend .row { gap: 12px; padding: 7px 0; }
.belt-legend .row + .row { border-top: 1px solid var(--line); }
.belt-legend .mono.xs { width: 34px; text-align: right; }

/* Barra de ferramentas */
.toolbar { display: flex; flex-direction: column-reverse; gap: 10px; margin-bottom: 14px; }
.toolbar-r { display: flex; gap: 8px; }
.toolbar-r .search { flex: 1; }
.toolbar-r select.input { width: auto; flex: none; }
@media (min-width: 900px) {
  .toolbar { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
  .toolbar-r .search { flex: none; width: 250px; }
}
.search { position: relative; display: block; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 36px; }

/* Tabela de alunos */
.thead { display: none; }
.trow { display: grid; grid-template-columns: 36px auto auto minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.t-name { grid-column: 1 / 5; display: flex; align-items: center; gap: 12px; min-width: 0; }
.t-name .grow { display: flex; flex-direction: column; min-width: 0; }
.t-name b { font-weight: 700; }
.t-belt { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 8px; color: var(--text-2); white-space: nowrap; }
.t-freq { grid-column: 3; grid-row: 2; font-size: 13px; }
.t-last { grid-column: 4; grid-row: 2; color: var(--muted); }
.t-belt .rank { min-width: 90px; }
.t-next { grid-column: 5; grid-row: 1; display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.t-next .tag svg { width: 12px; height: 12px; }
@media (max-width: 899px) { .t-belt .small, .t-next .bar, .t-next-l { display: none; } }
@media (min-width: 900px) {
  .thead, .trow { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1.55fr) minmax(0, .75fr) minmax(0, .95fr) minmax(0, 1.55fr); gap: 14px; }
  .thead { display: grid; margin: 0 -10px; padding: 0 10px 10px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
  .trow > * { grid-column: auto !important; grid-row: auto !important; }
  .trow { padding-block: 11px; }
  .t-next { justify-content: flex-start; }
  .t-next-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .thead + .list .item:first-child::before { display: none; }
}

/* Abas de página: sublinhado vermelho Tatame */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-top: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; flex: none; height: 42px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: color .15s; }
.tabs button.on { color: var(--text); }
.tabs button::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px; border-radius: 2px 2px 0 0; background: var(--accent); transform: scaleX(0); transition: transform .25s var(--ease); }
.tabs button.on::after { transform: scaleX(1); }
.tabs .muted { font-size: 12px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.tab-body { padding-top: 18px; }
.tab-body > .section-title:first-child { margin-top: 4px; }

/* Ficha do aluno */
.crumbs { align-items: center; margin-bottom: 16px; }
.back { display: inline-flex; align-items: center; gap: 5px; margin-left: -6px; padding: 5px 10px 5px 6px; border-radius: var(--r-sm); color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none; transition: color .15s, background .15s; }
.hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; padding: 20px 22px; margin-bottom: 14px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: radial-gradient(110% 150% at 100% 0%, rgba(229,56,59,.15) 0%, rgba(229,56,59,0) 56%), var(--surface); }
.hero-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hero-id .avatar { width: 52px; height: 52px; font-size: 17px; background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-fg); }
.hero h1 { margin: 0; font-family: var(--display); font-size: 26px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.hero .sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.hero-belt { display: flex; align-items: center; gap: 14px; }
.hero-belt b { font-weight: 700; }
@media (min-width: 900px) { .hero h1 { font-size: 32px; } }

/* Aulas: histórico de chamadas */
.agenda-day { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
.agenda-day + .agenda-day { border-top: 1px solid var(--line); }
.agenda-date { display: flex; flex-direction: column; padding-top: 10px; }
.agenda-date b { font-family: var(--display); font-size: 24px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.agenda-date span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; font-weight: 600; text-transform: uppercase; }
.agenda .list { margin-bottom: 0; }
.lrow { gap: 14px; }
.lrow .slot-time { width: 48px; }
.lrow .grow > b { font-weight: 700; }
.l-count { display: flex; flex-direction: column; align-items: flex-end; flex: none; line-height: 1.2; }
.l-count b { font-family: var(--display); font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .agenda-day { grid-template-columns: 88px minmax(0, 1fr); } }

/* Aulas: grade semanal */
.week { display: flex; flex-direction: column; gap: 20px; }
.wcol.none { display: none; }
.wcol-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-family: var(--display); font-size: 14.5px; font-weight: 700; color: var(--text-2); }
.wcol.today .wcol-h { color: var(--accent-fg); }
.wcol-h .tag { height: 20px; }
.cls { position: relative; display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 11px 12px 11px 14px; margin-bottom: 8px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: background .15s, border-color .15s, transform .15s var(--ease); }
.cls:active { transform: scale(.99); }
.cls.off { opacity: .5; }
.cls-t { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.cls b { font-weight: 700; font-size: 14px; }
.cls-occ { margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--line); }
.cls-occ b { font-size: 13px; }
@media (max-width: 899px) {
  .cls { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
  .cls > :not(.cls-occ) { grid-column: 1; }
  .cls-occ { grid-column: 2; grid-row: 1 / span 3; align-self: center; display: flex; flex-direction: column; align-items: flex-end; margin: 0; padding: 0; border: 0; }
  .cls-occ b { font-size: 16px; }
}
.wcol-none { display: block; padding: 12px 0; font-size: 12px; color: var(--faint); text-align: center; border: 1px dashed var(--line); border-radius: var(--r); }
@media (min-width: 900px) {
  .week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
  .wcol, .wcol.none { display: block; padding: 12px 8px 10px; min-height: 260px; }
  .wcol + .wcol { border-left: 1px solid var(--line); }
  .wcol.today { background: rgba(229,56,59,.05); }
  .wcol-h { justify-content: space-between; padding: 0 4px 10px; margin: 0 -8px 10px; padding-inline: 12px; border-bottom: 1px solid var(--line); }
  .cls { padding: 9px 10px 9px 12px; background: var(--surface-2); }
  .wcol-none { border: 0; padding-top: 24px; }
}

/* Técnicas */
.lib-cats { margin: 0 -2px 14px; }
.lib-tools { margin-bottom: 4px; }
.lib-main > .section-title:nth-child(2) { margin-top: 24px; }
.section-title h2 .belt { width: 32px; height: 9px; }
.section-title h2 .belt::after { width: 10px; right: 4px; }
.tlib { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name lvl" "use diff"; gap: 4px 16px; }
.tlib.off { opacity: .5; }
.tl-name { grid-area: name; display: flex; flex-direction: column; min-width: 0; }
.tl-name b { font-weight: 700; }
.tl-diff { grid-area: diff; justify-self: end; }
.tl-use { grid-area: use; }
.tl-lvl { grid-area: lvl; display: flex; align-items: center; gap: 8px; justify-self: end; }
.tl-lvl .bar { width: 48px; }
@media (min-width: 900px) {
  .lib { display: grid; grid-template-columns: 204px minmax(0, 1fr); gap: 32px; align-items: start; }
  .lib-cats { position: sticky; top: 24px; flex-direction: column; gap: 2px; margin: 0; overflow: visible; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; }
  .lib-cats .chip { justify-content: space-between; width: 100%; height: 34px; }
  .lib-tools .search { flex: 1; width: auto; }
  .tlib { grid-template-columns: minmax(0, 1fr) 74px 170px 108px; grid-template-areas: "name diff use lvl"; }
  .tl-diff, .tl-lvl { justify-self: start; }
}

.top > div:first-child { min-width: 0; max-width: 100%; }
.top .sub { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 899px) {
  .top:has(> div:first-child > h1) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; }
  .top:has(> div:first-child > h1) > div:first-child { display: contents; }
  .top:has(> div:first-child > h1) .sub { grid-column: 1 / -1; grid-row: 2; }
  /* Qualquer outro item junto do título (ex.: o <p> de explicação do Diário) também vai para a largura total, embaixo.
     Sem isto ele caía na coluna da ação e espremia o título até largura zero (letras por cima do texto). */
  .top:has(> div:first-child > h1) > div:first-child > :not(h1):not(.sub) { grid-column: 1 / -1; }
  .top:has(> div:first-child > h1) > :last-child:not(:first-child) { grid-column: 2; grid-row: 1; margin-left: 0; }
  /* Dois botões com texto (ex.: Estoque do administrador: "Movimentar" e "Novo produto") não cabem ao lado do título:
     espremiam "Produtos e estoque" a 30px em 320px. Vão para a linha de baixo, depois do subtítulo. */
  .top:has(> div:first-child > h1) > :last-child:not(:first-child):has(> .btn + .btn) { grid-column: 1 / -1; grid-row: 3; justify-self: start; margin-top: 12px; }
}

/* ===================== Progressão da graduação ===================== */
@property --f { syntax: '<number>'; inherits: false; initial-value: 0; }
.rank { --tab: #111; --h: 12px; --body: 24px; --end: 6px; --sw: 3px; --sg: 2px; --tp: 4px; --nw: 16px;
  display: inline-flex; align-items: center; gap: 4px; flex: none; vertical-align: middle; }
.rk-belt { display: flex; justify-content: flex-end; height: var(--h); padding: 0 var(--end) 0 var(--body); border-radius: 2px;
  background: linear-gradient(rgba(255,255,255,.1), transparent 45%, rgba(0,0,0,.16)), var(--c); outline: 1px solid rgba(255,255,255,.14); outline-offset: -1px; }
.rank[data-b=preta] { --tab: #C8191F; }
.rank[data-b=preta] .rk-belt { outline-color: rgba(255,255,255,.26); }
.rk-tab { display: flex; gap: var(--sg); padding: 0 var(--tp); background: var(--tab); }
.rk-tab i { position: relative; width: var(--sw); background: rgba(255,255,255,.16); }
.rk-tab i.on { background: #fff; }
.rk-tab i.pend { background: linear-gradient(to top, rgba(255,255,255,.85) calc(var(--f) * 100%), rgba(255,255,255,.16) 0); }
.rk-tab i.pend.ready { background: var(--good); }
.rk-next { width: var(--nw); height: var(--h); border-radius: 2px; box-shadow: inset 0 0 0 1.5px var(--c);
  background: linear-gradient(90deg, var(--c) calc(var(--f) * 100%), transparent 0); }
.rk-next[data-b=preta] { --c: #6A6D77; }
.rk-next.ready { background: var(--c); box-shadow: inset 0 0 0 1.5px var(--c), 0 0 0 2px var(--surface), 0 0 0 3.5px var(--good); }
.rk-max { font-size: 12px; color: var(--muted); margin-left: 6px; }
.rank.lg { --h: 26px; --body: 92px; --end: 16px; --sw: 7px; --sg: 12px; --tp: 10px; --nw: 42px; gap: 8px; margin-bottom: 18px; }
.rank.lg .rk-tab i::after { content: attr(data-n); position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--muted); }
.rank.lg .rk-tab i.on::after { color: var(--text-2); }
.rank.lg .rk-tab i.pend::after { color: var(--text); }
.enter .rk-tab i.pend, .enter .rk-next { animation: rk-fill .9s var(--ease) .15s both; }
@keyframes rk-fill { from { --f: 0; } }

/* ===================== Painel: hoje no tatame (hero com profundidade rubra) ===================== */
.today { position: relative; border-radius: var(--r-lg); border: 1px solid rgba(229,56,59,.26); padding: 20px 22px; margin-bottom: 14px;
  background: radial-gradient(110% 150% at 100% 0%, rgba(229,56,59,.18) 0%, rgba(229,56,59,0) 58%), var(--surface); }
.today-k { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-fg); }
.today-k::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.today-row { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "time info" "cta cta"; gap: 14px 20px; align-items: center; margin-top: 12px; }
.today-time { grid-area: time; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.today-time b { font-family: var(--display); font-size: 46px; line-height: .95; font-weight: 800; letter-spacing: -.04em; }
.today-time span { font-size: 12.5px; color: var(--muted); margin-top: 5px; font-weight: 600; }
.today-info { grid-area: info; min-width: 0; }
.today h2 { margin: 0; font-family: var(--display); font-size: 24px; line-height: 1.1; font-weight: 800; letter-spacing: -.025em; overflow-wrap: anywhere; }   /* palavra longa no nome da aula (ex.: "(demonstração)") não pode passar da coluna nem ser cortada no celular */
.today-info .muted { font-size: 13.5px; margin-top: 5px; }
.today-cta { grid-area: cta; height: 46px; font-size: 14.5px; padding: 0 22px; }
.today.quiet { border-color: var(--line); background: var(--surface); padding: 18px 20px; }
.today.quiet .today-k { color: var(--muted); }
.today.quiet .today-k::before { background: var(--good); }
.today.quiet h2 { margin-top: 6px; font-size: 20px; }
.today.quiet p { margin: 4px 0 0; }
@media (min-width: 900px) {
  .today { padding: 24px 26px; }
  .today-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "time info cta"; gap: 26px; }
  .today-time b { font-size: 58px; }
  .today h2 { font-size: 28px; }
}

.slot .grow > b, .lrow .grow > b, .sname, .t-name b, .cls b { font-family: var(--display); font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.section-title.sub { margin-top: 24px; }
.cls.now { border-color: var(--accent-line); background: var(--accent-soft); }
.cls-t em { font-style: normal; font-weight: 700; color: var(--accent-fg); margin-left: 5px; }

/* ---------- Hover só onde há ponteiro de verdade ---------- */
@media (hover: hover) and (pointer: fine) {
  .section-title .link:hover, .link:hover { color: var(--text); }
  .btn:hover { background: var(--accent-hover); }
  .btn.ghost:hover { background: var(--surface-2); border-color: var(--line-3); }
  .btn.danger:hover { background: var(--bad-soft); }
  .icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--line); }
  .chip:not(.on):hover { color: var(--text); background: var(--surface-2); }
  .seg button:not(.on):hover { color: var(--text); }
  .input:hover:not(:focus) { border-color: var(--line-3); }
  a.item:hover, button.item:hover { background: var(--surface-2); }
  a.item:hover::before, button.item:hover::before, a.item:hover + .item::before, button.item:hover + .item::before { opacity: 0; }
  .lvl button:not(.on):hover { color: var(--text); border-color: var(--line-3); }
  .att:not(.on):hover { background: var(--surface-2); }
  .tabs button:hover { color: var(--text); }
  .back:hover { color: var(--text); background: var(--surface-2); }
  .cls:hover { background: var(--surface-2); border-color: var(--line-3); }
  @media (min-width: 900px) {
    .nav a:not(.on):hover { background: var(--surface-2); color: var(--text); }
    .side-me:hover { background: var(--surface-3); border-color: var(--line-2); }
  }
}
@media (hover: none) {
  a.item:active, button.item:active, .att:active, .chip:active, .icon-btn:active, .back:active, .btn.ghost:active { background: var(--surface-2); }
  .cls:active { background: var(--surface-2); }
  .tabs button:active, .seg button:active { color: var(--text); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Diário de aulas (equipe) ---------- */
.j-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0 16px; }
.j-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; min-width: 0; }
.j-stat b { font-family: var(--display); font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.j-stat span { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 3px; }
.j-stat.good b { color: var(--good); } .j-stat.warn b { color: var(--warn); }
.j-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.j-range { display: flex; align-items: center; gap: 8px; }
.j-item { gap: 14px; }
.j-time { width: 52px; flex: none; display: flex; flex-direction: column; line-height: 1.2; font-variant-numeric: tabular-nums; }
.j-time b { font-weight: 700; }
.j-time small { color: var(--muted); font-size: 12px; }
.j-go { color: var(--accent-fg); font-size: 13px; font-weight: 600; flex: none; min-width: 56px; text-align: right; }
.j-head { display: flex; gap: 16px; align-items: flex-start; margin-top: 14px; }
.j-date { flex: none; width: 58px; height: 64px; border-radius: 10px; background: var(--accent-2); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.j-date b { font-family: var(--display); font-size: 25px; font-weight: 800; } .j-date span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.j-title { font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 3px; }
.j-vis { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 11px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-fg); font-size: 12.5px; font-weight: 600; }
.j-ro { border-color: rgba(232,180,76,.35); background: var(--warn-soft); color: var(--text-2); font-size: 13.5px; }
.j-form .card { margin-top: 12px; }
.j-lab { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.j-lab em { font-style: normal; font-weight: 600; color: var(--muted); font-size: 12px; margin-left: 6px; }
.j-lab em.sug { color: var(--accent-fg); }
.j-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.j-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 11px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; }
.j-chip.tech { background: var(--accent-soft); border-color: var(--accent-line); }
.j-chip small { color: var(--muted); font-size: 11px; }
.j-chip button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: var(--text-2); cursor: pointer; line-height: 1; }
.j-chip button:hover { background: var(--bad-soft); color: var(--bad); }
.j-found { display: grid; gap: 2px; margin-top: 6px; border: 1px solid var(--line-2); border-radius: 9px; padding: 4px; background: var(--surface-2); }
.j-opt { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 7px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.j-opt:hover { background: var(--surface-3); } .j-opt span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.j-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 0 6px; margin-top: 6px; background: linear-gradient(transparent, var(--bg) 35%); }
.j-actions .err { flex: 1 1 100%; text-align: right; }
@media (max-width: 760px) {
  .j-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .j-actions { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .j-actions .btn { flex: 1; }
  .j-head { gap: 12px; } .j-title { font-size: 19px; }
}
@media (min-width: 761px) { .j-actions { position: static; background: none; } }
