/* FloKI Portal — Design-System. Farben und Schrift wie flokiconsult.at:
   Navy für die Seitenleiste, Blau als Akzent, Verlauf Blau → Cyan nur für die
   Hauptaktion, Grün/Gelb/Rot ausschließlich für Zustände. Alle Komponenten
   verwenden nur diese Tokens (Rahmenkonzept §6). */

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

:root {
  /* Marke (flokiconsult.at) */
  --navy-950: #040B1C; --navy-900: #061029; --navy-800: #0B1B3F; --navy-700: #13275A; --navy-100: #EAF0FB;
  --blue-700: #1846B0; --blue-600: #1F59D2; --blue-500: #326CED; --blue-400: #588AF5;
  --cyan-500: #07B4CF; --cyan-300: #5EC3DF; --periwinkle: #7B9FEF;
  --gradient-brand: linear-gradient(120deg, var(--blue-600) 0%, var(--blue-500) 45%, var(--cyan-500) 100%);
  /* Text */
  --ink: #0B1526; --ink-2: #1B2840; --muted: #4A5872; --faint: #66748C;
  --muted-on-dark: #A7B6D4;
  /* Flächen und Linien */
  --bg: #F4F7FD; --panel: #FFFFFF; --soft: #F7F9FE; --line: #E1E8F4; --line-soft: #EDF1F8;
  /* Zustände */
  --green: #137A4B; --green-soft: #E2F5EB; --amber: #8A5A00; --amber-soft: #FFF3D6;
  --red: #C0352B; --red-soft: #FCE9E7; --info: var(--blue-600); --info-soft: #E8EFFD;
  /* Diagramme: Stunden blau, Pauschale cyan */
  --chart-hours: var(--blue-500); --chart-fixed: var(--cyan-500); --chart-grid: #E6ECF6;
  /* Schrift */
  --font: "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 12px; --fs-s: 13.5px; --fs-m: 15px; --fs-l: 18px; --fs-xl: 24px; --fs-xxl: 32px;
  /* Abstände */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  /* Radien und Schatten */
  --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-xl: 24px; --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(11, 21, 38, .05), 0 4px 12px rgba(11, 21, 38, .05);
  --shadow-md: 0 6px 24px rgba(11, 21, 38, .09);
  --shadow-lg: 0 24px 64px -16px rgba(11, 21, 38, .28);
  --shadow-glow: 0 8px 28px -8px rgba(50, 108, 237, .55);
  --sidebar-w: 248px;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 var(--fs-m)/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; margin: 0; color: var(--ink); }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.num, .money, td.money, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); display: flex; flex-direction: column;
  background: var(--navy-900); color: #fff; padding: var(--sp-5) var(--sp-4); overflow-y: auto;
  background-image: radial-gradient(420px 260px at 0% 100%, rgba(50,108,237,.22), transparent 70%), radial-gradient(300px 200px at 100% 0%, rgba(7,180,207,.12), transparent 70%); }
.brand { display: block; padding: var(--sp-1) var(--sp-2) var(--sp-5); }
.brand img { width: 172px; height: auto; display: block; }
.nav-group { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-on-dark);
  opacity: .75; padding: var(--sp-4) var(--sp-3) var(--sp-2); }
.nav-item { position: relative; display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-3); margin: 2px 0;
  border-radius: var(--r-m); color: #DCE5F7; font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,.11); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gradient-brand); }
.nav-item svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-spacer { flex: 1; min-height: var(--sp-5); }
.nav-item.profile .who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.nav-item.profile .who small { color: var(--muted-on-dark); font-weight: 400; font-size: var(--fs-xs); }
.badge { margin-left: auto; font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(255,255,255,.14); color: #fff; }
.badge.env { background: var(--amber-soft); color: var(--amber); }

.main { flex: 1; min-width: 0; padding: var(--sp-5) var(--sp-6) var(--sp-7); }
.appbar { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.appbar .menu-toggle, .appbar-logo { display: none; }
#view { max-width: 1320px; }

/* ---------- Kopf einer Ansicht ---------- */
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.topbar h1 { font-size: var(--fs-xxl); line-height: 1.15; letter-spacing: -.02em; }
.topbar .sub { color: var(--muted); margin-top: var(--sp-1); }
.topbar .actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.crumb { font-size: var(--fs-s); color: var(--muted); margin-bottom: var(--sp-1); }
.crumb a { color: var(--muted); }

/* ---------- Karten ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-sm); padding: var(--sp-5); min-width: 0; }
.card + .card { margin-top: var(--sp-4); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.card-head h2 { font-size: var(--fs-l); }
.card-head .hint { font-size: var(--fs-s); color: var(--muted); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: var(--sp-5) var(--sp-5) 0; }
.grid { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.stack > * + * { margin-top: var(--sp-4); }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-sm); padding: var(--sp-4) var(--sp-5); min-width: 0; }
.kpi .label { font-size: var(--fs-s); color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .meta { font-size: var(--fs-s); color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi.hero { background: var(--navy-900); border-color: var(--navy-800); color: #fff;
  background-image: radial-gradient(260px 160px at 100% 0%, rgba(7,180,207,.35), transparent 70%), radial-gradient(240px 160px at 0% 100%, rgba(50,108,237,.35), transparent 70%); }
.kpi.hero .label, .kpi.hero .meta { color: var(--muted-on-dark); }

/* ---------- Knöpfe ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 38px; padding: 8px 18px;
  font: 600 var(--fs-s)/1 var(--font); color: #fff; background: var(--gradient-brand); border: 0; border-radius: var(--r-pill);
  box-shadow: var(--shadow-glow); cursor: pointer; white-space: nowrap; text-decoration: none; transition: transform .12s, box-shadow .12s, filter .12s; }
.btn:hover { filter: brightness(1.05); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.ghost { background: var(--panel); color: var(--ink-2); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--blue-400); color: var(--blue-600); }
.btn.subtle { background: transparent; color: var(--blue-600); box-shadow: none; padding-inline: 10px; }
.btn.subtle:hover { background: var(--info-soft); }
.btn.danger { background: var(--red); box-shadow: none; }
.btn.danger.ghost { background: var(--panel); color: var(--red); border-color: #F1C8C3; }
.btn.ok { background: var(--green); box-shadow: none; }
.btn.sm { min-height: 30px; padding: 5px 12px; font-size: var(--fs-xs); }
.btn.icon { padding: 0; width: 38px; }
.seg { display: inline-flex; background: var(--line-soft); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; font: 500 var(--fs-s)/1 var(--font); color: var(--muted); padding: 7px 14px; border-radius: var(--r-pill); cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Formulare ---------- */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-4); }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field.span-3 { grid-column: 1 / -1; }
.field-label { font-size: var(--fs-s); font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.req-star { color: var(--red); }
.field-info { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--line); color: var(--muted); font-size: 10px; font-weight: 700; cursor: help; }
.field-note { font-size: var(--fs-xs); color: var(--muted); }
input, select, textarea { font: 400 var(--fs-m)/1.4 var(--font); color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 9px 12px; min-height: 40px; width: 100%; transition: border-color .12s, box-shadow .12s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(50,108,237,.18); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: var(--soft); color: var(--muted); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--blue-600); cursor: pointer; }
.field.check { flex-direction: row; align-items: center; gap: var(--sp-2); padding-top: 26px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); background: var(--red-soft); }
.form-section { font-size: var(--fs-m); margin: var(--sp-5) 0 var(--sp-3); }
.inline-fields { display: flex; gap: var(--sp-2); align-items: center; }
.inline-fields > * { flex: 1; }
.btn-row { display: flex; gap: var(--sp-2); justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.or { flex: 0 0 auto !important; color: var(--faint); font-size: var(--fs-s); }

/* Filterleiste */
.filters { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; margin-bottom: var(--sp-4); }
.filters .field { min-width: 150px; flex: 0 1 auto; }
.filters .field.grow { flex: 1 1 220px; }
.filters input, .filters select { min-height: 38px; padding: 7px 10px; font-size: var(--fs-s); }

/* ---------- Banner und Pillen ---------- */
.banner { border-radius: var(--r-m); padding: 11px 16px; margin-bottom: var(--sp-4); font-size: var(--fs-s); font-weight: 500;
  background: var(--info-soft); color: var(--blue-700); border: 1px solid #CFDDFB; }
.banner.error { background: var(--red-soft); color: var(--red); border-color: #F3C9C4; }
.banner.warn { background: var(--amber-soft); color: var(--amber); border-color: #F2DDA6; }
.banner.ok { background: var(--green-soft); color: var(--green); border-color: #BFE5CF; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 600; padding: 3px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.offen { background: var(--amber-soft); color: var(--amber); }
.pill.verrechnet { background: var(--info-soft); color: var(--blue-700); }
.pill.bezahlt { background: var(--green-soft); color: var(--green); }
.pill.neutral { background: var(--line-soft); color: var(--muted); }
.pill.neutral::before { display: none; }
.tag { display: inline-block; font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: var(--r-s); background: var(--navy-100); color: var(--navy-700); white-space: nowrap; }
.tag.fixed { background: #E0F6FA; color: #0B6E7E; }
.tag.kind-hosting { background: var(--navy-100); color: var(--navy-700); }
.tag.kind-domain { background: #E0F6FA; color: #0B6E7E; }
.tag.kind-support { background: #ECE9FD; color: #4B3AA8; }
.tag.kind-lizenz { background: #FFF1E0; color: #8A4B00; }
.tag.kind-sonstiges { background: var(--line-soft); color: var(--muted); }
.chart .bar-cost { fill: #C9D4E8; }
.chart .bar-price { fill: var(--blue-500); }
.lock { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; fill: none; stroke: var(--faint); stroke-width: 2; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
table.data th { text-align: left; font-weight: 600; font-size: var(--fs-xs); letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data tbody tr:hover td { background: #FAFBFF; }
table.data tr.clickable { cursor: pointer; }
table.data th.money, table.data td.money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data th.check, table.data td.check { width: 36px; padding-right: 0; }
table.data tr.sum td { font-weight: 600; background: var(--soft); border-top: 1px solid var(--line); border-bottom: 0; }
table.data tr.group td { background: var(--navy-100); font-weight: 600; color: var(--navy-800); border-bottom: 0; }
table.data tr.selected td { background: #EEF3FF; }
table.data .desc { max-width: 520px; white-space: pre-line; }
table.data .sub-row td { background: var(--soft); font-size: var(--fs-s); }
.th-sort { border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; padding: 0; }
.th-sort .arrow { opacity: .5; }
.th-sort.active .arrow { opacity: 1; color: var(--blue-600); }
.empty { padding: var(--sp-6); text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: var(--fs-l); margin-bottom: var(--sp-1); }

/* Auswahlleiste */
.selection-bar { position: sticky; bottom: var(--sp-4); z-index: 5; display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  margin-top: var(--sp-4); padding: 10px 12px 10px 20px; border-radius: var(--r-pill); background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg); }
.selection-bar .count { font-weight: 600; margin-right: auto; }
.selection-bar .btn.ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.18); }

/* Fortschritt (Budget) */
.progress { height: 8px; border-radius: var(--r-pill); background: var(--line-soft); overflow: hidden; min-width: 80px; }
.progress > i { display: block; height: 100%; background: var(--gradient-brand); border-radius: inherit; }
.progress.warn > i { background: #E3A008; }
.progress.over > i { background: var(--red); }

/* ---------- Laufende Zeit (Kopfleiste) ---------- */
.timer { flex: 1; display: flex; align-items: center; gap: var(--sp-2); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 6px 6px 6px 8px; box-shadow: var(--shadow-sm); min-width: 0; }
.timer.running { border-color: rgba(50,108,237,.45); box-shadow: 0 0 0 4px rgba(50,108,237,.10), var(--shadow-sm); }
.timer select { flex: 0 1 260px; min-width: 120px; border: 0; background: var(--soft); border-radius: var(--r-pill); min-height: 36px; font-size: var(--fs-s); }
.timer input { flex: 1 1 200px; min-width: 80px; border: 0; min-height: 36px; font-size: var(--fs-s); background: transparent; }
.timer input:focus, .timer select:focus { box-shadow: none; }
.timer .clock { font: 600 var(--fs-l)/1 var(--font); font-variant-numeric: tabular-nums; min-width: 86px; text-align: right; color: var(--ink); padding: 0 var(--sp-2); }
.timer.running .clock { color: var(--blue-600); }
.timer .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: 0 0 9px; }
.timer.running .dot { background: var(--red); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(192,53,43,.5); } 70% { box-shadow: 0 0 0 8px rgba(192,53,43,0); } 100% { box-shadow: 0 0 0 0 rgba(192,53,43,0); } }
.timer .btn { min-height: 36px; }
.timer .btn.stop { background: var(--red); box-shadow: 0 8px 22px -10px rgba(192,53,43,.7); }

/* ---------- Diagramme ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis { font: 500 11px var(--font); fill: var(--faint); font-variant-numeric: tabular-nums; }
.chart .bar-hours { fill: var(--chart-hours); }
.chart .bar-fixed { fill: var(--chart-fixed); }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + g rect, .chart g.col:hover rect { filter: brightness(1.08); }
.chart .value-label { font: 600 11px var(--font); fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--fs-s); color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--navy-900); color: #fff; border-radius: var(--r-s); padding: 8px 10px;
  font-size: var(--fs-xs); line-height: 1.45; box-shadow: var(--shadow-md); font-variant-numeric: tabular-nums; }
.chart-tip b { font-weight: 600; }
.donut-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); justify-items: center; }
.donut-wrap .donut-legend { width: 100%; }
.donut-legend { list-style: none; margin: 0; padding: 0; font-size: var(--fs-s); }
.donut-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: var(--sp-2); align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.donut-legend li:last-child { border-bottom: 0; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.bar-list li:last-child { border-bottom: 0; }
.bar-list .row { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-s); margin-bottom: 6px; }
.bar-list .row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-list .row a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list .stack-bar { display: flex; height: 8px; border-radius: var(--r-pill); overflow: hidden; background: var(--line-soft); }
.bar-list .stack-bar i { display: block; height: 100%; }
.bar-list .stack-bar .open { background: #E3A008; }
.bar-list .stack-bar .billed { background: var(--blue-500); }

/* Liste letzter Einträge */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-3); padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.feed li:last-child { border-bottom: 0; }
.feed .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .meta { font-size: var(--fs-xs); color: var(--muted); }
.feed .right { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Kunden-Kacheln */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.tile { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--sp-5); box-shadow: var(--shadow-sm);
  color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; cursor: pointer; text-align: left; font: inherit; width: 100%; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #C9D7F3; text-decoration: none; }
.tile h3 { font-size: var(--fs-l); margin-bottom: 2px; display: flex; align-items: center; gap: var(--sp-2); }
.tile .avatar { width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; font-weight: 700; color: #fff; background: var(--gradient-brand); flex: 0 0 38px; font-size: 14px; }
.tile .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin-top: var(--sp-4); }
.tile .facts div { font-size: var(--fs-xs); color: var(--muted); }
.tile .facts b { display: block; font-size: var(--fs-m); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tile.archived { opacity: .65; }

/* Detail: Stammdaten */
.facts-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px var(--sp-4); font-size: var(--fs-s); margin: 0; }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

/* Gruppen in der Zeitenliste */
.day-group + .day-group { margin-top: var(--sp-4); }

/* ---------- Dialoge ---------- */
dialog { border: 0; border-radius: var(--r-xl); padding: var(--sp-6); width: min(640px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.wide { width: min(860px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(6, 16, 41, .45); backdrop-filter: blur(2px); }
.dialog-title { font-size: var(--fs-xl); margin-bottom: var(--sp-4); }
.dialog-body { max-height: min(68vh, 720px); overflow-y: auto; padding: 2px; }
.dialog-actions { display: flex; gap: var(--sp-2); justify-content: flex-end; margin-top: var(--sp-5); align-items: center; }
.dialog-actions .spacer { flex: 1; }

/* Laufband bei Aufrufen */
.busy-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; background: var(--gradient-brand); background-size: 200% 100%; animation: busy 1.1s linear infinite; }
@keyframes busy { from { background-position: 200% 0; } to { background-position: 0 0; } }

/* Begrüßung */
.hello { font-size: var(--fs-xxl); font-weight: 600; letter-spacing: -.02em; }
.hello b { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }

/* ---------- Druck (Auswertung) ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .sidebar, .appbar, .no-print, .selection-bar, .filters, .busy-bar { display: none !important; }
  .main { padding: 0; }
  .card, .kpi { box-shadow: none; border-color: #ccd; break-inside: avoid; }
  .print-only { display: block; }
  table.data th { background: #f1f4fa !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
}

/* ---------- Smartphone-Sperre (mobil.js) ---------- */
html.mobil-gesperrt, html.mobil-gesperrt body { overflow: hidden; height: 100%; }
html.mobil-gesperrt body > :not(.mobil-sperre) { display: none !important; }
.mobil-sperre { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 32px 28px;
  padding-bottom: max(32px, env(safe-area-inset-bottom)); color: #fff; text-align: center; overflow: hidden; background: var(--navy-950); }
.mobil-sperre::before, .mobil-sperre::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.mobil-sperre::before { width: 560px; height: 560px; right: -260px; bottom: -240px;
  background: radial-gradient(circle closest-side, rgba(50,108,237,.55), rgba(50,108,237,.12) 55%, rgba(50,108,237,0)); }
.mobil-sperre::after { width: 420px; height: 420px; left: -200px; top: -160px;
  background: radial-gradient(circle closest-side, rgba(7,180,207,.32), rgba(7,180,207,0)); }
.mobil-sperre-inhalt { position: relative; z-index: 1; max-width: 340px; display: flex; flex-direction: column; align-items: center; }
.mobil-sperre-logo { width: 200px; height: auto; margin-bottom: 44px; }
.mobil-sperre-geraet { width: 132px; height: 88px; display: grid; place-items: center; margin-bottom: 28px; border-radius: 24px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 20px 50px -20px rgba(50,108,237,.6); }
.mobil-sperre-geraet svg { width: 92px; height: 62px; fill: none; stroke: var(--cyan-300); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mobil-sperre h1 { color: #fff; font-size: 30px; line-height: 1.12; letter-spacing: -.8px; font-weight: 700; margin: 0 0 14px; text-wrap: balance; }
.mobil-sperre h1 b { background: linear-gradient(120deg, var(--blue-400), var(--cyan-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mobil-sperre p { margin: 0; color: var(--muted-on-dark); font-size: var(--fs-m); line-height: 1.55; }
.mobil-sperre-url { margin-top: 28px !important; display: inline-block; padding: 9px 18px; border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: #fff !important; font-weight: 600; font-size: var(--fs-s) !important; letter-spacing: .2px; }
