/*
 * Pixel Quest — o painel da escola e do professor, e o cartão da entrada.
 *
 * Desenho B3, escolhido pelo Kayo em 30/11/2026 (modelo em docs/panel-b3.html):
 * tira de ícones redondos na beira esquerda, a coluna da escola ao lado e o
 * conteúdo em cartões arredondados sobre fundo creme. Laranja da Pixel Tech e
 * branco, com letra branca no laranja, sempre.
 *
 * É um layout só deste produto: não copia o painel dos outros programas.
 *
 * Verde, vermelho e âmbar são estado, cheios e com letra branca. Nada tem cara
 * de navegador: sem barra de rolagem (setas pulsando na beira), sem confirm,
 * sem select, sem sublinhado.
 */

@font-face { font-family: "Baloo 2"; src: url("fonts/baloo2.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("fonts/nunito-sans.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }

:root {
  --o: #fc7a00;
  --o-deep: #d96400;
  --o-soft: #fff1e2;
  --on-o: #ffffff;
  --paper: #ffffff;
  --desk: #faf6f1;
  --ink: #2a1d10;
  --soft: #7b6c5c;
  --line: #efe7dc;
  --ok: #2b8a3e;
  --bad: #e03131;
  --bad-deep: #c92a2a;
  --wait: #b86400;
  --off: #857a6e;
  --class: #2f6fd0;
  --display: "Baloo 2", "Trebuchet MS", sans-serif;
  --body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
* { scrollbar-width: none; }
::-webkit-scrollbar { display: none; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--body); font-size: 15px; line-height: 1.4; color: var(--ink); background: var(--desk); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, p, ul, fieldset, legend { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--o-deep); outline-offset: 2px; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sprite { position: absolute; }

/* ------------------------------------------------------------ a casca */

body.panel { display: grid; grid-template-columns: 92px 286px minmax(0, 1fr); height: 100%; overflow: hidden; }
body.panel.has-drawer { grid-template-columns: 92px 286px minmax(0, 1fr) 440px; }

.strip { background: var(--paper); border-right: 2px solid var(--line); padding: 16px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; }
.strip .q { width: 44px; height: 44px; border-radius: 14px; background: var(--o); color: var(--on-o); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 24px; margin-bottom: 8px; flex: none; }
.strip a:not(.q), .strip button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 800; font-size: 11px; color: var(--soft); }
.strip i { width: 42px; height: 42px; border-radius: 50%; background: var(--desk); display: grid; place-items: center; color: var(--ink); transition: background-color .15s ease, color .15s ease; }
.strip a:not(.q):hover i, .strip button:hover i { background: var(--o-soft); color: var(--o-deep); }
.strip a.on { color: var(--o-deep); }
.strip a.on i { background: var(--o); color: var(--on-o); }
.strip-out { margin-top: auto; padding-top: 8px; }

.side { padding: 18px 0 18px 22px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; min-width: 0; }
.side h2 { font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; }
.now { background: var(--o); color: var(--on-o); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.now small { font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: center; gap: 7px; }
.now small::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.now > b { font-family: var(--display); font-weight: 800; font-size: 21px; line-height: 1.1; overflow-wrap: anywhere; }
.now > span { font-weight: 700; font-size: 13px; }
.now ul { display: flex; flex-direction: column; gap: 6px; }
.now li { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13.5px; }
.now li a { flex: 1; background: #fff; color: var(--o-deep); border-radius: 11px; padding: 8px 11px; }
.now li a:hover { background: var(--o-soft); }
.now li svg.i { width: 17px; height: 17px; stroke-width: 3; }
.now li.done a { background: rgba(255, 255, 255, .22); color: #fff; }
.todo { background: var(--paper); border-radius: 22px; padding: 6px 16px; display: flex; flex-direction: column; }
.todo a { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-weight: 700; }
.todo a:first-child { border-top: 0; }
.todo a:hover { color: var(--o-deep); }
.todo b { font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--o); min-width: 34px; line-height: 1; }

.main { padding: 18px 22px 28px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; overscroll-behavior: contain; min-width: 0; position: relative; }
.who { position: absolute; top: 18px; right: 22px; display: flex; align-items: center; gap: 10px; font-weight: 800; text-align: right; line-height: 1.15; }
.who small { display: block; color: var(--soft); font-weight: 700; font-size: 12px; }
.me { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 13px; flex: none; }
.me:hover { background: var(--o-deep); }

.head { display: flex; align-items: center; gap: 12px; min-height: 44px; padding-right: 230px; }
.head h1 { font-family: var(--display); font-weight: 800; font-size: 32px; line-height: 1.05; overflow-wrap: anywhere; }
.round { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.round.go { background: var(--o); color: var(--on-o); }
.round.go:hover { background: var(--o-deep); }
.round.ghost { background: var(--paper); color: var(--ink); width: 40px; height: 40px; }
.round.ghost:hover { background: var(--o-soft); color: var(--o-deep); }
.sub { color: var(--soft); font-weight: 700; font-size: 13.5px; }
.sub.strong { color: var(--ink); }
.empty { background: var(--paper); border-radius: 20px; padding: 26px; color: var(--soft); font-weight: 700; text-align: center; }
.hint { color: var(--soft); font-size: 13px; font-weight: 600; }
.hint a { color: var(--o-deep); font-weight: 800; }

.tabs { display: flex; gap: 22px; font-weight: 800; color: var(--soft); border-bottom: 2px solid var(--line); }
.tabs a { padding-bottom: 8px; margin-bottom: -2px; border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--o); }

/* ----------------------------------------------------------- cartões */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { background: var(--paper); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .15s ease; }
a.card:hover { box-shadow: 0 0 0 2px var(--o); }
.card-top { display: flex; gap: 11px; align-items: center; min-width: 0; }
.card-top > div { min-width: 0; }
.kind { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: #fff; flex: none; }
.t-class { background: var(--class); }
.card-top b { font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.12; display: block; overflow-wrap: anywhere; }
.card-top small { color: var(--soft); font-size: 12.5px; font-weight: 600; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.count { font-weight: 800; }

.seal { display: inline-grid; place-items: center; width: 88px; height: 24px; border-radius: 12px; color: #fff; font-weight: 800; font-size: 12px; flex: none; }
.seal.ok { background: var(--ok); }
.seal.wait { background: var(--wait); }
.seal.off { background: var(--off); }

/* ------------------------------------------------------------ linhas */

.rows { background: var(--paper); border-radius: 20px; padding: 4px 8px; display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-top: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.row:first-child { border-top-color: transparent; }
a.row:hover, .row.sel { background: var(--o-soft); border-top-color: transparent; }
a.row:hover + .row, .row.sel + .row { border-top-color: transparent; }
.row-name { flex: 1; min-width: 0; font-weight: 800; overflow-wrap: anywhere; }
.row-name small { display: block; color: var(--soft); font-weight: 600; font-size: 12.5px; }
.row-meta { width: 118px; flex: none; color: var(--soft); font-weight: 700; font-size: 13px; }
.go-to { color: var(--o); width: 18px; height: 18px; }
.av { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }

/* ------------------------------------------------------------ gaveta */

.drawer { background: var(--paper); border-left: 2px solid var(--line); padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; overscroll-behavior: contain; min-width: 0; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-head h2 { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.1; overflow-wrap: anywhere; }
.drawer .round.ghost { background: var(--desk); }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span:first-child, .field > legend { font-size: 12.5px; font-weight: 800; color: var(--soft); margin-bottom: 0; }
.field > legend { margin-bottom: 5px; }
.field input:not([type="radio"]):not([type="checkbox"]), .field textarea { width: 100%; background: var(--desk); border: 2px solid transparent; border-radius: 12px; padding: 10px 12px; font-weight: 700; }
.field textarea { resize: none; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--o); background: var(--paper); }
.field input::placeholder, .field textarea::placeholder { color: #b3a698; font-weight: 600; }
.pass { position: relative; display: block; }
.pass input { padding-right: 46px !important; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--soft); }
.eye:hover { background: var(--o-soft); color: var(--o-deep); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: flex; flex-direction: column; gap: 1px; height: 100%; background: var(--desk); border: 2px solid transparent; border-radius: 12px; padding: 9px 12px; cursor: pointer; }
.choice b { font-weight: 800; }
.choice small { color: var(--soft); font-weight: 600; font-size: 12px; }
.choice input:checked + span { background: var(--o); color: var(--on-o); }
.choice input:checked + span small { color: var(--on-o); }
.choice input:focus-visible + span { outline: 3px solid var(--o-deep); outline-offset: 2px; }

.btns { display: flex; gap: 10px; }
.btn { flex: 1; min-height: 44px; padding: 0 16px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--desk); color: var(--ink); text-align: center; }
.btn:hover { background: var(--line); }
.btn.go { background: var(--o); color: var(--on-o); }
.btn.go:hover { background: var(--o-deep); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger:hover { background: var(--bad-deep); }
.btn.wide { width: 100%; }
.life { margin-top: auto; display: flex; }
.life .btn { width: 100%; }
.life.two { gap: 10px; }
.life.two form { flex: 1; display: flex; }

/* O quadro de marcar: disciplinas nas linhas, turmas nas colunas. */
.matrix-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.matrix { border-collapse: separate; border-spacing: 5px; font-size: 12.5px; font-weight: 800; }
.matrix thead th { color: var(--soft); font-weight: 800; text-align: center; vertical-align: bottom; line-height: 1.15; width: 44px; max-width: 60px; padding: 0 0 2px; overflow-wrap: anywhere; }
.matrix tbody th { text-align: left; font-weight: 800; padding-right: 6px; white-space: nowrap; position: sticky; left: 0; background: var(--paper); }
.matrix td { padding: 0; }
.box { display: block; cursor: pointer; }
.box input { position: absolute; opacity: 0; pointer-events: none; }
.box span { width: 44px; height: 30px; border-radius: 9px; background: var(--desk); display: grid; place-items: center; color: transparent; transition: background-color .12s ease; }
.box span svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.box:hover span { background: var(--o-soft); }
.box input:checked + span { background: var(--o); color: var(--on-o); }
.box input:focus-visible + span { outline: 3px solid var(--o-deep); outline-offset: 2px; }

/* ------------------------------------------------- avisos e a pergunta */

.notice { margin: 0; border-radius: 12px; padding: 11px 14px; font-weight: 800; color: #fff; }
.notice.ok { background: var(--ok); }
.notice.bad { background: var(--bad); }
.notice[data-toast] { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40; max-width: min(92vw, 520px); text-align: center; }

.ask { border: 0; border-radius: 22px; padding: 22px; width: min(92vw, 400px); background: var(--paper); color: var(--ink); }
.ask::backdrop { background: rgba(42, 29, 16, .45); }
.ask p { font-weight: 800; font-size: 16px; margin-bottom: 18px; }

/* Setas de "tem mais": no lugar da barra de rolagem (panel.js posiciona). */
.more { position: fixed; z-index: 30; width: 34px; height: 24px; display: grid; place-items: center; color: var(--o); pointer-events: auto; transition: opacity .2s ease; }
.more svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.more.up { animation: more-up 1.4s ease-in-out infinite; }
.more.down { animation: more-down 1.4s ease-in-out infinite; }
.more.left, .more.right { width: 24px; height: 34px; }
.more.left { animation: more-left 1.4s ease-in-out infinite; }
.more.right { animation: more-right 1.4s ease-in-out infinite; }
.more.is-off { opacity: 0; pointer-events: none; }
@keyframes more-up { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes more-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes more-left { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-4px); } }
@keyframes more-right { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .more { animation: none !important; } }

/* ------------------------------------------------------------ entrada */

body.entry { display: grid; place-items: center; padding: 24px 16px; min-height: 100%; height: auto; background: var(--o); }
.entry-card { width: min(100%, 400px); background: var(--paper); border-radius: 26px; padding: 28px 26px; display: flex; flex-direction: column; gap: 14px; }
.logo { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 800; font-size: 21px; }
.logo i { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-style: normal; font-size: 19px; background: var(--o); color: var(--on-o); }
.entry-card h1 { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.1; }
.entry-lead { color: var(--soft); font-weight: 700; }

/* ---------------------------------------------- telas mais estreitas */

/* Com a gaveta aberta e pouca largura, a coluna da escola dá lugar a ela. */
@media (max-width: 1640px) {
  body.panel.has-drawer { grid-template-columns: 92px minmax(0, 1fr) 420px; }
  body.panel.has-drawer .side { display: none; }
}
@media (max-width: 1080px) {
  body.panel { grid-template-columns: 92px 240px minmax(0, 1fr); }
  body.panel.has-drawer { grid-template-columns: 92px minmax(0, 1fr) 380px; }
  .row-meta { width: 96px; }
}

/* Celular: o menu vai para baixo, preso; a página fica presa e quem rola é o
   body (DEC-052). A coluna da escola sobe para cima do conteúdo, e a gaveta
   vira uma folha por cima da tela. */
@media (max-width: 860px) {
  html { overflow: hidden; }
  body.panel, body.panel.has-drawer { display: block; height: 100%; overflow-y: auto; overscroll-behavior: none; -webkit-overflow-scrolling: touch; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .strip { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; flex-direction: row; justify-content: space-around; align-items: flex-start; border-right: 0; border-top: 2px solid var(--line); padding: 8px 6px calc(6px + env(safe-area-inset-bottom, 0px)); overflow: visible; }
  .strip .q { display: none; }
  .strip-out { margin: 0; padding: 0; }
  .side { padding: 16px 16px 0; }
  body.panel.has-drawer .side { display: flex; }
  .main { padding: 16px 16px 24px; overflow: visible; }
  .who { position: static; justify-content: flex-end; }
  .head { padding-right: 0; flex-wrap: wrap; }
  .head h1 { font-size: 27px; }
  .row { flex-wrap: wrap; }
  .row-meta { width: auto; }
  .drawer { position: fixed; inset: 0 0 calc(70px + env(safe-area-inset-bottom, 0px)) 0; z-index: 25; border-left: 0; padding: 16px; }
}
