/* =====================================================================
   CORTE DA NOTA · APP  —  tema claro (padrão) e escuro
   ===================================================================== */
:root {
  --bg: #F3EFE8;
  --grid: rgba(20, 17, 17, .045);
  --surface: #FCFAF7;
  --field: #FFFFFF;
  --border: #E2DACE;
  --border-2: #D9D0C3;
  --row: #ECE5DA;
  --hover: #F4EFE7;
  --text: #141111;
  --text-2: #5E5553;
  --text-3: #6E6462;
  --accent: #731F26;
  --accent-hover: #5C1820;
  --accent-text: #731F26;
  --accent-soft: #F6E9EA;
  --accent-line: #DDBFC1;
  --ink: #141111;
  --on-ink: #F2EDE4;
  --track: #EAE3D8;
  --done-bg: #141111;
  --done-fg: #F2EDE4;
  --shadow: 0 1px 0 #FFFFFF inset, 0 14px 34px -22px rgba(60, 40, 30, .35);
  --grain-blend: multiply;
  --nav-bg: rgba(252, 250, 247, .94);
  --nav-active-bg: #141111;
  --nav-active-fg: #F2EDE4;
  --nav-fg: #4A4240;

  --f-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-body: 'Barlow', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --r: 12px;
}

:root[data-theme="escuro"] {
  --bg: #0B0A0A;
  --grid: rgba(230, 220, 203, .028);
  --surface: #131111;
  --field: rgba(0, 0, 0, .35);
  --border: #262020;
  --border-2: #332B2B;
  --row: #221C1C;
  --hover: #171414;
  --text: #F2EDE4;
  --text-2: #B8AEA9;
  --text-3: #8C8180;
  --accent-text: #E6828A;
  --accent-soft: rgba(115, 31, 38, .2);
  --accent-line: #4A2428;
  --ink: #E6DCCB;
  --on-ink: #0D0D0D;
  --track: #241D1D;
  --done-bg: #E6DCCB;
  --done-fg: #0D0D0D;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 40px -24px rgba(0, 0, 0, .8);
  --grain-blend: overlay;
  --nav-bg: rgba(14, 12, 12, .92);
  --nav-active-bg: rgba(115, 31, 38, .4);
  --nav-active-fg: #F2EDE4;
  --nav-fg: #B8AEA9;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
:root[data-theme="escuro"] { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: .05; mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--accent-text); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------- layout ---------------- */
.app { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.nav {
  flex: 0 0 248px; background: var(--nav-bg); border-right: 1px solid var(--border);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.marca { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-bottom: 18px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.marca img { width: 88px; height: auto; display: block; }
.marca b { font-family: var(--f-display); font-weight: 700; font-size: 22px; letter-spacing: 2.5px; text-transform: uppercase; }
.marca small { font-family: var(--f-mono); font-size: 10px; letter-spacing: 1.5px; color: var(--text-3); }
.menu { display: flex; flex-direction: column; gap: 3px; }
.menu a, .menu span.breve {
  display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 14px;
  border-radius: 8px; text-decoration: none; color: var(--nav-fg); font-weight: 500;
  border: 1px solid transparent;
}
.menu a:hover { background: var(--hover); color: var(--text); }
.menu a[aria-current="page"] { background: var(--nav-active-bg); color: var(--nav-active-fg); font-weight: 600; }
.menu .n { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); }
.menu a[aria-current="page"] .n { color: #E6828A; }
.menu span.breve { opacity: .55; cursor: default; }
.menu span.breve em { margin-left: auto; font-style: normal; font-family: var(--f-mono); font-size: 9px; letter-spacing: 1px; border: 1px solid var(--border-2); border-radius: 999px; padding: 2px 6px; }
.nav-rodape { margin-top: auto; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.nav-rodape .quem { font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }
.topo-mobile { display: none; }

.main { flex: 1 1 auto; min-width: 0; padding: 28px 32px 64px; display: flex; flex-direction: column; gap: 24px; max-width: 1400px; }
.barra { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.crumb { font-family: var(--f-mono); font-size: 12px; letter-spacing: 1.5px; color: var(--text-3); text-transform: uppercase; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .nav { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 30; transform: translateX(-100%); transition: transform .2s; height: 100%; }
  .app.nav-aberta .nav { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .4); }
  .topo-mobile {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px; background: var(--nav-bg); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
  }
  .topo-mobile img { height: 36px; }
  .topo-mobile b { font-family: var(--f-display); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: 18px; }
  .main { padding: 18px 16px 48px; }
}

/* ---------------- cartões ---------------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; }
.tick::before, .tick::after { content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; }
.tick::before { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); border-top-left-radius: var(--r); }
.tick::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); border-bottom-right-radius: var(--r); }
.pilha { display: flex; flex-direction: column; gap: 16px; }
.linha { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.entre { justify-content: space-between; }
.colunas { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-3 { flex: 3 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.col-2 { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.grade-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }

/* ---------------- tipografia ---------------- */
h1, h2, h3 { margin: 0; font-family: var(--f-display); text-transform: uppercase; }
.titulo-pagina { font-weight: 800; font-size: 44px; letter-spacing: .5px; line-height: 1; }
.secao { display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 22px; letter-spacing: 2px; }
.secao .num { font-family: var(--f-mono); font-size: 12px; color: var(--accent-text); letter-spacing: 1px; font-weight: 500; }
.rotulo { font-family: var(--f-mono); font-size: 11px; letter-spacing: 1.5px; color: var(--text-3); text-transform: uppercase; }
.mudo { color: var(--text-2); }
.fraco { color: var(--text-3); font-size: 13px; }
.grande { font-family: var(--f-display); font-weight: 800; line-height: 1; }
.mono { font-family: var(--f-mono); }
.vermelho { color: var(--accent-text); }

/* ---------------- botões e campos ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent;
  font-family: var(--f-display); font-weight: 700; font-size: 17px; letter-spacing: 1.5px; text-transform: uppercase;
  text-decoration: none; transition: background .15s, color .15s, border-color .15s, transform .1s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-red { background: var(--accent); color: #FFFFFF; }
.btn-red:hover { background: var(--accent-hover); }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover { opacity: .9; }
.btn-cream { background: #F2EDE4; color: #141111; }
.btn-cream:hover { background: #FFFFFF; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border-2); font-family: var(--f-body); font-weight: 600; font-size: 13px; letter-spacing: 1px; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-text); }
.btn-mini { min-height: 36px; padding: 0 12px; }
.btn-icone { min-width: 44px; padding: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-text); text-decoration: underline; font-size: 14px; }

.campo { display: flex; flex-direction: column; gap: 6px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 1.5px; color: var(--text-3); text-transform: uppercase; min-width: 0; }
.input, select.input {
  min-height: 46px; border-radius: 8px; background: var(--field); border: 1px solid var(--border-2);
  color: var(--text); font-family: var(--f-body); font-size: 16px; padding: 0 12px; width: 100%; text-transform: none; letter-spacing: 0;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-num { font-size: 22px; font-weight: 600; }

/* ---------------- barras ---------------- */
.trilho { height: 8px; border-radius: 8px; background: var(--track); overflow: hidden; }
.trilho > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.trilho.fino { height: 4px; }
.trilho.grosso { height: 22px; border-radius: 6px; }
.trilho > i.ok { background: var(--done-bg); }

/* ---------------- hero ---------------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r); padding: 36px;
  background: #161213; color: #F2EDE4; border: 1px solid #161213;
  box-shadow: 0 24px 50px -28px rgba(20, 17, 17, .7);
  display: flex; flex-wrap: wrap; gap: 36px;
}
:root[data-theme="escuro"] .hero { background: #140F10; border-color: #2E2425; }
.hero::before, .hero::after { content: ""; position: absolute; width: 14px; height: 14px; }
.hero::before { top: -1px; left: -1px; border-top: 2px solid #B0323C; border-left: 2px solid #B0323C; border-top-left-radius: var(--r); }
.hero::after { bottom: -1px; right: -1px; border-bottom: 2px solid #B0323C; border-right: 2px solid #B0323C; border-bottom-right-radius: var(--r); }
.hero .marca-agua { position: absolute; right: -20px; bottom: -70px; font-family: var(--f-display); font-weight: 800; font-size: 300px; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(194, 74, 82, .32); pointer-events: none; white-space: nowrap; }
.hero-esq { position: relative; flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.hero-dir { position: relative; flex: 2 1 260px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; padding-left: 28px; border-left: 1px solid #3A2C2D; }
.hero h1 { font-weight: 800; font-size: 78px; line-height: .9; letter-spacing: .5px; }
.hero h1 span { color: #D9666E; }
.hero .data { font-family: var(--f-mono); font-size: 12px; letter-spacing: 1.5px; color: #E6828A; text-transform: uppercase; }
.hero p { margin: 0; font-size: 18px; color: #CFC4BC; max-width: 470px; line-height: 1.45; }
.hero .rotulo, .hero .campo { color: #A99C97; }
.alvo { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 16px 16px 20px; border: 1px solid #4A2A2D; border-radius: 10px; background: rgba(115, 31, 38, .22); }
.alvo .nome { font-family: var(--f-display); font-weight: 700; font-size: 26px; text-transform: uppercase; line-height: 1.05; }
.alvo .rotulo { color: #E6828A; }
.contagem { font-family: var(--f-display); font-weight: 800; font-size: 110px; line-height: .9; }
.hero .input { background: rgba(0, 0, 0, .35); border-color: #3A2C2D; color: #F2EDE4; color-scheme: dark; }
.hero .linha-alvo { display: flex; align-items: center; gap: 10px; }
.hero .linha-alvo i { flex: 1; height: 1px; background: linear-gradient(90deg, #B0323C, transparent); }
.plano { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid #3A2C2D; border-radius: 10px; background: rgba(0, 0, 0, .25); }
.plano-min { font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1; }
.plano-min small { font-size: 16px; font-weight: 600; color: #B8AEA9; margin-left: 2px; }
.plano-trilho { background: #2E2425; }
.plano-trilho > i { background: #D9666E; }
.plano-txt { font-size: 13px; color: #B8AEA9; line-height: 1.45; }
.plano-txt strong { color: #F2EDE4; }
.editar-alvo summary { cursor: pointer; font-family: var(--f-mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #A99C97; min-height: 32px; display: flex; align-items: center; }
.editar-alvo summary:hover { color: #F2EDE4; }
.hero .grade-auto .campo { min-width: 0; }
@media (max-width: 600px) {
  .hero { padding: 24px; }
  .hero h1 { font-size: 56px; }
  .hero-dir { padding-left: 0; border-left: 0; border-top: 1px solid #3A2C2D; padding-top: 18px; }
  .contagem { font-size: 84px; }
}

/* ---------------- KPIs ---------------- */
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .valor { font-family: var(--f-display); font-weight: 700; font-size: 46px; line-height: 1; }
.kpi .sub { font-size: 14px; color: var(--text-2); }

/* ---------------- constância ---------------- */
.quadros { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 400px; }
.q { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.q-feito { background: var(--done-bg); color: var(--done-fg); }
.q-perdido { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-text); }
.q-antes { border: 1px dashed var(--border-2); }
.q-hoje { border: 1.5px solid var(--accent); color: var(--accent-text); background: var(--field); animation: pulso 2s ease-in-out infinite; }
@keyframes pulso { 0%, 100% { box-shadow: 0 0 0 0 rgba(115, 31, 38, .45); } 50% { box-shadow: 0 0 0 5px rgba(115, 31, 38, 0); } }
@media (prefers-reduced-motion: reduce) { .q-hoje { animation: none; } }
.legenda { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--text-2); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------------- listas ---------------- */
.lista { display: flex; flex-direction: column; }
.item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 10px; border-bottom: 1px solid var(--row); border-radius: 8px; }
.item:hover { background: var(--hover); }
.item .nome { font-weight: 600; font-size: 16px; }
.vazio { padding: 18px; border: 1px dashed var(--border-2); border-radius: 10px; color: var(--text-2); font-size: 14px; line-height: 1.5; }

.check {
  display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 8px 14px; width: 100%;
  border-radius: 8px; background: var(--field); border: 1px solid var(--row); text-align: left; font-size: 15px;
}
.check .caixa { flex: 0 0 22px; height: 22px; border-radius: 5px; border: 1.5px solid var(--text-3); display: grid; place-items: center; font-size: 14px; font-weight: 700; color: transparent; }
.check[aria-pressed="true"] .caixa { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.check[aria-pressed="true"] .txt { color: var(--text-3); text-decoration: line-through; }
.meta-linha { display: flex; gap: 6px; align-items: center; }
.meta-linha .check { flex: 1; }

/* ---------------- gráfico de barras ---------------- */
.barras { position: relative; display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 14px; border-top: 1px dashed var(--border); }
.barras .col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.barras .col b { width: 62%; border-radius: 4px 4px 0 0; display: block; min-height: 3px; }
.barras .col small { font-family: var(--f-mono); font-size: 11px; color: var(--text-2); }
.barras .meta { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--accent); opacity: .6; }
.barras-rot { display: flex; gap: 10px; margin-top: 6px; }
.barras-rot span { flex: 1 1 0; text-align: center; font-family: var(--f-mono); font-size: 10px; color: var(--text-3); }

/* ---------------- tabela ---------------- */
.tabela-caixa { overflow-x: auto; }
table.tabela { width: 100%; min-width: 620px; border-collapse: collapse; }
.tabela th { text-align: left; font-family: var(--f-mono); font-size: 11px; letter-spacing: 1.5px; color: var(--text-3); font-weight: 500; padding: 10px 8px; border-bottom: 1px solid var(--border-2); text-transform: uppercase; }
.tabela td { padding: 12px 8px; border-bottom: 1px solid var(--row); vertical-align: middle; }

/* ---------------- arsenal ---------------- */
.arsenal { display: flex; flex-direction: column; gap: 8px; padding: 24px; min-height: 180px; text-decoration: none; color: var(--text); overflow: hidden; }
.arsenal .t { font-family: var(--f-display); font-weight: 800; font-size: 28px; text-transform: uppercase; line-height: 1.02; }
.arsenal .cta { margin-top: auto; font-weight: 600; color: var(--accent-text); }
.arsenal.destaque { background: var(--accent); border-color: var(--accent); color: #F2EDE4; }
.arsenal.destaque .rotulo, .arsenal.destaque .cta { color: #F2D9D9; }
.arsenal.destaque .simbolo { position: absolute; right: -6px; top: -36px; font-family: var(--f-display); font-weight: 800; font-size: 160px; color: transparent; -webkit-text-stroke: 1px rgba(242, 237, 228, .22); pointer-events: none; }

/* ---------------- cronômetro ---------------- */
.crono { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); flex-wrap: nowrap; }
@media (max-width: 1100px) and (min-width: 601px) { .crono { flex-wrap: wrap; border-radius: var(--r); } }
.crono .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); }
.crono.rodando .ponto { background: #B0323C; box-shadow: 0 0 8px rgba(176, 50, 60, .7); }
.crono .tempo { font-family: var(--f-display); font-weight: 600; font-size: 26px; letter-spacing: 1px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.crono select { min-height: 40px; max-width: 190px; border-radius: 999px; padding: 0 12px; font-size: 14px; }
.crono .btn { border-radius: 999px; }
@media (max-width: 600px) {
  .barra { flex-direction: column; align-items: stretch; }
  .crono { border-radius: var(--r); padding: 10px 12px; justify-content: space-between; flex-wrap: wrap; }
  .crono select { flex: 1 1 100%; max-width: none; }
}

.tempo-btn { background: none; border: 0; padding: 0 4px; color: var(--text); border-radius: 6px; }
.tempo-btn:hover { color: var(--accent-text); }

/* ---------------- modo foco ---------------- */
.foco {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px;
  background: rgba(12, 10, 10, .72);
  -webkit-backdrop-filter: blur(18px) saturate(.7); backdrop-filter: blur(18px) saturate(.7);
  color: #F2EDE4; opacity: 0; transition: opacity .25s ease;
}
.foco.aberto { opacity: 1; }
.foco-centro { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 100%; }
.foco-busto { width: 92px; height: auto; opacity: .9; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .6)); }
.foco-rotulo { font-family: var(--f-mono); font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: #E6828A; }
.foco-materia { font-family: var(--f-display); font-weight: 700; font-size: clamp(24px, 4vw, 40px); text-transform: uppercase; letter-spacing: 1px; }
.foco-tempo { font-family: var(--f-display); font-weight: 800; font-size: clamp(80px, 17vw, 210px); line-height: .9; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.foco-acoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; }
.foco-acoes .btn { min-height: 52px; padding: 0 28px; font-size: 19px; }
.btn-foco-ghost { background: transparent; color: #F2EDE4; border-color: rgba(242, 237, 228, .35); }
.btn-foco-ghost:hover { border-color: #F2EDE4; }
.foco-min { margin-top: 18px; background: none; border: 0; color: #B8AEA9; font-family: var(--f-mono); font-size: 12px; letter-spacing: 1px; text-decoration: underline; min-height: 44px; }
.foco-min:hover { color: #F2EDE4; }
body.em-foco { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .foco { transition: none; } }

/* ---------------- notas ---------------- */
.busca { min-height: 52px; font-size: 16px; padding-left: 16px; }
.chip { min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 14px; }
.chip:hover { border-color: var(--accent); color: var(--accent-text); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.grade-notas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.nota { display: flex; flex-direction: column; gap: 8px; min-height: 150px; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 18px; transition: border-color .15s, transform .15s; }
.nota:hover { border-color: var(--accent); transform: translateY(-1px); }
.nota-titulo { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.nota-trecho { font-size: 14px; color: var(--text-2); line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tag { font-family: var(--f-mono); font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.tag-disc { background: var(--track); color: var(--text-2); }
.vazio-notas { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 16px; color: var(--text-2); text-align: center; }
.vazio-notas svg { color: var(--text-3); }
.area { min-height: 200px; padding: 12px; line-height: 1.5; resize: vertical; font-size: 15px; }
dialog.dlg-nota { width: min(640px, calc(100vw - 32px)); }
.nota-mini { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px; border-radius: 8px; border: 0; border-bottom: 1px solid var(--row); background: none; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.nota-mini:hover { background: var(--hover); }
.nota-mini b { font-weight: 600; overflow-wrap: anywhere; }
.nota-mini span { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- registro: confiança ---------------- */
dialog.dlg-registro { width: min(560px, calc(100vw - 32px)); }
.conf { border: 1px dashed var(--border-2); border-radius: 10px; padding: 10px 14px; }
.conf summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.conf-grade { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 8px 10px; align-items: end; }
.conf-grade .rotulo { padding-bottom: 14px; }
.conf-grade .input { min-height: 42px; }
.input[readonly] { background: var(--track); color: var(--text-2); }

.tipos { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tipos legend { margin-bottom: 6px; padding: 0; }
.chip-radio { position: relative; }
.chip-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip-radio span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--field); font-weight: 600; font-size: 14px; color: var(--text-2); }
.chip-radio input:checked + span { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chip-radio input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* ---------------- carreira e tendência ---------------- */
.tend { display: inline-block; font-family: var(--f-mono); font-size: 11px; letter-spacing: .5px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; font-weight: 500; }
.tend-nucleo { background: var(--accent); color: #FFFFFF; }
.tend-frequente { background: var(--ink); color: var(--on-ink); }
.tend-as_vezes { background: transparent; color: var(--text-2); border: 1px solid var(--border-2); }
.tend-cel { min-width: 180px; }
.tend-nota { display: block; font-size: 12px; margin-top: 4px; line-height: 1.35; max-width: 280px; }
.grupo-mat { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.grupo-mat legend { margin-bottom: 6px; padding: 0; }
.check-mat { display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--row); cursor: pointer; font-size: 15px; line-height: 1.35; }
.check-mat:hover { background: var(--hover); }
.check-mat input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; }
.check-mat.tem { opacity: .6; cursor: default; }

/* ---------------- estatísticas ---------------- */
.viz { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s0: #B7AFA8; }
:root[data-theme="escuro"] .viz { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s0: #5A504E; }
.pilha-tipos { display: flex; height: 22px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--surface); }
.pilha-tipos i { display: block; height: 100%; }
.pilha-tipos i:first-child { border-radius: 6px 0 0 6px; } .pilha-tipos i:last-child { border-radius: 0 6px 6px 0; }
.leg-tipos { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px 14px; align-items: center; font-size: 14px; }
.leg-tipos .sw { width: 12px; height: 12px; border-radius: 3px; }
.pvr { display: grid; grid-template-columns: minmax(110px, 1.2fr) minmax(120px, 2.4fr) 64px 92px; gap: 8px 14px; align-items: center; font-size: 14px; }
.pvr .barra { position: relative; height: 12px; border-radius: 4px; background: var(--track); }
.pvr .barra i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--done-bg); }
.pvr .barra u { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--accent); border-radius: 1px; text-decoration: none; }
@media (max-width: 600px) { .pvr { grid-template-columns: 1fr 64px 92px; } .pvr .barra { grid-column: 1 / -1; order: 5; } }
.filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grafico { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 18px; border-bottom: 1px solid var(--border-2); }
.grafico .col { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.grafico .col b { width: 70%; max-width: 34px; border-radius: 4px 4px 0 0; display: block; }
.grafico .col small { font-family: var(--f-mono); font-size: 10px; color: var(--text-2); white-space: nowrap; }
.grafico .meta { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--accent); opacity: .7; pointer-events: none; }
.grafico .meta span { position: absolute; right: 0; top: -16px; font-family: var(--f-mono); font-size: 10px; color: var(--accent-text); }
.grafico-rot { display: flex; gap: 6px; margin-top: 6px; }
.grafico-rot span { flex: 1 1 0; text-align: center; font-family: var(--f-mono); font-size: 10px; color: var(--text-3); min-width: 0; overflow: hidden; }
.matriz { display: grid; grid-template-columns: 120px 1fr 1fr; gap: 8px; }
.matriz .cel { border-radius: 10px; padding: 14px; border: 1px solid var(--border); background: var(--field); display: flex; flex-direction: column; gap: 4px; }
.matriz .cel b { font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1; }
.matriz .cel.alerta { border-color: var(--accent); background: var(--accent-soft); }
.matriz .cab { font-family: var(--f-mono); font-size: 11px; letter-spacing: 1px; color: var(--text-3); text-transform: uppercase; align-self: end; }
.calor { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.calor .sem { display: flex; flex-direction: column; gap: 3px; }
.calor i { width: 13px; height: 13px; border-radius: 3px; display: block; background: var(--track); }
.calor i.n1 { background: #E3C3C6; } .calor i.n2 { background: #C27A81; } .calor i.n3 { background: #94323C; } .calor i.n4 { background: #4A1015; }
:root[data-theme="escuro"] .calor i.n1 { background: #3A2326; } :root[data-theme="escuro"] .calor i.n2 { background: #6B2A31; }
:root[data-theme="escuro"] .calor i.n3 { background: #A8414B; } :root[data-theme="escuro"] .calor i.n4 { background: #E6828A; }
.calor i.fut { background: transparent; }
.ponto-fraco { display: flex; flex-direction: column; gap: 2px; }
.ponto-fraco b { font-weight: 600; }
.materia { border-bottom: 1px solid var(--row); }
.materia summary { display: grid; grid-template-columns: minmax(120px, 1.4fr) minmax(80px, 2fr) 56px 64px; gap: 14px; align-items: center; padding: 12px 6px; cursor: pointer; border-radius: 8px; list-style: none; }
.materia summary::-webkit-details-marker { display: none; }
.materia summary:hover { background: var(--hover); }
.materia-nome { font-weight: 600; overflow-wrap: anywhere; }
.materia-num { text-align: right; }
.materia-corpo { padding: 8px 6px 18px; display: flex; flex-direction: column; gap: 14px; }
.materia[open] summary { background: var(--hover); }
@media (max-width: 600px) { .materia summary { grid-template-columns: 1fr 50px 56px; } .materia-barra { display: none; } .matriz { grid-template-columns: 84px 1fr 1fr; } .conf-grade { grid-template-columns: 84px 1fr 1fr; } }
.alvo-card { display: flex; flex-direction: column; gap: 10px; }
.alvo-card .contagem-mini { font-family: var(--f-display); font-weight: 800; font-size: 54px; line-height: .9; }

/* ---------------- diálogo e aviso ---------------- */
dialog { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--text); padding: 24px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
dialog::backdrop { background: rgba(10, 8, 8, .55); }
.aviso { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 10px; font-weight: 500; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); max-width: calc(100vw - 32px); }
.aviso.erro { background: var(--accent); color: #FFFFFF; }

/* ---------------- login ---------------- */
.entrada { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.entrada .card { width: min(420px, 100%); padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.entrada .marca { border-bottom: 0; padding-bottom: 0; }
.entrada .marca img { width: 120px; }
.erro-txt { color: var(--accent-text); font-size: 14px; min-height: 1em; }
.carregando { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; font-family: var(--f-mono); font-size: 12px; letter-spacing: 2px; color: var(--text-3); }
