/* BizSuite hub, design E (2026-10-29): dark sidebar, warm background, indigo accent, round cards.
   Accent tokens (--accent, --onAccent, --accentSoft, --accentOnSoft, --navOn, --navOnText) come
   from /theme.css. Overdue stays in --warn (#A3261A / #FF9C8F) as in design D. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  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;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  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;
}

:root {
  color-scheme: light;
  --bg: #F6F4F1; --surface: #FFFFFF; --text: #20233A; --muted: #63646D;
  --border: #E8E5EA; --track: #F2F0F4; --panel: #ECEBF4; --hero: #ECEBF4; --heroSub: #5D5F6E; --warn: #A3261A;
  --side: #24273D; --sideText: #CED1E7; --sideMuted: #9A9EB8; --sideHover: rgba(255,255,255,.07);
  --sideLine: rgba(255,255,255,.12); --sideStrong: #F4F6FF;
  --shadow: 0 1px 2px rgba(32,35,58,.04), 0 6px 20px rgba(32,35,58,.05);
  --navShadow: 0 8px 28px rgba(32,35,58,.14);
  --fabShadow: 0 6px 18px rgba(32,35,58,.24);
  --tabOn: #E9EAF5;
  --st-open-bg: #E9EAF5; --st-open-fg: #3B4C81;
  --st-paid-bg: #E3F5EA; --st-paid-fg: #17633A;
  --st-over-bg: #FDE7E4; --st-over-fg: #A3261A;
  --st-draft-bg: #EFEDF0; --st-draft-fg: #4F505C;
  --accent: #3B4C81; --onAccent: #FFFFFF; --accentSoft: #E9EAF5; --accentOnSoft: #3B4C81;
  --navOn: #DCDBFE; --navOnText: #262547;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --bg: #151823; --surface: #202331; --text: #F1F4FC; --muted: #AEB2C2;
    --border: #33364A; --track: #272B3C; --panel: #292F44; --hero: #292F44; --heroSub: #B3B8CD; --warn: #FF9C8F;
    --side: #0E111C; --sideText: #CACFDF; --sideMuted: #8E93A8; --sideHover: rgba(255,255,255,.06);
    --sideLine: rgba(255,255,255,.1); --sideStrong: #F4F6FF;
    --shadow: none; --navShadow: 0 8px 24px rgba(0,0,0,.45); --fabShadow: 0 6px 18px rgba(0,0,0,.5);
    --tabOn: #2B3047;
    --st-open-bg: #292F44; --st-open-fg: #B4C4FC;
    --st-paid-bg: #12301F; --st-paid-fg: #7FD9A2;
    --st-over-bg: #3A1A17; --st-over-fg: #FF9C8F;
    --st-draft-bg: #2A2D3B; --st-draft-fg: #BCC0CC;
    --accent: #3A4A80; --onAccent: #FFFFFF; --accentSoft: #292F44; --accentOnSoft: #B4C4FC;
    --navOn: #C6C6F1; --navOnText: #262651;
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #151823; --surface: #202331; --text: #F1F4FC; --muted: #AEB2C2;
  --border: #33364A; --track: #272B3C; --panel: #292F44; --hero: #292F44; --heroSub: #B3B8CD; --warn: #FF9C8F;
  --side: #0E111C; --sideText: #CACFDF; --sideMuted: #8E93A8; --sideHover: rgba(255,255,255,.06);
  --sideLine: rgba(255,255,255,.1); --sideStrong: #F4F6FF;
  --shadow: none; --navShadow: 0 8px 24px rgba(0,0,0,.45); --fabShadow: 0 6px 18px rgba(0,0,0,.5);
  --tabOn: #2B3047;
  --st-open-bg: #292F44; --st-open-fg: #B4C4FC;
  --st-paid-bg: #12301F; --st-paid-fg: #7FD9A2;
  --st-over-bg: #3A1A17; --st-over-fg: #FF9C8F;
  --st-draft-bg: #2A2D3B; --st-draft-fg: #BCC0CC;
  --accent: #3A4A80; --onAccent: #FFFFFF; --accentSoft: #292F44; --accentOnSoft: #B4C4FC;
  --navOn: #C6C6F1; --navOnText: #262651;
}

/* --- base ------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.5; font-feature-settings: "cv11", "ss01";
}
a { color: var(--accentOnSoft); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.warn { color: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accentOnSoft); outline-offset: 2px; }
svg.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.icon.sm { width: 16px; height: 16px; }
svg.icon.lg { width: 20px; height: 20px; }
[hidden] { display: none !important; }

/* --- shell ------------------------------------------------------------------------------ */
.shell { display: flex; min-height: 100vh; align-items: flex-start; }
.sidebar {
  position: sticky; top: 0; flex: 0 0 296px; height: 100vh;
  display: flex; flex-direction: column; padding: 26px 16px 18px;
  background: var(--side); color: var(--sideText); overflow: hidden;
}
/* Brand and account stay put; only the navigation between them scrolls when it is too long. */
.nav-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; padding: 0 6px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; color: var(--sideStrong); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--navOn); color: var(--navOnText);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-mark svg.icon { width: 22px; height: 22px; stroke-width: 2.2; }
.brand-mark:has(img) { background: #fff; border: 1px solid var(--border); overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-word { font-size: 23px; font-weight: 500; letter-spacing: -0.03em; }
.brand-logo { padding: 4px 10px 30px; }
.brand-logo img { display: block; width: 100%; max-width: 210px; height: auto; max-height: 52px; object-fit: contain; object-position: left center; }
.brand-plate { display: block; padding: 8px 12px; border-radius: 12px; background: #fff; }
.logo-preview { display: block; max-width: 280px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 8px; }
.logo-preview.on-light { background: #fff; } .logo-preview.on-dark { background: #1F2333; }
.logo-preview img { display: block; width: 100%; height: auto; max-height: 48px; object-fit: contain; object-position: left center; }
.auth-logo { display: block; width: min(100%, 300px); margin: 0 auto; }
.auth-logo img { display: block; width: 100%; height: auto; }
.auth-logo .for-dark { display: none; }
:root[data-theme=dark] .auth-logo .for-light { display: none; }
:root[data-theme=dark] .auth-logo .for-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .auth-logo .for-light { display: none; }
  :root:not([data-theme=light]) .auth-logo .for-dark { display: block; }
}
.firm { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0 0 20px;
  border: 1px solid var(--sideLine); border-radius: 14px; color: var(--sideStrong); min-width: 0; }
.firm:hover { text-decoration: none; background: var(--sideHover); }
.firm-mark { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.1); color: var(--sideStrong);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
  flex-shrink: 0; overflow: hidden; }
.firm-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.firm-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link { display: flex; align-items: center; gap: 13px; min-height: 42px; padding: 0 12px;
  border-radius: 12px; color: var(--sideText); font-size: 15px; font-weight: 450; }
.nav-link:hover { background: var(--sideHover); color: var(--sideStrong); text-decoration: none; }
.nav-link[aria-current=page] { background: var(--navOn); color: var(--navOnText); font-weight: 550; }
.nav-link .count { margin-left: auto; font-size: 12px; color: var(--sideMuted); font-variant-numeric: tabular-nums; }
.nav-link[aria-current=page] .count { color: var(--navOnText); }
.nav-sep { height: 1px; background: var(--sideLine); margin: 10px 12px; }
.nav-label { font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sideMuted); padding: 22px 12px 6px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-sep.modules + .nav-group { margin-top: 6px; }
.nav-link > span:not(.count) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link > svg.icon { flex-shrink: 0; }
.nav-sep.modules { margin: 14px 12px 4px; }
.nav-link.module.here { color: var(--sideStrong); font-weight: 550; }
.nav-group .nav-link.sub { padding-left: 43px; min-height: 38px; font-size: 14px; }
.nav-group.open { padding-bottom: 6px; }
.sidebar .grow { flex-grow: 1; min-height: 24px; }
.me { display: flex; align-items: center; gap: 10px; padding: 16px 8px 0; margin-top: 10px;
  border-top: 1px solid var(--sideLine); }
.me-text { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; color: var(--sideStrong); }
.me-text:hover { text-decoration: none; }
.me-text .small { color: var(--sideMuted); }
.me .icon-btn.plain { width: 32px; height: 32px; color: var(--sideText); }
.me .icon-btn.plain:hover { background: var(--sideHover); }
.me .avatar { background: var(--navOn); color: var(--navOnText); }
.me-text strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: var(--accentSoft);
  color: var(--accentOnSoft); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

.main { flex: 1 1 560px; min-width: 0; padding: 22px 44px 40px; display: flex; flex-direction: column; gap: 22px; }
.topbar { display: flex; align-items: center; gap: 14px; min-height: 52px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border); }
.crumb { display: flex; align-items: center; gap: 10px; flex-grow: 1; min-width: 0; font-size: 15px;
  font-weight: 500; color: var(--text); }
.crumb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 6px 0 12px; width: min(340px, 34vw);
  border-radius: 12px; background: transparent; border: 1px solid transparent; color: var(--muted); }
.search:focus-within { background: var(--surface); border-color: var(--border); }
.search input { border: 0; outline: 0; background: transparent; color: var(--text); flex-grow: 1; min-width: 0; font-size: 15px; }
.search input::placeholder { color: var(--muted); }
.kbd { font: 500 11px/1 Inter, system-ui, sans-serif; color: var(--muted); padding: 5px 7px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface); white-space: nowrap; }
.theme-switch { display: inline-flex; gap: 2px; padding: 4px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); }
.theme-switch button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 500; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed=true] { background: var(--panel); color: var(--accentOnSoft); font-weight: 600; }
.theme-menu { position: relative; }
.theme-menu > summary { list-style: none; cursor: pointer; }
.theme-menu > summary::-webkit-details-marker { display: none; }
.theme-menu > .theme-switch { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; flex-direction: column;
  min-width: 150px; box-shadow: var(--navShadow); }
.theme-menu > .theme-switch button { width: 100%; justify-content: flex-start; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.pagehead h1 { flex-grow: 1; min-width: 0; }
.icon-btn { width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); display: inline-flex; align-items: center;
  justify-content: center; padding: 0; }
.icon-btn:hover { background: var(--track); }
.icon-btn.plain { border-color: transparent; background: transparent; width: 36px; height: 36px; }
.theme-icon-dark { display: none; }
:root[data-theme=dark] .theme-icon-dark { display: inline; }
:root[data-theme=dark] .theme-icon-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .theme-icon-dark { display: inline; }
  :root:not([data-theme=light]) .theme-icon-light { display: none; }
}
@media (max-width: 1180px) {
  .theme-switch button span { display: none; }
  .search { width: min(260px, 30vw); }
  .main { padding: 22px 28px 40px; }
}

/* mobile parts, hidden on large screens */
.mhead, .tabbar, .fab { display: none; }

/* --- buttons and forms ------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px;
  padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600;
  white-space: nowrap; text-decoration: none; }
.btn:hover { text-decoration: none; filter: brightness(1.04); }
.btn-primary { background: var(--accent); color: var(--onAccent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--track); }
.btn-ghost { background: transparent; color: var(--accentOnSoft); padding: 0 10px; }
.btn-danger { background: var(--surface); color: var(--warn); border-color: var(--border); }
.btn-sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions .spacer { flex-grow: 1; }
form.inline { display: inline; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error { font-size: 12px; color: var(--warn); font-weight: 500; }
.input, .field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=date], .field input[type=time], .field input[type=number], .field input[type=search], .field input[type=url],
.field input[type=tel], .field select, .field textarea {
  height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); width: 100%;
}
.field textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.field input[type=color] { width: 64px; height: 42px; padding: 3px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); }
.field.has-error input, .field.has-error select { border-color: var(--warn); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.check-chip input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.check-chip:has(input:checked) { background: var(--accentSoft); color: var(--accentOnSoft);
  border-color: var(--accentSoft); font-weight: 600; }
.check-chip.disabled { opacity: .55; cursor: default; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); }
.segmented label { display: inline-flex; align-items: center; height: 34px; padding: 0 14px;
  border-radius: 10px; cursor: pointer; font-weight: 500; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--tabOn); color: var(--accentOnSoft); font-weight: 600; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); }

/* --- cards ---------------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.tight { padding: 18px; gap: 6px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 0 4px 6px; }
.card-head h2 { flex-grow: 1; }
.card-head a { font-size: 13px; font-weight: 500; }
.grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.col-2 { flex: 2 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-1 { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

.hero { flex: 2 1 440px; min-width: 0; border-radius: 20px; padding: 26px 28px; background: var(--hero);
  display: flex; flex-direction: column; gap: 20px; }
.hero .greet { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; }
.hero .sub { color: var(--heroSub); margin-top: 4px; }
.kpis { display: flex; flex-wrap: wrap; gap: 12px; }
.kpi { flex: 1 1 150px; display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border-radius: 16px;
  background: var(--track); }
.hero .kpi { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  white-space: nowrap; }
.kpi .value.warn { color: var(--warn); }
a.kpi { color: var(--text); }
a.kpi:hover { text-decoration: none; }
a.kpi:hover .value { text-decoration: underline; text-decoration-thickness: 1px; }
.hero .later { font-size: 12px; color: var(--heroSub); }
.quick { flex: 1 1 260px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.quick-btn { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--text); text-align: left; text-decoration: none; }
.quick-btn:hover { text-decoration: none; background: var(--track); }
.quick-btn .text { display: flex; flex-direction: column; min-width: 0; }
.quick-btn .text strong { font-weight: 600; }
.quick-btn .text span { font-size: 12px; color: var(--muted); }
.quick-btn.soon { opacity: .6; cursor: default; }
.tile { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--accentSoft);
  color: var(--accentOnSoft); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; }

/* rows inside a card */
.trow { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 14px; background: var(--track); }
.trow .body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.trow .title { font-weight: 500; overflow-wrap: anywhere; }
.trow .meta { font-size: 12px; color: var(--muted); }
/* "Heute" of the group (Hilmar 2026-11-09, after his pattern "Daily-Screen"): white panels,
   fine lines, smaller radii, little lavender, red only for what is urgent. */
.daily { --dl-r: 12px; --dl-ink: var(--accent); --dl-amber: #8A5A0B; --dl-ambersoft: #FBF1DC; --dl-redsoft: #FAF0EC; display: block; }
:root[data-theme=dark] .daily { --dl-ink: var(--accentOnSoft); --dl-amber: #E8B84A; --dl-ambersoft: #3A2F16; --dl-redsoft: #3D2C2A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .daily { --dl-ink: var(--accentOnSoft); --dl-amber: #E8B84A; --dl-ambersoft: #3A2F16; --dl-redsoft: #3D2C2A; } }
.dl-welcome { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.dl-eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.dl-welcome h1 { font-size: 30px; letter-spacing: -.03em; font-weight: 600; line-height: 1.2; margin: 0 0 8px; }
.dl-welcome h1 span { color: var(--dl-ink); }
.dl-summary { font-size: 14px; color: var(--muted); }
.dl-summary strong { color: var(--warn); font-weight: 500; }
.dl-metrics { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 14px; margin-bottom: 28px; }
.dl-metric { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--dl-r);
  padding: 18px 20px; min-width: 0; color: var(--text); }
a.dl-metric:hover { text-decoration: none; border-color: var(--muted); }
.dl-metric.lead { border-top: 3px solid var(--dl-ink); padding-top: 16px; }
.dl-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.dl-value { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dl-value small { font-size: 13px; color: var(--muted); letter-spacing: 0; font-weight: 400; }
.dl-track { width: 100%; height: 5px; margin-top: 12px; display: block; }
.dl-track .bg { fill: var(--border); }
.dl-track .fg { fill: var(--dl-ink); }
.dl-foot { display: flex; gap: 6px; font-size: 12px; margin-top: 7px; color: var(--muted); }
.dl-foot .right { margin-left: auto; }
.dl-delta { font-weight: 600; color: var(--text); }
.dl-delta.neg { color: var(--warn); }
.dl-subrow { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.dl-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.dl-badge { display: inline-block; background: var(--dl-redsoft); color: var(--warn); padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.dl-badge.amber { background: var(--dl-ambersoft); color: var(--dl-amber); }
.dl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; align-items: start; }
.dl-main { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.dl-sectionhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dl-sectionhead h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.dl-count { font-size: 11px; background: var(--track); color: var(--muted); padding: 1px 7px; border-radius: 6px; font-weight: 600; }
.dl-hint { font-size: 12px; color: var(--muted); margin-left: auto; }
.dl-tabs { display: flex; gap: 2px; margin-left: 8px; }
.dl-tabs a { font-size: 12px; color: var(--muted); padding: 3px 9px; border-radius: 6px; }
.dl-tabs a[aria-current=true] { background: var(--track); color: var(--text); font-weight: 600; }
.dl-tabs a:hover { text-decoration: none; color: var(--text); }
.dl-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--dl-r); padding: 0 18px; }
.dl-panel.steps .step { border-bottom: 1px solid var(--border); padding: 14px 0; margin: 0; background: transparent; border-radius: 0; }
.dl-panel.steps .step:last-child { border-bottom: 0; }
.dl-empty { padding: 18px 0; color: var(--muted); }
.dl-notice { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.dl-panel > .dl-notice:last-of-type, .dl-more .dl-notice:last-child { border-bottom: 0; }
.dl-more[open] { border-top: 1px solid var(--border); }
.dl-noticeicon { display: grid; place-items: center; color: var(--warn); }
.dl-noticeicon.amber { color: var(--dl-amber); }
.dl-label svg.icon { width: 26px; height: 26px; stroke-width: 1.8; color: var(--dl-ink); }
.dl-sidehead svg.icon { width: 23px; height: 23px; color: var(--dl-ink); }
.dl-noticeicon svg.icon { width: 21px; height: 21px; }
.dl-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: block; }
.dl-noticecopy { display: flex; flex-direction: column; min-width: 0; }
.dl-noticename { font-weight: 500; color: var(--text); }
.dl-noticedesc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dl-noticevalue { text-align: right; min-width: 92px; }
.dl-noticevalue b { display: block; font-size: 15px; font-weight: 600; color: var(--warn); font-variant-numeric: tabular-nums; }
.dl-noticevalue b.amber { color: var(--dl-amber); }
.dl-noticevalue small { display: block; font-size: 11px; color: var(--muted); }
.dl-action { font-size: 12px; font-weight: 500; white-space: nowrap; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--dl-ink); }
.dl-action:hover { text-decoration: none; background: var(--track); }
.dl-more summary { list-style: none; cursor: pointer; color: var(--dl-ink); font-size: 13px; padding: 12px 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.dl-more summary::-webkit-details-marker { display: none; }
.dl-more[open] { display: flex; flex-direction: column; }
.dl-more[open] summary { order: 2; border-top: 1px solid var(--border); }
.dl-more[open] summary .icon { transform: rotate(180deg); }
.dl-more .when-open, .dl-more[open] .when-closed { display: none; }
.dl-more[open] .when-open { display: inline; }
.dl-legend { font-size: 12px; color: var(--muted); margin-top: 8px; }
.dl-side { --dl-rule: color-mix(in srgb, var(--muted) 45%, transparent); border-left: 1px solid var(--dl-rule); padding-left: 24px; min-width: 0; }
.dl-sideblock { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1.5px solid var(--dl-rule); }
.dl-sideblock:last-child { border-bottom: 0; margin-bottom: 0; }
.dl-sidehead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; color: var(--muted); }
.dl-sidehead h2 { font-size: 15px; font-weight: 600; color: var(--text); }
.dl-dateflag { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; color: var(--text); }
.dl-dateflag:hover { text-decoration: none; }
.dl-dateflag > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.dl-datebox { background: var(--track); color: var(--dl-ink); border-radius: 9px; min-width: 46px; text-align: center; padding: 6px 4px; }
.dl-datebox small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.dl-datebox b { display: block; font-size: 20px; font-weight: 600; line-height: 1.1; }
.dl-eventtitle { font-weight: 500; }
.dl-muted { display: block; font-size: 12px; color: var(--muted); }
.dl-agendarow { display: flex; gap: 10px; font-size: 13px; padding: 5px 0; color: var(--text); }
.dl-agendarow .when { color: var(--muted); min-width: 52px; }
.dl-past { font-size: 12px; color: var(--muted); margin: 10px 0; }
.dl-past summary { cursor: pointer; }
.dl-past p { margin: 6px 0 0 12px; }
.dl-info { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.7px solid var(--dl-ink);
  font: 700 13px/1 Georgia, "Times New Roman", serif; color: var(--dl-ink); cursor: help; }
.dl-weekvalue { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.dl-weekvalue small { font-size: 13px; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.dl-weekmarks { display: flex; gap: 4px; margin: 12px 0 8px; }
.dl-weekmarks span { height: 5px; flex: 1; background: var(--border); border-radius: 2px; }
.dl-weekmarks span.on { background: var(--dl-ink); }
.dl-billvalue { font-size: 19px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.dl-bank { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; margin-top: 10px; }
@media (max-width: 1100px) { .dl-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 20px; } .dl-side { padding-left: 18px; } }
@media (max-width: 899px) {
  .dl-welcome { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dl-welcome h1 { font-size: 26px; }
  .dl-welcome .btn { display: none; }
  .dl-metrics { grid-template-columns: 1fr; gap: 10px; }
  .dl-layout { grid-template-columns: 1fr; }
  .dl-side { border-left: 0; padding: 20px 0 0; border-top: 1.5px solid var(--dl-rule); }
  .dl-hint, .dl-action { display: none; }
  .dl-sectionhead { flex-wrap: wrap; }
  .dl-notice { grid-template-columns: 20px minmax(0, 1fr) auto; }
}
.trow.done .title { text-decoration: line-through; color: var(--muted); }
.trow a.title { color: var(--text); }
.checkbox { width: 24px; height: 24px; flex-shrink: 0; border-radius: 8px; border: 1.5px solid var(--muted);
  background: var(--surface); color: var(--onAccent); display: flex; align-items: center;
  justify-content: center; padding: 0; }
.checkbox svg { width: 14px; height: 14px; stroke-width: 3; visibility: hidden; }
.checkbox[aria-pressed=true] { background: var(--accent); border-color: var(--accent); }
.checkbox[aria-pressed=true] svg { visibility: visible; }

.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px;
  font-weight: 600; white-space: nowrap; background: var(--surface); color: var(--muted); }
.pill.open { background: var(--st-open-bg); color: var(--st-open-fg); }
.pill.paid { background: var(--st-paid-bg); color: var(--st-paid-fg); }
.pill.over { background: var(--st-over-bg); color: var(--st-over-fg); }
.pill.draft { background: var(--st-draft-bg); color: var(--st-draft-fg); }

.progress { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.progress .bar { height: 8px; border-radius: 4px; background: var(--accent); }
.pct-0{width:0}
.pct-5{width:5%}.pct-10{width:10%}.pct-15{width:15%}.pct-20{width:20%}.pct-25{width:25%}
.pct-30{width:30%}.pct-35{width:35%}.pct-40{width:40%}.pct-45{width:45%}.pct-50{width:50%}
.pct-55{width:55%}.pct-60{width:60%}.pct-65{width:65%}.pct-70{width:70%}.pct-75{width:75%}
.pct-80{width:80%}.pct-85{width:85%}.pct-90{width:90%}.pct-95{width:95%}.pct-100{width:100%}
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

/* list toolbar and row cards */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.toolbar .spacer { flex-grow: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); }
.filter { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 10px;
  color: var(--text); font-weight: 500; white-space: nowrap; }
.filter:hover { background: var(--track); text-decoration: none; }
.filter .count { color: var(--muted); font-weight: 500; }
.filter[aria-current=true] { background: var(--tabOn); color: var(--accentOnSoft); font-weight: 600; }
.filter[aria-current=true] .count { color: var(--accentOnSoft); }
.list { display: flex; flex-direction: column; gap: 8px; }
.rowcard { display: grid; grid-template-columns: auto minmax(200px, 1.6fr) minmax(120px, 1fr) auto;
  gap: 16px; align-items: center; padding: 11px 18px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); }
a.rowcard:hover { text-decoration: none; background: var(--track); }
.rowcard .main-col { display: flex; flex-direction: column; min-width: 0; }
.rowcard .main-col strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowcard .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowcard .tags { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.taskcard { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.taskcard .body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.taskcard .title { font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.taskcard.done .title { text-decoration: line-through; color: var(--muted); }
.taskcard .meta { font-size: 12px; color: var(--muted); }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); border-radius: 16px;
  border: 1px dashed var(--border); }

/* detail pages */
.detail-head { display: flex; align-items: center; gap: 16px; }
.detail-head .tile { width: 52px; height: 52px; border-radius: 14px; font-size: 16px; }
.dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl-item { display: flex; gap: 12px; align-items: flex-start; }
.tl-item .tile { width: 32px; height: 32px; border-radius: 10px; }
.tl-item .body { flex-grow: 1; min-width: 0; }
.timeline.ruled { gap: 0; }
.timeline.ruled .tl-item { padding: 16px 0; border-top: 1px solid var(--border); }
.changes { margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.changes li { overflow-wrap: anywhere; }
.changes del { color: var(--warn); text-decoration: line-through; }
.changes ins { text-decoration: none; color: var(--text); }
.subnav { display: flex; flex-wrap: wrap; gap: 4px; }

/* flashes */
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px;
  background: var(--st-paid-bg); color: var(--st-paid-fg); font-weight: 500; }
.flash.error { background: var(--st-over-bg); color: var(--st-over-fg); }
.notice { padding: 12px 16px; border-radius: 14px; background: var(--track); color: var(--muted); }

/* auth pages */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 28px; gap: 18px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; justify-content: center; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr { background: #fff; border-radius: 14px; padding: 8px; align-self: center; line-height: 0; }
.qr svg { width: 200px; height: 200px; }
.secret { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; letter-spacing: .06em;
  word-break: break-all; background: var(--track); padding: 8px 12px; border-radius: 10px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* mail */
.mailbody { white-space: pre-wrap; font-family: inherit; margin: 0; background: var(--track);
  padding: 16px; border-radius: 14px; overflow-wrap: anywhere; }

/* sales */
.grow { flex-grow: 1; min-width: 0; }
.intcard { grid-template-columns: auto minmax(0, 1fr) auto; padding: 14px 18px; }
.intcard .main-col { gap: 2px; }
.intcard .sub { font-size: 13px; }
.loancard { grid-template-columns: auto minmax(0, 1fr) auto auto; padding: 14px 18px; }
.loancard .sub { font-size: 13px; }
.loancard .amount { text-align: right; font-weight: 600; display: flex; flex-direction: column; white-space: nowrap; }
.loancard .amount .sub { font-weight: 400; }
.doccard { grid-template-columns: auto minmax(180px, 1.6fr) minmax(110px, 1fr) minmax(90px, auto) 120px; }
.doccard .amount { text-align: right; font-weight: 600; display: flex; flex-direction: column; }
.doccard .amount .sub { font-weight: 400; }
.holdings-list .doccard { grid-template-columns: auto minmax(180px, 1.6fr) minmax(110px, 1fr) 150px 120px; }
.steer-list .doccard { grid-template-columns: auto minmax(220px, 1.2fr) minmax(190px, 0.8fr) 200px minmax(200px, 0.6fr); gap: 20px; }
.list-head { background: none; border: 0; box-shadow: none; padding-top: 0; padding-bottom: 0;
  font-size: 12px; font-weight: 600; color: var(--muted); align-items: end; }
.list-head > span { display: flex; flex-direction: column; min-width: 0; }
.list-head .sub { font-weight: 400; font-size: 11px; }
.list-head .num-head { text-align: right; align-items: flex-end; }
.list-head .spacer { width: 40px; }
.list:has(.tile.logo) .list-head .spacer { width: 140px; }
.sum { color: var(--text); font-weight: 600; }
button.rowcard.pick { width: 100%; text-align: left; font: inherit; cursor: pointer; }
button.rowcard.pick:hover { background: var(--track); }
.kv.total { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 2px; font-size: 16px; }
.totals-block { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 4px; }
.pos { width: 22px; flex-shrink: 0; text-align: right; color: var(--muted); }
.pre { white-space: pre-line; }
.btn.wide, form > .btn.wide { width: 100%; }
.problems { margin: 0; padding: 10px 14px 10px 30px; border-radius: 12px; background: var(--st-over-bg);
  color: var(--st-over-fg); font-size: 13px; }
.recipient { border-radius: 14px; background: var(--track); padding: 10px 14px; }
.recipient summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.recipient summary::-webkit-details-marker { display: none; }
.recipient summary .label { font-size: 13px; font-weight: 500; }
.recipient[open] summary { margin-bottom: 12px; }
.line { display: grid; grid-template-columns: 22px minmax(0, 1fr) 36px; gap: 8px 12px; align-items: start;
  padding: 12px; border-radius: 14px; background: var(--track); }
.line.has-error { box-shadow: inset 0 0 0 1px var(--warn); }
.line .pos { padding-top: 11px; grid-row: 1; grid-column: 1; }
.line-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; grid-row: 1; grid-column: 2; }
.line > .icon-btn { grid-row: 1; grid-column: 3; margin-top: 3px; }
.line-main .error { font-size: 12px; color: var(--warn); font-weight: 500; }
.line .input { height: 38px; padding: 0 10px; border-radius: 10px; }
.input.small-text { height: auto; min-height: 34px; padding: 7px 10px; font-size: 13px; resize: vertical; }
.line-nums { grid-row: 2; grid-column: 2; display: grid; gap: 8px; align-items: end;
  grid-template-columns: minmax(56px, .8fr) minmax(76px, 1fr) minmax(84px, 1.1fr) minmax(56px, .8fr) minmax(76px, 1fr) minmax(80px, 1fr); }
.line-nums:not(:has(select[name=line_vat])) {
  grid-template-columns: minmax(56px, .8fr) minmax(76px, 1fr) minmax(84px, 1.1fr) minmax(56px, .8fr) minmax(80px, 1fr); }
.line-nums label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.line-nums .num { text-align: right; }
.line-amount { text-align: right; font-weight: 600; padding-bottom: 9px; }
.add-item { display: inline-flex; gap: 8px; flex-wrap: wrap; flex: 1 1 320px; }
.add-item select { flex: 1 1 200px; }
.add-item select { height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); max-width: 320px; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dunning-grid { display: grid; grid-template-columns: minmax(0, 1fr) 110px 130px; gap: 8px 12px; align-items: center; }
.dunning-grid label { display: flex; flex-direction: column; font-weight: 500; }
.dunning-grid.has-error .input { border-color: var(--warn); }
.text-block { border-radius: 14px; background: var(--track); padding: 10px 14px; }
.text-block summary { cursor: pointer; font-weight: 500; }
.text-block[open] summary { margin-bottom: 10px; }
.attachment { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px;
  background: var(--track); align-self: flex-start; }
a.trow { color: var(--text); }
a.trow:hover { text-decoration: none; background: var(--accentSoft); }

/* finance */
.credit { color: var(--st-paid-fg); }
.tile.credit { background: var(--st-paid-bg); color: var(--st-paid-fg); }
.amount-col { min-width: 96px; text-align: right; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.entry-row .pill { flex-shrink: 0; }
.accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.account-card .balance { font-size: 20px; white-space: nowrap; }
.account-card .kv { align-items: center; }
.kpis.compact { gap: 10px; }
.kpis.compact .kpi { flex-basis: 110px; padding: 10px 14px; border-radius: 12px; gap: 2px; }
.kpis.compact .kpi .label { font-size: 12px; }
.kpis.compact .kpi .value { font-size: 18px; letter-spacing: -0.01em; }
.aging { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 4px; }
.age { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--track); }
.age .label { font-size: 12px; color: var(--muted); }
.age.late { background: var(--st-over-bg); color: var(--st-over-fg); }
.age.late .label { color: var(--st-over-fg); }
.date-inline { min-width: 0; width: auto; }
.upload-card { max-width: 640px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 28px 20px;
  border: 1.5px dashed var(--border); border-radius: 18px; background: var(--track); cursor: pointer; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); }
.dropzone input[type=file] { max-width: 100%; }
.tile.big { width: 56px; height: 56px; border-radius: 16px; background: var(--accentSoft); color: var(--accentOnSoft); }
.receipt-file { align-items: stretch; gap: 10px; }
.receipt-img { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: var(--track); }
.rline-nums { display: grid; gap: 8px; grid-template-columns: minmax(150px, 2fr) minmax(90px, 1fr) minmax(76px, .8fr) minmax(90px, 1fr); }
.rline-nums:not(:has(select[name=line_vat])) { grid-template-columns: minmax(150px, 2fr) minmax(90px, 1fr); }
.rline-nums label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.rline-nums .num { text-align: right; }
.segmented.wrap { flex-wrap: wrap; }
.pay .if-private, .pay .if-open, .pay .if-bank { display: none; }
.pay:has(input[value=private]:checked) .if-private { display: flex; }
.pay:has(input[value=open]:checked) .if-open { display: flex; }
.pay:has(input[value=bank]:checked) .if-bank, .pay:has(input[value=card]:checked) .if-bank,
.pay:has(input[value=open]:checked) .if-bank { display: flex; }
.cat-grid { display: grid; grid-template-columns: minmax(160px, 2fr) 90px 100px 80px auto; gap: 8px 10px; align-items: center; }
.cat-row { display: contents; }
.cat-grid .input { height: 38px; padding: 0 10px; border-radius: 10px; }

/* holdings */
.chart { width: 100%; height: auto; max-height: 260px; display: block; margin: 0 auto; }
.chart .axis { stroke: var(--border); stroke-width: 1; }
.chart .tick { font: 11px Inter, sans-serif; fill: var(--muted); }
.chart .bar-in { fill: var(--st-paid-fg); }
.chart .bar-out { fill: var(--warn); opacity: .8; }
.chart .line-actual { stroke: var(--accent); stroke-width: 2.5; fill: var(--accent); }
.chart .line-plan { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; fill: var(--muted); }
.chart path.line-actual, .chart path.line-plan { fill: none; }
.chart circle.line-plan { stroke-dasharray: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 6px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.swatch.in { background: var(--st-paid-fg); } .swatch.out { background: var(--warn); opacity: .8; }
.swatch.actual { background: var(--accent); } .swatch.plan { background: var(--muted); }
/* Invested against value today: two bars on one scale, their ratio is the multiple. */
.vbar-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 120px; grid-template-areas: "label bar num";
  gap: 6px 14px; align-items: center; margin-top: 12px; }
.vbar-label { grid-area: label; font-size: 13px; color: var(--muted); }
.vbar-row .vbar { grid-area: bar; }
.vbar-row .num { grid-area: num; text-align: right; font-variant-numeric: tabular-nums; }
.vbar { display: block; width: 100%; height: 22px; border-radius: 7px; overflow: hidden; }
.vbar .track { fill: var(--track); }
.vbar .seg { stroke: var(--surface); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.seg.out { fill: var(--warn); opacity: .8; }
.seg.back { fill: var(--st-paid-fg); }
.seg.equity { fill: var(--accentOnSoft); }
.seg.loans { fill: color-mix(in srgb, var(--accentOnSoft) 45%, var(--surface)); }
.seg.interest { fill: #D9A021; }
.swatch.back { background: var(--st-paid-fg); } .swatch.equity { background: var(--accentOnSoft); }
.swatch.loans { background: color-mix(in srgb, var(--accentOnSoft) 45%, var(--surface)); }
.swatch.interest { background: #D9A021; }
.vbar-moic { margin-left: auto; color: var(--text); }
.vbar-row + .legend { margin-top: 16px; }
.lights { display: inline-flex; gap: 4px; }
.light { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; font-size: 12px; font-weight: 600; }
.light.green { background: var(--st-paid-bg); color: var(--st-paid-fg); }
.light.amber { background: rgba(217, 160, 33, .18); color: #9A6A00; }
:root[data-theme=dark] .light.amber { color: #E8B84A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .light.amber { color: #E8B84A; } }
.light.red { background: var(--st-over-bg); color: var(--st-over-fg); }
.light.dot { min-width: 9px; width: 9px; height: 9px; padding: 0; margin-left: 4px; vertical-align: 1px; }
.light.dot.green { background: var(--st-paid-fg); } .light.dot.amber { background: #D9A021; } .light.dot.red { background: var(--warn); }
.stack-xs { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.stack-xs .meta { font-size: 12px; color: var(--muted); font-weight: 400; }
.portfolio-hero { flex-basis: auto; }
.scroll-x { overflow-x: auto; }
.grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid-table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 6px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.grid-table td { padding: 3px 6px; vertical-align: middle; white-space: nowrap; }
.grid-table tr.first td { border-top: 1px solid var(--border); padding-top: 8px; }
.grid-table .num { text-align: right; }
.input.cell { height: 32px; width: 108px; padding: 0 8px; border-radius: 8px; text-align: right; }
.select-inline select { border: 0; background: transparent; color: var(--text); height: 40px; outline: 0; }
a.plain-link, a.plain-link:hover { color: var(--text); text-decoration: none; }
.holding-row .lights { margin-right: 6px; flex-direction: column; align-items: flex-end; gap: 3px; }
.lights-year { font-size: 11px; color: var(--muted); }
.lights-pills { display: inline-flex; gap: 4px; }
.lights .light { font-size: 12px; white-space: nowrap; }
.lights-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 12px 4px 2px; }
.lights-legend .light.dot { margin: 0 2px 0 8px; }
.lights-legend .light.dot:first-child { margin-left: 0; }

/* --- today ("Heute", design E) ------------------------------------------------------------ */
.today { display: flex; flex-direction: column; gap: 30px; }
.today-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; padding-top: 10px; }
.today-head > div { flex-grow: 1; min-width: 0; }
.today-date { font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.today-greet { font-size: 46px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.08; }
.today-greet em { font-style: normal; color: var(--accentOnSoft); }
.today-head .btn { height: 50px; padding: 0 22px; border-radius: 14px; font-size: 15px; margin-bottom: 4px; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stat { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 172px; padding: 22px 24px;
  border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--text); min-width: 0; }
a.stat:hover { text-decoration: none; background: var(--track); }
.stat .label { font-size: 14px; font-weight: 500; padding-right: 32px; }
.stat > svg.icon { position: absolute; top: 21px; right: 22px; width: 21px; height: 21px; }
.stat .value { margin-top: auto; font-size: 38px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value small { font-size: 15px; font-weight: 500; letter-spacing: 0; margin-left: 5px; }
.stat .foot { font-size: 14px; color: var(--muted); margin-top: 6px; }
.stat .foot.warn { color: var(--warn); }
.stat.primary { background: var(--accent); color: var(--onAccent); border-color: transparent; }
.stat.primary .label, .stat.primary .foot { color: color-mix(in srgb, var(--onAccent) 82%, var(--accent)); }
a.stat.primary:hover { background: color-mix(in srgb, var(--accent) 92%, #FFFFFF); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: 1px; }
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 30px 40px; align-items: start; }
.today-main, .today-side { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.sec-head { display: flex; align-items: center; gap: 10px; }
.sec-head h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.sec-head .aside { margin-left: auto; font-size: 14px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px;
  padding: 0 7px; border-radius: 7px; background: var(--panel); color: var(--accentOnSoft); font-size: 12px; font-weight: 600; }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--border); margin-top: 12px; }
.tabs a { padding: 10px 0 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a[aria-current=true] { color: var(--accentOnSoft); border-color: var(--accentOnSoft); font-weight: 600; }
.step { display: flex; align-items: flex-start; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.step .checkbox { margin-top: 1px; border-radius: 7px; }
.step .body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.step .title { font-size: 16px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.step .meta { font-size: 13.5px; color: var(--muted); }
.step.done .title { text-decoration: line-through; color: var(--muted); }
.step .avatar { background: var(--panel); color: var(--muted); font-weight: 500; }
.steps .empty { margin-top: 16px; }
.week { background: var(--panel); border-radius: 22px; padding: 22px 26px 24px; display: flex; flex-direction: column; }
.week .sec-head h2, .facts .sec-head h2 { font-size: 18px; }
.week .sec-head svg.icon, .facts .sec-head svg.icon { margin-left: auto; }
.week-num { margin-top: 16px; font-size: 44px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.week-num small { font-size: 18px; font-weight: 400; letter-spacing: 0; margin-left: 8px; color: var(--muted); }
.segs { display: flex; gap: 5px; margin-top: 20px; }
.segs i { flex: 1 1 0; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--accentOnSoft) 20%, var(--panel)); }
.segs i.on { background: var(--accentOnSoft); }
.facts { display: flex; flex-direction: column; gap: 4px; }
.facts .sub { color: var(--muted); margin: 6px 0 4px; }
.facts .kv { padding: 8px 0; font-size: 15px; }
.facts .kv strong { font-weight: 600; }
.facts .rule { border-top: 1px solid var(--border); margin: 10px 0 8px; }
.facts p { font-size: 14.5px; }
.facts a.strong { color: var(--text); font-weight: 600; }
.follow { display: flex; flex-direction: column; }
.follow-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.follow .sec-head { padding-bottom: 14px; }
.follow-row .tile { background: var(--surface); color: var(--muted); border: 1px solid var(--border); font-weight: 500; }
.follow-row .body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.follow-row .title { font-size: 16px; font-weight: 500; color: var(--text); }
.follow-row .meta { font-size: 13.5px; color: var(--muted); }
.follow-row .amount { text-align: right; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.follow-row .amount small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.follow-row .btn { flex-shrink: 0; }
/* Company logos: white ground for every tile variant, as most logos are made for light paper. */
.tile.logo, .tile.big.logo, .follow-row .tile.logo { background: #FFFFFF; border: 1px solid var(--border);
  padding: 3px; overflow: hidden; }
.tile.logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
/* Logos are mostly wide wordmarks: a wide field keeps them legible (Hilmar 2026-11-04). In a
   list with logos, tiles without one get the same width so the names stay aligned. */
.tile.logo { width: 140px; height: 44px; padding: 5px 10px; border-radius: 10px; }
.tile.logo img { border-radius: 0; }
:is(.card, .stack, .list):has(.tile.logo) .tile:not(.logo, .credit) { width: 140px; height: 44px; border-radius: 10px; }
.detail-head .tile.logo, .group-card-head .tile.logo { width: 180px; height: 56px; }
.tl-item .tile.logo { width: 96px; height: 32px; padding: 3px 6px; }
@media (max-width: 899px) {
  .tile.logo, :is(.card, .stack, .list):has(.tile.logo) .tile:not(.logo, .credit) { width: 96px; height: 36px; }
  .detail-head .tile.logo, .group-card-head .tile.logo { width: 132px; height: 44px; }
}
.logo-pick { display: flex; align-items: center; gap: 14px; }
.today .quick { display: none; }

/* --- phone layout --------------------------------------------------------------------------- */
@media (max-width: 899px) {
  body { font-size: 15px; }
  .shell { display: block; padding: 0; }
  .sidebar, .topbar { display: none; }
  .main { padding: 4px 16px 128px; gap: 14px; }
  .mhead { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; }
  .mhead h1 { font-size: 22px; flex-grow: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mhead .icon-btn { width: 44px; height: 44px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; z-index: 20;
    left: 16px; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); padding: 6px; border-radius: 24px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--navShadow); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    height: 54px; border-radius: 18px; color: var(--muted); font-size: 10px; font-weight: 500; }
  .tab:hover { text-decoration: none; }
  .tab svg.icon { width: 21px; height: 21px; }
  .tab[aria-current=page] { background: var(--accentSoft); color: var(--accentOnSoft); font-weight: 600; }
  .fab { display: flex; position: fixed; z-index: 21; right: 20px; bottom: calc(104px + env(safe-area-inset-bottom));
    width: 56px; height: 56px; border-radius: 18px; background: var(--accent); color: var(--onAccent);
    box-shadow: var(--fabShadow); align-items: center; justify-content: center; }
  .fab svg.icon { width: 24px; height: 24px; stroke-width: 2.2; }
  .hero { padding: 18px 20px; gap: 14px; flex-basis: 100%; }
  .hero .greet { font-size: 18px; }
  .hero .sub { font-size: 13px; margin-top: 2px; }
  .kpis, .kpis.compact { gap: 10px; }
  .kpi { flex-basis: 120px; padding: 10px 14px; border-radius: 12px; }
  .kpi .label { font-size: 12px; }
  .kpi .value { font-size: 18px; }
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; flex-basis: 100%; }
  .quick-btn { flex-direction: column; gap: 6px; padding: 14px 6px; text-align: center; font-size: 12px; }
  .quick-btn .text span { display: none; }
  .card { padding: 14px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; border: 0;
    background: transparent; gap: 8px; border-radius: 0; }
  .filter { height: 38px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px;
    font-weight: 600; flex-shrink: 0; }
  .filter[aria-current=true] { background: var(--accentSoft); border-color: var(--accentSoft); }
  .rowcard { display: flex; gap: 12px; padding: 12px 14px; }
  .rowcard .main-col { flex-grow: 1; }
  .rowcard .hide-sm { display: none; }
  .vbar-row { grid-template-columns: minmax(0, 1fr) max-content; grid-template-areas: "label num" "bar bar"; }
  .intcard, .loancard { align-items: flex-start; }
  .intcard .main-col strong, .intcard .sub, .loancard .main-col strong, .loancard .main-col .sub {
    white-space: normal; overflow-wrap: anywhere; }
  .intcard .tags { flex-shrink: 0; }
  .loancard { flex-wrap: wrap; }
  .loancard .main-col { flex-basis: calc(100% - 52px); }
  .loancard .tags { margin-left: 52px; }
  .loancard .amount { margin-left: auto; align-items: flex-end; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .btn, .input, .field input, .field select { height: 44px; }
  .field input[type=checkbox], .field input[type=radio] { height: auto; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .toolbar .search-inline { width: 100%; }
  .checkbox { width: 26px; height: 26px; }
  .pagehead { display: none; }
  .today { gap: 20px; }
  .today-head { padding-top: 0; }
  .today-head .btn { display: none; }
  .today-date { font-size: 11px; margin-bottom: 6px; }
  .today-greet { font-size: 28px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-row .stat.primary { grid-column: 1 / -1; }
  .stat { min-height: 0; padding: 16px 18px; border-radius: 18px; }
  .stat > svg.icon { top: 15px; right: 16px; width: 19px; height: 19px; }
  .stat .label { font-size: 13px; }
  .stat .label { padding-right: 24px; }
  .stat .value { font-size: 22px; margin-top: 10px; white-space: normal; overflow-wrap: anywhere; }
  .stat.primary .value { font-size: 28px; }
  .stat .value small { font-size: 12px; margin-left: 3px; }
  .stat .foot { font-size: 12.5px; }
  .today .quick { display: grid; }
  .today-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .sec-head h2 { font-size: 19px; }
  .step { gap: 12px; padding: 14px 0; }
  .step .title, .follow-row .title { font-size: 15px; }
  .follow-row { gap: 12px; flex-wrap: wrap; }
  .follow-row .body { flex-basis: 150px; }
  .follow-row .btn { display: none; }
}
.search-inline { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); min-width: 220px; width: min(100%, 380px); }
.search-inline input { border: 0; outline: 0; background: transparent; color: var(--text); flex-grow: 1; min-width: 0; height: 40px; }
@media (min-width: 900px) { .only-phone { display: none !important; } }
@media (max-width: 899px) { .only-desk { display: none !important; } }
@media (max-width: 899px) {
  .doccard .amount { margin-left: auto; align-items: flex-end; gap: 4px; flex-shrink: 0; }
  .steer-list .doccard .amount { flex-shrink: 1; min-width: 0; max-width: 40%; white-space: nowrap; }
  .steer-list .doccard .amount .sub { max-width: 100%; }
  .line { grid-template-columns: 18px minmax(0, 1fr) 36px; }
  .line-nums { grid-column: 2 / 4; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .line-nums .line-amount { grid-column: 1 / -1; padding: 0; }
  .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dunning-grid { grid-template-columns: minmax(0, 1fr) 72px 92px; }
  .add-item select { max-width: 100%; }
}
@media (max-width: 899px) {
  .quick.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .aging { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aging .age:first-child { grid-column: 1 / -1; }
  .rline-nums { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .rline-nums label:first-child { grid-column: 1 / -1; }
  .rline { grid-template-columns: 18px minmax(0, 1fr) 36px; }
  .cat-grid { grid-template-columns: minmax(0, 1fr) 76px; }
  .cat-grid > span { display: none; }
  .cat-grid select, .cat-grid .btn { grid-column: auto; }
  .amount-col { min-width: 0; font-size: 14px; }
  .entry-row { gap: 10px; padding: 10px; }
  .card-head { flex-wrap: wrap; }
  .card-head form { width: 100%; }
  .card-head form .btn { width: 100%; }
}

/* --- tasks and calendar (stage 5) ----------------------------------------------------------- */
.field > .check-chip { align-self: flex-start; }
svg.icon.xs { width: 13px; height: 13px; vertical-align: -2px; }
.repeat-note { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
details.repeat { border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; background: var(--surface); }
details.repeat > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: 600; }
details.repeat > summary::-webkit-details-marker { display: none; }
details.repeat[open] > summary { margin-bottom: 12px; }
details.repeat .muted { font-weight: 400; }
.check-line { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 8px; }
.segmented a { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 10px;
  font-weight: 500; color: var(--text); }
.segmented a:hover { text-decoration: none; background: var(--track); }
.segmented a[aria-current=true] { background: var(--tabOn); color: var(--accentOnSoft); font-weight: 600; }

.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.cal-nav { display: flex; align-items: center; gap: 6px; flex-grow: 1; min-width: 0; }
.cal-title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-left: 8px; white-space: nowrap; }
.cal-legend { margin-top: -4px; }
.cal-month { border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: var(--surface);
  box-shadow: var(--shadow); }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase;
  letter-spacing: .08em; border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 116px; padding: 6px 6px 8px; border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-week .cal-cell:last-child { border-right: 0; }
.cal-week:last-child .cal-cell { border-bottom: 0; }
.cal-cell.weekend { background: color-mix(in srgb, var(--track) 55%, var(--surface)); }
.cal-cell.out { background: var(--bg); }
.cal-cell.out .cal-daynum { color: var(--muted); font-weight: 400; }
.cal-daynum { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text); }
.cal-daynum:hover { text-decoration: none; background: var(--track); }
.cal-cell.today .cal-daynum { background: var(--accent); color: var(--onAccent); }
.chip { display: block; padding: 2px 7px; border-radius: 7px; font-size: 12px; line-height: 1.45; color: var(--text);
  background: var(--track); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip:hover { text-decoration: none; background: var(--panel); }
.chip .t { font-weight: 600; margin-right: 5px; font-variant-numeric: tabular-nums; }
.chip.bar { background: var(--accentSoft); color: var(--accentOnSoft); font-weight: 600; }
.chip.task { background: transparent; border: 1px dashed var(--border); }
.chip.task .box { display: inline-block; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 3px;
  margin-right: 5px; vertical-align: -1px; }
.chip.task.done { color: var(--muted); text-decoration: line-through; }
.chip.task.over { color: var(--warn); border-color: currentColor; }
.cal-cell .more { color: var(--muted); padding-left: 7px; }

.cal-days { display: flex; flex-direction: column; gap: 14px; }
.cal-day { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.cal-day.today { border-color: var(--accentOnSoft); }
.cal-day-head { display: flex; align-items: center; gap: 10px; }
.cal-day-head h3 { font-size: 15px; font-weight: 600; flex-grow: 1; }
.cal-row { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 12px;
  background: var(--track); color: var(--text); }
.cal-row:hover { text-decoration: none; background: var(--panel); }
.cal-row .when { width: 96px; flex-shrink: 0; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-row.allday { background: var(--accentSoft); }
.cal-row.allday .when { color: var(--accentOnSoft); }
.cal-row .body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.cal-row .title { font-weight: 500; overflow-wrap: anywhere; }
.cal-row .meta { font-size: 12px; color: var(--muted); }

.agenda-row { display: flex; gap: 14px; padding: 9px 0; border-top: 1px solid var(--border); color: var(--text); }
.agenda-row:first-of-type { border-top: 0; }
.agenda-row:hover { text-decoration: none; }
.agenda-row:hover strong { text-decoration: underline; }
.agenda-row .when { width: 88px; flex-shrink: 0; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.agenda-row .what { display: flex; flex-direction: column; min-width: 0; }
.agenda-row .what strong { font-weight: 500; overflow-wrap: anywhere; }
.agenda-row.past { opacity: .55; }
.facts.agenda .sub { margin-top: 0; }

@media (max-width: 899px) {
  .cal-bar { gap: 10px; }
  .cal-bar .segmented { flex-wrap: wrap; }
  .cal-nav { order: -1; flex-basis: 100%; }
  .cal-title { font-size: 17px; }
  .cal-row { gap: 10px; align-items: flex-start; }
  .cal-row .when { width: 50px; font-size: 12px; line-height: 1.35; padding-top: 1px; }
  .cal-row .avatar { display: none; }
  .cal-day { padding: 12px; }
}

/* --- group steering (stage 6) ------------------------------------------------------------- */
.group-table th { vertical-align: bottom; white-space: normal; min-width: 58px; padding: 6px 5px; hyphens: manual; }
.group-table td { padding-left: 5px; padding-right: 5px; }
.group-table th .th-sub { display: block; font-weight: 400; font-size: 11px; }
.group-table td { vertical-align: top; padding-top: 7px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.group-table tr.group-head td { background: var(--track); font-weight: 600; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; }
.group-table tr.sum td { border-top: 2px solid var(--text); border-bottom: 0; font-weight: 600; }
.group-table .name-cell { white-space: normal; min-width: 160px; max-width: 230px; }
.group-table .name-cell .small { display: block; }
.fig { display: inline-flex; align-items: center; justify-content: flex-end; font-variant-numeric: tabular-nums; font-weight: 600; }
.fig-plan { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.fig-plan.warn { color: var(--warn); }
.group-help { margin: 4px 4px 2px; line-height: 1.45; white-space: normal; }
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 8px 4px 0; }
.group-card { display: flex; flex-direction: column; gap: 10px; }
.group-card-head { display: flex; align-items: center; gap: 10px; }
.group-card-head .pill { margin-left: auto; }
.group-card-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 0; }
.group-card-figures div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.group-card-figures dt { color: var(--muted); }
.group-card-figures dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.strike { text-decoration: line-through; }
.input.invalid { border-color: var(--warn); }
.plan-table .input.cell { width: 140px; }
@media (max-width: 899px) { .row-actions { width: 100%; justify-content: flex-start; } }
/* A row card that is a link as a whole and holds a second link (status → month entry). */
.rowcard.linked { position: relative; }
.rowcard.linked:hover { background: var(--track); }
.rowcard.linked a.stretched { color: inherit; text-decoration: none; }
.rowcard.linked a.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.rowcard.linked .above { position: relative; z-index: 1; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.rowcard.linked a.above:hover { filter: brightness(.96); text-decoration: none; }
