/* JJ German · protótipo do portal.
   As variáveis abaixo concentram cores, tipografia, raios e espaçamentos. */
:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --panel: #ffffff;
  --sunken: #faf8f4;
  --ink: #1c1917;
  --ink-2: #57514c;
  --ink-3: #8f8780;
  --line: #e8e2d9;
  --line-2: #f1ece5;
  --red: #c8102e;
  --red-ink: #a00d25;
  --red-soft: #fcebee;
  --gold: #e2a21b;
  --gold-soft: #fdf4de;
  --green: #2f7d55;
  --green-soft: #e6f3eb;
  --amber: #b86e00;
  --amber-soft: #fff1da;
  --violet: #6b4fa3;
  --violet-soft: #f0ebf8;
  --blue: #1f5aa8;
  --blue-soft: #e7effa;
  --amber-ink: #7a4a00;
  --ink-4: #cdc6bd;          /* traços e textos apagados */
  --line-strong: #d6cdc1;    /* borda ao passar o mouse ou em foco */
  --muted-bg: #efece7;       /* etiquetas neutras e eventos cancelados */
  --weekend: #fcfbf9;
  --outside-a: #fbfaf7; --outside-b: #f8f6f2;
  --slot-dash: var(--cat-slot-bar);
  --alert-line: #f2c7cf; --alert-bg: #fff8f9;
  --on-ink: #ffffff;         /* texto sobre fundos na cor da tinta (botão principal) */
  --ink-hover: #33302c;
  --ink-rgb: 28 25 23;       /* base das sobreposições translúcidas */
  --paper: #ffffff;          /* folha da fatura, sempre clara */

  /* Categorias do calendário (definidas com a Jasmin em 4/12): aula verde, reposição e horário
     livre de reposição amarelos, aula experimental azul. "Abgesagt unter 24 h" fica vermelho. */
  --cat-lesson-bg: #e7f1f2; --cat-lesson-bar: #2b7f8a; --cat-lesson-ink: #164a51;
  --cat-makeup-bg: #fdf4de; --cat-makeup-bar: #e2a21b; --cat-makeup-ink: #5c430c;
  --cat-trial-bg: #e7effa; --cat-trial-bar: #1f5aa8; --cat-trial-ink: #173f75;
  --cat-slot-bg: #fdf8ec; --cat-slot-bar: #c98c0c; --cat-slot-ink: #6b4d0d;
  --cat-late-bg: #fcebee; --cat-late-bar: #c8102e; --cat-late-ink: #7d0b1d;
  --cat-private-bg: #efedea; --cat-private-bar: #8f8780; --cat-private-ink: #4a4540;

  --font: "Avenir Next", "Avenir", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgb(28 25 23 / 6%);
  --shadow: 0 1px 2px rgb(28 25 23 / 5%), 0 8px 24px -12px rgb(28 25 23 / 16%);
  --shadow-lg: 0 24px 60px -20px rgb(28 25 23 / 35%), 0 2px 6px rgb(28 25 23 / 6%);
  --sidebar: 248px;
  --hour: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2.5px solid var(--red); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 1.9rem; line-height: 1.1; letter-spacing: -.025em; font-weight: 650; }
h2 { font-size: 1.05rem; letter-spacing: -.01em; font-weight: 650; }
h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; }
a { color: inherit; }
.i { flex: none; }
.muted { color: var(--ink-3); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85em; color: var(--ink-2); }
.grow { flex: 1; }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); height: 100vh; }
.main { overflow-y: auto; height: 100vh; }
.page { padding: 28px 36px 48px; max-width: 1440px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-calendar { max-width: none; height: 100vh; padding-bottom: 20px; }

.sidebar { display: flex; flex-direction: column; gap: 28px; padding: 22px 16px 18px; border-right: 1px solid var(--line); background: var(--sunken); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; padding: 2px 8px; }
.brand img { width: 46px; height: auto; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 12%)); }
.brand b { display: block; font-size: 1.12rem; letter-spacing: -.02em; }
.brand small { display: block; color: var(--ink-3); font-size: .74rem; font-style: italic; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 550; transition: background .15s, color .15s; }
.nav a:hover { background: rgb(var(--ink-rgb) / 4.5%); color: var(--ink); }
.nav a.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.nav a.on .i { color: var(--red); }
.nav em { margin-left: auto; font-style: normal; font-size: .72rem; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; background: var(--red); color: #fff; }
.student-card { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
.student-card b { display: block; font-size: .92rem; }
.student-card small { color: var(--ink-3); font-size: .78rem; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 8px 0; border-top: 1px solid var(--line); }
.view-as { display: flex; flex-direction: column; gap: 6px; }
.view-as > span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; }
.view-as select, .lang select { width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 8px; font-size: .85rem; }
.lang { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.theme-pick { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgb(var(--ink-rgb) / 5%); }
.theme-pick button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 4px; border-radius: 7px; font-size: .76rem; color: var(--ink-3); }
.theme-pick button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }
.reset { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: .8rem; padding: 2px 0; }
.reset:hover { color: var(--ink); }

/* ---------- Componentes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; font-weight: 600; font-size: .9rem; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--on-ink); box-shadow: 0 1px 2px rgb(0 0 0 / 20%), inset 0 1px 0 rgb(255 255 255 / 10%); }
.btn.primary:hover { background: var(--ink-hover); }
.btn.ghost { background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--sunken); border-color: var(--line-strong); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { background: var(--red-ink); }
.btn.attention { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--line-strong); }
.btn.light { background: var(--panel); color: var(--ink); }
.btn.on-dark { background: rgb(255 255 255 / 12%); color: #fff; border: 1px solid rgb(255 255 255 / 22%); }
.btn.on-dark:hover { background: rgb(255 255 255 / 20%); }
.btn.sm { height: 32px; padding: 0 11px; font-size: .84rem; border-radius: 9px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: .8rem; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: .98rem; }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--ink-2); transition: background .15s; }
.icon-btn:hover { background: rgb(var(--ink-rgb) / 6%); color: var(--ink); }
.icon-btn.bordered { border: 1px solid var(--line); background: var(--panel); }
.icon-btn.ok { color: var(--green); }
.link { color: var(--red); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link.sm { font-size: .82rem; }
.link:hover { text-decoration: underline; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: rgb(var(--ink-rgb) / 5%); border-radius: 10px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: .86rem; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px rgb(var(--ink-rgb) / 6%); }
.seg.sm button { height: 30px; padding: 0 11px; font-size: .82rem; }
.seg.xs { width: 100%; }
.seg.xs button { flex: 1; justify-content: center; height: 28px; font-size: .8rem; padding: 0 8px; }
.seg button.on.ok { color: var(--green); }
.seg button.on.warn { color: var(--amber); }
.seg button.on.bad { color: var(--red); }

.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--av, #eee); color: rgb(var(--ink-rgb) / 78%); font-weight: 700; letter-spacing: .02em; }
.avatar-sm { width: 30px; height: 30px; font-size: .72rem; }
.avatar-md { width: 38px; height: 38px; font-size: .82rem; }
.avatar-lg { width: 46px; height: 46px; font-size: .95rem; }
.avatar-xl { width: 68px; height: 68px; font-size: 1.35rem; }
.cat-swatch { background: var(--cat-bg); color: var(--cat-ink); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cat-bar); flex: none; }
.cat-lesson { --cat-bg: var(--cat-lesson-bg); --cat-bar: var(--cat-lesson-bar); --cat-ink: var(--cat-lesson-ink); }
.cat-makeup { --cat-bg: var(--cat-makeup-bg); --cat-bar: var(--cat-makeup-bar); --cat-ink: var(--cat-makeup-ink); }
.cat-trial { --cat-bg: var(--cat-trial-bg); --cat-bar: var(--cat-trial-bar); --cat-ink: var(--cat-trial-ink); }
.cat-slot { --cat-bg: var(--cat-slot-bg); --cat-bar: var(--cat-slot-bar); --cat-ink: var(--cat-slot-ink); }
.cat-late { --cat-bg: var(--cat-late-bg); --cat-bar: var(--cat-late-bar); --cat-ink: var(--cat-late-ink); }
.cat-private { --cat-bg: var(--cat-private-bg); --cat-bar: var(--cat-private-bar); --cat-ink: var(--cat-private-ink); }

.status-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: .76rem; font-weight: 650; white-space: nowrap; }
.tone-ok { --tone: var(--green); --tone-bg: var(--green-soft); }
.tone-warn { --tone: var(--amber); --tone-bg: var(--amber-soft); }
.tone-bad { --tone: var(--red); --tone-bg: var(--red-soft); }
.tone-credit { --tone: var(--violet); --tone-bg: var(--violet-soft); }
.tone-muted { --tone: var(--ink-2); --tone-bg: var(--muted-bg); }
.tone-neutral { --tone: var(--ink-3); --tone-bg: var(--line-2); }
.tone-pending { --tone: var(--red); --tone-bg: var(--red-soft); }
.status-chip { color: var(--tone); background: var(--tone-bg); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head.pad { padding: 18px 22px 0; }
.empty, .empty-sm { color: var(--ink-3); }
.empty { padding: 28px; text-align: center; }
.empty-sm { font-size: .88rem; padding: 6px 0; list-style: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 650; margin-bottom: 6px; }
.eyebrow.light { color: rgb(255 255 255 / 60%); }
.hero h1 { font-size: 2.35rem; }
.lead { color: var(--ink-2); margin-top: 8px; font-size: 1.02rem; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s; }
button.stat:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: .8rem; font-weight: 600; }
.stat b { font-size: 1.85rem; font-weight: 650; letter-spacing: -.03em; line-height: 1.15; }
.stat b.stat-money, .stat b.stat-sm { font-size: 1.18rem; letter-spacing: -.01em; padding: 6px 0 3px; }
.stat small { color: var(--ink-3); font-size: .8rem; }
.stat.is-alert { border-color: var(--alert-line); background: linear-gradient(180deg, var(--panel) 0%, var(--alert-bg) 100%); }
.stat.is-alert .stat-label { color: var(--red); }

/* ---------- Hoje ---------- */
.today-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.agenda-item { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.agenda-item time { font-weight: 650; font-size: .95rem; text-align: right; }
.agenda-item time small { display: block; color: var(--ink-3); font-weight: 500; font-size: .76rem; }
.agenda-card { position: relative; display: flex; align-items: center; gap: 12px; text-align: left; padding: 11px 14px 11px 18px; border-radius: var(--r); background: var(--cat-bg); color: var(--cat-ink); transition: filter .15s; overflow: hidden; }
.agenda-card:hover { filter: brightness(.98) saturate(1.05); }
.agenda-card .bar, .ev .bar, .chip .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cat-bar); }
.agenda-main { flex: 1; min-width: 0; }
.agenda-main b { display: block; color: var(--ink); }
.agenda-main small { color: var(--cat-ink); opacity: .85; }
.agenda-main em { font-style: normal; color: var(--red); font-weight: 700; }
.agenda-item.past .agenda-card { opacity: .62; }
.agenda-item.live .agenda-card { box-shadow: 0 0 0 2px var(--red); }
.agenda-item.cat-slot .agenda-card { background: transparent; border: 1.5px dashed var(--slot-dash); }
.quick-check { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); color: var(--ink-3); background: var(--panel); }
.quick-check:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.inbox { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.inbox-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.inbox-item:first-child { border-top: 0; padding-top: 0; }
.inbox-item > div:not(.inbox-actions) { flex: 1; min-width: 0; }
.inbox-item p { font-size: .9rem; color: var(--ink-2); }
.inbox-item p b { color: var(--ink); font-weight: 650; }
.inbox-item small { color: var(--ink-3); font-size: .8rem; }
.inbox-item.quiet p { color: var(--ink-3); }
.inbox-actions { display: flex; gap: 6px; }
.inbox-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--tone); background: var(--tone-bg); }

/* ---------- Calendário ---------- */
.cal-head { align-items: center; }
.cal-title { display: flex; align-items: center; gap: 14px; }
.cal-title h1 { font-size: 1.65rem; min-width: 0; }
.nav-arrows { display: flex; gap: 2px; }
.menu-wrap, .split-btn { position: relative; display: inline-flex; }
.split-btn .btn.primary:first-child { border-radius: 10px 0 0 10px; }
.split-btn .caret { border-radius: 0 10px 10px 0; padding: 0 9px; border-left: 1px solid rgb(255 255 255 / 18%); }
.menu { position: absolute; top: calc(100% + 6px); z-index: 30; min-width: 290px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .14s ease-out; }
.menu.right { right: 0; }
.menu button { display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 9px 10px; border-radius: 9px; }
.menu button:hover { background: var(--sunken); }
.menu button .i, .menu .dot { margin-top: 3px; }
.menu span { display: flex; flex-direction: column; font-weight: 600; font-size: .9rem; }
.menu small { color: var(--ink-3); font-weight: 450; font-size: .8rem; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: -4px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.legend-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); font-size: .82rem; font-weight: 600; color: var(--ink-2); transition: opacity .15s; }
.legend-chip i { width: 10px; height: 10px; border-radius: 3px; background: var(--cat-bar); }
.legend-chip.cat-slot i { background: transparent; border: 1.5px dashed var(--cat-bar); }
.legend-chip.off { opacity: .45; text-decoration: line-through; }
.cal-bar-right { display: flex; align-items: center; gap: 10px; }
.select-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--ink-3); }
.select-pill select { border: 0; background: transparent; font-size: .84rem; font-weight: 600; color: var(--ink); padding-right: 6px; outline: none; }
.tz-note { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--ink-3); margin-top: -8px; }

.cal-panel { flex: 1; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; }

/* Mês */
.month { display: flex; flex-direction: column; height: 100%; min-height: 620px; }
.month-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.month-head div { padding: 10px 12px; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; }
.month-grid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), minmax(118px, 1fr)); }
.mcell { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; cursor: pointer; transition: background .12s; }
.mcell:nth-child(7n) { border-right: 0; }
.mcell:hover { background: var(--sunken); }
.mcell.weekend { background: var(--weekend); }
.mcell.outside { background: repeating-linear-gradient(135deg, var(--outside-a) 0 6px, var(--outside-b) 6px 12px); }
.mcell.outside .dnum { color: var(--ink-4); }
.mcell-top { display: flex; justify-content: flex-end; padding: 0 2px; }
.dnum { font-size: .82rem; font-weight: 650; color: var(--ink-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.mcell.is-today .dnum { background: var(--red); color: #fff; }
.mchips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chip { position: relative; display: flex; align-items: center; gap: 6px; height: 23px; padding: 0 6px 0 10px; border-radius: 6px; background: var(--cat-bg); color: var(--cat-ink); font-size: .76rem; text-align: left; overflow: hidden; white-space: nowrap; min-width: 0; }
.chip time { font-weight: 700; flex: none; }
.chip span { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; color: var(--ink); font-weight: 550; }
.chip:hover { filter: brightness(.97); }
.chip.cat-slot { background: transparent; border: 1px dashed var(--slot-dash); }
.chip.cat-slot span { color: var(--cat-ink); }
.chip.is-absent span { text-decoration: line-through; color: var(--ink-3); }
.chip.is-absent { background: var(--muted-bg); }
.chip.is-pending { box-shadow: inset 0 0 0 1.5px var(--red); }
.more-link { font-size: .76rem; color: var(--ink-3); font-weight: 650; text-align: left; padding: 1px 6px; }
.more-link:hover { color: var(--ink); }

/* Semana e dia */
.tg { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.tg-head { display: grid; grid-template-columns: 58px repeat(var(--days), minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--panel); position: relative; z-index: 2; }
.tg-day { display: flex; flex-direction: column; align-items: center; padding: 9px 4px 8px; gap: 0; border-left: 1px solid var(--line-2); transition: background .12s; }
.tg-day:hover { background: var(--sunken); }
.tg-day span { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 650; }
.tg-day b { font-size: 1.3rem; font-weight: 650; letter-spacing: -.02em; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; margin: 2px 0; }
.tg-day small { font-size: .72rem; color: var(--ink-3); }
.tg-day.is-today b { background: var(--red); color: #fff; }
.tg-day.is-today span { color: var(--red); }
.tg-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.tg-body { position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); }
.tg-times { position: relative; }
.tg-times span { position: absolute; right: 10px; transform: translateY(-50%); font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.tg-times span:first-child { transform: none; top: 3px !important; }
.tg-cols { display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr)); background-image: repeating-linear-gradient(to bottom, var(--line-2) 0 1px, transparent 1px var(--hour)), repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour) / 2), rgb(232 226 217 / 45%) calc(var(--hour) / 2) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px) var(--hour)); }
.tg-col { position: relative; border-left: 1px solid var(--line-2); cursor: copy; }
.tg-col.weekend { background: var(--weekend); }
.tg-col.is-today { background: rgb(200 16 46 / 2.5%); }
.ev { position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 5px 8px 5px 11px; border-radius: 8px; background: var(--cat-bg); color: var(--cat-ink); text-align: left; overflow: hidden; font-size: .78rem; line-height: 1.25; cursor: pointer; border: 1px solid rgb(255 255 255 / 70%); transition: box-shadow .15s, transform .15s; z-index: 1; }
.ev:hover { box-shadow: var(--shadow); z-index: 3; }
.ev-time { display: flex; align-items: center; gap: 4px; font-weight: 650; opacity: .9; white-space: nowrap; }
.ev-name { font-weight: 650; color: var(--ink); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ev-sub { opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ev.compact { flex-direction: row; align-items: center; gap: 6px; padding-top: 0; padding-bottom: 0; }
.ev.compact .ev-name { font-size: .78rem; }
.ev.cat-slot { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--cat-slot-bar) 8%, transparent) 0 6px, transparent 6px 12px); border: 1.5px dashed var(--slot-dash); }
.ev.cat-slot .bar { display: none; }
.ev.cat-slot .ev-name { color: var(--cat-ink); }
.ev.is-absent { background: var(--muted-bg); color: var(--ink-3); }
.ev.is-absent .bar { background: var(--ink-4); }
.ev.is-absent .ev-name { text-decoration: line-through; color: var(--ink-3); }
/* Abgesagt unter 24 h: riscada como as outras faltas, mas com o fundo vermelho. */
.ev.is-absent.cat-late, .chip.is-absent.cat-late { background: var(--cat-bg); color: var(--cat-ink); }
.ev.is-absent.cat-late .bar { background: var(--cat-bar); }
.ev.is-pending { box-shadow: inset 0 0 0 1.5px var(--red); background: repeating-linear-gradient(135deg, var(--cat-bg) 0 8px, var(--panel) 8px 16px); }
.ev-mark { position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--tone); background: var(--tone-bg); }
.ev.compact .ev-mark { top: 50%; transform: translateY(-50%); }
.chip .ev-mark { position: static; width: 16px; height: 16px; flex: none; }
.ev-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.chip .ev-dot { position: static; flex: none; }
.now-line { position: absolute; left: -1px; right: 0; height: 2px; background: var(--red); z-index: 4; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.view-day .ev { font-size: .85rem; padding-left: 14px; }
.view-day .ev-name { font-size: .95rem; }

/* Menu do dia */
.popover { position: fixed; z-index: 40; width: 340px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 12px; animation: pop .14s ease-out; }
.popover header { display: flex; justify-content: space-between; gap: 10px; }
.popover h3 { font-size: 1.05rem; letter-spacing: -.01em; }
.popover header p { color: var(--ink-3); font-size: .84rem; margin-top: 2px; }
.pop-actions { display: flex; flex-direction: column; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px 0; }
.pop-actions button { display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 9px 8px; border-radius: 9px; }
.pop-actions button:hover { background: var(--sunken); }
.pop-actions .dot { margin-top: 6px; }
.pop-actions span { display: flex; flex-direction: column; font-weight: 600; }
.pop-actions small { color: var(--ink-3); font-weight: 450; font-size: .8rem; }

/* ---------- Painel lateral da aula ---------- */
.scrim { position: fixed; inset: 0; background: rgb(var(--ink-rgb) / 22%); z-index: 50; animation: fade .18s ease-out; backdrop-filter: blur(1.5px); }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 10px; right: 10px; bottom: 10px; width: min(480px, calc(100vw - 20px)); z-index: 51; background: var(--panel); border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: slide .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 20px 10px 22px; }
.drawer-who { display: flex; gap: 13px; align-items: center; min-width: 0; }
.drawer-who h2 { font-size: 1.3rem; letter-spacing: -.02em; }
.drawer-tools { display: flex; gap: 2px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 22px 14px; }
.meta { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--sunken); border: 1px solid var(--line-2); font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.cat-tag { background: var(--cat-bg); color: var(--cat-ink); border-color: transparent; }
.cat-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--cat-bar); }
.banner { display: flex; gap: 12px; align-items: flex-start; margin: 0 22px 14px; padding: 14px; border-radius: 14px; }
.banner.pending { background: var(--red-soft); color: var(--red-ink); flex-wrap: wrap; }
.banner > div:not(.banner-actions) { flex: 1; min-width: 200px; }
.banner p { font-size: .86rem; color: var(--ink-2); margin-top: 2px; }
.banner-actions { display: flex; gap: 8px; margin-left: auto; }
.tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 11px 8px; color: var(--ink-3); font-weight: 600; font-size: .88rem; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); }
.tabs button.on::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--red); }
.tab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.page-tabs { padding: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; color: var(--ink-2); background: var(--sunken); border-radius: 10px; padding: 10px 12px; }
.hint .i { margin-top: 2px; color: var(--ink-3); }
.status-list { display: flex; flex-direction: column; gap: 6px; }
.status-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); text-align: left; transition: border-color .15s, background .15s; }
.status-opt:hover { border-color: var(--line-strong); background: var(--sunken); }
.status-opt.on { border-color: var(--tone); background: var(--tone-bg); box-shadow: 0 0 0 1px var(--tone); }
.status-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--tone); background: var(--tone-bg); flex: none; }
.status-opt.on .status-ic { background: var(--tone); color: #fff; }
.status-txt { flex: 1; display: flex; flex-direction: column; }
.status-txt b { font-size: .9rem; font-weight: 650; }
.status-txt small { color: var(--ink-3); font-size: .78rem; }
.bill-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); background: var(--muted-bg); padding: 3px 7px; border-radius: 6px; }
.bill-tag.free { color: var(--green); background: var(--green-soft); }
.bill-note { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); color: var(--amber-ink); font-size: .86rem; font-weight: 550; }
.rule { display: flex; gap: 7px; align-items: flex-start; font-size: .79rem; color: var(--ink-3); }
.rule .i { margin-top: 2px; }
.aud-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.aud-hint { font-size: .8rem; color: var(--ink-3); }
.editor { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.editor:focus-within { border-color: var(--line-strong); box-shadow: 0 0 0 4px rgb(226 162 27 / 14%); }
.editor-bar { display: flex; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line-2); background: var(--sunken); }
.editor-bar button { min-width: 30px; height: 28px; padding: 0 7px; border-radius: 7px; font-size: .88rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; }
.editor-bar button:hover { background: rgb(var(--ink-rgb) / 6%); color: var(--ink); }
.editor-bar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.editor-bar .tpl { font-size: .8rem; font-weight: 650; color: var(--red); }
.editor-area { min-height: 210px; max-height: 46vh; overflow-y: auto; padding: 14px 16px; outline: none; font-size: .94rem; line-height: 1.55; }
.editor-area:empty::before { content: attr(data-placeholder); color: var(--ink-3); }
.editor-area h3, .note-body h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--red); margin: 12px 0 4px; font-weight: 700; }
.editor-area h3:first-child, .note-body h3:first-child { margin-top: 0; }
.editor-area ul, .note-body ul { margin: 4px 0; padding-left: 20px; }
.editor-area p, .note-body p { margin: 0 0 4px; }
.saved-hint { display: flex; gap: 5px; align-items: center; font-size: .76rem; color: var(--ink-3); margin-top: -6px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line-2); font-size: .88rem; }
.file-list a { flex: 1; font-weight: 600; text-decoration: none; }
.file-list a:hover { text-decoration: underline; }
.file-list small { color: var(--ink-3); }
.file-list .icon-btn.xs { width: 26px; height: 26px; border-radius: 7px; margin: -4px -6px -4px 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 18px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 1.5px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--ink-3); background: var(--panel); flex: none; margin-top: 4px; position: relative; z-index: 1; }
.timeline .who-student .tl-dot { border-color: var(--red); }
.timeline p { font-size: .9rem; font-weight: 550; }
.timeline small { color: var(--ink-3); font-size: .78rem; }
.lead-sm { font-size: .9rem; color: var(--ink-2); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.switch-row span { display: flex; flex-direction: column; }
.switch-row b { font-size: .9rem; font-weight: 600; }
.switch-row small { color: var(--ink-3); font-size: .8rem; }
.switch-row.tight { border: 0; padding: 4px 0; font-size: .86rem; font-weight: 600; }
.switch { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--ink-4); position: relative; cursor: pointer; transition: background .18s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 25%); transition: transform .18s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(16px); }
.assign { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.assign-row { display: flex; gap: 8px; }
.assign-row select { flex: 1; }

/* ---------- Formulários e diálogos ---------- */
.modal-layer { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-layer .scrim { z-index: 0; }
.modal { position: relative; z-index: 1; width: 100%; max-height: calc(100vh - 40px); background: var(--panel); border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: rise .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal.w-sm { max-width: 440px; }
.modal.w-md { max-width: 560px; }
.modal.w-lg { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; gap: 14px; padding: 22px 24px 6px; }
.modal-head h2 { font-size: 1.3rem; letter-spacing: -.02em; }
.modal-head p { color: var(--ink-3); font-size: .9rem; margin-top: 3px; }
.modal-body { padding: 14px 24px 20px; overflow-y: auto; }
.modal-body.flush { padding: 0; background: var(--sunken); }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line-2); background: var(--sunken); }
.foot-note { margin-right: auto; font-size: .8rem; color: var(--ink-3); }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: .8rem; font-weight: 650; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.field input, .field select, .field textarea, .assign select, .search input {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--panel); transition: border-color .15s, box-shadow .15s; }
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus { outline: none; border-color: var(--line-strong); box-shadow: 0 0 0 4px rgb(226 162 27 / 15%); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.three { grid-template-columns: 1.2fr 1fr 1fr; }
.private-tag { font-style: normal; display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pill { height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line); font-weight: 600; font-size: .86rem; color: var(--ink-2); }
.pill:hover { border-color: var(--line-strong); }
.pill.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.pill-input { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink-3); font-size: .84rem; }
.pill-input input { width: 34px; border: 0; outline: none; text-align: right; font-weight: 600; background: transparent; padding: 0; -moz-appearance: textfield; }
.pill-input input::-webkit-inner-spin-button, .pill-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.type-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.type-opt { display: flex; align-items: center; gap: 7px; padding: 10px 11px; border-radius: 12px; border: 1px solid var(--line); text-align: left; transition: border-color .15s, background .15s; }
.type-opt b { font-size: .84rem; line-height: 1.2; }
.type-hint { margin-top: -6px; font-size: .84rem; color: var(--ink-3); }
.type-opt:hover { background: var(--sunken); }
.type-opt.on { background: var(--cat-bg); border-color: var(--cat-bar); box-shadow: 0 0 0 1px var(--cat-bar); }
.warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); color: var(--amber-ink); font-size: .86rem; }
.warn .i { margin-top: 2px; }
.att-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.att-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.att-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-2); }
.att-row:first-child { border-top: 0; }
.att-who { flex: 1; min-width: 0; }
.att-who b { display: block; font-size: .92rem; }
.att-who small { color: var(--ink-3); font-size: .8rem; }
.att-ctrl { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.att-ctrl select { height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: .8rem; background: var(--panel); }
.copy-field { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--sunken); }
.copy-field code { flex: 1; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps { margin: 16px 0; padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.step-label { font-size: .78rem; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.tx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tx-opt { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; padding: 16px; border: 1px solid var(--line); border-radius: 14px; transition: border-color .15s, box-shadow .15s; }
.tx-opt:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.tx-opt small { color: var(--ink-3); font-size: .82rem; }
.tx-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 4px; }
.tx-payment { background: var(--green-soft); color: var(--green); }
.tx-refund { background: var(--violet-soft); color: var(--violet); }
.tx-charge { background: var(--gold-soft); color: var(--amber-ink); }
.tx-discount { background: var(--red-soft); color: var(--red); }
.notice { display: flex; gap: 12px; padding: 14px; border-radius: 14px; }
.notice.ok { background: var(--violet-soft); color: var(--violet); }
.notice.bad { background: var(--red-soft); color: var(--red); }
.notice p { color: var(--ink-2); font-size: .88rem; margin-top: 2px; }
.notice b { color: var(--ink); }
.slot-day { display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.slot-day:first-child { border-top: 0; }
.slot-day h4 { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); font-weight: 600; }
.slot-row { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-pick { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; border: 1.5px dashed var(--slot-dash); font-weight: 650; color: var(--cat-slot-ink); }
.slot-pick small { display: flex; align-items: center; gap: 4px; color: var(--ink-3); font-weight: 500; font-size: .76rem; }
.slot-pick:hover { background: var(--green-soft); }
.slot-pick.on { border-style: solid; border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 1px var(--green); }

/* ---------- Alunos ---------- */
.search { display: inline-flex; align-items: center; gap: 8px; position: relative; color: var(--ink-3); }
.search .i { position: absolute; left: 12px; }
.search input { padding-left: 36px; width: 260px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--sunken); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-action] { cursor: pointer; transition: background .12s; }
.table tbody tr[data-action]:hover { background: var(--sunken); }
.table .num { text-align: right; white-space: nowrap; }
.table.compact td { padding: 10px 16px; }
.who { display: flex; align-items: center; gap: 11px; }
.who b { display: block; font-weight: 650; }
.who small { color: var(--ink-3); font-size: .8rem; }
.slot-tag { display: inline-block; font-size: .76rem; font-weight: 650; color: var(--ink-2); background: var(--sunken); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 7px; }
.credit-pill { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--violet); background: var(--violet-soft); padding: 2px 8px; border-radius: 99px; }
.owed { color: var(--red); font-weight: 650; }
.pos { color: var(--green); }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-weight: 600; font-size: .88rem; align-self: flex-start; }
.back-link:hover { color: var(--ink); }
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-id { flex: 1; min-width: 220px; }
.profile-id p { color: var(--ink-3); margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.level { font-weight: 700; font-size: .78rem; color: var(--on-ink); background: var(--ink); padding: 2px 8px; border-radius: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.two-col.wide-left { grid-template-columns: 1.5fr 1fr; }
.lesson-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lesson-row { width: 100%; display: flex; align-items: center; gap: 14px; padding: 9px 10px; border-radius: 12px; text-align: left; transition: background .12s; }
button.lesson-row:hover { background: var(--sunken); }
.lr-date { width: 42px; display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.lr-date b { font-size: 1.15rem; }
.lr-date small { color: var(--ink-3); font-size: .72rem; text-transform: uppercase; font-weight: 650; }
.lr-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lr-main b { font-size: .9rem; font-weight: 600; }
.lr-main small { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: .8rem; }
.lesson-row.is-absent .lr-main b { text-decoration: line-through; color: var(--ink-3); }
.inv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.inv-list button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2); text-align: left; transition: border-color .12s, background .12s; }
.inv-list button:hover { border-color: var(--line); background: var(--sunken); }
.inv-list span:first-child { display: flex; flex-direction: column; }
.inv-list small { color: var(--ink-3); font-size: .78rem; }
.inv-list.row { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.inv-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-weight: 650; }
.inv-status { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.st-draft { color: var(--ink-2); background: var(--muted-bg); }
.st-sent { color: var(--blue); background: var(--blue-soft); }
.st-paid { color: var(--green); background: var(--green-soft); }
.st-overdue { color: var(--red); background: var(--red-soft); }
.tx-tag { font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; margin-right: 4px; }
.tx-tag.tx-invoice { color: var(--blue); background: var(--blue-soft); }
.form-panel { max-width: 760px; }
/* Perfil do aluno: acesso ao portal (link do convite). */
.access-panel { margin-top: 16px; display: grid; gap: 10px; }
.access-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.access-head h2 { font-size: 1rem; margin: 0 0 4px; }
.access-head p { margin: 0; font-size: .86rem; }
.access-link { display: flex; gap: 8px; }
.access-link input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--panel); color: var(--ink-2); font-size: .82rem; }
.form-actions { display: flex; justify-content: flex-end; }

/* ---------- Cobrança ---------- */
.auto-card { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: var(--r-lg); background: linear-gradient(120deg, #1f1b18 0%, #2b2420 60%, #3a2a1c 100%); color: #fff; box-shadow: var(--shadow); flex-wrap: wrap; }
.auto-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgb(226 162 27 / 20%); color: var(--gold); flex: none; }
.auto-text { flex: 1; min-width: 260px; }
.auto-text p { color: rgb(255 255 255 / 72%); font-size: .9rem; margin-top: 3px; }
.auto-toggles { display: flex; flex-direction: column; gap: 4px; }
.auto-toggles .switch-row { color: rgb(255 255 255 / 85%); }
.auto-toggles .switch { background: rgb(255 255 255 / 22%); }
.auto-toggles .switch:checked { background: var(--gold); }
.draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r-lg); background: var(--gold-soft); border: 1px solid #f1dca9; }
.draft-bar b { display: block; }
.draft-bar span { color: var(--amber-ink); font-size: .88rem; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 24px; }
.es-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--gold-soft); color: var(--amber-ink); }
.empty-state > p { color: var(--ink-2); max-width: 520px; }
.preview-list { list-style: none; margin: 8px 0 12px; padding: 0; width: min(560px, 100%); display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; text-align: left; }
.preview-list li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line-2); font-size: .9rem; }
.preview-list li:first-child { border-top: 0; }
.preview-list li > span:not(.avatar) { flex: 1; font-weight: 600; }
.preview-list small { color: var(--ink-3); font-size: .8rem; }
.preview-list .more { color: var(--ink-3); justify-content: center; }

/* Fatura */
.invoice-doc { background: var(--paper); color: #1c1917; margin: 24px; padding: 36px 40px; border-radius: 6px; box-shadow: 0 1px 3px rgb(0 0 0 / 8%), 0 10px 30px -16px rgb(0 0 0 / 20%); display: flex; flex-direction: column; gap: 26px; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.inv-brand { display: flex; gap: 12px; align-items: center; }
.inv-brand img { width: 54px; }
.inv-brand b { display: block; font-size: 1.2rem; letter-spacing: -.02em; }
.inv-brand small { color: var(--ink-3); }
.inv-title { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.inv-title h2 { font-size: 1.7rem; letter-spacing: -.03em; font-weight: 600; }
.inv-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 12px 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.inv-meta small { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; margin-bottom: 3px; }
.inv-meta b { display: block; }
.inv-meta span { color: var(--ink-2); font-size: .88rem; }
.inv-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.inv-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.inv-table td { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.inv-table .num { text-align: right; }
.inv-sec td { padding-top: 16px; font-weight: 700; font-size: .8rem; color: var(--red); border-bottom: 0; }
.inv-totals { align-self: flex-end; width: min(320px, 100%); display: flex; flex-direction: column; gap: 6px; }
.inv-totals div { display: flex; justify-content: space-between; color: var(--ink-2); }
.inv-totals .grand { padding-top: 10px; margin-top: 4px; border-top: 2px solid var(--ink); color: var(--ink); font-size: 1.15rem; }
.inv-foot { font-size: .84rem; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.inv-foot .tax-note { color: var(--ink); font-weight: 600; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px 0 12px; border-top: 2px solid var(--ink); }
.inv-parties > div { display: flex; flex-direction: column; gap: 1px; }
.inv-parties small { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; margin-bottom: 3px; }
.inv-parties span { color: var(--ink-2); font-size: .88rem; }
.inv-from { text-align: right; }
.inv-hint { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 22px; font-size: .84rem; color: var(--ink-2); background: var(--bg); border-bottom: 1px solid var(--line); }
.inv-hint.bad { color: var(--red); }
.fx-box { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); }
.receipt-zone { border: 1.5px dashed var(--line); border-radius: var(--r); background: var(--bg); transition: border-color .15s, background .15s; }
.receipt-zone.drag { border-color: var(--red); background: var(--panel); }
.receipt-zone.has-file { border-style: solid; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.rc-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px; cursor: pointer; color: var(--ink-2); text-align: center; }
.rc-pick small { color: var(--ink-3); font-size: .78rem; }
.rc-file { display: flex; align-items: center; gap: 10px; }
.rc-file span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rc-file b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-file small { color: var(--ink-3); font-size: .76rem; }
.rc-status { margin: 0; font-size: .84rem; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.rc-status.ok { color: var(--ink-2); }
.rc-fee { margin: 4px 0 0 21px; font-size: .8rem; color: var(--ink-3); }
input.filled { background: var(--gold-soft); }
input.filled { border-color: var(--gold); }
.rc-read .warn { margin: 6px 0 0; }
.rc-link { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; background: var(--panel); cursor: pointer; }
.rc-link:hover { border-color: var(--ink-3); }
.rc-drive { font-size: .74rem; color: var(--ink-3); }
.rc-missing { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ink-2); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.rc-missing span { color: var(--red); font-weight: 650; }
.rc-actions { white-space: nowrap; display: flex; gap: 6px; justify-content: flex-end; }
.empty-sm.pad { padding: 22px; }
.bal-items { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: .8rem; color: var(--ink-2); }
.bal-items li { display: flex; justify-content: space-between; gap: 10px; }
.bal-items span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bal-items em { font-style: normal; color: var(--ink-3); }
.stat .bal-items b { font-size: inherit; font-weight: 600; letter-spacing: 0; line-height: inherit; font-variant-numeric: tabular-nums; }
.bal-items .more { color: var(--ink-3); }
.prefer-credit { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--amber-soft); color: var(--amber-ink); font-size: .86rem; }
.prefer-credit p { margin: 0; flex: 1 1 200px; }
.fx-line { display: block; color: var(--ink-3); font-size: .76rem; margin-top: 2px; }
.year-panel { margin-bottom: 18px; display: flex; flex-direction: column; gap: 14px; }
.year-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.year-head h2 { margin: 0; font-size: 1.05rem; }
.year-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 16px; }
.year-figs small { display: block; color: var(--ink-3); font-size: .78rem; }
.year-figs b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.limit { display: flex; flex-direction: column; gap: 6px; }
.limit small { color: var(--ink-3); font-size: .8rem; }
.limit-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.limit-bar span { display: block; height: 100%; background: var(--ink-2); border-radius: inherit; }
.limit.warn .limit-bar span { background: var(--red); }
.year-panel .inv-hint { padding: 0; background: none; border: 0; }
.field-hint { color: var(--ink-3); font-size: .78rem; line-height: 1.35; }
.field.has-error input, .field.has-error textarea { border-color: var(--red); }
.field-error { color: var(--red); font-size: .78rem; font-weight: 600; }
.business-panel { margin-bottom: 18px; }
.backup-panel { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; padding: 14px 18px; }
.backup-panel > div { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.backup-panel > div span { color: var(--ink-3); font-size: .85rem; }
.backup-panel.is-alert { border-color: var(--red); }
.business-panel summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; list-style: none; }
.business-panel summary::-webkit-details-marker { display: none; }
.business-panel summary::before { content: '▸'; color: var(--ink-3); }
.business-panel[open] summary::before { content: '▾'; }
.business-panel summary span { color: var(--ink-3); font-size: .86rem; }
.business-panel[open] summary { margin-bottom: 14px; }

/* ---------- Área do aluno ---------- */
.portal-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.next-card { position: relative; overflow: hidden; padding: 24px 26px; border-radius: 22px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #3b2b1f 0%, #1c1917 55%); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.next-card h2 { font-size: 1.7rem; letter-spacing: -.025em; font-weight: 600; }
.next-time { display: flex; align-items: center; gap: 12px; color: rgb(255 255 255 / 78%); font-size: 1.05rem; font-weight: 600; }
.next-time span { display: inline-flex; align-items: center; gap: 5px; font-size: .88rem; }
.next-actions { display: flex; gap: 10px; margin-top: 14px; position: relative; z-index: 1; }
.next-mark { position: absolute; right: -24px; bottom: -34px; width: 190px; opacity: .2; transform: rotate(-12deg); filter: grayscale(.1); }
.credit-card { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 22px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.credit-num { font-size: 2.6rem; font-weight: 650; line-height: 1; color: var(--violet); background: var(--violet-soft); width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; }
.credit-card p { color: var(--ink-2); font-size: .9rem; margin-top: 3px; }
.notes-feed { display: flex; flex-direction: column; gap: 8px; }
.notes-feed details { border: 1px solid var(--line-2); border-radius: 14px; padding: 4px 14px; }
.notes-feed details[open] { background: var(--sunken); }
.notes-feed summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.notes-feed summary::-webkit-details-marker { display: none; }
.notes-feed summary span { display: flex; gap: 10px; align-items: baseline; font-weight: 600; }
.notes-feed summary b { font-size: .78rem; color: var(--ink-3); font-weight: 650; min-width: 86px; }
.notes-feed details[open] summary .i { transform: rotate(180deg); }
.note-body { font-size: .92rem; padding: 4px 0 10px; }
.notes-feed .file-list { margin-bottom: 10px; }

/* ---------- Avisos ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-lg); animation: toast .22s cubic-bezier(.2, .8, .2, 1); }
.toast .i { color: #8fe0b0; }
.toast-undo { margin-left: 6px; padding: 4px 10px; border-radius: 8px; color: inherit; font-weight: 700; background: rgb(255 255 255 / 14%); }
.toast-undo:hover { background: rgb(255 255 255 / 24%); }
.icon-btn.tx-remove { width: 26px; height: 26px; margin-left: 4px; vertical-align: middle; color: var(--ink-3); opacity: 0; }
tr:hover .icon-btn.tx-remove, .icon-btn.tx-remove:focus-visible { opacity: 1; }
.icon-btn.tx-remove:hover { color: var(--red); }
@media (hover: none) { .icon-btn.tx-remove { opacity: 1; } }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- Telas menores ---------- */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-grid, .two-col, .two-col.wide-left, .portal-top { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .main { height: auto; min-height: 0; }
  .app { height: 100vh; }
  .sidebar { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .brand span, .sidebar-foot .reset, .view-as > span { display: none; }
  .sidebar-foot .reset.logout { display: inline-flex; }
  .sidebar-foot .logout span { display: none; }
  .nav { flex-direction: row; }
  .nav a span { display: none; }
  .sidebar-foot { flex-direction: row; margin: 0 0 0 auto; padding: 0; border: 0; align-items: center; }
  .view-as { flex-direction: row; }
  .student-card { padding: 4px; border: 0; background: none; }
  .student-card > div { display: none; } /* no celular fica só a sigla; o nome está no cabeçalho das telas */
  .page { padding: 18px 14px 40px; }
  .page-calendar { height: auto; }
  .stats, .stats.three { grid-template-columns: 1fr 1fr; }
  .tg-scroll { max-height: 70vh; }
  .view-week .tg { min-width: 760px; }
  .view-week { overflow-x: auto; }
  .month-grid { grid-template-rows: repeat(var(--rows), minmax(88px, 1fr)); }
  .chip time { display: none; }
  .field-row, .field-row.three, .tx-grid { grid-template-columns: 1fr 1fr; }
  .inv-meta { grid-template-columns: 1fr 1fr; }
  .invoice-doc { margin: 10px; padding: 22px; }
  .table th:nth-child(2), .table td:nth-child(2), .table th:nth-child(3), .table td:nth-child(3) { display: none; }
  .hero h1 { font-size: 1.9rem; }
}
@media (max-width: 520px) {
  .field-row, .field-row.three { grid-template-columns: 1fr; }
}


/* ---------- Página da aula ----------
   O documento é uma folha clara (como a fatura), com a barra de formatação fixa no topo.
   As cores de correção ficam legíveis nos dois temas porque a folha não muda. */
.page-lesson { max-width: 1240px; }
.lp-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.lp-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lp-title h1 { font-size: 1.65rem; letter-spacing: -.025em; margin: 0; font-weight: 650; }
.lp-title p { margin: 2px 0 0; color: var(--ink-2); display: flex; align-items: center; gap: 7px; font-size: .92rem; }
.lp-nav { margin-left: auto; display: flex; gap: 8px; }
.lp-step { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .86rem; }
.lp-step span { display: flex; flex-direction: column; line-height: 1.15; }
.lp-step small { font-size: .7rem; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.lp-step:hover { border-color: var(--line-strong); color: var(--ink); }

.lp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; align-items: start; }
.lp-layout.read { grid-template-columns: minmax(0, 1fr) 260px; }
.lp-paper { --lp-ink: #1c1917; background: var(--paper); color: var(--lp-ink); border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.lp-bar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 7px 8px; border-bottom: 1px solid var(--line-2); background: var(--sunken); border-radius: 14px 14px 0 0; }
.lp-bar > button, .lp-img-btn { min-width: 28px; height: 30px; padding: 0 6px; border-radius: 7px; font-size: .9rem; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; }
.lp-bar > button:hover, .lp-img-btn:hover { background: rgb(var(--ink-rgb) / 7%); color: var(--ink); }
.lp-bar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.lp-bar .grow { flex: 1; }
.lp-bar .tpl { font-size: .8rem; font-weight: 650; color: var(--red); }
.lp-img-btn { font-size: .82rem; font-weight: 600; }
.lp-h1 { font-weight: 800; font-size: .86rem; }
.lp-h2 { font-weight: 700; font-size: .78rem; }
.lp-swatches { display: inline-flex; gap: 2px; padding: 0 2px; }
.lp-swatches .sw { width: 22px; height: 26px; border-radius: 6px; font-weight: 800; color: var(--sw); font-size: .9rem; box-shadow: inset 0 -3px 0 var(--sw); }
.lp-swatches .sw.reset { color: #1c1917; box-shadow: inset 0 -3px 0 #8f8780; }
.lp-swatches .mk { width: 22px; height: 22px; margin: 2px 1px; border-radius: 5px; background: var(--mk); border: 1px solid rgb(0 0 0 / 10%); }
.lp-swatches .mk.reset { background: linear-gradient(135deg, #fff 45%, #c8102e 45% 55%, #fff 55%); }
.lp-swatches button:hover { outline: 2px solid var(--line-strong); }
.lp-linkbar { flex-basis: 100%; display: flex; gap: 6px; padding: 6px 2px 2px; }
.lp-linkbar[hidden] { display: none; }
.lp-link-input { flex: 1; height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); }

.lp-area { min-height: 62vh; padding: 34px 44px 60px; outline: none; font-size: 1.02rem; line-height: 1.6; color: var(--lp-ink); overflow-wrap: anywhere; }
.lp-area td, .lp-area th { overflow-wrap: break-word; } /* palavras inteiras nas colunas ("Akkusativ") */
.lp-area:empty::before { content: attr(data-placeholder); color: #8f8780; }
.lp-area h2 { font-size: 1.45rem; letter-spacing: -.02em; margin: 26px 0 8px; font-weight: 700; color: #1c1917; }
.lp-area h3 { font-size: 1.12rem; margin: 20px 0 6px; font-weight: 700; color: #a00d25; }
.lp-area > :first-child { margin-top: 0; }
.lp-area p { margin: 0 0 8px; }
.lp-area ul, .lp-area ol { margin: 4px 0 10px; padding-left: 26px; }
.lp-area a { color: #1f5aa8; text-decoration: underline; text-underline-offset: 2px; }
.lp-area img { display: block; max-width: 100%; height: auto; margin: 10px 0; border-radius: 8px; border: 1px solid #e8e2d9; }
.lp-area img.missing { min-height: 60px; background: #f4f1ec; }
.lp-area table { border-collapse: collapse; margin: 10px 0 14px; width: 100%; }
.lp-area td, .lp-area th { border: 1px solid #d9d2c7; padding: 6px 10px; vertical-align: top; min-width: 60px; }
.lp-area th { background: #faf8f4; text-align: left; }
.lp-area blockquote { margin: 8px 0; padding: 6px 14px; border-left: 3px solid #e2a21b; background: #fdf8ec; }
.lp-area hr { border: 0; border-top: 1px solid #e8e2d9; margin: 18px 0; }
.lp-empty { color: #8f8780; }

.lp-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; }
.lp-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.lp-box h4 { display: flex; align-items: center; gap: 6px; }
.lp-private { min-height: 90px; max-height: 260px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--sunken); }
.lp-tip { display: flex; gap: 7px; font-size: .8rem; color: var(--ink-3); margin: 0; line-height: 1.45; }
.lp-tip .i { flex: none; margin-top: 2px; }
.muted { color: var(--ink-3); font-size: .78rem; }

.lp-open { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--sunken); text-decoration: none; color: var(--ink); }
.lp-open span { flex: 1; display: flex; flex-direction: column; }
.lp-open b { font-weight: 650; font-size: .92rem; }
.lp-open small { color: var(--ink-3); font-size: .8rem; }
.lp-open:hover { border-color: var(--line-strong); background: var(--panel); }
.note-body.clamp { max-height: 220px; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to bottom, #000 70%, transparent); }
.note-body img { max-width: 100%; height: auto; border-radius: 6px; }
.notes-feed .link { margin: 2px 0 10px; }

@media (max-width: 980px) {
  .lp-layout, .lp-layout.read { grid-template-columns: 1fr; }
  .lp-side { position: static; }
  .lp-area { padding: 22px 18px 40px; min-height: 50vh; }
  .lp-nav { margin-left: 0; width: 100%; justify-content: space-between; }
}


/* ---------- Conteúdo (busca nas páginas das aulas) ---------- */
.search-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 14px; }
.search.big { flex: 1; min-width: 260px; }
.search.big input { width: 100%; height: 46px; font-size: 1.02rem; border-radius: 12px; }
.search-bar select { height: 46px; border-radius: 12px; }
.search-hint, .search-count { display: flex; gap: 7px; align-items: center; color: var(--ink-3); font-size: .88rem; margin: 0 0 12px; }
.sr-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.sr-item { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.sr-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.sr-who { flex: 1; display: flex; flex-direction: column; }
.sr-head small { color: var(--ink-3); font-size: .82rem; display: inline-flex; align-items: center; gap: 4px; }
.sr-head:hover { background: var(--sunken); }
.sr-date-badge { display: flex; flex-direction: column; align-items: center; width: 42px; line-height: 1.1; }
.sr-date-badge b { font-size: 1.15rem; } .sr-date-badge small { text-transform: uppercase; font-size: .7rem; }
.sr-sec { display: flex; gap: 12px; align-items: flex-start; padding: 10px 16px; }
.sr-sec + .sr-sec { border-top: 1px dashed var(--line-2); }
.sr-sec a { flex: 1; text-decoration: none; color: var(--ink-2); min-width: 0; }
.sr-sec a b { display: block; color: var(--ink); font-weight: 650; margin-bottom: 2px; }
.sr-sec p { margin: 0; font-size: .9rem; line-height: 1.5; }
.sr-sec a:hover b { text-decoration: underline; }
.sr-list mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: inset 0 -2px 0 var(--gold); }
.sr-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; font-size: .82rem; color: var(--ink-2); }
.sr-files span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 8px; background: var(--sunken); }
.copy-preview { min-height: 0; max-height: 220px; overflow: auto; padding: 14px 18px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font-size: .9rem; color: #1c1917; }
.lp-area .flash { animation: flash 2.2s ease-out; border-radius: 6px; }
@keyframes flash { 0%, 30% { background: #fff1a8; box-shadow: 0 0 0 6px #fff1a8; } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }
.role-student .nav { margin-top: 10px; }

/* ---------- Biblioteca ----------
   Cada tipo de bloco tem uma cor (variável --ut), usada na barra, na etiqueta e nos filtros. */
.t-grammar { --ut: var(--blue); --ut-soft: var(--blue-soft); }
.t-vocab { --ut: var(--green); --ut-soft: var(--green-soft); }
.t-phrase { --ut: var(--amber); --ut-soft: var(--amber-soft); }
.t-slang { --ut: var(--violet); --ut-soft: var(--violet-soft); }
.t-exercise { --ut: var(--red); --ut-soft: var(--red-soft); }
.unit-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: .74rem; font-weight: 700; color: var(--ut); background: var(--ut-soft); white-space: nowrap; }
.lib-stats { color: var(--ink-3); font-size: .86rem; margin: -6px 0 12px; }
.type-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.type-chips button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.type-chips button .i { color: var(--ut, var(--ink-3)); }
.type-chips button em { font-style: normal; color: var(--ink-3); font-weight: 600; font-size: .78rem; }
.type-chips button.on { border-color: var(--ut, var(--ink)); background: var(--ut-soft, var(--sunken)); color: var(--ink); }
.lib-level { max-width: 960px; margin-bottom: 20px; }
.lib-level h2 { display: flex; align-items: baseline; gap: 10px; font-size: .9rem; font-weight: 600; color: var(--ink-3); margin: 0 0 8px; }
.lib-level h2 span { font-size: 1.25rem; font-weight: 750; color: var(--ink); letter-spacing: -.02em; }
.lib-list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.lib-list li + li { border-top: 1px solid var(--line-2); }
.lib-row { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 20px; text-decoration: none; color: var(--ink); }
.lib-row:hover { background: var(--sunken); }
.lib-bar { position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; background: var(--ut); }
.lib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lib-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lib-top b { font-weight: 650; }
.lib-tags, .lib-snip { color: var(--ink-3); font-size: .82rem; }
.lib-snip mark, .lib-top mark, .sr-unit mark { background: var(--gold-soft); color: inherit; box-shadow: inset 0 -2px 0 var(--gold); border-radius: 3px; }
.lib-meta { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .8rem; }
.lib-uses { min-width: 64px; text-align: right; }
.lib-pill { font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; display: inline-block; line-height: 1.5; vertical-align: middle; white-space: nowrap; }
.lib-pill.draft { background: var(--muted-bg); color: var(--ink-2); }
.lib-pill.third { background: var(--amber-soft); color: var(--amber-ink); }

.unit-title { gap: 12px; }
.unit-title-input { flex: 1; min-width: 240px; font-size: 1.6rem; font-weight: 650; letter-spacing: -.02em; border: 0; border-bottom: 1.5px dashed transparent; background: transparent; padding: 2px 0; border-radius: 0; }
.unit-title-input:hover, .unit-title-input:focus { border-bottom-color: var(--line-strong); outline: none; }
.unit-fields { display: grid; grid-template-columns: minmax(0, 1fr) 78px; gap: 10px; }
.field.sm span { font-size: .76rem; }
.lp-box h4 { margin: 4px 0 2px; }
.seg.wrap { flex-wrap: wrap; }
.unit-students { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow: auto; font-size: .86rem; }
.unit-students label { display: flex; gap: 8px; align-items: center; }
.unit-uses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.unit-uses a { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 8px; background: var(--sunken); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .86rem; }
.unit-uses small { color: var(--ink-3); font-weight: 500; }
.danger-text { color: var(--red); align-self: flex-start; }
.lp-layout.single { grid-template-columns: minmax(0, 860px); }
.lp-side.unit-side { position: static; } /* o painel do bloco é mais alto que a tela */
.lp-bar .lib-btn { font-size: .8rem; font-weight: 650; color: var(--blue); }

/* Bloco da biblioteca dentro da página da aula (não editável ali; edita-se na biblioteca). */
.lp-area .unit-ref { margin: 14px 0; border: 1px solid #d9d2c7; border-left: 4px solid var(--ut, #8f8780); border-radius: 10px; background: #fdfcfa; user-select: none; }
.lp-area .unit-ref.missing { color: #8f8780; padding: 10px 14px; }
.unit-ref-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid #ece6dd; font-size: .9rem; }
.unit-ref-head b { flex: 1; min-width: 0; color: #1c1917; overflow-wrap: break-word; }
.unit-ref-head a { display: inline-flex; white-space: nowrap; align-items: center; gap: 3px; font-size: .78rem; font-weight: 600; text-decoration: none; color: #57514c; }
.unit-ref-head a:hover { color: #1c1917; }
.unit-ref-body { padding: 10px 16px 6px; user-select: text; }
.unit-ref-body h2 { font-size: 1.15rem; margin-top: 8px; }
.unit-ref-body h3 { font-size: 1rem; }

/* Janelas da biblioteca */
.type-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 14px; }
.type-pick button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.type-pick button .i { color: var(--ut); }
.type-pick button.on { border-color: var(--ut); background: var(--ut-soft); color: var(--ink); box-shadow: 0 0 0 1px var(--ut); }
.search-bar.tight { margin: 0 0 10px; }
.search-bar.tight .search.big input, .search-bar.tight select { height: 40px; }
.pick-list { list-style: none; margin: 0 0 12px; padding: 0; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.pick-list li + li { border-top: 1px solid var(--line-2); }
.pick-list button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; }
.pick-list button b { flex: 1; font-weight: 600; }
.pick-list button:hover { background: var(--sunken); }
.pick-list button.on { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }

/* Busca: grupos e resultados da biblioteca */
.sr-group { display: flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 650; margin: 18px 0 10px; color: var(--ink-2); }
.sr-group:first-of-type { margin-top: 6px; }
.sr-unit { display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.sr-unit .sr-who { gap: 4px; }
.sr-unit .unit-tag { align-self: flex-start; }
.sr-unit small { color: var(--ink-3); font-size: .84rem; }
.sr-unit:hover { background: var(--sunken); }
.sr-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }

/* ---------- Tema escuro ----------
   Mesma identidade (vermelho, dourado, categorias), com fundos quentes escuros.
   O tema é aplicado por data-theme="dark" no <html>; a fatura continua em papel claro. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161311;
  --panel: #211d1a;
  --sunken: #1b1815;
  --ink: #f2ede6;
  --ink-2: #c7bdb2;
  --ink-3: #93897f;
  --ink-4: #5d554e;
  --line: #352f2a;
  --line-2: #2a2521;
  --line-strong: #4a423b;
  --red: #e2475c;
  --red-ink: #ff9aa8;
  --red-soft: #3b1b21;
  --gold: #e8ad35;
  --gold-soft: #3a2e15;
  --green: #5cbf8a;
  --green-soft: #1b3126;
  --amber: #e9a640;
  --amber-soft: #382a12;
  --amber-ink: #f3c47a;
  --violet: #ad92e6;
  --violet-soft: #2b2340;
  --blue: #8db6f2;
  --blue-soft: #1c2a40;
  --muted-bg: #2b2623;
  --weekend: #1d1916;
  --outside-a: #1b1815; --outside-b: #191613;
  --slot-dash: var(--cat-slot-bar);
  --alert-line: #5a2a33; --alert-bg: #2a1b1e;
  --on-ink: #1c1917;
  --ink-hover: #ffffff;
  --ink-rgb: 242 237 230;

  --cat-lesson-bg: #16323a; --cat-lesson-bar: #3fa6b3; --cat-lesson-ink: #a8e1e8;
  --cat-makeup-bg: #3a2e15; --cat-makeup-bar: #e2a21b; --cat-makeup-ink: #f4d690;
  --cat-trial-bg: #1c2a40; --cat-trial-bar: #8db6f2; --cat-trial-ink: #c3d8f7;
  --cat-slot-bg: #2c2414; --cat-slot-bar: #d9a43a; --cat-slot-ink: #ecd08f;
  --cat-late-bg: #3d1b22; --cat-late-bar: #e2475c; --cat-late-ink: #ffb8c3;
  --cat-private-bg: #2b2724; --cat-private-bar: #8f8780; --cat-private-ink: #d3ccc5;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 35%);
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px -12px rgb(0 0 0 / 60%);
  --shadow-lg: 0 24px 60px -20px rgb(0 0 0 / 75%), 0 2px 6px rgb(0 0 0 / 40%);
}
:root[data-theme="dark"] .invoice-doc, :root[data-theme="dark"] .lp-paper {
  --ink-rgb: 28 25 23;
  /* A fatura é um documento em papel: mantém as cores do tema claro. */
  color-scheme: light;
  --ink: #1c1917; --ink-2: #57514c; --ink-3: #8f8780; --ink-4: #cdc6bd;
  --line: #e8e2d9; --line-2: #f1ece5; --panel: #ffffff; --sunken: #faf8f4; --muted-bg: #efece7;
  --red: #c8102e; --red-soft: #fcebee; --green: #2f7d55; --green-soft: #e6f3eb;
  --amber: #b86e00; --amber-soft: #fff1da; --blue: #1f5aa8; --blue-soft: #e7effa;
}
:root[data-theme="dark"] .avatar { filter: saturate(.85) brightness(.82); }
:root[data-theme="dark"] .scrim { background: rgb(0 0 0 / 50%); }
:root[data-theme="dark"] .auto-card, :root[data-theme="dark"] .next-card { box-shadow: inset 0 0 0 1px var(--line); }

@media print {
  body { background: #fff; color: #1c1917; }
  .sidebar, .scrim, .modal-foot, .toast, .drawer, .popover, .cal-bar, .head-actions, .inv-hint { display: none !important; }
  .app:has(.modal-layer) .page { display: none !important; }
  .modal-layer { position: static; padding: 0; display: block; }
  .modal { box-shadow: none; max-height: none; max-width: none; border-radius: 0; animation: none; }
  .modal-body.flush { background: #fff; }
  .invoice-doc { box-shadow: none; margin: 0; }
  .app { display: block; height: auto; }
  .main { height: auto; overflow: visible; }
}

/* Perfil do aluno: dados que só a Jasmin muda, para leitura */
.profile-facts dl { margin: 0; display: flex; flex-direction: column; }
.profile-facts dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.profile-facts dl > div:last-child { border-bottom: 0; }
.profile-facts dt { color: var(--ink-3); font-size: .88rem; }
.profile-facts dd { margin: 0; font-weight: 650; }
.profile-facts p { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: .82rem; }
/* Aviso no perfil (visão da Jasmin) quando o aluno mudou os próprios dados */
.self-edits { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; padding: 10px 14px; border-radius: 10px; background: var(--sunken); color: var(--ink-2); font-size: .86rem; }
.self-edits ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink-3); }

/* Campo de resposta: onde o aluno escreve durante a aula. Fica no papel claro, como a página. */
.lp-bar .lp-ans-btn { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 650; }
.lp-area .answer { margin: 12px 0; border: 1.5px dashed #9db7dc; border-radius: 10px; background: #f7faff; user-select: none; }
.answer-head { display: flex; align-items: center; gap: 6px; padding: 6px 12px 0; color: #1f5aa8; font-size: .78rem; font-weight: 700; }
.answer-meta { margin-left: auto; color: #6b7a8f; font-weight: 500; }
.answer-text { min-height: 2.6em; padding: 4px 12px 10px; outline: none; user-select: text; color: #1c1917; }
.answer-text[contenteditable]:focus { box-shadow: inset 0 0 0 2px #cfe0f7; border-radius: 0 0 9px 9px; }
.answer-text:empty::before { content: attr(data-placeholder); color: #8f9bb0; }
.answer-text.is-template { color: #6b7a8f; font-size: .88rem; font-style: italic; }
.answer-text p { margin: 0 0 .4em; }
.lp-area .answer.live { animation: answer-live 1.4s ease-out; }
@keyframes answer-live { 0%, 25% { background: #e3efff; border-color: #1f5aa8; } 100% { background: #f7faff; border-color: #9db7dc; } }
.ans-tip { color: var(--blue); }

.switch-row.lib-open { max-width: 560px; margin: -6px 0 14px; }

/* ---------- Login (login.html) ---------- */
.login-page { display: grid; place-items: center; min-height: 100%; padding: 24px; }
.login { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 28px 28px 20px; }
.login-brand { padding: 0 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line-2); }
.login h1 { font-size: 1.3rem; letter-spacing: -.02em; margin: 0 0 6px; }
.login p { color: var(--ink-2); margin: 0 0 18px; }
.login .btn + .btn { margin-top: 12px; }
.login a.btn { text-decoration: none; }
.login-error { background: var(--alert-bg); border: 1px solid var(--alert-line); color: var(--red-ink) !important; border-radius: var(--r-sm); padding: 10px 12px; }
.login-recovery { margin: 16px 0; color: var(--ink-2); font-size: .9rem; }
.login-recovery summary { cursor: pointer; }
.login-recovery form { display: grid; gap: 10px; margin-top: 12px; }
.login-recovery label { display: grid; gap: 4px; font-weight: 600; color: var(--ink); }
.login-recovery input { height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--panel); text-transform: uppercase; letter-spacing: .08em; }
.login-codes { columns: 2; padding-left: 1.4em; margin: 0 0 16px; font-size: 1rem; }
.login-codes code { letter-spacing: .06em; }
.login-check { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; font-weight: 600; }
.btn.is-disabled { opacity: .45; pointer-events: auto; cursor: not-allowed; }
.login-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 !important; color: var(--ink-3) !important; font-size: .82rem; }
.login-or::before, .login-or::after { content: ''; flex: 1; border-top: 1px solid var(--line-2); }
.login-hint { display: block; margin-top: 8px; color: var(--ink-3); font-size: .8rem; line-height: 1.4; }
.login-foot { display: flex; justify-content: flex-end; margin-top: 18px; }
.login-foot select { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); padding: 4px 8px; color: var(--ink-2); }
