/* ============================================================
   Design-Tokens
   Hintergrund: kühles Off-White · Akzent: Petrol (Werbeagentur-Ton)
   Faktura = warmes Koralle (schon verdient) · Prognose = kühles Indigo (kommt noch)
   ============================================================ */
:root {
  --bg: #F4F6F5;
  --surface: #FFFFFF;
  --ink: #1A2321;
  --ink-soft: #566360;
  --line: #E1E6E4;

  --primary: #D9BB8D;
  --primary-ink: #2A2118;

  --faktura: #E8562C;
  --prognose: #3D5AC4;
  --success: #2F9E44;
  --danger: #C4392E;

  --radius: 14px;
  --radius-sm: 8px;

  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: var(--primary); }
.link-muted { color: var(--ink-soft); text-decoration: none; font-size: 13px; }
.link-muted:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .12s ease;
}
.btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn--ghost { background: transparent; }
.btn--full { width: 100%; }

.icon-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.icon-btn:hover { background: var(--line); color: var(--ink); }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 20px 50px rgba(20,30,28,.08);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.login-brand__mark {
  width: 36px; height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
}
.login-brand__name { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.login-form input {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.alert { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; }
.alert--error { background: #FBE9E7; color: var(--danger); }

/* ---------- App shell ---------- */
.app { max-width: 1100px; margin: 0 auto; padding: 0 20px 60px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  gap: 20px;
  flex-wrap: wrap;
}
.topbar__brand { display: flex; align-items: center; gap: 10px; }
.topbar__mark {
  width: 32px; height: 32px;
  background: var(--primary); color: #fff;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
}
.topbar__title { font-family: var(--font-display); font-weight: 700; font-size: 19px; }

.company-switch { display: flex; gap: 6px; background: var(--surface); padding: 4px; border-radius: 999px; border: 1px solid var(--line); }
.company-switch__btn {
  display: inline-block; text-decoration: none;
  border: none; background: transparent; padding: 8px 16px; border-radius: 999px;
  font-weight: 600; cursor: pointer; color: var(--ink-soft);
}
.company-switch__btn.is-active { background: var(--company-color); color: var(--ink); font-weight: 700; }

.topbar__user { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px;
  background: color-mix(in srgb, var(--user-color) 16%, white);
}
.user-chip::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--user-color);
}

/* ---------- Controls ---------- */
.controls {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.control-group { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.toggle-btn {
  display: inline-block; text-decoration: none;
  border: none; background: transparent; padding: 7px 14px; border-radius: 999px;
  font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink-soft);
}
.toggle-btn.is-active { background: var(--ink); color: #fff; }
.period-label { font-weight: 600; font-family: var(--font-mono); font-size: 13px; padding: 0 6px; min-width: 110px; text-align: center; }

/* ---------- Chart ---------- */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

/* ---------- Umsatz-Cockpit: Diagramm + Kennzahlen nebeneinander ---------- */
.cockpit-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; margin-bottom: 24px; }
.cockpit-grid.cockpit-grid--single { grid-template-columns: 1fr; }
.cockpit-grid .chart-card, .cockpit-grid .summary-card { margin-bottom: 0; }
.chart-wrap { width: 100%; min-height: 460px; }
.chart-wrap--year-summary { min-height: 380px; }
.chart-svg { width: 100%; height: 460px; display: block; }
@media (max-width: 900px) {
  .cockpit-grid { grid-template-columns: 1fr; }
  .cockpit-grid .summary-card { order: -1; }
}
@media (max-width: 640px) {
  .chart-wrap { min-height: 380px; }
  .chart-svg { height: 380px; }
}

/* ---------- Table ---------- */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.table-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.table-card__head h2 { font-family: var(--font-display); font-size: 16px; margin: 0; }

.entries-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.entries-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-soft); border-bottom: 1px solid var(--line); padding: 8px 10px;
}
.entries-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.entries-table th.num, .entries-table td.num { text-align: right; font-family: var(--font-mono); }
.entries-table tbody tr:hover { background: var(--bg); cursor: pointer; }

.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.status-pill--faktura { background: color-mix(in srgb, var(--faktura) 15%, white); color: var(--faktura); }
.status-pill--prognose { background: color-mix(in srgb, var(--prognose) 15%, white); color: var(--prognose); }
.status-pill--aktiv { background: color-mix(in srgb, var(--success) 16%, white); color: var(--success); }
.status-pill--gestoppt { background: color-mix(in srgb, var(--danger) 14%, white); color: var(--danger); }
.status-pill--pausiert { background: color-mix(in srgb, #E8B923 20%, white); color: #8a6d00; }
.status-pill--offen { background: color-mix(in srgb, #4FA6D9 18%, white); color: #1F6E9C; }
.status-pill--in-klaerung { background: color-mix(in srgb, #8B5CF6 18%, white); color: #6D28D9; }

.employee-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.employee-tag::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--tag-color, var(--ink-soft)); }

.row-delete { border: none; background: transparent; color: var(--ink-soft); cursor: pointer; padding: 4px 8px; }
.row-delete:hover { color: var(--danger); }

.empty-state { color: var(--ink-soft); text-align: center; padding: 30px 0; }

/* ---------- Legende (Kunden nach Rohertrag) ---------- */
.chart-legend {
  list-style: none; margin: 16px 0 0; padding: 12px 0 0;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 10px 20px;
}
.chart-legend__item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.chart-legend__swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.chart-legend__name { color: var(--ink); font-weight: 600; }
.chart-legend__value { color: var(--ink-soft); font-family: var(--font-mono); }

/* ---------- Shell layout: linke Sidebar + Content ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar__logo img { max-width: 100%; max-height: 90px; height: auto; display: block; margin: 0 auto; }
.sidebar__greeting { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 14px;
}
.side-nav a:hover { background: var(--bg); color: var(--ink); }
.side-nav a.is-active { background: color-mix(in srgb, var(--primary) 30%, white); color: var(--ink); }
.side-nav__icon { font-size: 15px; }
.sidebar__footer { padding-top: 14px; border-top: 1px solid var(--line); }
.company-switch--sidebar { display: flex; flex-direction: column; gap: 4px; }
.company-switch--sidebar .company-switch__btn { border-radius: var(--radius-sm); padding: 8px 12px; text-align: left; }

.shell__main { flex: 1; min-width: 0; }
.shell__main .content { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }

.mobile-topbar {
  display: none; align-items: center; justify-content: center;
  padding: 14px 0; border-bottom: 1px solid var(--line); background: var(--surface);
}
.mobile-topbar__logo { height: 28px; width: auto; }
.mobile-topbar__burger {
  display: none; position: fixed; top: 14px; right: 14px; z-index: 40;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  width: 38px; height: 38px; font-size: 18px; cursor: pointer;
}
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(20,30,28,.4); z-index: 25;
}
.sidebar-backdrop.is-open { display: block; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .mobile-topbar { display: flex; position: relative; }
  .mobile-topbar__burger { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 30;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar.is-open { transform: translateX(0); }
}

/* ---------- Section nav (Legacy, nicht mehr verlinkt, harmlos falls noch referenziert) ---------- */
.section-nav {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 22px; padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.section-nav a {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 14px;
  padding: 8px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.section-nav a.is-active { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-bottom-color: var(--surface); margin-bottom: -1px; }
.section-nav a:hover { color: var(--ink); }

/* ---------- Overview tiles ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tile {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: box-shadow .12s ease, transform .08s ease;
}
.tile:hover { box-shadow: 0 10px 24px rgba(20,30,28,.08); transform: translateY(-1px); }
.tile--disabled { opacity: .55; cursor: default; }
.tile--disabled:hover { box-shadow: none; transform: none; }
.tile__title { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.tile__desc { color: var(--ink-soft); font-size: 13px; margin: 0; }
.tile__badge {
  display: inline-block; margin-top: 10px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft);
  background: var(--bg); padding: 3px 8px; border-radius: 999px;
}

/* ---------- Soll/Ist summary ---------- */
.summary-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.summary-card__headline { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.summary-card__headline h2 { font-family: var(--font-display); font-size: 15px; margin: 0; color: var(--ink-soft); font-weight: 600; }
.summary-card__value { font-family: var(--font-mono); font-size: 28px; font-weight: 700; }

.soll-ist { width: 100%; border-collapse: collapse; font-size: 14px; }
.soll-ist th { text-align: left; color: var(--ink-soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 6px 10px; }
.soll-ist td { padding: 8px 10px; font-family: var(--font-mono); }
.soll-ist td:first-child, .soll-ist th:first-child { font-family: var(--font-body); text-transform: none; font-weight: 600; letter-spacing: 0; }
.diff-pill { display: inline-block; padding: 4px 10px; border-radius: var(--radius-sm); font-weight: 700; }
.diff-pill--good { background: color-mix(in srgb, var(--success) 16%, white); color: var(--success); }
.diff-pill--ok { background: color-mix(in srgb, #C9A227 16%, white); color: #8a6d00; }
.diff-pill--bad { background: color-mix(in srgb, var(--danger) 14%, white); color: var(--danger); }

/* ---------- Ranked customer/entry list (Statistik-Seite) ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.rank-list__item:last-child { border-bottom: none; }
.rank-list__swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.rank-list__main { flex: 1; min-width: 0; }
.rank-list__customer { font-weight: 600; }
.rank-list__product { color: var(--ink-soft); font-size: 12px; }
.rank-list__pct { color: var(--ink-soft); font-family: var(--font-mono); font-size: 12px; width: 54px; text-align: right; }
.rank-list__amount { font-family: var(--font-mono); font-weight: 600; width: 90px; text-align: right; }

/* ---------- KPI cards (Übersicht) ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.kpi-card__label { font-size: 12px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }
.kpi-card__value { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.kpi-card__bar { margin-top: 10px; height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.kpi-card__bar-fill { height: 100%; background: var(--primary); }
.kpi-card__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 6px; }
.kpi-card__trend { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 3px; }
.kpi-card__trend--up { color: var(--success); }
.kpi-card__trend--down { color: var(--danger); }
.kpi-card__spark { flex-shrink: 0; }

/* ---------- Page topbar (Begrüßung + Firmenumschalter) ---------- */
.page-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 24px 24px 0;
}
.page-topbar--compact { padding: 16px 24px 0; }
.page-topbar__greeting h1 { font-family: var(--font-display); font-size: 21px; margin: 0 0 2px; }
.page-topbar__greeting p { color: var(--ink-soft); font-size: 13px; margin: 0; }
.page-topbar__right { display: none; align-items: center; gap: 14px; }
.page-topbar__avatar {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; background: var(--user-color, var(--primary));
  flex-shrink: 0;
}
@media (min-width: 901px) {
  .page-topbar__right { display: flex; }
  .company-switch--sidebar { display: none; }
}

/* ---------- Donut / Kreisdiagramm ---------- */
.donut-wrap { display: flex; justify-content: center; padding: 10px 0 4px; }
.donut-figures { display: flex; justify-content: space-between; text-align: center; margin-top: 8px; }
.donut-figures div { flex: 1; }
.donut-figures .label { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em; }
.donut-figures .value { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.donut-remaining { text-align: center; font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

.year-progress-bar { position: relative; height: 22px; background: var(--bg); border-radius: 999px; overflow: visible; margin-top: 4px; }
.year-progress-bar__fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s ease; }
.year-progress-bar__expenses-marker {
  position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--danger);
  border-radius: 2px;
}

.stat-row { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
.stat-row .stat { flex: 1; min-width: 90px; }
.stat-row .stat .label { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em; }
.stat-row .stat .value { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.stat-row .stat .value--good { color: var(--success); }
.stat-row .stat .value--bad { color: var(--danger); }
.stat-row .stat .value--warn { color: #8a6d00; }

.wide-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.wide-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.wide-card__head h3 { font-family: var(--font-display); font-size: 14px; margin: 0; }
.wide-card__link { font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 600; }
.wide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.finance-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.finance-line:last-child { border-bottom: none; }
.finance-line .amount { font-family: var(--font-mono); font-weight: 700; }

/* ---------- Schnellzugriffe ---------- */
.quick-access {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.quick-access__label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); font-weight: 700; align-self: center; margin-right: 4px; }
.quick-access a {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
}
.quick-access a:hover { background: color-mix(in srgb, var(--primary) 20%, white); }

/* ---------- Ausgaben: Kategorie-Gruppen ---------- */
.expense-category { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.expense-category__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--bg); }
.expense-category__total { font-family: var(--font-mono); font-weight: 700; }
.history-cell { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.history-cell:hover { color: var(--primary); }

/* ---------- Placeholder pages ---------- */
.placeholder-card {
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 60px 20px; text-align: center; color: var(--ink-soft);
}
.placeholder-card h2 { font-family: var(--font-display); color: var(--ink); margin-bottom: 8px; }

/* ---------- Period nav (server-rendered links) ---------- */
.period-nav { display: flex; align-items: center; gap: 4px; }
.period-nav a { color: var(--ink-soft); text-decoration: none; font-size: 20px; padding: 2px 8px; border-radius: var(--radius-sm); }
.period-nav a:hover { background: var(--line); color: var(--ink); }

.period-scroll-wrap { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.period-scroll {
  display: flex; gap: 6px; overflow-x: auto; scroll-behavior: smooth;
  padding: 6px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  cursor: grab; user-select: none; -webkit-overflow-scrolling: touch;
}
.period-scroll::-webkit-scrollbar { height: 4px; }
.period-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.period-scroll.is-dragging { cursor: grabbing; }
.period-scroll .toggle-btn { flex-shrink: 0; }
.period-scroll--months .toggle-btn { padding: 6px 12px; font-size: 12px; }
.entry-dialog { border: none; border-radius: var(--radius); padding: 0; width: 420px; max-width: 92vw; }
.entry-dialog::backdrop { background: rgba(20, 30, 28, .35); }
.entry-form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.entry-form h3 { font-family: var(--font-display); margin: 0 0 4px; }
.entry-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.entry-form input, .entry-form select {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 10px;
}
.entry-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry-form__actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.spacer { flex: 1; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .controls { flex-direction: column; align-items: stretch; }
  .entry-form__row { grid-template-columns: 1fr; }

  /* Tabelle wird zu gestapelten Karten statt horizontal zu scrollen */
  .entries-table thead { display: none; }
  .entries-table, .entries-table tbody, .entries-table tr, .entries-table td {
    display: block; width: 100%;
  }
  .entries-table tr {
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    margin-bottom: 10px; padding: 6px 10px;
  }
  .entries-table td {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 0; border-bottom: 1px solid var(--line); text-align: right;
  }
  .entries-table td:last-child { border-bottom: none; }
  .entries-table td::before {
    content: attr(data-label);
    font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--ink-soft); font-weight: 600; text-align: left; margin-right: 12px;
  }

  /* Kundenanalyse: auf dem Handy nur Kunde + Summe, Rest erst bei Antippen */
  #customerTable tr { cursor: pointer; }
  #customerTable tr:not(.is-expanded) td:not([data-label="Kunde"]):not([data-label="Summe (netto)"]) {
    display: none;
  }

  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi-card { min-width: 0; }
  .kpi-card__value { min-width: 0; overflow-wrap: break-word; }
  .kpi-card { padding: 10px 8px; }
  .kpi-card__label { font-size: 9px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kpi-card__value { font-size: 15px; }
  .kpi-card__row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .kpi-card__trend { font-size: 10px; }
  .kpi-card__spark { display: none; }

  /* Rohertrag/Soll/Differenz-Kachel kleiner, damit das Diagramm mehr Raum bekommt */
  .summary-card { padding: 12px 14px; }
  .summary-card__headline { margin-bottom: 8px; }
  .summary-card__value { font-size: 20px; }
  .soll-ist { font-size: 12px; }
  .soll-ist td { padding: 5px 6px; }
  .diff-pill { padding: 2px 7px; font-size: 12px; }
}

/* Paket-Gruppen bei Abo-Kunden */
.status-pill--business { background: color-mix(in srgb, var(--primary) 32%, white); color: #7a5b1f; }
.status-pill--betreuung-optimierung { background: color-mix(in srgb, #4FA6D9 18%, white); color: #1F6E9C; }
.status-pill--dashboard-funnel { background: color-mix(in srgb, #8a94a6 20%, white); color: #4b5563; }


/* 2 weitere Paket-Gruppen bei Abo-Kunden */
.status-pill--web-wartung { background: color-mix(in srgb, #2F9E44 16%, white); color: #1e6b2c; }
.status-pill--sonstiges { background: color-mix(in srgb, #566360 14%, white); color: #3a4442; }
 