/* ===== Tokens ===== */
:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f0efec;
  --surface-3: #e7e6e1;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #7d7c76;
  --border: #e3e2dd;
  --accent: #2a78d6;
  --accent-strong: #1c5cab;
  --accent-soft: #cde2fb;
  --accent-ink: #ffffff;
  --good: #0ca30c;
  --good-ink: #006300;
  --warn: #fab219;
  --warn-ink: #8a5a00;
  --critical: #d03b3b;
  --critical-ink: #b02a2a;
  --c0: #8a8983;
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100;
  --c5: #e87ba4; --c6: #008300; --c7: #6250d6; --c8: #e34948;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --radius: 14px;
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211; --surface: #1a1a19; --surface-2: #242422; --surface-3: #2e2e2b;
    --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8e86; --border: #333331;
    --accent: #3987e5; --accent-strong: #6da7ec; --accent-soft: #184f95; --accent-ink: #ffffff;
    --good-ink: #4cc24c; --warn-ink: #fab219; --critical-ink: #e66767;
    --c0: #8f8e86;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
    --c5: #d55181; --c6: #0ca30c; --c7: #9085e9; --c8: #e66767;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #242422; --surface-3: #2e2e2b;
  --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8e86; --border: #333331;
  --accent: #3987e5; --accent-strong: #6da7ec; --accent-soft: #184f95; --accent-ink: #ffffff;
  --good-ink: #4cc24c; --warn-ink: #fab219; --critical-ink: #e66767;
  --c0: #8f8e86;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
  --c5: #d55181; --c6: #0ca30c; --c7: #9085e9; --c8: #e66767;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}

/* ===== Base ===== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.sec { color: var(--text-2); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.neg { color: var(--good-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ===== Layout ===== */
.app { min-height: 100vh; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(6, 1fr);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 500;
}
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--accent); }
.nav .brand { display: none; }
main {
  max-width: 980px; margin: 0 auto;
  padding: 16px 16px calc(var(--nav-h) + 96px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) {
  .nav {
    top: 0; right: auto; width: 210px; height: auto; padding: 16px 10px;
    border-top: 0; border-right: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 2px;
  }
  .nav .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-weight: 700; color: var(--text); font-size: 1rem; }
  .nav .brand img { width: 30px; height: 30px; border-radius: 8px; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: .92rem; }
  .nav a.on { background: var(--surface-2); }
  main { margin-left: 210px; margin-right: 0; padding: 28px 32px 120px; max-width: 1040px; }
  .app main { margin-left: max(210px, calc(105px + 50vw - 520px)); }
}

/* ===== Page header ===== */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { flex: 1; min-width: 0; }
.month-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.month-nav h1 { flex: 0 1 auto; text-align: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mes-titulo { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 8px; margin: 0 -2px;
  border: 0; border-radius: 10px; background: none; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.mes-titulo:hover { background: var(--surface-2); }
.mes-titulo svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.mp-ano { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 2px 0 12px; }
.mp-ano b { font-size: 1.2rem; min-width: 4ch; text-align: center; }
.mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mp-mes { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; min-height: 58px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mp-mes:hover { border-color: var(--accent); }
.mp-mes .n { font-weight: 600; font-size: .92rem; }
.mp-mes .v { font-size: .78rem; color: var(--text-2); }
.mp-mes .v b { color: var(--accent-strong); }
.mp-mes.hoje { border-color: var(--accent); }
.mp-mes.vazio .n, .mp-mes.vazio .v { color: var(--muted); }
.mp-mes.sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mp-mes.sel .v, .mp-mes.sel .v b, .mp-mes.sel .n { color: var(--accent-ink); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font-size: .9rem; margin-bottom: 8px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .9rem;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--critical-ink); }
.btn.sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.btn svg { width: 18px; height: 18px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; flex: none;
  border: 0; background: transparent; border-radius: 10px; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }
.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 15;
  width: 58px; height: 58px; border-radius: 18px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px rgba(42,120,214,.35);
  display: grid; place-items: center;
}
.fab svg { width: 28px; height: 28px; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 32px; } }

/* ===== Cards ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h2 { flex: 1; }
.card-head > svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
h2 > svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; color: var(--text-2); }
svg:not([width]):not([class*="icon"]) { max-width: 100%; }
.grid-2 { display: grid; gap: 14px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2 > .card { margin-bottom: 0; } .grid-2 { margin-bottom: 14px; } }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.kpi .lbl { font-size: .78rem; color: var(--text-2); font-weight: 500; }
.kpi .val { font-size: 1.3rem; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .sub { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.kpi.hero { grid-column: 1 / -1; }
@media (max-width: 759px) { .kpis > .kpi:last-child:nth-child(even):not(.hero) { grid-column: 1 / -1; } }
.kpi.hero .val { font-size: 1.9rem; }
@media (min-width: 760px) { .kpi.hero { grid-column: auto; } .kpi.hero .val { font-size: 1.3rem; } }

/* ===== Lists ===== */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--border);
  min-width: 0; color: inherit; text-decoration: none; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%;
}
.row:last-child { border-bottom: 0; }
button.row, a.row { cursor: pointer; }
button.row:hover, a.row:hover { background: var(--surface-2); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.day-head { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 2px 2px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.badge { display: inline-block; font-size: .68rem; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); vertical-align: 1px; }
.badge.acc { background: var(--accent-soft); color: var(--accent-strong); }
:root[data-theme="dark"] .badge.acc { color: #cde2fb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.acc { color: #cde2fb; } }
.empty { text-align: center; color: var(--muted); padding: 22px 8px; font-size: .9rem; }

/* ===== Meters (budget) ===== */
.meter { margin: 10px 0 2px; }
.meter-top { display: flex; align-items: baseline; gap: 8px; font-size: .88rem; }
.meter-top .name { flex: 1; min-width: 0; font-weight: 500; }
.track { display: block; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 6px; position: relative; }
.track > i { display: block; height: 100%; border-radius: 4px; background: var(--good); }
.track.st-warn > i { background: var(--warn); }
.track.st-crit > i { background: var(--critical); }
.track.st-acc > i { background: var(--accent); }
.status { font-size: .74rem; font-weight: 600; white-space: nowrap; margin-left: auto; }
.status.ok { color: var(--good-ink); }
.status.warn { color: var(--warn-ink); }
.status.crit { color: var(--critical-ink); }

/* ===== Category bars ===== */
.cat-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.cat-row:last-child { border-bottom: 0; }
.cat-row:hover { background: var(--surface-2); }
.cat-row.on { background: var(--surface-2); }
.cat-row .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.cat-row .track, .cat-row .meta-line { grid-column: 2 / -1; margin-top: 0; }
.cat-row .meta-line { display: flex; gap: 8px; font-size: .74rem; color: var(--muted); }
.cat-row .meta-line .status { margin-left: auto; }
.hbar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; grid-column: 2 / -1; }
.hbar > i { display: block; height: 100%; border-radius: 3px; }

/* ===== Chips & filters ===== */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .84rem; white-space: nowrap; color: var(--text);
  text-decoration: none;
}
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .dot { width: 8px; height: 8px; }
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 10px; gap: 2px; }
.seg a, .seg button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: .86rem; }
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ===== Bar chart (HTML) ===== */
.chart { position: relative; height: 200px; margin: 6px 0 4px; padding-left: 44px; }
.chart .grid { position: absolute; left: 44px; right: 0; border-top: 1px solid var(--border); }
.chart .grid span { position: absolute; left: -44px; top: -8px; width: 40px; text-align: right; font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart .ref { position: absolute; left: 44px; right: 0; border-top: 1.5px dashed var(--text-2); z-index: 2; pointer-events: none; }
.chart .ref span { position: absolute; right: 0; top: -17px; font-size: .68rem; color: var(--text-2); background: var(--surface); padding: 0 4px; border-radius: 4px; }
.chart .cols { position: absolute; left: 44px; right: 0; top: 0; bottom: 0; display: flex; align-items: flex-end; gap: 2px; }
.chart .col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; text-decoration: none; border-radius: 6px; }
.chart .col:hover { background: var(--surface-2); }
.chart .col i { display: block; width: min(70%, 34px); background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.chart .col.dim i { background: var(--accent-soft); }
.chart .col.sel i { background: var(--accent-strong); }
.chart .col.neg i { background: repeating-linear-gradient(135deg, var(--text-2) 0 2px, transparent 2px 6px); box-shadow: inset 0 0 0 1.5px var(--text-2); }
.x-labels { display: flex; gap: 2px; padding-left: 44px; }
.x-labels span { flex: 1; text-align: center; font-size: .68rem; color: var(--muted); overflow: hidden; white-space: nowrap; }
.chart-legend { font-size: .75rem; color: var(--text-2); margin-top: 6px; }
#tip {
  position: fixed; z-index: 100; pointer-events: none; background: var(--text); color: var(--bg);
  padding: 6px 10px; border-radius: 8px; font-size: .8rem; line-height: 1.35; max-width: 240px;
  opacity: 0; transform: translateY(4px); transition: opacity .1s, transform .1s; white-space: pre-line;
}
#tip.show { opacity: 1; transform: none; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
tfoot td { font-weight: 700; border-bottom: 0; }

/* ===== Forms / dialog ===== */
dialog#sheet {
  border: 0; padding: 0; background: var(--surface); color: var(--text);
  width: 100%; max-width: 520px; max-height: 92vh; border-radius: 18px 18px 0 0;
  margin: auto auto 0; box-shadow: 0 -8px 40px rgba(0,0,0,.25);
}
@media (min-width: 600px) { dialog#sheet { margin: auto; border-radius: 18px; } }
dialog#sheet::backdrop { background: rgba(0,0,0,.45); }
.sheet-form { display: flex; flex-direction: column; max-height: 92vh; }
.sheet-form > header { display: flex; align-items: center; padding: 14px 16px 6px; gap: 8px; }
.sheet-form > header h2 { flex: 1; font-size: 1.1rem; }
.sheet-body { padding: 6px 16px 12px; overflow-y: auto; }
.sheet-form > footer { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); align-items: center; }
.sheet-form > footer .sp { flex: 1; }
.field { margin: 12px 0; }
.field > label, .field > .lbl { display: block; font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field .hint { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.sheet-erro { margin: 4px 16px 12px; padding: 10px 12px; border-radius: 10px; font-size: .88rem; font-weight: 600;
  color: var(--critical-ink); background: color-mix(in srgb, var(--critical) 12%, transparent); border: 1px solid color-mix(in srgb, var(--critical) 40%, transparent); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=month], input[type=search], input:not([type]), select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); outline: none; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input.big { font-size: 1.6rem; font-weight: 700; padding: 10px 12px; font-variant-numeric: tabular-nums; }
textarea { min-height: 80px; resize: vertical; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f-row .field { margin: 6px 0; }
.radio-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.radio-chips label { position: relative; }
.radio-chips input { position: absolute; opacity: 0; pointer-events: none; }
.radio-chips input + span {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .86rem;
}
.radio-chips input:checked + span { background: var(--text); color: var(--bg); border-color: var(--text); }
.radio-chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { position: relative; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--text); }

/* ===== Sincronização ===== */
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  border-radius: 999px; padding: 4px 10px 4px 8px; font-size: .75rem; font-weight: 600; cursor: pointer;
}
.sync-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.sync-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.sync-pill.s-ok i { background: var(--good); }
.sync-pill.s-pend i { background: var(--warn); }
.sync-pill.s-erro i { background: var(--critical); }
.sync-pill.s-erro { color: var(--critical-ink); }
.sync-pill.s-sinc i { background: var(--accent); animation: pulso 1s ease-in-out infinite alternate; }
@keyframes pulso { from { opacity: .3; } to { opacity: 1; } }
.page-head .month-nav { min-width: 250px; }
pre.code { background: var(--surface-2); border-radius: 8px; padding: 10px; font-size: .74rem; overflow-x: auto; white-space: pre; margin: 8px 0; }
code { font-size: .85em; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.sheet-body .kpis { grid-template-columns: 1fr 1fr; }
.sheet-body .kpis > .kpi { grid-column: auto !important; }
.sheet-body .kpis .val { font-size: 1.1rem; }
/* Gráfico por categoria/tipo (barras horizontais) */
.hb-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: -4px 0 6px; }
.hb-total b { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.hb { display: flex; flex-direction: column; }
.hb-row { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 9px 4px; cursor: pointer; color: inherit; border-radius: 8px; }
.hb-row:last-child { border-bottom: 0; }
.hb-row:hover { background: var(--surface-2); }
.hb-top { display: flex; gap: 8px; align-items: baseline; }
.hb-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hb-val { font-weight: 600; }
.hb-pct { width: 36px; text-align: right; color: var(--muted); font-size: .78rem; }
.hb-track { display: block; height: 10px; margin-top: 6px; }
.hb-track i { display: block; height: 100%; min-width: 2px; background: var(--accent); border-radius: 0 4px 4px 0; }
.hb-track i.neg { background: repeating-linear-gradient(135deg, var(--text-2) 0 2px, transparent 2px 6px); box-shadow: inset 0 0 0 1.5px var(--text-2); }
.hb-row .meta-line { display: flex; gap: 8px; font-size: .74rem; color: var(--muted); margin-top: 4px; }
.row .quem { font-weight: 600; color: var(--text-2); }
.rec-row[data-act] { cursor: pointer; }
.rec-row[data-act]:hover { background: var(--surface-2); }
.rec-row[data-act]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rec-row.atraso .t { color: var(--critical-ink); }
.row .row-ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.row .dia { flex: none; width: 42px; font-size: .82rem; color: var(--text-2); }

/* ===== Misc ===== */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 90px); transform: translateX(-50%) translateY(10px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem;
  opacity: 0; transition: .2s; z-index: 200; pointer-events: none; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); margin-bottom: 14px; font-size: .88rem; }
.banner .t { flex: 1; }
:root[data-theme="dark"] .banner { color: #f0efec; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.thumbs button { padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; aspect-ratio: 4/3; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.92); display: flex; flex-direction: column; }
.viewer .bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #fff; }
.viewer .bar .t { flex: 1; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .bar button { color: #fff; }
.viewer .bar button:hover { background: rgba(255,255,255,.12); }
.viewer .img-wrap { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 8px; }
.viewer img { max-width: 100%; height: auto; background: #fff; }
.viewer.zoom img { max-width: none; }
.note-text { white-space: pre-wrap; font-size: .9rem; color: var(--text-2); margin-top: 6px; }
.welcome { max-width: 520px; margin: 8vh auto 0; text-align: center; }
.welcome img { width: 72px; height: 72px; border-radius: 18px; }
.welcome h1 { margin: 14px 0 8px; font-size: 1.6rem; }
.welcome p { color: var(--text-2); }
.welcome .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.welcome .actions .btn { padding: 13px; }
.menu-list a { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.menu-list a:last-child { border-bottom: 0; }
.menu-list svg { width: 20px; height: 20px; color: var(--text-2); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .sp { flex: 1; }
.pill-status { display: inline-flex; align-items: center; gap: 4px; }
.ok-ico { color: var(--good-ink); display: inline-flex; flex: none; }
.ok-ico svg { width: 18px; height: 18px; }
details.help summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details.help { font-size: .9rem; color: var(--text-2); }
details.help ol, details.help ul { padding-left: 20px; }
