@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(../vendor/inter/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(../vendor/inter/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(../vendor/inter/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(../vendor/inter/inter-latin-700-normal.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --brand: #4f46e5;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #eef0f3;
  --canvas: #e5e7eb;
  --hover: rgba(17, 24, 39, .045);
  --row-hover: #fafbfc;
  --border: #e6e8eb;
  --border-strong: #d4d7dc;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #6b7280;
  --faint: #9ca3af;
  --primary: var(--brand);
  --primary-hover: color-mix(in srgb, var(--brand) 84%, #000);
  --primary-soft: color-mix(in srgb, var(--brand) 9%, #fff);
  --primary-border: color-mix(in srgb, var(--brand) 38%, #fff);
  --primary-text: color-mix(in srgb, var(--brand) 72%, #111827);
  --primary-2: color-mix(in srgb, var(--brand) 42%, #fff);
  --green: #16a34a; --green-soft: #dcfce7; --green-text: #166534; --green-border: #bbf7d0;
  --amber: #d97706; --amber-soft: #fef3c7; --amber-text: #92400e; --amber-border: #fde68a;
  --red: #dc2626; --red-soft: #fee2e2; --red-text: #991b1b; --red-border: #fecaca;
  --blue-soft: #e0f2fe; --blue-text: #075985;
  --violet-soft: #f3e8ff; --violet-text: #6b21a8;
  --gray-soft: #f1f2f4;
  --chart-2: #cbd5e1;
  --tooltip: #111827;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, .25), 0 4px 10px -4px rgba(16, 24, 40, .08);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
  --sidebar: 248px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1015;
  --surface: #161920;
  --surface-2: #1b1f27;
  --surface-3: #232833;
  --canvas: #0b0d11;
  --hover: rgba(255, 255, 255, .055);
  --row-hover: #1d2129;
  --border: #272c36;
  --border-strong: #363c48;
  --text: #e8eaef;
  --text-2: #b4bac6;
  --muted: #8a91a0;
  --faint: #636a78;
  --primary: color-mix(in srgb, var(--brand) 90%, #fff);
  --primary-hover: color-mix(in srgb, var(--brand) 62%, #fff);
  --primary-soft: color-mix(in srgb, var(--brand) 20%, #161920);
  --primary-border: color-mix(in srgb, var(--brand) 50%, #161920);
  --primary-text: color-mix(in srgb, var(--brand) 40%, #fff);
  --primary-2: color-mix(in srgb, var(--brand) 45%, #161920);
  --green: #22c55e; --green-soft: rgba(34, 197, 94, .14); --green-text: #86efac; --green-border: rgba(34, 197, 94, .35);
  --amber: #f59e0b; --amber-soft: rgba(245, 158, 11, .15); --amber-text: #fcd34d; --amber-border: rgba(245, 158, 11, .35);
  --red: #f87171; --red-soft: rgba(248, 113, 113, .14); --red-text: #fca5a5; --red-border: rgba(248, 113, 113, .35);
  --blue-soft: rgba(56, 189, 248, .14); --blue-text: #7dd3fc;
  --violet-soft: rgba(168, 85, 247, .16); --violet-text: #d8b4fe;
  --gray-soft: #262b35;
  --chart-2: #3a4150;
  --tooltip: #2b313d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, .6), 0 4px 10px -4px rgba(0, 0, 0, .4);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1015;
    --surface: #161920;
    --surface-2: #1b1f27;
    --surface-3: #232833;
    --canvas: #0b0d11;
    --hover: rgba(255, 255, 255, .055);
    --row-hover: #1d2129;
    --border: #272c36;
    --border-strong: #363c48;
    --text: #e8eaef;
    --text-2: #b4bac6;
    --muted: #8a91a0;
    --faint: #636a78;
    --primary: color-mix(in srgb, var(--brand) 90%, #fff);
    --primary-hover: color-mix(in srgb, var(--brand) 62%, #fff);
    --primary-soft: color-mix(in srgb, var(--brand) 20%, #161920);
    --primary-border: color-mix(in srgb, var(--brand) 50%, #161920);
    --primary-text: color-mix(in srgb, var(--brand) 40%, #fff);
    --primary-2: color-mix(in srgb, var(--brand) 45%, #161920);
    --green: #22c55e; --green-soft: rgba(34, 197, 94, .14); --green-text: #86efac; --green-border: rgba(34, 197, 94, .35);
    --amber: #f59e0b; --amber-soft: rgba(245, 158, 11, .15); --amber-text: #fcd34d; --amber-border: rgba(245, 158, 11, .35);
    --red: #f87171; --red-soft: rgba(248, 113, 113, .14); --red-text: #fca5a5; --red-border: rgba(248, 113, 113, .35);
    --blue-soft: rgba(56, 189, 248, .14); --blue-text: #7dd3fc;
    --violet-soft: rgba(168, 85, 247, .16); --violet-text: #d8b4fe;
    --gray-soft: #262b35;
    --chart-2: #3a4150;
    --tooltip: #2b313d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .25);
    --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, .6), 0 4px 10px -4px rgba(0, 0, 0, .4);
    --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.strong { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-col { display: flex; flex-direction: column; gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }

/* ---------- Boot ---------- */
.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: 0 0 var(--sidebar); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 80%, #fff), color-mix(in srgb, var(--brand) 85%, #000)); display: grid; place-items: center; color: #fff; box-shadow: 0 4px 10px -2px color-mix(in srgb, var(--brand) 45%, transparent); flex: 0 0 auto; }
.brand-name { font-weight: 650; font-size: 14.5px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.nav { padding: 6px 10px; overflow-y: auto; flex: 1; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; margin-bottom: 1px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary-text); }
.nav a.active svg { color: var(--primary); }
.nav a svg { color: var(--faint); }
.nav .count { margin-left: auto; font-size: 11px; background: var(--red-soft); color: var(--red-text); border-radius: 999px; padding: 0 7px; font-weight: 600; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; cursor: pointer; }
.user-chip:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: 0 0 auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--border); }
.content { padding: 8px 28px 48px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 8px 0 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.btn.menu-btn { display: none; }

/* ---------- Search ---------- */
.search { position: relative; flex: 1; max-width: 460px; }
.search input { width: 100%; padding: 8px 12px 8px 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; color: var(--text); box-shadow: var(--shadow-sm); }
.search input:focus { outline: none; border-color: var(--primary-border); box-shadow: var(--ring); }
.search > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
kbd { font-family: var(--font); font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface-2); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 420px; overflow: auto; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.search-results a:hover, .search-results a.sel { background: var(--surface-2); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head.plain { border-bottom: 0; padding-bottom: 4px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 12px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .label { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .icon-bg { position: absolute; right: 16px; top: 16px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, box-shadow .12s; text-decoration: none; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px color-mix(in srgb, var(--brand) 30%, transparent), inset 0 1px 0 rgba(255,255,255,.12); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red-border); }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.xs.icon { width: 26px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 9px 0 0 9px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 9px 9px 0; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.dropdown-menu.up { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }
.dropdown-menu button, .dropdown-menu a { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border: 0; background: none; font: inherit; color: var(--text); border-radius: 8px; cursor: pointer; text-align: left; }
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--surface-2); }
.dropdown-menu button.danger { color: var(--red); }
.dropdown-menu button:disabled { opacity: .45; cursor: not-allowed; }
.dropdown-menu .sep { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown-menu svg { color: var(--muted); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 550; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--red); }
.input, select.input, textarea.input { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); font: inherit; color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.input:focus { outline: none; border-color: var(--primary-border); box-shadow: var(--ring); }
.input.invalid { border-color: var(--red-border); }
.input:disabled, .input[readonly] { background: var(--surface-2); color: var(--muted); }
.input.sm { height: 30px; font-size: 13px; padding: 0 9px; border-radius: 8px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 9px 0 0 9px; }
.input-group .addon { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 9px 9px 0; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 36px; height: 20px; background: var(--border-strong); border-radius: 999px; transition: background .15s; position: relative; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.c-1 { grid-column: span 1; } .c-2 { grid-column: span 2; } .c-3 { grid-column: span 3; } .c-4 { grid-column: span 4; } .c-5 { grid-column: span 5; } .c-6 { grid-column: span 6; } .c-7 { grid-column: span 7; } .c-8 { grid-column: span 8; } .c-9 { grid-column: span 9; } .c-12 { grid-column: span 12; }
.segmented { display: inline-flex; max-width: 100%; overflow-x: auto; background: var(--surface-3); padding: 3px; border-radius: 10px; gap: 2px; }
.segmented button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 550; padding: 5px 12px; border-radius: 7px; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented .n { font-size: 11px; color: var(--faint); font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; user-select: none; }
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table th:first-child { border-top-left-radius: var(--radius-lg); }
.table th:last-child { border-top-right-radius: var(--radius-lg); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--row-hover); }
.table .r { text-align: right; }
.table.compact td { padding: 8px 14px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .input { max-width: 300px; }
.cell-title { font-weight: 550; color: var(--text); }
.cell-sub { font-size: 12.5px; color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 550; padding: 2px 9px; border-radius: 999px; white-space: nowrap; line-height: 18px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-gray { background: var(--gray-soft); color: var(--text-2); }
.b-blue { background: var(--blue-soft); color: var(--blue-text); }
.b-green { background: var(--green-soft); color: var(--green-text); }
.b-amber { background: var(--amber-soft); color: var(--amber-text); }
.b-red { background: var(--red-soft); color: var(--red-text); }
.b-violet { background: var(--violet-soft); color: var(--violet-text); }
.b-indigo { background: var(--primary-soft); color: var(--primary-text); }

/* ---------- Empty / Alerts ---------- */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .ico { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 14px; }
.empty h3 { color: var(--text); margin-bottom: 4px; font-size: 15px; }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid; font-size: 13.5px; align-items: flex-start; }
.alert svg { flex: 0 0 auto; margin-top: 1px; }
.alert.info { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-text); }
.alert.warn { background: var(--amber-soft); border-color: var(--amber-border); color: var(--amber-text); }
.alert.error { background: var(--red-soft); border-color: var(--red-border); color: var(--red-text); }
.alert.success { background: var(--green-soft); border-color: var(--green-border); color: var(--green-text); }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(17, 24, 39, .42); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .12s ease-out; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: pop .16s ease-out; }
.modal.lg { max-width: 820px; }
.modal.xl { max-width: 1080px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; }
.modal-body { padding: 18px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--tooltip); color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 280px; max-width: 420px; font-size: 13.5px; animation: pop .18s ease-out; }
.toast.error { background: #7f1d1d; }
.toast.success svg { color: #4ade80; }

/* ---------- Detail views ---------- */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.sticky { position: sticky; top: 76px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 0 0 14px; position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); margin-top: 3px; flex: 0 0 auto; }
.timeline .dot.on { border-color: var(--primary); background: var(--primary-soft); }
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--green); border-radius: 999px; }
.totals { width: 100%; max-width: 360px; margin-left: auto; font-size: 13.5px; }
.totals .row { display: flex; justify-content: space-between; padding: 5px 0; color: var(--text-2); }
.totals .row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-size: 16px; font-weight: 650; color: var(--text); }
.pdf-frame { width: 100%; height: 78vh; border: 1px solid var(--border); border-radius: 12px; background: var(--canvas); }

/* ---------- Items editor ---------- */
.items { width: 100%; border-collapse: separate; border-spacing: 0; }
.items th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.items td { padding: 6px; vertical-align: top; border-bottom: 1px solid var(--border); }
.items tr.text-row td { background: var(--surface-2); }
.items .input { height: 34px; }
.items textarea.input { min-height: 34px; height: 34px; padding: 6px 9px; font-size: 13px; }
.items .drag { cursor: grab; color: var(--faint); padding-top: 8px; }
.items .line-total { padding-top: 14px; font-weight: 550; text-align: right; white-space: nowrap; }
.items tr.dragging { opacity: .4; }
.ac { position: relative; }
.ac-list { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; max-height: 280px; overflow: auto; }
.ac-list button { display: flex; justify-content: space-between; gap: 16px; width: 100%; border: 0; background: none; text-align: left; padding: 7px 9px; border-radius: 7px; font: inherit; cursor: pointer; color: var(--text); }
.ac-list button:hover, .ac-list button.sel { background: var(--primary-soft); }
.ac-list button.ac-create { color: var(--primary); border-top: 1px solid var(--border); border-radius: 0 0 7px 7px; margin-top: 2px; }
.ac-list button.ac-create:first-child { border-top: 0; margin-top: 0; border-radius: 7px; }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-stack { width: 100%; max-width: 34px; display: flex; align-items: flex-end; gap: 3px; height: 100%; }
.bar { flex: 1; border-radius: 5px 5px 2px 2px; background: var(--primary); min-height: 2px; transition: height .3s; position: relative; }
.bar.paid { background: var(--primary-2); }
.bar-col .lbl { font-size: 11px; color: var(--muted); }
.bar:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--tooltip); color: #fff; font-size: 11.5px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; z-index: 5; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 550; color: var(--muted); padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.side-tabs { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; }
.side-tabs button { display: flex; align-items: center; gap: 9px; text-align: left; border: 0; background: none; font: inherit; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; cursor: pointer; }
.side-tabs button:hover { background: var(--hover); }
.side-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(1200px 600px at 0% 0%, color-mix(in srgb, var(--brand) 78%, #fff) 0%, var(--brand) 38%, color-mix(in srgb, var(--brand) 35%, #0b0b1a) 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side h2 { font-size: 30px; line-height: 1.2; font-weight: 650; max-width: 440px; letter-spacing: -.02em; }
.auth-side ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; color: rgba(255,255,255,.86); }
.auth-side li { display: flex; gap: 10px; align-items: center; }
.auth-main { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.auth-box { width: 100%; max-width: 380px; }
.glass { position: absolute; right: -80px; bottom: -60px; width: 380px; height: 260px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 18px; transform: rotate(-8deg); }

/* ---------- Designer ---------- */
.designer { display: grid; grid-template-columns: 240px minmax(0, 1fr) 300px; gap: 0; height: calc(100vh - 60px); margin: 0 -28px -48px; border-top: 1px solid var(--border); }
.designer-panel { background: var(--surface); overflow-y: auto; padding: 16px; }
.designer-panel.dp-left { border-right: 1px solid var(--border); }
.designer-panel.dp-right { border-left: 1px solid var(--border); }
.designer-stage { overflow: auto; background: var(--canvas); padding: 32px; position: relative; }
.designer-stage .zoom { position: sticky; top: 0; left: 0; z-index: 5; display: inline-flex; margin-bottom: 12px; }
.page-canvas { background: #fff; box-shadow: 0 10px 30px -10px rgba(0,0,0,.25); position: relative; margin: 0 auto; transform-origin: top center; font-family: "DejaVu Sans", Verdana, sans-serif; color: #1f2937; }
.page-canvas .margin-guide { position: absolute; border: 1px dashed color-mix(in srgb, var(--brand) 25%, transparent); pointer-events: none; }
.page-canvas .flow-guide { position: absolute; left: 0; right: 0; border-top: 2px dashed #f59e0b; pointer-events: none; }
.page-canvas .flow-guide span { position: absolute; right: 6px; top: -18px; background: #f59e0b; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 4px; font-family: var(--font); }
.d-el { position: absolute; overflow: hidden; cursor: move; outline: 1px dashed transparent; line-height: 1.4; }
.d-el:hover { outline-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.d-el.sel { outline: 1.5px solid var(--primary); overflow: visible; z-index: 3; }
.d-el.editing { cursor: text; }
.d-el .handle { position: absolute; width: 9px; height: 9px; background: var(--surface); border: 1.5px solid var(--primary); border-radius: 2px; }
.d-el .handle.se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.d-el .handle.e { right: -5px; top: calc(50% - 4px); cursor: ew-resize; }
.d-el .handle.s { bottom: -5px; left: calc(50% - 4px); cursor: ns-resize; }
.d-el .tag { position: absolute; top: -18px; left: -1px; background: var(--primary); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 4px 4px 0 0; font-family: var(--font); white-space: nowrap; }
.d-el [contenteditable] { outline: none; min-height: 100%; }
.d-el.all-pages { outline: 1px dashed rgba(16,185,129,.35); }
.d-flow { position: absolute; font-size: 8pt; pointer-events: none; opacity: .9; }
.palette button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; margin-bottom: 6px; cursor: pointer; font: inherit; font-weight: 500; color: var(--text); text-align: left; }
.palette button:hover { border-color: var(--primary-border); background: var(--primary-soft); }
.layer-list button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; background: none; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px; color: var(--text-2); text-align: left; }
.layer-list button.sel { background: var(--primary-soft); color: var(--primary-text); }
.layer-list button:hover { background: var(--surface-2); }
.prop-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.prop-row .field > label { font-size: 11px; }
.color-input { display: flex; align-items: center; gap: 6px; }
.color-input input[type=color] { width: 32px; height: 30px; border: 1px solid var(--border-strong); border-radius: 7px; padding: 2px; background: var(--surface); cursor: pointer; }
.fmt-bar { display: flex; gap: 2px; flex-wrap: wrap; padding: 4px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.fmt-bar button { border: 0; background: none; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; color: var(--text-2); font: inherit; }
.fmt-bar button:hover, .fmt-bar button.on { background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.ph-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 9px; padding: 4px; }
.ph-list button { display: block; width: 100%; text-align: left; border: 0; background: none; font-family: var(--mono); font-size: 11.5px; padding: 4px 6px; border-radius: 5px; cursor: pointer; color: var(--text-2); }
.ph-list button:hover { background: var(--primary-soft); color: var(--primary-text); }
.col-list .col { display: grid; grid-template-columns: 20px 1fr 54px; gap: 6px; align-items: center; margin-bottom: 6px; }

/* ---------- API Docs ---------- */
.endpoint { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.method { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; min-width: 54px; text-align: center; }
.m-get { background: var(--green-soft); color: var(--green-text); } .m-post { background: var(--blue-soft); color: var(--blue-text); } .m-put, .m-patch { background: var(--amber-soft); color: var(--amber-text); } .m-delete { background: var(--red-soft); color: var(--red-text); }
pre.code { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.55; margin: 0; }
.token-box { display: flex; gap: 8px; align-items: center; background: #0f172a; color: #a5f3fc; padding: 10px 12px; border-radius: 10px; font-family: var(--mono); font-size: 13px; word-break: break-all; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-2 { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .designer { grid-template-columns: 200px minmax(0, 1fr) 260px; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid > * { grid-column: span 12 !important; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-brand { display: flex !important; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .side-tabs { flex-direction: row; overflow-x: auto; position: static; }
  .side-tabs button { white-space: nowrap; flex: none; }
  .designer { grid-template-columns: 1fr; height: auto; }
  .hide-sm { display: none !important; }
  .search kbd { display: none; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dt { margin-top: 8px; }
}
@media print { .sidebar, .topbar { display: none; } }
.dropdown .user-chip { border: 0; background: none; width: 100%; font: inherit; color: inherit; }
.sidebar-foot .dropdown { display: block; }
.sidebar-foot .dropdown-menu { width: 100%; }

.items th.name-col { min-width: 240px; }
.din-window { position: absolute; border: 1px dashed rgba(14,165,233,.55); background: rgba(14,165,233,.04); pointer-events: none; }
.din-window .din-zone { border-bottom: 1px dashed rgba(14,165,233,.4); }
.din-window span { position: absolute; left: 0; bottom: -16px; font-size: 10px; color: #0284c7; font-family: var(--font); white-space: nowrap; }
.fold-mark { position: absolute; height: 1px; pointer-events: none; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--text-2); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.camera-btn { display: none !important; width: 100%; margin-top: 10px; height: 44px; }
.expense-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.receipt-preview { position: sticky; top: 76px; overflow: hidden; min-height: 320px; background: var(--surface-3); }
@media (max-width: 900px) {
  .camera-btn { display: inline-flex !important; }
  .expense-grid { grid-template-columns: 1fr; }
  .receipt-preview { position: static; max-height: 60vh; overflow: auto; }
}

/* ---------- Aktualisierung (self-updater) */
.label-sm { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.update-version { font-size: 22px; font-weight: 650; margin-top: 4px; }
.privacy-note { font-size: 12.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; line-height: 1.5; }
.privacy-note p { margin: 0; }
.privacy-note ul { margin: 4px 0 6px; padding-left: 18px; }
.changelog-entry + .changelog-entry { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border, #eceef2); }
.changelog-entry h4 { margin: 0 0 6px; font-size: 14px; }
.md { font-size: 13.5px; line-height: 1.55; }
.md ul, .md ol { margin: 4px 0; padding-left: 20px; }
.md p { margin: 4px 0; }
.md h3, .md h4, .md h5 { font-size: 13.5px; margin: 10px 0 4px; }
.progress.error > div { background: var(--red); }
.update-result .badge { font-size: 12.5px; }

/* ---------- Swagger UI (API-Referenz) */
.swagger-frame { overflow: hidden; padding: 0; }
.swagger-frame iframe { display: block; width: 100%; height: calc(100vh - 230px); min-height: 560px; border: 0; background: var(--bg); }

/* ---------- Live-Vorschau */
:root { --lp-w: min(46vw, 760px); }
.live-preview { position: fixed; top: 0; right: 0; bottom: 0; width: var(--lp-w); background: var(--surface-3); border-left: 1px solid var(--border); z-index: 40; display: flex; flex-direction: column; box-shadow: -8px 0 24px rgba(16,24,40,.06); }
.live-preview .lp-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 13.5px; }
.live-preview iframe { flex: 1; width: 100%; border: 0; background: var(--canvas); }
body.has-preview .main { margin-right: var(--lp-w); }
body.has-preview .layout-2 { grid-template-columns: 1fr; }
.btn.active { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-text); }
@media (max-width: 1100px) { :root { --lp-w: 100vw; } body.has-preview .main { margin-right: 0; } }

/* ---------- Listen: Auswahl, Sammelaktionen, Filter, Ansichten */
.cb { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.table tr.selected td { background: var(--primary-soft); }
.bulk-bar { position: fixed; left: calc(50% + var(--sidebar) / 2); bottom: 20px; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 14px; flex-wrap: nowrap; white-space: nowrap;
  background: #111827; color: #fff; border: 1px solid rgba(255,255,255,.08); padding: 10px 12px 10px 18px; border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(16,24,40,.45); max-width: calc(100vw - 32px); }
.bulk-bar .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; box-shadow: none; }
.bulk-bar .btn:hover { background: rgba(255,255,255,.16); }
.bulk-bar .dropdown-menu .btn, .bulk-bar .dropdown-menu button { color: var(--text); }
.bulk-count { font-size: 13.5px; white-space: nowrap; }
.bulk-enter-active, .bulk-leave-active { transition: opacity .15s, transform .15s; }
.bulk-enter-from, .bulk-leave-to { opacity: 0; transform: translate(-50%, 10px); }
.adv-filter { display: grid; grid-template-columns: 2fr repeat(5, minmax(0, 1fr)) auto; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
@media (max-width: 1100px) { .adv-filter { grid-template-columns: 1fr 1fr; } }
.count-pill { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; margin-left: 2px; }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; font-size: 12.5px; overflow: hidden; }
.chip button { border: 0; background: transparent; padding: 4px 10px; cursor: pointer; color: var(--text-2); font: inherit; }
.chip button:hover { background: var(--primary-soft); color: var(--primary-text); }
.chip .x { padding: 4px 8px 4px 2px; color: var(--faint); }
.dd-title { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 12px 4px; }
.dd-check { display: flex !important; padding: 5px 12px; font-size: 13.5px; gap: 8px; cursor: pointer; }
.dd-check:hover { background: var(--surface-2); }
@media (max-width: 900px) { .bulk-bar { left: 50%; flex-wrap: wrap; white-space: normal; } }

/* ---------- Befehlspalette & Tastaturkürzel */
.search-results.palette { max-height: 70vh; overflow: auto; min-width: 420px; }
.search-results.palette a { display: flex; align-items: center; gap: 10px; }
.pal-head { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); padding: 8px 12px 4px; }
.pal-kbd, .kbd { font-family: var(--font); font-size: 11px; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); margin-left: 3px; white-space: nowrap; }
.pal-foot { border-top: 1px solid var(--border); padding: 7px 12px; font-size: 11.5px; color: var(--muted); }
.kb-row { padding: 6px 0; border-bottom: 1px solid var(--border); }

/* ---------- Einrichtungsassistent */
.setup-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; max-width: 1040px; }
@media (max-width: 860px) { .setup-grid { grid-template-columns: 1fr; } .stepper { flex-direction: row; overflow-x: auto; } .stepper li span:last-child { display: none; } }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 80px; }
.stepper li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer; color: var(--text-2); font-size: 14px; }
.stepper li:hover { background: var(--hover); }
.stepper li.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.stepper .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--surface); border: 1px solid var(--border-strong); flex: 0 0 auto; }
.stepper li.active .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.stepper li.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.logo-box { width: 180px; height: 80px; border: 1px dashed var(--border-strong); border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.logo-box img { max-width: 160px; max-height: 64px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--amber-text); }
.checklist li.done { color: var(--green-text); }
.checklist li .muted { margin-left: auto; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: var(--primary-border); box-shadow: var(--shadow); }
.tile svg { color: var(--primary); margin-bottom: 4px; }
.setup-card .progress { height: 8px; }
.search-results.palette a { flex-wrap: nowrap; white-space: nowrap; }
.search-results.palette a .grow { flex: 1 1 auto; min-width: 0; }
.search-results.palette .pal-kbd { flex: 0 0 auto; margin-left: auto; }
.search .palette kbd { position: static; transform: none; inset: auto; }
.ml-8 { margin-left: 8px; } label.btn.disabled { opacity: .6; pointer-events: none; }

/* ---------- Shop-Anbindungen */
.shop-logo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: #fff; font-weight: 700; font-size: 14px; flex: 0 0 auto; }
.shop-logo.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; margin-right: 2px; }

/* Reports */
.report-filter { gap: 8px; align-items: center; }
.aging-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; }
.aging-bar > div { position: relative; min-width: 4px; }
.aging-bar > div:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--tooltip); color: #fff; font-size: 11.5px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; z-index: 5; }
.share { display: inline-block; width: calc(100% - 52px); height: 6px; background: var(--surface-2); border-radius: 3px; margin-right: 6px; vertical-align: middle; overflow: hidden; }
.share > div { height: 100%; background: var(--primary); border-radius: 3px; }
.table tr.sub-row td { background: var(--surface-2); font-size: 12.5px; padding-top: 6px; padding-bottom: 6px; padding-left: 34px; }
.table tfoot td { border-top: 2px solid var(--border); }

/* Settings mode in the sidebar */
.nav-back { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 600; background: var(--surface-2); }
.nav-back:hover { color: var(--primary-text); background: var(--primary-soft); }
.nav-title { display: flex; align-items: center; gap: 8px; padding: 10px 10px 2px; font-weight: 650; font-size: 15px; }
.sidebar-foot .foot-row { display: flex; align-items: center; gap: 6px; }
.sidebar-foot .foot-row > .dropdown { flex: 1; min-width: 0; }
.sidebar-foot .gear { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.sidebar-foot .gear:hover, .sidebar-foot .gear.active { background: var(--primary-soft); color: var(--primary); }
@media (min-width: 901px) { .settings-layout.in-shell { grid-template-columns: minmax(0, 1fr); } .settings-layout.in-shell > .side-tabs { display: none; } }

/* Theme switch in the user menu */
.theme-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; }
.segmented.sm { padding: 2px; }
.segmented.sm button { padding: 4px 9px; }
.dropdown-menu .segmented button { width: auto; margin: 0; padding: 4px 9px; color: var(--muted); border-radius: 7px; }
.dropdown-menu .segmented button:hover { background: transparent; color: var(--text); }
.dropdown-menu .segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Appearance settings */
.accent-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.accent-dot { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .12s; }
.accent-dot:hover { transform: scale(1.08); }
.accent-dot.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor; color: #fff; outline: 2px solid var(--text); outline-offset: 2px; }
.accent-preview { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 16px; border: 1px dashed var(--border-strong); border-radius: 12px; }
.accent-preview .progress > div { background: var(--primary); }
.theme-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 620px; }
.theme-card { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 12px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; font: inherit; color: var(--text); text-align: left; font-size: 13px; }
.theme-card.active { border-color: var(--primary); box-shadow: var(--ring); }
.theme-thumb { height: 64px; border-radius: 8px; display: grid; grid-template-columns: 28% 1fr; grid-template-rows: 1fr 1fr; gap: 6px; padding: 8px; background: #f6f7f9; border: 1px solid #e6e8eb; }
.theme-thumb i { grid-row: span 2; background: #fff; border-radius: 4px; }
.theme-thumb b { background: #fff; border-radius: 4px; border-top: 3px solid var(--brand); }
.theme-card.dark .theme-thumb { background: #0e1015; border-color: #272c36; }
.theme-card.dark .theme-thumb i, .theme-card.dark .theme-thumb b { background: #1b1f27; }
.theme-card.system .theme-thumb { background: linear-gradient(90deg, #f6f7f9 50%, #0e1015 50%); }
.theme-card.system .theme-thumb i { background: #fff; }
.theme-card.system .theme-thumb b { background: linear-gradient(90deg, #fff 50%, #1b1f27 50%); }
@media (max-width: 560px) { .theme-cards { grid-template-columns: 1fr; } }

/* Login */
.auth-side .brand-logo { background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.auth-side .brand-logo path[stroke^="var"] { stroke: var(--brand); }
.auth-foot { color: rgba(255,255,255,.65); position: relative; z-index: 1; }
.auth-side > div:not(.auth-art) { position: relative; z-index: 1; }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 28px; font-size: 17px; }
.auth-art { position: absolute; right: -40px; bottom: -30px; width: 340px; height: 300px; pointer-events: none; }
.art-invoice { position: absolute; right: 60px; bottom: 60px; width: 250px; background: rgba(255,255,255,.96); color: #111827; border-radius: 14px; padding: 18px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); transform: rotate(-6deg); display: flex; flex-direction: column; gap: 8px; }
.art-logo { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); }
.art-paid { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; color: #166534; background: #dcfce7; padding: 2px 8px; border-radius: 999px; }
.art-line { display: block; height: 7px; border-radius: 4px; background: #e5e7eb; }
.art-line.w60 { width: 60%; } .art-line.w55 { width: 55%; } .art-line.w50 { width: 50%; } .art-line.w40 { width: 40%; } .art-line.w15 { width: 15%; }
.art-rows { display: flex; flex-direction: column; gap: 7px; padding: 8px 0; border-top: 1px solid #eef0f3; border-bottom: 1px solid #eef0f3; margin-top: 6px; }
.art-rows > div { display: flex; justify-content: space-between; }
.art-total { font-size: 12px; color: #6b7280; } .art-total b { color: #111827; font-size: 14px; }
.art-chip { position: absolute; left: 0; top: 40px; display: inline-flex; gap: 6px; align-items: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(6px); transform: rotate(-6deg); }
@media (max-height: 760px) { .auth-art { display: none; } }

/* KPI cards */
.kpi-spark { display: block; width: calc(100% + 40px); margin: 10px -20px -18px; }
.kpi .delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; padding: 0 6px; border-radius: 999px; }
.kpi .delta.up { color: var(--green-text); background: var(--green-soft); }
.kpi .delta.down { color: var(--red-text); background: var(--red-soft); }
a.kpi-link { color: inherit; transition: border-color .15s, box-shadow .15s; }
a.kpi-link:hover { color: inherit; border-color: var(--primary-border); box-shadow: var(--shadow); }
.kpi-good .value { font-size: 20px; padding: 3px 0 2px; }
.setup-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--primary); flex: none; }

/* Editor: recipient line and foldable cards */
.recipient-line { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.recipient-line > .small { flex: 1; min-width: 0; }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary:hover .fold-icon { color: var(--text); }
details.fold .fold-icon { color: var(--faint); transition: transform .15s; flex: none; }
details.fold[open] .fold-icon { transform: rotate(180deg); }
.min-w-0 { min-width: 0; }

/* Lists as cards on phones: cells marked with data-m are arranged in a compact card, the rest is hidden */
@media (max-width: 640px) {
  .table.m-cards thead { display: none; }
  .table.m-cards, .table.m-cards tbody { display: block; width: 100%; }
  .table.m-cards tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "cb title amount" "cb sub status" "cb meta status"; column-gap: 12px; row-gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--border); align-items: center; }
  .table.m-cards tbody tr:last-child { border-bottom: 0; }
  .table.m-cards td { display: none; padding: 0 !important; border: 0 !important; background: transparent !important; }
  .table.m-cards td[data-m], .table.m-cards td[colspan] { display: block; }
  .table.m-cards td[colspan] { grid-column: 1 / -1; }
  .table.m-cards td[data-m="cb"] { grid-area: cb; align-self: center; }
  .table.m-cards td[data-m="title"] { grid-area: title; font-weight: 600; min-width: 0; }
  .table.m-cards td[data-m="title"] .cell-sub { display: none; }
  .table.m-cards td[data-m="sub"] { grid-area: sub; min-width: 0; font-size: 13px; }
  .table.m-cards td[data-m="sub"] .cell-sub, .table.m-cards td[data-m="sub"] .truncate { max-width: none !important; }
  .table.m-cards td[data-m="meta"] { grid-area: meta; font-size: 12px; color: var(--muted); min-width: 0; }
  .table.m-cards td[data-m="meta"] .cell-sub { display: inline; margin-left: 6px; }
  .table.m-cards td[data-m="amount"] { grid-area: amount; text-align: right; font-weight: 650; }
  .table.m-cards td[data-m="status"] { grid-area: status; justify-self: end; align-self: start; text-align: right; }
  .table.m-cards td[data-m="status"] .badge.xs, .table.m-cards td[data-m="status"] svg { display: none; }
  .table.m-cards tr.selected { background: var(--primary-soft); }
  .table.m-cards .avatar { display: none !important; }
}

/* Invoice view: quick actions and PDF preview */
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qa { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; box-shadow: var(--shadow-sm); }
.qa:hover { border-color: var(--primary-border); color: var(--primary-text); background: var(--primary-soft); }
.qa.warn { color: var(--amber-text); border-color: var(--amber-border); background: var(--amber-soft); }
.pdf-card { padding: 0; overflow: hidden; position: relative; min-height: 420px; }
.pdf-iframe { width: 100%; height: 82vh; border: 0; display: block; background: var(--canvas); opacity: 0; transition: opacity .25s; }
.pdf-iframe.ready { opacity: 1; }
.pdf-skeleton { position: absolute; inset: 0; background: var(--canvas); display: flex; flex-direction: column; align-items: center; padding: 36px 24px; gap: 14px; }
.pdf-skeleton .paper { width: min(100%, 460px); aspect-ratio: 210 / 297; max-height: calc(82vh - 90px); background: var(--surface); border-radius: 4px; box-shadow: var(--shadow); padding: 8% 9%; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.pdf-skeleton .paper i, .pdf-skeleton .paper b { display: block; height: 9px; border-radius: 5px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.pdf-skeleton .paper b { height: 80px; margin: 14px 0; border-radius: 6px; }
.pdf-skeleton .paper .r { align-self: flex-end; }
.pdf-skeleton .w20 { width: 20%; } .pdf-skeleton .w25 { width: 25%; } .pdf-skeleton .w30 { width: 30%; } .pdf-skeleton .w45 { width: 45%; } .pdf-skeleton .w60 { width: 60%; } .pdf-skeleton .w65 { width: 65%; } .pdf-skeleton .w70 { width: 70%; }
.pdf-loading { display: flex; align-items: center; gap: 8px; }
.pdf-mobile { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 20px; min-height: 260px; color: var(--muted); background: var(--surface); }
.pdf-card:has(.pdf-mobile) { min-height: 0; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* German date input */
.date-input { position: relative; display: block; min-width: 132px; }
.date-input .input { padding-right: 34px; font-variant-numeric: tabular-nums; }
.date-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; background: none; border-radius: 7px; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.date-btn:hover, .date-input.open .date-btn { background: var(--hover); color: var(--primary); }
.date-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 120; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px; width: 292px; }
.date-pop.up { top: auto; bottom: calc(100% + 6px); }
.date-head { margin-bottom: 6px; }
.date-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.date-grid th { font-size: 11px; font-weight: 600; color: var(--faint); padding: 4px 0; text-align: center; }
.date-grid td { padding: 1px; text-align: center; }
.date-grid .kw { width: 26px; font-size: 10px; color: var(--faint); font-weight: 500; }
.date-grid button { width: 100%; aspect-ratio: 1; border: 0; background: none; border-radius: 8px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.date-grid button:hover { background: var(--hover); }
.date-grid button.we { color: var(--muted); }
.date-grid button.other { color: var(--faint); }
.date-grid button.today { box-shadow: inset 0 0 0 1.5px var(--primary-border); font-weight: 650; }
.date-grid button.sel { background: var(--primary); color: #fff; font-weight: 650; }
.date-grid button:disabled { opacity: .3; cursor: default; }
.date-foot { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }

/* Small polish */
.dropdown-menu .menu-head { padding: 6px 10px 4px; max-width: 260px; }
@media (max-width: 640px) {
  .search kbd { display: none; }
  /* horizontally scrollable tab rows: fade at the edge shows there is more */
  .segmented, .tabs { scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .segmented::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .segmented.sm { -webkit-mask-image: none; mask-image: none; }
}

.label-row { height: 19px; margin-bottom: 6px; }
.label-row .label { margin: 0; }
.segmented.xs { padding: 2px; border-radius: 7px; }
.segmented.xs button { padding: 1px 8px; font-size: 11.5px; border-radius: 5px; }
.quick-actions > .xs { margin-right: 2px; }

/* Invoice attachments */
.attachments { display: flex; flex-direction: column; gap: 8px; }
.att-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.att-row.pending { border-style: dashed; }
.att-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--red-soft); color: var(--red); flex: none; }
.att-name { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.att-name:hover { color: var(--primary); }
.att-name.static { cursor: default; }
.att-name.static:hover { color: var(--text); }
.att-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.flag { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface-2); color: var(--faint); font: inherit; font-size: 11px; font-weight: 550; padding: 1px 7px; border-radius: 999px; cursor: pointer; text-decoration: line-through; }
.flag.on { color: var(--primary-text); background: var(--primary-soft); border-color: var(--primary-border); text-decoration: none; }
.flag:disabled { cursor: default; }
.att-drop { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: 10px; color: var(--text-2); font-size: 13px; cursor: pointer; text-align: center; transition: background .15s, border-color .15s; }
.att-drop:hover, .att-drop.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.input.sm { height: 30px; font-size: 13px; padding: 0 8px; }
.card-head h3 .count-pill { margin-left: 6px; vertical-align: 1px; }

/* Receipt rules */
.rule-sec { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13px; color: var(--text-2); padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; }
.rule-sec:first-of-type { border-top: 0; }
.rule-preview { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-text); font-size: 13px; min-width: 0; }
.chip-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.chip-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.suggest-card { background: linear-gradient(135deg, var(--primary-soft), var(--surface)); }
.table tr.faint td { opacity: .55; }

/* Data export / invitation */
.exp-head { display: flex; gap: 12px; align-items: flex-start; }
.exp-head h3 { margin-bottom: 2px; }
.exp-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.auth-single { grid-template-columns: 1fr; }
.auth-single .auth-main { min-height: 100vh; }

/* Payment runs */
.run-bar { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.run-bar .field { width: 180px; }

/* PWA */
.offline-bar { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 8px 16px; background: var(--amber-soft); color: var(--amber-text); font-size: 13px; font-weight: 550; border-bottom: 1px solid var(--amber-border); }
@media (display-mode: standalone) { .topbar { padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); } }

/* Send dialog channels */
.send-channels { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.send-channels .check { display: inline-flex; align-items: center; gap: 7px; }

/* Datenübernahme */
.stepper-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--faint); font-weight: 550; }
.stepper-h span.active { color: var(--primary-text); background: var(--primary-soft); padding: 3px 10px; border-radius: 999px; }
.stepper-h span.done { color: var(--text-2); }
.import-counts > div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.import-counts b { font-size: 20px; font-variant-numeric: tabular-nums; }
.import-counts span { font-size: 12.5px; color: var(--muted); }
.import-counts small { display: block; color: var(--faint); }
.import-step { display: flex; gap: 12px; align-items: flex-start; }
.import-step .exp-icon { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.import-step .exp-icon.ok { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.import-step .exp-icon.warn { background: color-mix(in srgb, var(--amber, #d97706) 15%, transparent); color: var(--amber-text, #b45309); }
.import-step .exp-icon.fail { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
@media (max-width: 700px) { .import-counts.grid-4 { grid-template-columns: repeat(2, 1fr); } }

.terminal-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 8px; text-align: center; }
.terminal-state .spinner { width: 36px; height: 36px; }
.terminal-state.SUCCESSFUL { color: var(--green); }
.terminal-state.FAILED, .terminal-state.CANCELLED { color: var(--red); }
.terminal-state b { color: var(--text); font-size: 16px; }

/* Meldungen des Plattform-Betreibers */
.ann-banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; border: 1px solid transparent; }
.ann-banner.info { background: var(--blue-soft); color: var(--blue-text); }
.ann-banner.warning { background: var(--amber-soft); color: var(--amber-text); border-color: var(--amber-border); }
.ann-banner.maintenance { background: var(--red-soft); color: var(--red-text); }
.ann-banner > svg { flex: none; margin-top: 2px; }
.ann-banner .grow { min-width: 0; }
.ann-banner .x { background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0 2px; font-size: 18px; line-height: 1; }
.ann-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.auth .ann-stack { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); width: min(720px, calc(100% - 32px)); z-index: 50; }

.ann-banner .ann-link { color: inherit; font-weight: 600; white-space: nowrap; }
/* Abo & Vertrag */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.plan-card { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, background .15s; }
.plan-card:hover { border-color: var(--primary-border, var(--primary)); }
.plan-card.active { border-color: var(--primary); background: var(--primary-soft); }
.plan-card .price { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.plan-card .price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.plan-card ul { margin: 4px 0 0; padding-left: 16px; }

.legal-preview { font-size: 14px; line-height: 1.6; max-height: 70vh; overflow: auto; }
.legal-preview h1 { font-size: 19px; } .legal-preview h2 { font-size: 15px; margin-top: 18px; }

/* ---------------------------------------------------------------- Kolibill branding & login page */
.kolibill-logo { display: inline-flex; align-items: center; vertical-align: middle; }
.kolibill-logo img { width: auto; display: block; }
.kolibill-logo .kb-dark { display: none; }
:root[data-theme="dark"] .kolibill-logo .kb-light { display: none; }
:root[data-theme="dark"] .kolibill-logo .kb-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .kolibill-logo .kb-light { display: none; }
  :root:not([data-theme="light"]) .kolibill-logo .kb-dark { display: block; }
}
.brand-mark { flex: 0 0 auto; display: block; object-fit: contain; background: #fff; border-radius: 22%; padding: 2px; box-shadow: 0 0 0 1px var(--border); }
.login-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 28px; }
.login-logo { max-width: 220px; max-height: 64px; width: auto; height: auto; object-fit: contain; }
.powered-by { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); letter-spacing: .01em; text-decoration: none; opacity: .85; transition: opacity .15s; }
.powered-by:hover { opacity: 1; color: var(--text); }
.auth-main { position: relative; }
.auth-powered { position: absolute; left: 0; right: 0; bottom: 24px; justify-content: center; }
/* customer logo at the top left of the coloured side – on a light badge, because most logos are made for white paper */
.auth-side .side-logo { display: inline-flex; align-items: center; background: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: 0 10px 30px rgba(10, 14, 30, .18); }
.auth-side .side-logo img { display: block; max-height: 52px; max-width: 240px; width: auto; height: auto; object-fit: contain; }
/* the form repeats the logo only on small screens, where the side is hidden */
.auth-mobile-only { display: none; }
@media (max-width: 900px) { .auth-mobile-only { display: flex; } }
.login-notice { white-space: pre-line; }
.auth-side .side-top { display: flex; align-items: center; min-height: 32px; }
.auth-side .side-company { font-size: 17px; }
.auth-side .side-text { margin: 14px 0 0; max-width: 440px; color: rgba(255,255,255,.86); white-space: pre-line; line-height: 1.5; }
.auth-side.own-color { background: radial-gradient(1200px 600px at 0% 0%, color-mix(in srgb, var(--side) 78%, #fff) 0%, var(--side) 38%, color-mix(in srgb, var(--side) 35%, #0b0b1a) 100%); }
.auth-side.has-bg { background-size: cover; background-position: center; }
.login-settings { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
.img-drop { width: 180px; height: 80px; border: 1px dashed var(--border-strong); border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.img-drop img { max-width: 160px; max-height: 64px; }
.login-preview { position: sticky; top: 16px; }
.login-preview-box { display: grid; grid-template-columns: 96px 1fr; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-height: 300px; background: var(--surface); }
.lp-side { opacity: .9; }
.lp-main { padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; }
.lp-side { padding: 10px; }
.lp-logo { display: inline-flex; background: #fff; padding: 5px 7px; border-radius: 6px; box-shadow: 0 3px 10px rgba(10, 14, 30, .18); }
.lp-logo img { display: block; max-width: 62px; max-height: 20px; object-fit: contain; }
.lp-main { position: relative; padding-top: 40px !important; }
.lp-powered { margin-top: auto; text-align: center; font-size: 9px; color: var(--muted); }
.lp-input { height: 22px; border: 1px solid var(--border); border-radius: 6px; margin-top: 6px; }
.lp-btn { height: 24px; border-radius: 6px; margin-top: 10px; }
@media (max-width: 1100px) { .login-settings { grid-template-columns: 1fr; } .login-preview { position: static; max-width: 320px; } }
/* setup checklist on the dashboard: text keeps its width, on phones the button moves below */
.setup-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "icon text cta close"; gap: 16px; align-items: center; }
.setup-head .setup-icon { grid-area: icon; }
.setup-head .setup-text { grid-area: text; min-width: 0; }
.setup-head .setup-cta { grid-area: cta; }
.setup-head .setup-close { grid-area: close; }
@media (max-width: 720px) {
  .setup-head { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "icon text close" "cta cta cta"; gap: 12px 14px; align-items: start; }
  .setup-head .setup-cta { width: 100%; }
  .setup-head h2 { font-size: 17px; }
}
/* dashboard: chart (2/3) next to top customers (1/3), stacked on small screens */
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) {
  .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
  .card-head:has(.legend) { flex-wrap: wrap; row-gap: 6px; }
}
/* dashboard lists on phones: number/customer left, amount and status stacked on the right */
@media (max-width: 600px) {
  .dash-mini, .dash-mini tbody { display: block; }
  .dash-mini tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main amount" "main status"; align-items: center; column-gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
  .dash-mini tr:last-child { border-bottom: 0; }
  .dash-mini td { padding: 0 !important; border: 0 !important; }
  .dash-mini td:nth-child(1) { grid-area: main; min-width: 0; }
  .dash-mini td:nth-child(1) .cell-sub { max-width: 100% !important; }
  .dash-mini td:nth-child(2) { grid-area: status; justify-self: end; }
  .dash-mini td:nth-child(3) { grid-area: amount; justify-self: end; }
}
/* KI of the operator: notice before switching on */
.ai-platform { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.ai-notice { white-space: pre-line; font-size: 13.5px; line-height: 1.55; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.ai-own > summary { cursor: pointer; padding: 6px 0; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
label.check input { margin-top: 3px; }
/* data migration: choose the source */
.source-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.source-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; color: var(--text); }
.source-card:hover { border-color: var(--border-strong); }
.source-card.active { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.gc-box { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 12px 14px; margin-top: 4px; }
/* PSD2: choose the bank */
.psd2-banks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 320px; overflow: auto; }
.psd2-bank { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.psd2-bank:hover { border-color: var(--brand); }
.psd2-bank img { width: 22px; height: 22px; object-fit: contain; flex: none; }
/* bank setup assistant */
.wiz { display: flex; flex-direction: column; gap: 12px; min-height: 180px; }
.wiz-bank { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2, var(--surface)); }
.wiz-bank > div { flex: 1; }
.wiz-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.wiz-way { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.wiz-way:hover:not(:disabled) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--primary-soft); }
.wiz-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.wiz-code { padding: 4px 8px; border-radius: 6px; background: var(--surface-2, var(--bg)); border: 1px solid var(--border); word-break: break-all; }
.wiz-radio { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.wiz-radio:has(input:checked) { border-color: var(--brand); background: var(--primary-soft); }
/* bank transfer dialog */
.pay-box { padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, var(--bg)); }
.pay-iban { font-size: 17px; letter-spacing: .5px; }
.pay-amount { font-size: 22px; font-weight: 700; }
.powered-opt { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
.powered-logo { height: 14px; width: auto; vertical-align: -2px; }
/* brands */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.brand-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.mk-logo { height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: #fff; border: 1px solid var(--border); padding: 6px; margin-bottom: 6px; }
.mk-logo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.mk-logo.lg { width: 220px; height: 80px; margin: 0; }
/* bank connections list */
.bank-conns { flex-basis: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.bank-conn { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.bank-conn .grow { flex: 1; min-width: 0; }
.acct-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.acct-row .input.sm { max-width: 220px; padding: 4px 8px; height: 30px; }
.acct-row .grow { flex: 1; }
/* balance of the chosen sender account */
.bal-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2, var(--bg)); display: flex; flex-direction: column; gap: 6px; }
.bal-card .bal-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bal-card .bal-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.bal-card .bal-amount { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bal-card .bal-after { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-muted, inherit); }
.bal-card.low { border-color: var(--amber-border); background: var(--amber-soft); }
.bal-card.low .bal-after, .bal-card .bal-warn { color: var(--amber-text); }
.run-balance { display: flex; flex-direction: column; justify-content: flex-end; min-width: 130px; padding-bottom: 2px; }
.run-balance.low .strong { color: var(--amber-text); }
.fade-enter-active, .fade-leave-active { transition: opacity .15s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }
.skonto-ok { color: var(--green); }
/* settings overview */
a.nav-title { color: inherit; text-decoration: none; border-radius: 8px; }
a.nav-title:hover, a.nav-title.active { color: var(--primary-text); }
.set-search { position: relative; max-width: 520px; }
.set-search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.set-search .input { padding-left: 36px; }
.set-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.set-group { padding: 6px; }
.set-group-head { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); padding: 10px 10px 6px; }
.set-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.set-item:hover { background: var(--hover); }
.set-item .strong { display: block; color: var(--text); }
.set-desc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.debit-checks { display: flex; flex-direction: column; gap: 6px; }
.debit-checks > div { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); }
.debit-checks > div svg { flex: none; margin-top: 2px; }
.debit-checks .ok svg { color: var(--green); }
.debit-checks .todo { background: var(--amber-soft); }
.debit-checks .todo svg { color: var(--amber-text); }
.debit-checks .wait svg { color: var(--muted); }

/* protocol details: readable key/value pairs that wrap instead of running out of the page */
.audit-data { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; word-break: break-word; }
.audit-data b { font-weight: 600; color: var(--text-2, var(--text)); }

/* projects: budget bar */
.budget { min-width: 150px; }
.budget-track { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.budget-fill { height: 100%; border-radius: 99px; background: var(--green, #16a34a); transition: width .3s; }
.budget.warn .budget-fill { background: var(--amber, #d97706); }
.budget.over .budget-fill { background: var(--red, #dc2626); }
.budget-label { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.budget.wide { margin-top: 10px; }
/* time tracking: stopwatch */
.timer-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) auto; gap: 10px; align-items: center; }
.timer-form .field { margin: 0; }
.timer-form .field > label { display: none; }
.timer-run { display: flex; align-items: center; gap: 14px; }
.timer-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red, #dc2626); flex: none; animation: timer-pulse 1.4s ease-in-out infinite; }
@keyframes timer-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.timer-clock { font-size: 26px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.timer-card.running { border-color: color-mix(in srgb, var(--red, #dc2626) 35%, var(--border)); }
.time-table .day-row td { background: var(--surface-2); padding-top: 7px; padding-bottom: 7px; }
@media (max-width: 900px) { .timer-form { grid-template-columns: minmax(0, 1fr); } .timer-clock { font-size: 20px; } .time-table .day-row td:nth-child(n+3) { display: none; } }
/* cash flow forecast: balance curve */
.balance-curve { width: 100%; height: 170px; display: block; overflow: visible; }
.balance-curve .bc-area { fill: color-mix(in srgb, var(--brand, #4f46e5) 12%, transparent); }
.balance-curve .bc-line { fill: none; stroke: var(--brand, #4f46e5); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.balance-curve .bc-line.neg { stroke: var(--red, #dc2626); }
.balance-curve .bc-zero { stroke: var(--red, #dc2626); stroke-dasharray: 4 4; stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .6; }
/* cash book: cancelled entries */
.cash-table tr.struck td { color: var(--muted); }
.cash-table tr.struck .cell-title { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.cash-table .day-row td { background: var(--surface-2); }
/* settings → functions */
.module-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.module-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; }
.module-row + .module-row { border-top: 1px solid var(--border); }
.module-row:hover { background: var(--surface-2); }
.module-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft, #eef2ff); color: var(--primary, #4f46e5); flex: none; }
/* only in the mobile card layout */
.m-only { display: none; }
@media (max-width: 900px) { .table.m-cards .m-only { display: inline; } }
/* code examples must never widen the page */
pre.code { max-width: 100%; overflow-x: auto; }
/* phones: wide tables scroll inside their card instead of widening the page */
@media (max-width: 900px) {
  .table:not(.m-cards) { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .card, .grid > *, .form-grid > * { min-width: 0; }
}
@media (max-width: 900px) {
  .page-head, .page-head > .flex, .page-head > div:last-child { flex-wrap: wrap; min-width: 0; }
  .card-head { flex-wrap: wrap; row-gap: 6px; }
  .card-body > .flex, .card-body > .flex-col > .flex { flex-wrap: wrap; }
  code, .mono { overflow-wrap: anywhere; }
}
.kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .kpis.kpis-3 { grid-template-columns: 1fr; } }
