/* Portal One Education — identidade herdada do Portal One (dourado #D4AF37, marrom #40372F,
   Cormorant Garamond nos títulos, Jost no texto, Sora nos números). */
:root {
  --gold: #D4AF37; --gold-d: #B88645; --gold-soft: #f6edd6; --gold-wash: #fbf6e8;
  --ink: #2f2822; --ink-2: #5d5247; --muted: #8a7d6e;
  --bg: #FAF7F1; --card: #FFFFFF; --line: #e9e1d2; --line-2: #f1ebdf;
  --side: #1c1814; --side-2: #26211c; --side-ink: #e9e1d2; --side-muted: #9a8e80;
  --ok: #3f7d55; --ok-bg: #e8f3ec; --warn: #a8741a; --warn-bg: #fbf1dc;
  --bad: #a2453a; --bad-bg: #f8e7e4; --info: #5b6b85; --info-bg: #ecf0f6;
  --roxo: #6d5a9c; --roxo-bg: #efeaf7;
  --r: 14px; --r-sm: 9px;
  --sombra: 0 1px 2px rgba(47,40,34,.05), 0 6px 24px rgba(47,40,34,.06);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --num: "Sora", "Jost", system-ui, sans-serif;
  --side-w: 264px;
  color-scheme: light;
}
[data-tema="escuro"] {
  --ink: #efe7da; --ink-2: #cbbfae; --muted: #9a8e80;
  --bg: #15120f; --card: #1f1b17; --line: #342d26; --line-2: #2a241f;
  --gold-soft: #3a3020; --gold-wash: #2a2418;
  --ok-bg: #1d2e23; --warn-bg: #33291a; --bad-bg: #3a201c; --info-bg: #1e2430; --roxo-bg: #2a2436;
  --sombra: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .2px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.esconder-valores .valor { filter: blur(7px); user-select: none; }

/* ---------- entrada ---------- */
.entrada { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px;
  background: radial-gradient(1200px 600px at 20% 0%, #3a3127 0%, #1c1814 55%, #120f0c 100%); color: var(--side-ink); }
.entrada-caixa { width: min(980px, 100%); }
.entrada-topo { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.entrada-topo img { width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(212,175,55,.35), 0 10px 40px rgba(212,175,55,.15); }
.marca { font-family: var(--num); font-weight: 700; letter-spacing: 3px; font-size: 26px; }
.marca small { display: block; font-size: 11px; letter-spacing: 7px; color: var(--gold); font-weight: 600; margin-top: 2px; }
.slogan { font-family: var(--serif); font-size: 22px; color: #d9cdb9; margin-top: 4px; font-style: italic; }
.entrada h2 { font-size: 26px; margin: 8px 0 4px; color: #fff; }
.entrada p { color: var(--side-muted); margin: 0 0 18px; }
.perfis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.perfil { text-align: left; background: rgba(255,255,255,.04); border: 1px solid rgba(212,175,55,.18); border-radius: var(--r);
  padding: 16px; cursor: pointer; transition: .18s; color: var(--side-ink); }
.perfil:hover, .perfil:focus-visible { border-color: var(--gold); background: rgba(212,175,55,.08); transform: translateY(-2px); outline: none; }
.perfil b { display: block; font-size: 16px; margin: 8px 0 2px; color: #fff; font-weight: 500; }
.perfil span { font-size: 13px; color: var(--side-muted); }
.selo { display: inline-block; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; padding: 3px 9px; border-radius: 99px;
  background: rgba(212,175,55,.14); color: var(--gold); font-weight: 600; }
.aviso-demo { margin-top: 22px; font-size: 13px; color: var(--side-muted); border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }

/* ---------- estrutura ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; transition: grid-template-columns .2s; }
.app.recolhido { --side-w: 76px; }
.lateral { background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; z-index: 30; }
.lateral-topo { display: flex; align-items: center; gap: 11px; padding: 18px 16px 14px; }
.lateral-topo img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.lateral-topo .marca { font-size: 15px; letter-spacing: 2px; white-space: nowrap; }
.lateral-topo .marca small { font-size: 9px; letter-spacing: 5px; }
.busca { margin: 0 14px 10px; position: relative; }
.busca input { width: 100%; background: var(--side-2); border: 1px solid #3a322a; border-radius: 10px; padding: 9px 10px 9px 34px; color: var(--side-ink); font-size: 14px; }
.busca input:focus { outline: none; border-color: var(--gold-d); }
.busca svg { position: absolute; left: 10px; top: 9px; width: 17px; height: 17px; color: var(--side-muted); }
.busca-res { position: absolute; left: 0; right: 0; top: 42px; background: var(--side-2); border: 1px solid #3a322a; border-radius: 10px; max-height: 320px; overflow: auto; display: none; z-index: 5; }
.busca-res.aberta { display: block; }
.busca-res a { display: block; padding: 8px 12px; text-decoration: none; font-size: 13.5px; }
.busca-res a:hover, .busca-res a.ativo { background: rgba(212,175,55,.12); }
.busca-res small { color: var(--side-muted); display: block; font-size: 11.5px; }
.menu { flex: 1; overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; scrollbar-color: #3a322a transparent; }
.setor { font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold-d); font-weight: 600; padding: 14px 10px 6px; white-space: nowrap; }
.item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--side-ink);
  font-size: 14.5px; white-space: nowrap; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.item svg { width: 20px; height: 20px; flex: none; color: var(--side-muted); }
.item:hover { background: rgba(255,255,255,.05); }
.item.ativo { background: linear-gradient(90deg, rgba(212,175,55,.2), rgba(212,175,55,.05)); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.item.ativo svg { color: var(--gold); }
.item .seta { margin-left: auto; width: 15px; height: 15px; transition: .2s; }
.item.expandido .seta { transform: rotate(90deg); }
.subs { display: none; padding: 2px 0 6px 42px; }
.subs.aberto { display: block; }
.subs a { display: block; padding: 5px 8px; font-size: 13px; color: var(--side-muted); text-decoration: none; border-radius: 7px; }
.subs a:hover { color: #fff; background: rgba(255,255,255,.04); }
.subs a.ativo { color: var(--gold); }
.app.recolhido .item span, .app.recolhido .setor, .app.recolhido .busca, .app.recolhido .lateral-topo .marca, .app.recolhido .subs, .app.recolhido .item .seta, .app.recolhido .lateral-rodape .quem { display: none; }
.app.recolhido .item { justify-content: center; }
.lateral-rodape { border-top: 1px solid #2e2721; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d)); color: #1c1814; flex: none; }
.quem { min-width: 0; font-size: 13px; }
.quem b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quem span { color: var(--side-muted); font-size: 12px; }

.principal { min-width: 0; display: flex; flex-direction: column; }
.topo { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 26px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.topo h1 { font-size: 27px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icone-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); flex: none; }
.icone-btn:hover { border-color: var(--gold); color: var(--gold-d); }
.icone-btn svg { width: 19px; height: 19px; }
.conteudo { padding: 22px 26px 60px; max-width: 1400px; width: 100%; }
.faixa-leitura { background: var(--bad); color: #fff; padding: 8px 26px; font-size: 14px; }

/* ---------- componentes ---------- */
.grade { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--sombra); min-width: 0; }
.card h3 { font-size: 20px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 > svg { width: 20px; height: 20px; color: var(--gold-d); flex: none; }
.lista-item > svg { width: 18px; height: 18px; color: var(--gold-d); flex: none; }
.card h3 .acoes { margin-left: auto; font-family: var(--sans); }
.kpi { position: relative; overflow: hidden; }
.kpi .rot { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; font-weight: 500; }
.kpi .val { font-family: var(--num); font-size: 28px; font-weight: 600; margin-top: 6px; letter-spacing: -.5px; }
.kpi .det { font-size: 13px; color: var(--muted); margin-top: 2px; }
.kpi svg.ic { position: absolute; right: 14px; top: 14px; width: 22px; height: 22px; color: var(--gold); opacity: .8; }
.kpi.destaque { background: linear-gradient(135deg, #2a231c, #1c1814); color: #f3ead9; border-color: #3a3127; }
.kpi.destaque .rot, .kpi.destaque .det { color: #b5a891; }
.btn { display: inline-flex; align-items: center; gap: 7px; border-radius: 10px; padding: 9px 15px; border: 1px solid var(--line); background: var(--card);
  cursor: pointer; font-size: 14px; font-weight: 500; transition: .15s; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--gold); }
.btn svg { width: 17px; height: 17px; }
.btn.ouro { background: linear-gradient(135deg, var(--gold), var(--gold-d)); color: #1c1814; border-color: transparent; }
.btn.ouro:hover { filter: brightness(1.06); }
.btn.escuro { background: var(--side); color: #f3ead9; border-color: var(--side); }
.btn.perigo { color: var(--bad); }
.btn.roxo { background: var(--roxo); color: #fff; border-color: transparent; }
.btn.peq { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.barra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.barra .espaco { flex: 1; }
.campo-busca { position: relative; min-width: 240px; flex: 1; max-width: 380px; }
.campo-busca input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.campo-busca svg { position: absolute; left: 11px; top: 10px; width: 17px; height: 17px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.chip.ativo { background: var(--side); color: #f3ead9; border-color: var(--side); }
.chip .n { font-family: var(--num); font-size: 11.5px; opacity: .7; margin-left: 4px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); } .tag.info { background: var(--info-bg); color: var(--info); }
.tag.ouro { background: var(--gold-soft); color: var(--gold-d); } .tag.roxo { background: var(--roxo-bg); color: var(--roxo); }
.tabela-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--sombra); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--gold-wash); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clicavel { cursor: pointer; } tr.clicavel:hover td { background: var(--gold-wash); }
.pessoa { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pessoa .avatar { width: 32px; height: 32px; font-size: 12px; }
.pessoa b { font-weight: 500; display: block; }
.pessoa small { color: var(--muted); }
.lista { display: flex; flex-direction: column; }
.lista-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.lista-item:last-child { border-bottom: 0; }
.lista-item .hora { font-family: var(--num); font-size: 13px; color: var(--gold-d); min-width: 48px; font-weight: 600; }
.lista-item .cor { width: 4px; align-self: stretch; border-radius: 4px; }
.vazio { text-align: center; padding: 34px 16px; color: var(--muted); }
.vazio svg { width: 38px; height: 38px; color: var(--gold); opacity: .7; margin-bottom: 8px; }
.progresso { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progresso i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-d), var(--gold)); border-radius: 99px; }
.abas { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.aba { padding: 10px 15px; border: 0; background: none; cursor: pointer; font-size: 14.5px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.aba.ativo { color: var(--ink); border-bottom-color: var(--gold); font-weight: 500; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; }
.form .largo { grid-column: 1 / -1; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
label.f input, label.f select, label.f textarea { border: 1px solid var(--line); background: var(--card); border-radius: var(--r-sm); padding: 9px 11px; font-size: 14.5px; font-weight: 400; color: var(--ink); }
label.f input:focus, label.f select:focus, label.f textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
label.f input:disabled, label.f select:disabled, label.f textarea:disabled { background: var(--line-2); color: var(--ink-2); }
.cab-ficha { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.cab-ficha .avatar { width: 64px; height: 64px; font-size: 22px; }
.cab-ficha h2 { font-size: 30px; }
.voltar { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 12px; }
.voltar svg { width: 16px; height: 16px; }
.info-linha { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.grafico { width: 100%; height: auto; display: block; }
.grafico text { font-family: var(--num); font-size: 11px; fill: var(--muted); }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* calendário */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.cal .dsem { background: var(--gold-wash); text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 8px 0; border-bottom: 1px solid var(--line); }
.cal .dia { min-height: 108px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; font-size: 12px; cursor: pointer; }
.cal .dia:nth-child(7n) { border-right: 0; }
.cal .dia.fora { background: var(--line-2); opacity: .55; }
.cal .dia.hoje .n { background: var(--gold); color: #1c1814; border-radius: 99px; padding: 0 7px; }
.cal .n { font-family: var(--num); font-weight: 600; font-size: 12.5px; display: inline-block; margin-bottom: 4px; }
.ev { display: block; border-radius: 6px; padding: 2px 6px; margin-bottom: 3px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.ev.cancelada { text-decoration: line-through; opacity: .6; }

/* chamada */
.chamada-linha { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.chamada-linha .pessoa { flex: 1; min-width: 200px; }
.st { display: flex; gap: 4px; flex-wrap: wrap; }
.st button { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.st button.on.presente { background: var(--ok); color: #fff; border-color: var(--ok); }
.st button.on.falta { background: var(--bad); color: #fff; border-color: var(--bad); }
.st button.on.atraso, .st button.on.saida_antecipada { background: var(--warn); color: #fff; border-color: var(--warn); }
.st button.on.justificada { background: var(--info); color: #fff; border-color: var(--info); }
.qr-caixa { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.qr-caixa .qr { background: #fff; padding: 12px; border-radius: 12px; border: 1px solid var(--line); }
.qr-caixa .qr img, .qr-caixa .qr svg { display: block; width: 220px; height: 220px; image-rendering: pixelated; }
.codigo { font-family: var(--num); font-size: 24px; letter-spacing: 4px; font-weight: 600; color: var(--gold-d); }

/* matriz de permissões */
.matriz th, .matriz td { text-align: center; padding: 7px 6px; }
.matriz th:first-child, .matriz td:first-child { text-align: left; padding-left: 14px; position: sticky; left: 0; background: var(--card); z-index: 1; }
.matriz th:first-child { background: var(--gold-wash); }
.matriz th { font-size: 10.5px; letter-spacing: .3px; text-transform: none; white-space: normal; min-width: 64px; }
.matriz input { width: 17px; height: 17px; accent-color: var(--gold-d); cursor: pointer; }
.matriz tr.setor-linha td { background: var(--gold-wash); font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--gold-d); font-weight: 600; text-align: left; }
.interruptor { position: relative; width: 40px; height: 22px; flex: none; }
.interruptor input { opacity: 0; width: 0; height: 0; }
.interruptor i { position: absolute; inset: 0; background: var(--line); border-radius: 99px; cursor: pointer; transition: .2s; }
.interruptor i::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.interruptor input:checked + i { background: var(--gold-d); }
.interruptor input:checked + i::after { transform: translateX(18px); }

/* modal e avisos */
.fundo-modal { position: fixed; inset: 0; background: rgba(20,16,12,.5); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 16px; animation: aparecer .15s; }
.modal { background: var(--card); border-radius: 18px; width: min(720px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal header { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.modal header h2 { font-size: 24px; flex: 1; }
.modal .corpo { padding: 20px 22px; }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--card); }
.avisos { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.aviso { background: var(--side); color: #f3ead9; padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 14px; display: flex; gap: 10px; align-items: center; animation: subir .25s; max-width: 380px; }
.aviso::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.aviso.erro::before { background: #e07a6c; }
.carregando { display: grid; place-items: center; padding: 60px; color: var(--muted); }
.giro { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: girar .8s linear infinite; }
.planejado { border: 1px dashed var(--gold-d); background: var(--gold-wash); }
.planejado ul { columns: 2; margin: 8px 0 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
@keyframes aparecer { from { opacity: 0; } } @keyframes subir { from { opacity: 0; transform: translateY(10px); } } @keyframes girar { to { transform: rotate(360deg); } }
.entra { animation: subir .25s ease-out; }

.so-movel { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .22s; }
  .app.menu-aberto .lateral { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .app.recolhido { --side-w: 0; }
  .so-movel { display: grid; } .so-desk { display: none; }
  .topo { padding: 10px 14px; } .topo h1 { font-size: 22px; }
  .conteudo { padding: 16px 14px 60px; }
  .g2 { grid-template-columns: 1fr; }
  .cal .dia { min-height: 70px; } .ev { font-size: 10px; padding: 1px 4px; }
  .planejado ul { columns: 1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
