/* Fontul interfeței, servit local. */
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/source-sans-3-latin-ext.c6ba61588d7d.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/source-sans-3-latin.9ef356ea553a.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Teme: culorile sunt doar aici. Accentul se schimbă prin data-accent, tema prin data-theme. */
:root {
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #eef1f6; --text: #18212d; --muted: #5b6676;
  --line: #dfe4eb; --error: #b3261e; --error-bg: #fdeceb; --ok: #1b6e3c; --ok-bg: #e5f3ea;
  --warn: #8a5a00; --warn-bg: #fff3d4; --violet: #6a45b5; --shadow: 0 1px 2px rgb(16 24 40 / 5%);
  --accent: #1f5fae; --accent-contrast: #ffffff; --accent-soft: #e5eefa;
  color-scheme: light;
}
:root[data-accent="green"] { --accent: #1c7a54; --accent-soft: #e0f3ea; }
:root[data-accent="violet"] { --accent: #6a45b5; --accent-soft: #eee8fa; }
:root[data-accent="amber"] { --accent: #a4560a; --accent-soft: #fbeedd; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161d; --surface: #1a2029; --surface-2: #232b36; --text: #e6eaf0; --muted: #9ba6b4;
    --line: #313a47; --error: #ff9d94; --error-bg: #3a1f1d; --ok: #7fd6a0; --ok-bg: #1a3326;
    --warn: #eec26a; --warn-bg: #352a11; --violet: #c4b2f5; --shadow: none;
    --accent: #80b3f1; --accent-contrast: #0c1622; --accent-soft: #1e3149;
    color-scheme: dark;
  }
  :root:not([data-theme="light"])[data-accent="green"] { --accent: #6fd1a7; --accent-soft: #1b3a2e; }
  :root:not([data-theme="light"])[data-accent="violet"] { --accent: #b9a0f2; --accent-soft: #2e2547; }
  :root:not([data-theme="light"])[data-accent="amber"] { --accent: #edb06a; --accent-soft: #3b2b17; }
}
:root[data-theme="dark"] {
  --bg: #11161d; --surface: #1a2029; --surface-2: #232b36; --text: #e6eaf0; --muted: #9ba6b4;
  --line: #313a47; --error: #ff9d94; --error-bg: #3a1f1d; --ok: #7fd6a0; --ok-bg: #1a3326;
  --warn: #eec26a; --warn-bg: #352a11; --violet: #c4b2f5; --shadow: none;
  --accent: #80b3f1; --accent-contrast: #0c1622; --accent-soft: #1e3149;
  color-scheme: dark;
}
:root[data-theme="dark"][data-accent="green"] { --accent: #6fd1a7; --accent-soft: #1b3a2e; }
:root[data-theme="dark"][data-accent="violet"] { --accent: #b9a0f2; --accent-soft: #2e2547; }
:root[data-theme="dark"][data-accent="amber"] { --accent: #edb06a; --accent-soft: #3b2b17; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15.5px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--accent); text-underline-offset: 2px; }
h1 { font-size: 1.55rem; line-height: 1.2; margin: 0 0 6px; font-weight: 700; text-wrap: balance; }
h2 { font-size: 1.08rem; margin: 28px 0 10px; }
h3 { font-size: 1rem; margin: 20px 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* Structura paginii */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.04rem; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-contrast); display: grid; place-items: center; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.menu-toggle { display: none; }
.nav { display: flex; flex-direction: column; flex: 1; padding: 0 10px 12px; }
.nav > a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.nav > a { display: flex; align-items: center; gap: 9px; }
.nav > a .icon { width: 17px; height: 17px; color: var(--muted); }
.nav > a.current .icon { color: var(--accent); }
.nav-count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 10px; font-size: .74rem; font-weight: 700; line-height: 1.6; text-align: center; background: var(--warn-bg); color: var(--warn); }
.nav-count.is-blocking { background: var(--error-bg); color: var(--error); }
.nav > a:hover { background: var(--surface-2); }
.nav > a.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-group { margin: 14px 10px 3px; font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
/* Contul, jos în bara laterală: butonul deschide meniul deasupra lui. */
.account { position: sticky; bottom: 0; margin-top: auto; padding-block: 10px 4px; border-top: 1px solid var(--line); background: var(--surface); }
.account-button { list-style: none; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.account-button::-webkit-details-marker { display: none; }
.account-button:hover, .account[open] .account-button { background: var(--surface-2); }
.account-button > .icon { margin-left: auto; width: 16px; height: 16px; color: var(--muted); }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-contrast); font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.account-text { display: grid; min-width: 0; line-height: 1.25; }
.account-text strong { font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-text span { font-size: .8rem; color: var(--muted); }
.account-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 10px 30px rgb(16 24 40 / 18%); display: grid; gap: 1px; }
.account-email { margin: 0; padding: 7px 10px 8px; font-size: .84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu a, .account-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; font-size: .93rem; font-weight: 400; text-decoration: none; text-align: left; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--surface-2); filter: none; }
.account-menu .icon { width: 17px; height: 17px; color: var(--muted); }
.account-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.account-menu form { margin: 0; }
.month-box { margin: 6px 0 4px; background: var(--surface-2); border-radius: 9px; padding: 8px 10px; display: grid; gap: 2px; }
.month-box-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.month-box-row { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.month-box-row strong { font-size: 1.12rem; }
.month-box-row span { color: var(--muted); font-size: .85rem; font-weight: 400; }
.prefs { padding: 10px; display: grid; gap: 6px; font-size: .85rem; }
.prefs label, .pref-label { color: var(--muted); }
.swatches { display: flex; gap: 8px; }
.prefs-card .prefs { padding: 0 0 8px; max-width: 280px; font-size: .95rem; }
.prefs-card p { margin: 0; font-size: .88rem; }
.swatch { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch[data-accent-value="blue"] { background: #1f5fae; }
.swatch[data-accent-value="green"] { background: #1c7a54; }
.swatch[data-accent-value="violet"] { background: #6a45b5; }
.swatch[data-accent-value="amber"] { background: #a4560a; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.content { min-width: 0; }
.page { max-width: 1200px; padding: 20px 30px 48px; }
.narrow { max-width: 720px; padding: 20px 30px 48px; }
.crumbs { padding: 16px 30px 0; font-size: .86rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.auth { max-width: 400px; margin: 0 auto; padding: 8vh 16px 32px; }
.auth .brand { display: flex; margin-bottom: 14px; font-size: 1.2rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; box-shadow: var(--shadow); }
.page-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.page-head > :first-child { min-width: 0; }
.page-head > .actions { margin: 0; }
.subtitle { color: var(--muted); }

/* Acțiuni */
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
button, .button { display: inline-block; padding: 7px 14px; font: inherit; font-size: .95rem; font-weight: 600; color: var(--accent-contrast); background: var(--accent); border: 1px solid var(--accent); border-radius: 7px; cursor: pointer; text-decoration: none; line-height: 1.3; white-space: nowrap; }
button:hover, .button:hover { filter: brightness(1.08); }
.button.secondary, button.secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.button.secondary:hover, button.secondary:hover { background: var(--surface-2); filter: none; }
form.inline { display: inline; margin: 0; }
.row-actions { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; white-space: nowrap; }
button.link.danger { color: var(--error); }
.badge.locked { cursor: help; }
.action-disabled { color: var(--muted); opacity: .75; cursor: not-allowed; }
.actions > .row-actions button.link.danger, .actions > .row-actions .action-disabled { display: inline-block; padding: 7px 14px; font-size: .95rem; font-weight: 600; line-height: 1.3; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.actions > .row-actions button.link.danger:hover { background: var(--surface-2); }
.action-disabled:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
button.link { padding: 0; font-weight: 400; color: var(--accent); background: none; border: 0; text-decoration: underline; text-underline-offset: 2px; }
.danger { color: var(--error); }

/* Formulare */
form > div { margin-bottom: 14px; }
form label, fieldset legend { display: block; font-weight: 600; margin-bottom: 4px; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; padding: 8px 10px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 92px; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0 7px 0 0; vertical-align: -2px; }
form div:has(> input[type=checkbox]) { display: flex; flex-wrap: wrap; align-items: center; }
form div:has(> input[type=checkbox]) > label { order: 2; margin: 0; font-weight: 400; }
form div:has(> input[type=checkbox]) > input { order: 1; }
form div:has(> input[type=checkbox]) > .helptext, form div:has(> input[type=checkbox]) > ul { order: 3; flex-basis: 100%; }
.helptext { display: block; font-size: .86rem; color: var(--muted); margin: 0 0 4px; }
.errorlist { margin: 0 0 6px; padding: 0; list-style: none; color: var(--error); font-size: .9rem; }
fieldset { border: 0; padding: 0; margin: 0; }
div:has(> div > div > label > input[type=checkbox]) > div { max-height: 300px; overflow-y: auto; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
form div > div > div { margin-bottom: 4px; }
form div > div > div > label { font-weight: 400; margin: 0; }
.date-field { display: flex; gap: 6px; }
.date-field input[type=date] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.date-pick { flex: none; padding: 8px 10px; color: var(--text); background: var(--surface-2); border-color: var(--line); font-weight: 400; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; box-shadow: var(--shadow); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 0; }
.inline-form > div { margin: 0; min-width: 180px; }
/* Câmpurile și butoanele de pe același rând au aceeași înălțime, ca să se alinieze. */
input:not([type=checkbox]):not([type=radio]):not(.reading), select:not(#readings select) { min-height: 42px; }
.inline-form > button, .inline-form > .button, .date-field > .date-pick, .form-actions > button, .form-actions > .button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; }
.topbar a { color: inherit; }

/* Mesaje */
.message, .problem { padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; }
.message { background: var(--ok-bg); color: var(--ok); }
.message.warning { background: var(--warn-bg); color: var(--warn); }
.message.error, .problem { background: var(--error-bg); color: var(--error); }
.message ul { margin: 4px 0 0; padding-left: 20px; }

/* Tabele */
.scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child > td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover > td { background: var(--surface-2); }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.empty { color: var(--muted); }

/* Activ și trecut: rândurile încheiate se văd estompat, iar starea e scrisă, nu doar colorată. */
tr.is-past > td { color: var(--muted); background: var(--bg); }
tr.is-past a { color: var(--muted); }
tr.is-future > td { font-style: italic; }
.state { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px 1px 7px; border-radius: 10px; font-size: .8rem; font-weight: 600; font-style: normal; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state-active, .state-ok { background: var(--ok-bg); color: var(--ok); }
.state-past { background: var(--surface-2); color: var(--muted); }
.state-future { background: var(--accent-soft); color: var(--accent); }
.state-warn { background: var(--warn-bg); color: var(--warn); }
.state-error { background: var(--error-bg); color: var(--error); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--surface-2); font-size: .8rem; font-weight: 600; }
.diff { color: var(--error); }
.table-tools { display: flex; justify-content: flex-end; font-size: .86rem; color: var(--muted); margin-bottom: 6px; }
.table-tools label { margin: 0; font-weight: 400; cursor: pointer; }
.hide-past tr.is-past { display: none; }

/* Indicatori: etichetă, iconiță, valoare mare cu unitate, notă. Tonul colorează valoarea și iconița. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin: 12px 0 20px; }
.stat { position: relative; display: grid; gap: 8px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 15px; box-shadow: var(--shadow); --tone: var(--text); }
.stat[data-tone="ok"] { --tone: var(--ok); }
.stat[data-tone="accent"] { --tone: var(--accent); }
.stat[data-tone="violet"] { --tone: var(--violet); }
.stat[data-tone="warn"] { --tone: var(--warn); }
.stat[data-tone="error"] { --tone: var(--error); }
.stat[data-tone="muted"] { --tone: var(--muted); }
.stat-label { display: block; font-size: .76rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); line-height: 1.3; }
.stat:has(> .icon) .stat-label { padding-right: 30px; }
.stat > .icon { position: absolute; top: 13px; right: 14px; width: 22px; height: 22px; color: var(--tone); }
.stat[data-tone="muted"] > .icon, .stat:not([data-tone]) > .icon { color: var(--muted); }
.stat-value { display: block; font-size: 1.9rem; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; color: var(--tone); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-value.diff { --tone: var(--error); }
.stat-value.is-text { font-size: 1.22rem; line-height: 1.25; letter-spacing: 0; }
.stat-unit { font-size: .95rem; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat-note { display: block; font-family: var(--mono); font-size: .8rem; line-height: 1.45; color: var(--muted); }
.stat-note strong { color: var(--tone); font-weight: 600; }
.stat-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 2px 10px; background: var(--surface-2); border-radius: 7px; padding: 6px 10px; font-family: var(--mono); font-size: .8rem; }
.stat-split span { display: grid; color: var(--muted); }
.stat-split strong { color: var(--text); font-weight: 600; }
.stat-split strong.is-tone { color: var(--tone); }
a.stat { display: grid; color: var(--text); text-decoration: none; }
a.stat:hover { border-color: var(--accent); }

/* Carduri care duc mai departe: rapoarte, rulări, încasări */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 18px; }
/* Un singur șablon de card: antet (icon, titlu, stare), cifre într-un panou, notă, acțiune în dreapta jos.
   Tonul cardului (data-tone) colorează iconul, cifra marcată is-tone și butonul. */
.card-link { --tone: var(--accent); display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.card-link[data-tone="ok"] { --tone: var(--ok); }
.card-link[data-tone="warn"] { --tone: var(--warn); }
.card-link[data-tone="error"] { --tone: var(--error); }
.card-link[data-tone="muted"], .card-link[data-tone="past"] { --tone: var(--muted); }
.card-link > p { margin: 0; }
.card-link-head { display: flex; align-items: center; gap: 12px; }
.card-link-head h2 { margin: 0; font-size: 1.1rem; flex: 1; min-width: 0; }
.card-link-head h2 a { color: var(--text); text-decoration: none; }
.card-link-head h2 a:hover { color: var(--tone); }
.card-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent); }
.card-icon .icon { width: 20px; height: 20px; }
.card-link-head > .state, .card-link-head > form { flex: none; }
.card-figures { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 0; }
.card-figures > div { flex: 1 1 auto; display: grid; align-content: start; gap: 2px; padding: 0 16px; min-width: 0; }
.card-figures > div + div { border-left: 1px solid var(--line); }
.card-figures span { font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.card-figures strong { font-size: 1.45rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-figures strong.is-tone { color: var(--tone); }
.card-figures strong small { font-size: .85rem; font-weight: 500; color: var(--muted); }
.card-note { display: flex; gap: 8px; align-items: flex-start; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.card-note .icon { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.card-note strong { font-family: var(--font); font-weight: 600; color: var(--text); }
.card-actions { margin-top: auto; display: flex; justify-content: flex-end; }
.card-action { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px 8px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; white-space: nowrap; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 32%, transparent); }
.card-action:hover { background: color-mix(in srgb, var(--tone) 20%, transparent); }
.card-action .icon { width: 16px; height: 16px; }
button.star { padding: 6px; background: none; border: 0; color: var(--muted); line-height: 0; }
button.star:hover { color: var(--warn); filter: none; }
button.star.is-on { color: var(--warn); }
button.star.is-on .icon { fill: currentColor; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.month-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.month-picker > .button { min-width: 38px; text-align: center; }
.month-picker-label { padding: 0 6px; color: var(--muted); font-variant-numeric: tabular-nums; }
.month-picker-label strong { color: var(--text); font-size: 1.05rem; }

/* Panouri cu listă: probleme, notificări */
.columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 1rem; }
.panel-head a { font-size: .9rem; }
.panel-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.panel-row:last-child { border-bottom: 0; }
.panel-row .muted { font-size: .86rem; }
.panel-row .row-end { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.panel-empty { padding: 14px; color: var(--muted); }

/* Filtre ca jetoane și bară de salvare fixă jos */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
button.chip { padding: 3px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .88rem; font-weight: 500; }
button.chip:hover { filter: none; background: var(--surface-2); }
button.chip[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.savebar { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; box-shadow: 0 -4px 14px rgb(16 24 40 / 8%); }
tr.is-missing > td:first-child { box-shadow: inset 3px 0 0 var(--error); }
tr.is-missing input.reading { border-color: var(--error); }

/* Rezumatul unei rulări și grupurile pe entitate */
.meta-strip { display: flex; flex-wrap: wrap; gap: 8px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; box-shadow: var(--shadow); }
.meta-strip > div { display: grid; }
.meta-strip span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.meta-strip strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; box-shadow: var(--shadow); overflow: hidden; }
.group > summary { list-style: none; display: flex; gap: 12px; align-items: baseline; padding: 11px 14px; cursor: pointer; font-weight: 600; }
.group > summary::-webkit-details-marker { display: none; }
.group > summary::before { content: "▸"; color: var(--muted); width: 10px; }
.group[open] > summary::before { content: "▾"; }
.group[open] > summary { border-bottom: 1px solid var(--line); }
.group > summary .group-total { margin-left: auto; font-variant-numeric: tabular-nums; }
.group .scroll { border: 0; border-radius: 0; box-shadow: none; }
.group-tools { display: flex; justify-content: flex-end; gap: 12px; margin: -4px 0 8px; font-size: .9rem; }

/* Grila de citiri */
input.reading { max-width: 130px; text-align: right; }
#readings select { width: auto; padding: 5px 6px; }
#readings td { vertical-align: middle; }

@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar { position: sticky; z-index: 10; height: auto; max-height: 100vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-head { padding: 10px 16px; }
  .menu-toggle { display: inline-block; padding: 6px 12px; color: var(--text); background: var(--surface-2); border-color: var(--line); }
  .nav { display: none; padding: 0 8px 12px; }
  .nav.open { display: flex; }
  .page, .narrow { padding: 16px 16px 40px; }
  .crumbs { padding: 12px 16px 0; }
  .columns { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .sidebar, .crumbs, .actions, .form-actions { display: none; }
  .shell { display: block; }
  .scroll { border: 0; box-shadow: none; }
}
.auth h1 { margin-bottom: 14px; }
.auth form { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 12px; }
.auth form button { width: 100%; }
.page-head:has(> h2) { margin: 28px 0 10px; align-items: center; }
.page-head > h2 { margin: 0; }
.fold { margin-top: 26px; }
.fold summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
textarea[rows] { min-height: 0; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; color: inherit; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.current { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }

/* Dialogul de confirmare al aplicației */
.confirm-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgb(0 0 0 / 30%); }
.confirm-dialog::backdrop { background: rgb(10 14 20 / 55%); }
.confirm-dialog form { display: grid; gap: 14px; padding: 20px; }
.confirm-head { display: flex; align-items: center; gap: 12px; }
.confirm-head h2 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.confirm-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--error); background: var(--error-bg); }
.confirm-icon .icon { width: 20px; height: 20px; }
.confirm-text { margin: 0; color: var(--muted); }
.confirm-reason { display: grid; gap: 6px; font-weight: 600; }
.confirm-reason[hidden], .confirm-text[hidden] { display: none; }
.confirm-reason .muted { font-weight: 400; }
.confirm-reason textarea { width: 100%; resize: vertical; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
button.danger-button { color: #fff; background: var(--error); border-color: var(--error); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button.danger-button { color: #2a0f0d; } }
:root[data-theme="dark"] button.danger-button { color: #2a0f0d; }

/* Cum a fost înțeles un număr scris cu separatori */
.number-hint { display: block; margin-top: 4px; font-size: .82rem; color: var(--muted); }
.number-hint:empty { display: none; }
.number-hint.is-error { color: var(--error); }
