/* Able-Pro light skin (S10 / hz-dashboard). Tokens only — no vendor bundle. */
:root {
  --hz-primary: #4680ff;
  --hz-primary-hover: #3866cc;
  --hz-primary-subtle: #c8d9ff;
  --hz-body-bg: #f8f9fa;
  --hz-surface: #ffffff;
  --hz-heading: #1d2630;
  --hz-body-text: #131920;
  --hz-muted: #5b6b79;
  --hz-border: #e7eaee;
  --hz-sidebar-border: #bec8d0;
  --hz-active-bg: #f3f5f7;
  --hz-success: #2ca87f;
  --hz-warning: #e58a00;
  --hz-danger: #dc2626;
  --hz-info: #3ec9d6;
  --hz-primary-light: #e9f0ff;
  --hz-info-light: #c5eff3;
  --hz-success-light: #c0e5d9;
  --hz-warning-light: #f7dcb3;
  --hz-danger-light: #f5bebe;
  --hz-radius: 8px;
  --hz-radius-sm: 6px;
  --hz-radius-lg: 10px;
  --hz-shadow: 0 8px 24px rgba(27, 46, 94, 0.08);
  --hz-sidebar-w: 260px;
  --hz-topbar-h: 60px;
  --hz-font: "Inter", system-ui, sans-serif;
  --hz-brand-bordeaux: #7a1f3d;

  --primary: var(--hz-primary);
  --primary-hover: var(--hz-primary-hover);
  --surface: var(--hz-body-bg);
  --danger: var(--hz-danger);
  --warn: var(--hz-warning);
  --ok: var(--hz-success);
  --card: var(--hz-surface);
  --muted: var(--hz-muted);
  --line: var(--hz-border);
  --ink: var(--hz-body-text);
  --heading: var(--hz-heading);
  --shadow: var(--hz-shadow);
  --radius: var(--hz-radius);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--hz-font);
  background: var(--surface);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100svh;
}
input[readonly] { background: var(--hz-active-bg); color: var(--muted); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

.login-wrap {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--hz-body-bg);
}
.login,
.login-card {
  width: min(100%, 420px);
  margin: 0;
  background: var(--hz-surface);
  padding: 28px 22px 24px;
  border-radius: var(--hz-radius-lg);
  border: 1px solid var(--hz-border);
  box-shadow: var(--hz-shadow);
}
.login h1 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--hz-heading);
}
.login p { color: var(--muted); margin: 0 0 1rem; font-size: 0.9rem; }
.brand-logo {
  display: block;
  width: min(100%, 200px);
  height: 28px;
  margin: 0 0 16px;
  background-color: var(--hz-heading);
  -webkit-mask: url("/icons/logo.svg") center / contain no-repeat;
  mask: url("/icons/logo.svg") center / contain no-repeat;
}
.pwa-install {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 12px;
  background: var(--hz-active-bg);
  border-radius: var(--hz-radius);
  text-align: left;
}
.pwa-install.hidden { display: none !important; }
.pwa-install img { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.pwa-install .pwa-copy { min-width: 0; flex: 1; }
.pwa-install strong { display: block; font-size: 0.92rem; color: var(--hz-heading); }
.pwa-install span { display: block; font-size: 0.78rem; color: var(--hz-muted); }
.pwa-install .primary { width: auto; margin: 0; flex-shrink: 0; }
.auth-alt { margin: 0.85rem 0 0; }
.auth-alt .ghost { font-size: 0.9rem; }
label { display: block; margin: 0.75rem 0 0.25rem; font-size: 0.85rem; }
.period {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: end;
  margin: 0.75rem 0;
}
.period label { margin: 0; }
.period input[type="date"] { width: auto; min-width: 9.5rem; }
.list-row.action { cursor: pointer; }
.list-row.action:hover { background: var(--hz-active-bg); }
.card.action { cursor: pointer; }
.card.action:hover { border-color: var(--primary); }
.card.action:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.insight-findings { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.insight-findings li { margin: 0.35rem 0; }
.insight-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin: 0.75rem 0; }
.insight-actions .primary,
button.insight-request.primary {
  width: 100%;
  max-width: 22rem;
  margin-top: 0.15rem;
}
button.insight-request.ghost {
  width: auto;
  margin-top: 0;
}
.insight-idle { margin: 0.5rem 0; }
.insight-chat { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; }
.insight-msg { padding: 0.65rem 0.75rem; border-radius: 10px; border: 1px solid var(--line); }
.insight-msg.user { background: var(--hz-active-bg); }
.insight-msg.assistant { background: #e8f6f0; }
.insight-msg .muted { margin: 0 0 0.25rem; font-size: 0.8rem; }
.insight-compose { margin: 0.5rem 0 1rem; }
.insight-compose textarea,
.insight-rule-form textarea,
.insight-rule-form input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
}
.insight-compose textarea { min-height: 4.5rem; resize: vertical; }
.insight-compose .primary,
.insight-rule-form .primary { width: auto; margin-top: 0.5rem; }
.insight-proposed {
  border: 1px dashed var(--line);
  padding: 0.75rem;
  border-radius: 10px;
  margin: 0.75rem 0;
}
.insight-rules { margin-top: 1rem; }
.insight-rules summary { cursor: pointer; }
.insight-rule { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.insight-rule:last-child { border-bottom: 0; }
.receipt-articles { font-size: 0.85rem; }
.login button.primary[disabled] { opacity: 0.6; cursor: wait; }
.shell-header .row { justify-content: space-between; }

input[type="text"], input[type="password"], input[type="search"], input[type="date"], input[type="email"], input[type="number"], input[type="file"], select, textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--hz-radius);
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--hz-primary);
  outline-offset: 1px;
  border-color: var(--hz-primary);
}
.primary {
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: var(--hz-radius);
  padding: 0.7rem 1rem;
  width: 100%;
  margin-top: 1rem;
  font-weight: 700;
}
.primary:hover { background: var(--hz-primary-hover); }
.ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--primary);
  text-decoration: none;
  font-weight: 650;
}

.topbar,
.shell-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 8px;
  min-height: var(--hz-topbar-h);
  padding: 8px 12px 10px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hz-border);
  color: var(--hz-heading);
  overflow: visible;
}
.topbar-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.topbar-end {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.topbar-logout { display: none; }
.side-logout {
  margin-top: 8px;
  width: auto;
  padding: 0.35rem 0;
  font-size: 0.85rem;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.topbar-logo {
  display: block;
  width: min(120px, 32vw);
  height: 24px;
  background-color: var(--hz-heading);
  -webkit-mask: url("/icons/logo.svg") center / contain no-repeat;
  mask: url("/icons/logo.svg") center / contain no-repeat;
  flex: 0 1 auto;
  min-width: 72px;
}
.shell-header h1 {
  font-size: 1rem;
  margin: 0;
  font-weight: 700;
  color: var(--hz-heading);
}
.shell-header select {
  color: var(--ink);
  background: #fff;
}
.burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--hz-heading);
}
.burger-bars,
.burger-bars::before,
.burger-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
}
.burger-bars::before,
.burger-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.burger-bars::before { top: -6px; }
.burger-bars::after { top: 6px; }
.shell-header select option,
.shell-header select optgroup {
  color: var(--primary);
  background: #fff;
}
.row { display: flex; gap: 0.5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; justify-content: space-between; }
.row select { flex: 1; }
.stack label { margin-top: 0.6rem; }
.stack .primary { width: auto; }

.role-chip {
  display: none;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--hz-border);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  color: var(--hz-muted);
  background: var(--hz-active-bg);
  white-space: nowrap;
}
.crumbs { display: flex; flex-wrap: wrap; gap: 0.2rem; align-items: center; }
.crumbs button, .crumb-now {
  background: transparent;
  border: 0;
  color: var(--primary);
  padding: 0.15rem 0.2rem;
  text-decoration: underline;
}
.crumb-now { text-decoration: none; font-weight: 650; }
.live-wrap { display: flex; align-items: center; gap: 0.4rem; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #3dba74;
  box-shadow: 0 0 0 0 rgba(61, 186, 116, 0.7);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 186, 116, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(61, 186, 116, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 186, 116, 0); }
}
.dash-hero { padding: 1rem 1.05rem 0.95rem; }
.dash-hero h2 {
  margin: 0.25rem 0 0.35rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.dash-kpis { margin-bottom: 0.85rem; }
.kpi .value.enter { animation: popin 0.55s ease; }
@keyframes popin {
  from { transform: translateY(6px); opacity: 0.2; }
  to { transform: none; opacity: 1; }
}
.able-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.able-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 0.95rem 0.7rem;
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.15rem;
}
.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.kpi-glyph { width: 20px; height: 20px; }
.kpi-icon.tone-primary { background: var(--hz-primary-light); color: var(--hz-primary); }
.kpi-icon.tone-info { background: var(--hz-info-light); color: #0e7780; }
.kpi-icon.tone-success { background: var(--hz-success-light); color: var(--hz-success); }
.kpi-icon.tone-warning { background: var(--hz-warning-light); color: var(--hz-warning); }
.kpi-icon.tone-danger { background: var(--hz-danger-light); color: var(--hz-danger); }
.able-kpi .label { font-size: 0.78rem; }
.able-kpi .value { font-size: 1.28rem; font-weight: 700; color: var(--hz-heading); }
.mini-spark { width: 100%; height: 32px; margin-top: 0.2rem; }
.mini-spark-svg { width: 100%; height: 32px; display: block; }
.spark { width: 100%; height: 88px; display: block; }
.spark-line,
.area-line {
  fill: none;
  stroke: var(--hz-primary);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spark-line.tone-info { stroke: var(--hz-info); }
.spark-line.tone-success { stroke: var(--hz-success); }
.spark-line.tone-warning { stroke: var(--hz-warning); }
.spark-line.tone-danger { stroke: var(--hz-danger); }
.spark-fill { fill: rgba(70, 128, 255, 0.14); }
.spark-fill.tone-info { fill: rgba(62, 201, 214, 0.18); }
.spark-fill.tone-success { fill: rgba(44, 168, 127, 0.16); }
.spark-fill.tone-warning { fill: rgba(229, 138, 0, 0.16); }
.spark-fill.tone-danger { fill: rgba(220, 38, 38, 0.14); }
.dash-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.dash-chart-card,
.dash-compare-card { margin-bottom: 0; }
.card-head h2 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.card-head .muted { margin: 0 0 0.85rem; }
.able-chart { min-height: 4.75rem; }
.chart-wrap { position: relative; width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; }
.area-chart { min-height: 210px; }
.chart-grid { stroke: var(--hz-border); stroke-width: 1; }
.chart-axis {
  fill: var(--hz-muted);
  font-size: 11px;
  font-family: var(--hz-font);
}
.area-line { stroke-width: 2.4; }
.chart-hover-line { stroke: var(--hz-primary); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-hover-dot { fill: #fff; stroke: var(--hz-primary); stroke-width: 2; }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: var(--hz-heading);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.32rem 0.5rem;
  border-radius: 8px;
  transform: translate(-50%, -130%);
  white-space: nowrap;
  z-index: 2;
  box-shadow: var(--hz-shadow);
}
.chart-legend {
  display: flex;
  gap: 0.9rem;
  margin-bottom: 0.55rem;
  font-size: 0.75rem;
  color: var(--hz-muted);
}
.chart-legend .leg { display: inline-flex; align-items: center; gap: 0.35rem; }
.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.leg.current i { background: var(--hz-primary); }
.leg.prior i { background: var(--hz-sidebar-border); }
.gbar-plot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  align-items: end;
  min-height: 176px;
}
.gbar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
}
.gbar-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 132px;
}
.gbar-bar {
  width: 42%;
  max-width: 22px;
  height: 0;
  border-radius: 6px 6px 2px 2px;
  transition: height 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.gbar-bar.current { background: var(--hz-primary); }
.gbar-bar.prior { background: var(--hz-sidebar-border); }
.gbar-day { font-size: 0.72rem; color: var(--hz-muted); }
.gbar-val { font-size: 0.82rem; font-weight: 700; color: var(--hz-heading); }
.gbar-delta { font-size: 0.68rem; color: var(--hz-muted); text-align: center; line-height: 1.25; }
.gbar-delta.up { color: var(--hz-success); }
.gbar-delta.down { color: var(--hz-danger); }
.hbar { display: grid; gap: 0.65rem; }
.hbar-row {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.15rem 0;
}
.hbar-row:hover { background: var(--hz-active-bg); border-radius: 8px; }
.hbar-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: flex-start;
}
.hbar-value { text-align: right; flex-shrink: 0; }
.hbar-track {
  margin-top: 0.35rem;
  background: var(--hz-active-bg);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.hbar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--hz-primary);
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
.hbar-fill.warning { background: var(--hz-warning); }
.hbar-fill.danger { background: var(--hz-danger); }
.hbar-fill.success { background: var(--hz-success); }
.child-card {
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.child-card:hover { background: var(--hz-active-bg); }
.bar-track {
  margin-top: 0.35rem;
  background: var(--line);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--hz-primary);
  transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-fill.amber { background: var(--warn); }
.bar-fill.hoch { background: var(--danger); }
.check-row { display: flex; gap: 0.5rem; align-items: center; margin: 0.25rem 0; }
.check-row input { width: auto; }

.hz-app {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--hz-body-bg);
}
.hz-body {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: flex-start;
}
.page-col {
  flex: 1 1 auto;
  min-width: 0;
}
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.4);
}
.hz-app.nav-open .drawer-backdrop { display: block; }

.tabs,
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 8px 16px;
  background: var(--hz-surface);
  border-right: 1px dashed var(--hz-sidebar-border);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: min(280px, 86vw);
  height: 100svh;
  overflow: auto;
  transform: translateX(-105%);
  transition: transform 0.2s ease;
}
.hz-app.nav-open .sidebar { transform: translateX(0); }
.pc-user-card {
  padding: 8px 8px 12px;
  margin: -4px -4px 8px;
  border-bottom: 1px dashed var(--hz-sidebar-border);
}
.user-card-text { display: grid; min-width: 0; }
.user-card-text strong {
  font-size: 0.9rem;
  color: var(--hz-heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-card-text span { font-size: 0.75rem; color: var(--hz-muted); }
.tabs a[data-tab],
.tabs .nav-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--hz-radius);
  background: transparent;
  color: var(--hz-muted);
  font-weight: 600;
  font-size: 0.875rem;
  text-align: left;
  text-decoration: none;
}
.tabs a[data-tab]:hover,
.tabs .nav-item:hover { background: var(--hz-active-bg); color: var(--hz-heading); }
.tabs a[data-tab].active,
.tabs .nav-item.active {
  background: var(--hz-active-bg);
  color: var(--hz-primary);
  font-weight: 600;
}

main,
main.page {
  flex: 1;
  padding: 16px;
  padding-bottom: 5rem;
  max-width: min(1080px, 100%);
  margin: 0 auto;
  width: 100%;
}
.card {
  background: var(--card);
  border-radius: var(--hz-radius-lg);
  padding: 1rem;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--hz-shadow);
}
.card h2, .card h3 { color: var(--hz-heading); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
#zusatz-kpis { grid-template-columns: repeat(2, 1fr); }
.attach-split { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--hz-radius-lg); padding: 0.75rem; box-shadow: var(--hz-shadow); }
.kpi .label { font-size: 0.75rem; color: var(--muted); }
.kpi .value { font-size: 1.15rem; font-weight: 650; }

.banner { padding: 0.7rem 0.85rem; border-radius: var(--hz-radius); margin-bottom: 0.8rem; }
.banner.error { background: #fde8e8; color: var(--danger); }
.banner.ok { background: #e4f6ef; color: var(--ok); }
.banner.warn { background: #fff4e0; color: #7a6230; }
.muted { color: var(--muted); font-size: 0.85rem; }
.drop {
  border: 1.5px dashed var(--primary);
  border-radius: 14px;
  padding: 1.4rem 1rem;
  text-align: center;
  background: #fff;
}
.timeline-event-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}
.timeline-event-toolbar h3 { margin: 0; }
#timeline-show-all[hidden] { display: none !important; }
#timeline-show-all[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
}
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: center;
  flex-shrink: 0;
}
.list-actions .ghost {
  padding: 0.15rem 0;
  font-size: 0.85rem;
}
.ghost.danger { color: var(--danger); }
.ampel { display: inline-block; padding: 0.1rem 0.45rem; border-radius: 999px; font-size: 0.75rem; }
.ampel.neutral { background: #e5f3ea; color: var(--ok); }
.ampel.amber { background: #f7efd8; color: #7a6230; }
.ampel.hoch { background: #fde8e0; color: var(--danger); }

.chip { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 6px; font-size: 0.75rem; margin-right: 0.3rem; }
.chip.BON { background: #e7eee9; }
.chip.SST { background: #f7efd8; color: #7a6230; }
.chip.STO { background: #fde8e0; color: var(--danger); }
.chip.UMB { background: #e4eaf6; color: #2a3f73; }
.chip.SPL { background: #e4eaf6; color: #2a3f73; }
.chip.BST { background: #fde8e0; color: var(--danger); }
.chip.REC { background: #e8f3ea; color: #1a5c32; }
.chip.DIV,
.chip.TIP { background: #f6e8f0; color: #6b2d4a; }
.chip.RET { background: #fde8e0; color: var(--danger); }
.chip.EIN { background: #e8f3ea; color: #1a5c32; }
.chip.ZAA,
.chip.ZUS,
.chip.DELB,
.chip.ZUE { background: #e4eaf6; color: #2a3f73; }
.chip.WAA,
.chip.RPR { background: #ececec; color: #555; }
.chip.OPS,
.chip.CLS,
.chip.PRO,
.chip.TIE,
.chip.PIX,
.chip.RAB,
.chip.CPR,
.chip.ZR,
.chip.ABR,
.chip.VAB,
.chip.UEB,
.chip.RES,
.chip.REST { background: #ececec; color: #555; }

.hidden { display: none !important; }
footer.tabs-mobile {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.header-tools { margin: 0; align-items: center; flex: none; width: 100%; }
.header-tools select { flex: 1 1 100%; min-width: 0; }
.header-period {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  margin: 0;
}
.header-period .window-chips { margin: 0; }
.shell-header .window-chips button {
  background: #fff;
  color: var(--hz-heading);
  border-color: var(--hz-border);
}
.shell-header .window-chips button.active {
  background: var(--hz-primary);
  color: #fff;
  border-color: var(--hz-primary);
}
.range-picker {
  position: relative;
  flex: 1 1 100%;
  min-width: 0;
  max-width: none;
}
.range-picker input[type="text"] {
  margin: 0;
  width: 100%;
  min-width: 0;
}
.range-calendar {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 30;
  background: var(--card);
  color: var(--primary);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(26, 53, 49, 0.18);
  padding: 0.75rem;
  min-width: min(38rem, calc(100vw - 1.5rem));
}
.range-calendar-hint {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.range-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.range-calendar-nav button {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  color: var(--primary);
}
.range-calendar-months {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.range-month h3 {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  text-align: center;
}
.range-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}
.range-dow {
  font-size: 0.68rem;
  text-align: center;
  color: var(--muted);
  padding: 0.15rem 0;
}
.range-day {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 0.35rem 0;
  min-height: 2rem;
  color: var(--primary);
}
.range-day:hover:not(:disabled) { background: var(--hz-primary-subtle); }
.range-day:disabled { visibility: hidden; }
.range-day.today { box-shadow: inset 0 0 0 1px var(--primary); }
.range-day.in-range { background: var(--hz-primary-subtle); }
.range-day.range-start,
.range-day.range-end {
  background: var(--primary);
  color: #fff;
}
.bon-search { display: flex; gap: 0.35rem; align-items: center; }
.bon-search input { margin: 0; }
.page-bon-search { margin: 0.75rem 0 0; max-width: 22rem; }
.page-bon-search .ghost {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  white-space: nowrap;
}
.tabs-more { position: static; flex: none; width: 100%; margin-top: 8px; }
.tabs-more > #more-btn {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.45rem 12px 0.2rem;
  color: var(--hz-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  cursor: default;
}
.tabs-more.open > #more-btn,
.tabs-more > #more-btn.active {
  color: var(--hz-primary);
  font-weight: 700;
}
.more-menu {
  position: static;
  background: transparent;
  border: 0;
  border-radius: 0;
  min-width: 0;
  box-shadow: none;
  z-index: 8;
  padding: 0;
  display: grid;
  gap: 2px;
}
.more-menu.hidden { display: grid !important; }
.more-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  text-align: left;
  flex: none;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 12px;
  border-radius: var(--hz-radius);
  color: var(--hz-muted);
  font-weight: 600;
  font-size: 0.875rem;
}
.more-menu button:hover { background: var(--hz-active-bg); color: var(--hz-heading); }
.more-menu button.active { background: var(--hz-active-bg); color: var(--hz-primary); }
.more-menu-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #6b6258);
  padding: 0.5rem 0.75rem 0.15rem;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}
.compare-chip {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
}
.compare-chip:hover { border-color: var(--primary); }
.compare-chip .delta.up { color: var(--ok); }
.compare-chip .delta.down { color: var(--danger); }
.window-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.6rem 0; }
.window-chips button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  color: var(--primary);
}
.window-chips button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.master-nav a {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
}
.master-nav a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.split-cards { display: grid; gap: 0.85rem; }
.receipt-hoch {
  border-left: 4px solid var(--danger);
  padding-left: 0.55rem;
  background: #fdf4ef;
}
.receipt-warn {
  border-left: 4px solid var(--warn);
  padding-left: 0.55rem;
  background: #fbf8ef;
}
.receipt-hinweis {
  border-left: 4px solid #8a9a8a;
  padding-left: 0.55rem;
  background: #f4f6f4;
}
.severity-pill {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
  margin-left: 0.35rem;
}
.severity-pill.hoch { background: #fde8e0; color: var(--danger); }
.severity-pill.warn { background: #f7efd8; color: #7a6230; }
.review-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.55rem 0; }
.review-filters button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  color: var(--primary);
}
.review-filters button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.review-pill {
  display: inline-block;
  font-size: 0.7rem;
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
  margin-left: 0.35rem;
}
.review-pill.unreviewed { background: #ececec; color: #555; }
.review-pill.ok { background: #e5f3ea; color: var(--ok); }
.review-pill.clarify { background: #f7efd8; color: #7a6230; }
.review-pill.disputed { background: #fde8e0; color: var(--danger); }
.review-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.review-actions button { width: auto; margin: 0; padding: 0.25rem 0.55rem; font-size: 0.8rem; }
.review-form { display: grid; gap: 0.55rem; margin-top: 0.75rem; }
.review-form textarea { min-height: 4.5rem; resize: vertical; }
.review-form .row { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: end; }
.review-form .row label { flex: 1; min-width: 8rem; }
.review-history { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; color: var(--muted); }
.proposed-rule { margin-top: 0.8rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.risk-brief { margin: 0.75rem 0 1rem; padding: 0.75rem 0.85rem; border-radius: 12px; border: 1px solid var(--line); }
.risk-brief.hoch { background: #fdf4ef; border-color: #efc7b6; }
.risk-brief.warn { background: #fbf8ef; border-color: #e6d7a8; }
.risk-brief.hinweis, .risk-brief.neutral { background: #f4f6f4; }
.risk-brief ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.list-row.action { border-radius: 8px; }
.list-row.action:focus { outline: 2px solid var(--primary); outline-offset: 2px; }

.tafel-orientation {
  border: 0;
  margin: 0.75rem 0 0;
  padding: 0;
}
.tafel-orientation legend {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
.tafel-preview-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  background: #fff;
  min-height: 8rem;
  overflow: hidden;
}
.tafel-preview-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: rgba(26, 53, 49, 0.08);
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 1;
}
#tafel-preview-body {
  position: relative;
  z-index: 2;
}
.tafel-preview-head { margin-bottom: 0.65rem; }
.tafel-preview-progress {
  font-size: 1.35rem;
  font-weight: 650;
  margin-bottom: 0.75rem;
}
.tafel-preview-grid {
  display: grid;
  gap: 0.5rem;
}
.tafel-preview-grid.tafel-preview-quer {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tafel-preview-grid.tafel-preview-hoch {
  grid-template-columns: 1fr;
}
.tafel-preview-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: var(--card);
}

.dienst-root { display: flex; flex-direction: column; gap: 0.85rem; }
.dienst-house h2 { margin: 0 0 0.35rem; }
.dienst-kpis { margin: 0.75rem 0 1rem; }
.dienst-kpis .kpi-value { font-size: 1.15rem; font-weight: 600; }
.dienst-kpis .kpi-note { font-size: 0.8rem; margin-top: 0.15rem; }
.dienst-team .list-row { cursor: default; }
.dienst-team .list-row:hover { background: transparent; }

@media (max-width: 640px) {
  .dienst-kpis { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .range-calendar { left: 0; right: auto; min-width: 0; width: min(22rem, calc(100vw - 1.5rem)); }
  .range-calendar-months { grid-template-columns: 1fr; }
}
@media (min-width: 768px) {
  .burger { display: none; }
  .topbar,
  .shell-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .topbar-main { flex: 0 1 auto; }
  .topbar .brand { flex: 0 0 auto; }
  .topbar-logo { width: 148px; height: 28px; min-width: 120px; }
  .topbar-logout { display: inline-flex; }
  .role-chip { display: inline-block; }
  .side-logout { display: none; }
  .header-tools { flex: 1 1 16rem; width: auto; }
  .header-tools select { flex: 0 1 13rem; min-width: 9rem; }
  .header-period { flex: 1 1 16rem; justify-content: flex-end; }
  .range-picker { flex: 1 1 13.5rem; min-width: 12.5rem; max-width: 18rem; }
  .tabs,
  .sidebar {
    position: sticky;
    top: var(--hz-topbar-h);
    align-self: flex-start;
    transform: none;
    width: var(--hz-sidebar-w);
    flex: 0 0 var(--hz-sidebar-w);
    height: auto;
    min-height: calc(100svh - var(--hz-topbar-h));
  }
  .drawer-backdrop,
  .hz-app.nav-open .drawer-backdrop { display: none !important; }
}
@media (min-width: 1024px) {
  main, main.page { max-width: 1080px; margin: 0 auto; width: 100%; }
  .desktop-split { display: grid; grid-template-columns: 420px 1fr; gap: 1rem; }
  .dash-kpis,
  .able-kpis { grid-template-columns: repeat(4, 1fr); }
  #zusatz-kpis { grid-template-columns: repeat(4, 1fr); }
  .compare-grid { grid-template-columns: repeat(4, 1fr); }
  .split-cards { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1.35fr 1fr; }
}

.load-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 80;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}
.load-progress[hidden] { display: none !important; }
.load-progress-bar {
  height: 100%;
  width: 36%;
  border-radius: 999px;
  background: var(--hz-primary);
  animation: load-progress-slide 1.05s ease-in-out infinite;
}
.header-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--hz-muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.header-loading[hidden] { display: none !important; }
.header-loading .load-pulse-bars { height: 0.95rem; }
.header-loading .load-pulse-bars span { width: 0.22rem; background: var(--hz-primary); }
@keyframes load-progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(380%); }
}

.is-loading {
  position: relative;
  min-height: 4.75rem;
  pointer-events: none;
  color: transparent;
}
.is-loading > *:not(.load-pulse) {
  visibility: hidden;
}
.load-pulse {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}
.load-pulse-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.32rem;
  height: 1.55rem;
}
.load-pulse-bars span {
  display: block;
  width: 0.38rem;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transform-origin: center bottom;
  animation: load-pulse 1.05s ease-in-out infinite;
}
.load-pulse-bars span:nth-child(2) { animation-delay: 0.14s; }
.load-pulse-bars span:nth-child(3) { animation-delay: 0.28s; }
@keyframes load-pulse {
  0%, 100% { transform: scaleY(0.4); opacity: 0.28; }
  50% { transform: scaleY(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot, .spark-line, .kpi .value.enter, .load-pulse-bars span, .load-progress-bar { animation: none; }
  .spark-line { stroke-dashoffset: 0; }
  .bar-fill, .hbar-fill, .gbar-bar { transition: none; }
  .load-pulse-bars span { opacity: 0.7; transform: none; }
  .load-progress-bar { width: 100%; opacity: 0.7; }
}
