/* FAST Dashboard – Design nach dem FAST-Logo (Navy #1A3C6A) */

:root {
  --navy: #1a3c6a;
  --navy-600: #24518d;
  --navy-700: #163356;
  --navy-800: #10284a;
  --navy-900: #0b1b33;
  --blue: #2f6fc4;
  --sky: #5aa2ff;
  --yellow: #f5c518;
  --yellow-600: #d9a900;

  --bg: #f2f5fa;
  --bg-2: #e9eef6;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --text: #0f1b2d;
  --text-2: #3d4b60;
  --muted: #6b7a90;
  --line: #e2e8f1;
  --line-2: #cfd8e5;
  --green: #159a5a;
  --green-bg: #e6f7ee;
  --red: #dc2650;
  --red-bg: #fdeaef;
  --amber: #d98b00;
  --amber-bg: #fff4dc;

  --chart-1: #1a3c6a;
  --chart-2: #5aa2ff;
  --chart-3: #f5c518;
  --chart-4: #19b385;
  --chart-5: #ff7a59;

  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.05), 0 1px 1px rgba(15, 27, 45, 0.03);
  --shadow: 0 6px 20px rgba(26, 60, 106, 0.08), 0 1px 3px rgba(15, 27, 45, 0.05);
  --shadow-lg: 0 20px 50px rgba(26, 60, 106, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 248px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme="dark"] {
  --bg: #0b1626;
  --bg-2: #0f1e33;
  --surface: #12223a;
  --surface-2: #172b47;
  --text: #eaf0f8;
  --text-2: #c2cede;
  --muted: #8fa1b8;
  --line: #22385a;
  --line-2: #2d4770;
  --green-bg: rgba(21, 154, 90, 0.16);
  --red-bg: rgba(220, 38, 80, 0.16);
  --amber-bg: rgba(217, 139, 0, 0.16);
  --chart-1: #7fb4ff;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: rgba(245, 197, 24, 0.45); }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ───────────── Layout ───────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-800) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}
.sidebar .logo { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.sidebar .logo img { height: 30px; width: auto; display: block; }
.sidebar .logo .sub {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.7; font-weight: 600;
  border-left: 1px solid rgba(255, 255, 255, 0.25); padding-left: 12px; line-height: 1.2;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; border: 0; background: transparent;
  color: rgba(255, 255, 255, 0.78); cursor: pointer; text-align: left; width: 100%;
  transition: background 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}
.nav-item svg { width: 19px; height: 19px; flex: none; opacity: 0.9; }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.is-active { background: rgba(255, 255, 255, 0.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.nav-item.is-active::before { content: ""; width: 3px; height: 18px; border-radius: 3px; background: var(--yellow); margin-left: -12px; margin-right: 1px; }
.nav-item .badge { margin-left: auto; background: var(--yellow); color: var(--navy-900); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.nav-section { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.5; padding: 16px 12px 6px; font-weight: 600; }

.sidebar-bottom { margin-top: auto; }
.user-card {
  display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.08);
}
.user-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* Aktionen (Design, Ueberall abmelden, Abmelden) in eigener Zeile unter dem Namen,
   damit nichts mehr ueber Name/E-Mail liegt (18.10.2026). */
.user-actions {
  display: flex; justify-content: space-around; gap: 4px; padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--yellow); color: var(--navy-900);
  font-weight: 800; display: grid; place-items: center; flex: none; font-size: 14px;
}
.user-card .name { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.user-card .email { font-size: 11.5px; opacity: 0.65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.icon-btn {
  border: 0; background: transparent; color: inherit; cursor: pointer; padding: 8px; border-radius: 10px;
  display: grid; place-items: center; opacity: 0.8; transition: background 150ms, opacity 150ms;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); opacity: 1; }
.icon-btn svg { width: 18px; height: 18px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 28px 12px; position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.topbar .titles { min-width: 0; }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.topbar .subtitle { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.back-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; width: 34px; height: 34px;
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform 150ms var(--ease), background 150ms;
}
.back-btn:hover { background: var(--surface-2); transform: translateX(-2px); }
.back-btn svg { width: 18px; height: 18px; }

.chips { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); padding: 4px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.chip {
  border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px;
  color: var(--text-2); transition: background 160ms var(--ease), color 160ms var(--ease);
  white-space: nowrap;
}
.chip:hover { background: var(--bg-2); color: var(--text); }
.chip.is-active { background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(26, 60, 106, 0.35); }
:root[data-theme="dark"] .chip.is-active { background: var(--sky); color: var(--navy-900); }

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform 150ms var(--ease), background 150ms;
}
.pill:hover { background: var(--surface-2); transform: translateY(-1px); }
.pill svg { width: 15px; height: 15px; opacity: 0.8; }
.pill .count { background: var(--yellow); color: var(--navy-900); border-radius: 999px; padding: 0 7px; font-size: 11.5px; font-weight: 800; }
.pill.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(21, 154, 90, 0.5); animation: livepulse 2s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(21, 154, 90, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(21, 154, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 154, 90, 0); } }

.view { padding: 8px 28px 120px; animation: viewin 420ms var(--ease) both; }
@keyframes viewin { from { opacity: 0; transform: translateY(10px) scale(0.992); } to { opacity: 1; transform: none; } }

/* ───────────── Cards / Grid ───────────── */
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.hero { grid-template-columns: 1.6fr 1fr; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: 1.3fr 1fr 1fr; align-items: start; }
.grid.stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.view > * + * { margin-top: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm); position: relative; min-width: 0;
  transition: box-shadow 220ms var(--ease), transform 220ms var(--ease), border-color 220ms;
}
.card.clickable { cursor: pointer; }
.card.clickable:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--line-2); }
.card.clickable:hover .card-arrow { opacity: 1; transform: translate(0, 0); }
.card-arrow { position: absolute; top: 16px; right: 16px; opacity: 0; transform: translate(-4px, 4px); transition: all 200ms var(--ease); color: var(--muted); }
.card-arrow svg { width: 16px; height: 16px; }
.card h3 { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; text-transform: uppercase; }
.card h2 { margin: 0 0 14px; font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card h2 .hint { font-weight: 500; color: var(--muted); font-size: 12.5px; margin-left: auto; }
.card.navy { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-800) 100%); color: #fff; border: 0; display: flex; flex-direction: column; }
.card.navy .spark.wide { flex: 1; min-height: 72px; max-height: 230px; }
.card.navy .kpi-foot { margin-top: auto; padding-top: 10px; }
.card.navy h3 { color: rgba(255, 255, 255, 0.7); }
.card.navy .muted { color: rgba(255, 255, 255, 0.65); }
.card.navy .delta { background: rgba(255, 255, 255, 0.14); color: #fff; }
.card.navy .delta.up { color: #7ff0b6; }
.card.navy .delta.down { color: #ffb3c1; }

.kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 6px; }
.kpi-value.hero { font-size: 44px; }
.kpi-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 6px; }
.spark { width: 120px; height: 44px; flex: none; }
.spark.wide { width: 100%; height: 72px; }
.spark-svg { display: block; width: 100%; height: 100%; }
.spark-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); white-space: nowrap; }
.delta.up { background: var(--green-bg); color: var(--green); }
.delta.down { background: var(--red-bg); color: var(--red); }
.delta svg { width: 12px; height: 12px; }

.stat { padding: 14px 16px; }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 20px; font-weight: 800; margin-top: 4px; letter-spacing: -0.01em; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.stat .sub .delta { font-size: 11px; padding: 2px 7px; }

/* ───────────── Charts ───────────── */
.chart { position: relative; width: 100%; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { animation: fadein 900ms var(--ease) both; }
.chart-compare { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 2 4; opacity: 0.55; }
.chart-trend { stroke: var(--yellow-600); stroke-width: 2; stroke-dasharray: 7 6; opacity: 0.95; animation: fadein 1.2s var(--ease) both; }
:root[data-theme="dark"] .chart-trend { stroke: var(--yellow); }
.chart-trend-label { fill: var(--yellow-600); font-size: 11px; font-weight: 700; font-family: var(--font); }
:root[data-theme="dark"] .chart-trend-label { fill: var(--yellow); }
.chart-dot { stroke: var(--surface); stroke-width: 2; }
.chart-dot-halo { opacity: 0.2; animation: halo 2s infinite; }
@keyframes halo { 0%, 100% { r: 6; opacity: 0.25; } 50% { r: 10; opacity: 0.08; } }
.chart-cursor { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; transition: opacity 150ms; }
.chart-bar { fill: var(--chart-1); opacity: 0.9; animation: barin 600ms var(--ease) both; transition: fill 150ms; }
.chart-bar:hover { fill: var(--sky); }
.chart-bar.is-highlight { fill: var(--yellow); }
@keyframes barin { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.chart-tip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; opacity: 0; transition: opacity 120ms;
  background: var(--navy-900); color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 10px; white-space: nowrap; box-shadow: var(--shadow); z-index: 5;
  line-height: 1.35;
}
.chart-tip b { font-weight: 700; color: var(--yellow); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 3px; background: var(--chart-1); }
.chart-legend i.trend { background: repeating-linear-gradient(90deg, var(--yellow-600) 0 5px, transparent 5px 9px); }
.chart-legend i.compare { background: repeating-linear-gradient(90deg, var(--muted) 0 2px, transparent 2px 5px); height: 2px; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-svg { display: block; flex: none; }
.donut-track { fill: none; stroke: var(--bg-2); stroke-width: 14; }
.donut-seg { fill: none; stroke-width: 14; transform: rotate(-90deg); transform-origin: 50% 50%; stroke-linecap: butt; animation: fadein 700ms var(--ease) both; }
.donut-value { font-size: 20px; font-weight: 800; fill: var(--text); font-family: var(--font); }
.donut-label { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.donut-legend { display: flex; flex-direction: column; gap: 6px; min-width: 160px; flex: 1; }
.donut-legend-row { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; }
.donut-legend-row .dot { width: 10px; height: 10px; border-radius: 50%; }
.donut-legend-row .val { font-weight: 700; }
.donut-legend-row .pct { color: var(--muted); font-size: 12px; min-width: 38px; text-align: right; }

.hbar-row { padding: 8px 0; border-bottom: 1px dashed var(--line); animation: viewin 400ms var(--ease) both; cursor: default; }
.hbar-row:last-child { border-bottom: 0; }
.hbar-row.is-highlight .hbar-fill { background: var(--yellow); }
.hbar-row.is-highlight .hbar-label { color: var(--navy); font-weight: 800; }
.hbar-head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.hbar-rank { width: 22px; height: 22px; border-radius: 7px; background: var(--bg-2); color: var(--text-2); font-size: 11.5px; font-weight: 800; display: grid; place-items: center; flex: none; }
.hbar-label { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.hbar-track { height: 7px; border-radius: 6px; background: var(--bg-2); margin-top: 7px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--navy), var(--sky)); transform-origin: left; animation: growx 700ms var(--ease) both; }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hbar-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ───────────── Tables / Lists ───────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.table td.r, .table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr { transition: background 120ms; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.is-highlight { background: var(--amber-bg); }
.table .name { font-weight: 600; }
.table-wrap { overflow-x: auto; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--bg-2); color: var(--text-2); white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok { background: var(--green-bg); color: var(--green); }
.status.bad { background: var(--red-bg); color: var(--red); }
.status.active { background: var(--amber-bg); color: var(--amber); }
.status.info { background: rgba(90, 162, 255, 0.16); color: var(--blue); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: flex-start; animation: viewin 400ms var(--ease) both; }
.list-item:last-child { border-bottom: 0; }
.list-item .ico { width: 38px; height: 38px; border-radius: 12px; background: var(--bg-2); display: grid; place-items: center; flex: none; color: var(--navy); font-weight: 800; font-size: 13px; }
:root[data-theme="dark"] .list-item .ico { color: var(--sky); }
.list-item .body { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.list-item .title .ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .title .time { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.list-item .desc { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.list-item.unread .title { color: var(--text); }
.list-item.unread .ico { background: var(--navy); color: #fff; }
.list-item .actions { display: flex; gap: 4px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); }

.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.empty .big { font-size: 34px; margin-bottom: 8px; }
.empty b { color: var(--text); }
.notice { background: var(--amber-bg); color: var(--amber); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.notice.info { background: rgba(90, 162, 255, 0.14); color: var(--blue); }
.notice code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

.btn {
  border: 0; border-radius: 11px; padding: 10px 16px; font-weight: 700; cursor: pointer; background: var(--navy); color: #fff;
  display: inline-flex; align-items: center; gap: 8px; transition: transform 150ms var(--ease), box-shadow 150ms, background 150ms;
  box-shadow: 0 4px 12px rgba(26, 60, 106, 0.25);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(26, 60, 106, 0.3); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn.yellow { background: var(--yellow); color: var(--navy-900); box-shadow: 0 4px 12px rgba(245, 197, 24, 0.35); }
.btn.danger { background: var(--red); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn svg { width: 16px; height: 16px; }
.input {
  width: 100%; border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; font: inherit; background: var(--surface); color: var(--text);
  outline: none; transition: border-color 150ms, box-shadow 150ms;
}
.input:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(26, 60, 106, 0.12); }
.form-row { display: flex; gap: 10px; align-items: center; }

.skeleton { position: relative; overflow: hidden; background: var(--bg-2); border-radius: 8px; color: transparent !important; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: shimmer 1.3s infinite; }
:root[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent); }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none; }
.toast {
  background: var(--navy-900); color: #fff; padding: 11px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 10px; animation: toastin 380ms var(--ease) both;
}
.toast.error { background: var(--red); }
@keyframes toastin { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }

/* ───────────── Status-Pill / Ampel ───────────── */
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none; }
.status-pill.ok .dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.status-pill.warn .dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.status-pill.error .dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); animation: blink 1.2s ease-in-out infinite; }
.status-pill.error { border-color: rgba(220, 38, 80, 0.45); color: var(--red); }
.status-pill.warn { border-color: rgba(217, 139, 0, 0.45); color: var(--amber); }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.nav-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.nav-dot.ok { background: #35d07f; }
.nav-dot.warn { background: var(--yellow); }
.nav-dot.error { background: #ff5c7c; box-shadow: 0 0 10px #ff5c7c; animation: blink 1.2s ease-in-out infinite; }

.status-hero { display: flex; align-items: center; gap: 20px; padding: 22px 24px; }
.status-hero .status-head { flex: 1; min-width: 0; }
.status-hero h2 { margin: 0 0 4px; font-size: 22px; }
.status-hero.ok { border-color: rgba(21, 154, 90, 0.35); background: linear-gradient(135deg, var(--surface) 0%, var(--green-bg) 100%); }
.status-hero.warn { border-color: rgba(217, 139, 0, 0.4); background: linear-gradient(135deg, var(--surface) 0%, var(--amber-bg) 100%); }
.status-hero.error { border-color: rgba(220, 38, 80, 0.4); background: linear-gradient(135deg, var(--surface) 0%, var(--red-bg) 100%); }
.lamp-wrap { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); flex: none; }
.lamp { width: 26px; height: 26px; border-radius: 50%; }
.lamp.ok { background: radial-gradient(circle at 35% 35%, #9df5c6, var(--green) 60%); box-shadow: 0 0 24px rgba(21, 154, 90, 0.7); }
.lamp.warn { background: radial-gradient(circle at 35% 35%, #ffe08a, var(--amber) 60%); box-shadow: 0 0 24px rgba(217, 139, 0, 0.7); }
.lamp.error { background: radial-gradient(circle at 35% 35%, #ff9db3, var(--red) 60%); box-shadow: 0 0 24px rgba(220, 38, 80, 0.75); animation: blink 1.2s ease-in-out infinite; }
.status-problems { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.status-groups .card h2 { align-items: center; }
.dot-lg { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot-lg.ok { background: var(--green); }
.dot-lg.warn { background: var(--amber); }
.dot-lg.error { background: var(--red); }
.dot-lg.unknown { background: var(--line-2); }
.status-list { display: flex; flex-direction: column; }
.status-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); animation: viewin 360ms var(--ease) both; }
.status-row:last-child { border-bottom: 0; }
.status-row .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--line-2); }
.status-row.ok .dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.status-row.warn .dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.status-row.error .dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.status-row .body { flex: 1; min-width: 0; }
.status-row .label { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-row .state-word { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--bg-2); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.status-row.ok .state-word { background: var(--green-bg); color: var(--green); }
.status-row.warn .state-word { background: var(--amber-bg); color: var(--amber); }
.status-row.error .state-word { background: var(--red-bg); color: var(--red); }
.status-row .detail { font-size: 12.5px; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.status-row.error .detail { color: var(--text); }
.status-row .ms { font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; margin-top: 3px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 5px 0; color: var(--text-2); }
.legend-row b { color: var(--text); }

/* ───────────── Zeitraum-Kalender ───────────── */
.range-wrap { position: relative; max-width: 100%; min-width: 0; }
.chip.custom { display: inline-flex; align-items: center; gap: 6px; }
.chip.custom svg { width: 14px; height: 14px; }
.datepicker {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; display: flex; gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: panelin 220ms var(--ease) both; max-width: calc(100vw - 32px);
}
.dp-presets { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; background: var(--surface-2); border-right: 1px solid var(--line); min-width: 150px; }
.dp-preset { border: 0; background: transparent; text-align: left; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.dp-preset:hover { background: var(--bg-2); color: var(--text); }
.dp-main { padding: 14px 16px 12px; position: relative; }
.dp-nav { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.dp-arrow { pointer-events: auto; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 18px; line-height: 1; display: grid; place-items: center; color: var(--text-2); }
.dp-arrow:hover:not(:disabled) { background: var(--bg-2); color: var(--text); }
.dp-arrow:disabled { opacity: 0.35; cursor: default; }
.dp-months { display: flex; gap: 22px; }
.dp-month { width: 252px; }
.dp-month-title { text-align: center; font-weight: 800; font-size: 13.5px; height: 30px; display: grid; place-items: center; margin-bottom: 6px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 34px); gap: 2px 0; justify-content: center; }
.dp-wd { font-size: 11px; color: var(--muted); font-weight: 700; text-align: center; padding: 4px 0 6px; }
.dp-cell { height: 34px; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 13px; color: var(--text); position: relative; padding: 0; }
.dp-cell span { display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto; border-radius: 50%; position: relative; z-index: 1; transition: background 120ms; }
.dp-cell:hover:not(:disabled) span { background: var(--bg-2); }
.dp-cell.today span { font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.dp-cell.in::before { content: ""; position: absolute; inset: 2px 0; background: rgba(90, 162, 255, 0.16); }
.dp-cell.start::before { border-radius: 17px 0 0 17px; left: 2px; }
.dp-cell.end::before { border-radius: 0 17px 17px 0; right: 2px; }
.dp-cell.start.end::before { border-radius: 17px; }
.dp-cell.start span, .dp-cell.end span { background: var(--navy) !important; color: #fff; font-weight: 800; }
:root[data-theme="dark"] .dp-cell.start span, :root[data-theme="dark"] .dp-cell.end span { background: var(--sky) !important; color: var(--navy-900); }
.dp-cell.disabled { color: var(--line-2); cursor: default; }
.dp-cell.empty { pointer-events: none; }
.dp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.dp-label { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.dp-actions { display: flex; gap: 8px; }

/* ───────────── Responsive ───────────── */
@media (max-width: 1240px) {
  .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .grid.hero, .grid.two, .grid.three { grid-template-columns: 1fr; }
  :root { --sidebar-w: 76px; }
  .sidebar { padding: 18px 10px; }
  .sidebar .logo { justify-content: center; padding-bottom: 16px; }
  .sidebar .logo img { height: 22px; }
  .sidebar .logo .sub, .nav-item span, .nav-section, .user-card .meta { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item.is-active::before { display: none; }
  .nav-item .badge { position: absolute; transform: translate(14px, -12px); }
  .user-card { align-items: center; padding: 8px; }
  .user-actions { flex-direction: column; gap: 2px; padding-top: 6px; width: 100%; align-items: center; }
  .topbar, .view { padding-left: 18px; padding-right: 18px; }
  .dp-presets { display: none; }
  .status-groups { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .app { flex-direction: column; }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; width: 100%; flex: none; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); flex-direction: row; align-items: center; z-index: 40; }
  .sidebar .logo, .sidebar-bottom, .nav-section { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-between; gap: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { padding: 8px 9px; border-radius: 10px; width: auto; flex: none; }
  .nav-item .badge { transform: translate(10px, -10px); }
  #briefEventText { display: none; }
  .pill.live { display: none; }
  .main { padding-bottom: 70px; }
  .topbar { padding: 14px 14px 8px; gap: 10px; }
  .topbar h1 { font-size: 19px; }
  .range-wrap { width: 100%; }
  .chips { overflow-x: auto; max-width: 100%; width: 100%; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip.custom { order: -1; position: sticky; left: 0; z-index: 1; background: var(--surface); }
  .chip.custom.is-active { background: var(--navy); }
  :root[data-theme="dark"] .chip.custom.is-active { background: var(--sky); }
  .view { padding: 4px 14px 150px; }
  .grid.kpis, .grid.stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 14px 15px; border-radius: 16px; }
  .kpi-value { font-size: 22px; }
  .kpi-value.hero { font-size: 34px; }
  .toast-wrap { bottom: 84px; }
  .status-hero { flex-wrap: wrap; }
  .status-hero .btn { width: 100%; justify-content: center; }
  /* Hinweis: kein position:fixed hier - der backdrop-filter der Topbar wuerde es einfangen */
  .datepicker { right: 0; width: calc(100vw - 28px); max-width: none; }
  .dp-main { width: 100%; }
  .dp-month { width: 100%; }
  .dp-grid { grid-template-columns: repeat(7, 1fr); }
  .chips { flex-wrap: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ── Restaurantliste mit Filtern ── */
.filter-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.chips.filters { flex-wrap: wrap; }
.chips.filters .chip { display: inline-flex; align-items: center; gap: 6px; }
.chips.filters .chip .count { background: var(--bg-2); color: var(--text-2); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 800; }
.chips.filters .chip.is-active .count { background: rgba(255, 255, 255, 0.22); color: #fff; }
.table tbody tr.is-muted td { color: var(--muted); }
.table tbody tr.is-muted td.name { text-decoration: line-through; text-decoration-color: var(--line-2); }

/* ── Kosten ── */
.small { font-size: 12.5px; }
.muted-inv { color: rgba(255, 255, 255, 0.72); }
.cost-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cost-head h2 { margin-bottom: 2px; }
.cost-items { margin-top: 12px; display: flex; flex-direction: column; }
.cost-item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.cost-item .amt { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.cost-item.income .amt { color: var(--green); }
.cost-item.neutral .amt { color: var(--muted); font-weight: 600; }
.cost-card.is-setup { border-style: dashed; }
.setup-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; line-height: 1.5; color: var(--text); }
.setup-steps li::marker { font-weight: 800; color: var(--blue); }

/* ── Modal, Kontextmenue, Formulare (Restaurant anlegen, Datenpflege) ── */
.modal-wrap { position: fixed; inset: 0; background: rgba(11, 27, 51, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 60; opacity: 0; transition: opacity 180ms var(--ease); backdrop-filter: blur(2px); }
.modal-wrap.show { opacity: 1; }
.modal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-height: calc(100vh - 32px); overflow: auto; transform: translateY(8px) scale(0.98); transition: transform 180ms var(--ease); }
.modal-wrap.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-body { padding: 16px 22px 22px; }
.modal-text { margin: 0 0 14px; color: var(--text-2); line-height: 1.5; font-size: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.icon-btn { background: transparent; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 6px 10px; border-radius: 8px; line-height: 1; }
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.row-menu { font-weight: 900; letter-spacing: 1px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .span2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .input { width: 100%; }
.field select.input { appearance: auto; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--navy); }
.form-error { background: var(--red-bg); color: var(--red); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }
.linkbox { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; word-break: break-all; color: var(--text); font-weight: 500; user-select: all; }
.pop-menu { position: absolute; z-index: 70; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 250px; display: flex; flex-direction: column; }
.pop-menu button { background: transparent; border: 0; text-align: left; padding: 9px 12px; border-radius: 8px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; }
.pop-menu button:hover:not(:disabled) { background: var(--bg-2); }
.pop-menu button:disabled { color: var(--muted); cursor: default; }
.pop-menu button.danger { color: var(--red); }
.pop-menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }
.table tbody tr.is-dim td { opacity: 0.62; }
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .modal-body { padding: 14px 16px 18px; }
}

/* ── Freigaben (Provisionsanfragen, Firmenkonten) ── */
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.btn.approve-btn { background: var(--green); box-shadow: 0 4px 12px rgba(21, 154, 90, 0.28); }
.btn.approve-btn:hover { box-shadow: 0 8px 20px rgba(21, 154, 90, 0.32); }
.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.reason-cell { max-width: 320px; white-space: pre-line; overflow-wrap: anywhere; font-size: 13px; color: var(--text-2); }
.reason-box { margin-top: 6px; background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 6px 9px; font-size: 12.5px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; text-align: left; max-width: 360px; }
.warn-text { color: var(--amber); font-weight: 600; }
.biz-item { align-items: center; }
.biz-item .title { flex-wrap: wrap; row-gap: 4px; }
.biz-item .title .status { flex: none; }
.biz-item .desc { -webkit-line-clamp: unset; display: block; overflow-wrap: anywhere; }
.biz-item .desc a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); }
.biz-item .actions { flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
@media (max-width: 640px) {
  .biz-item { flex-wrap: wrap; }
  .biz-item .actions { width: 100%; justify-content: flex-start; padding-left: 50px; }
  .row-actions { flex-direction: column; align-items: flex-end; }
}

/* ───────────── Restaurantliste: Spaltenfilter + Standortkarte ───────────── */
.th-btn { display: inline-flex; align-items: center; gap: 5px; background: transparent; border: 0; padding: 4px 6px; margin: -4px -6px; border-radius: 7px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; font-weight: inherit; cursor: pointer; white-space: nowrap; }
.th-btn:hover { background: var(--bg-2); color: var(--text); }
.th-btn .th-caret { width: 11px; height: 11px; opacity: 0.55; flex: none; }
.th-btn .th-sort { font-size: 12px; line-height: 1; }
.th-btn.is-sorted { color: var(--text); }
.th-btn.is-filtered { color: var(--blue); background: rgba(90, 162, 255, 0.14); }
.th-btn.is-filtered .th-caret { opacity: 1; }
.col-menu { min-width: 240px; max-width: 320px; }
.col-menu .col-menu-title { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 6px 12px 4px; }
.col-menu button.is-on { background: var(--bg-2); font-weight: 700; }
.col-menu .col-opts { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; }
.col-menu .col-opt { display: flex; align-items: center; gap: 9px; padding: 7px 12px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.col-menu .col-opt:hover { background: var(--bg-2); }
.col-menu .col-opt input[type="checkbox"] { width: 16px; height: 16px; flex: none; accent-color: var(--navy); }
.col-menu .col-opt .count { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.col-menu .col-min { cursor: default; }
.col-menu .col-min .input { width: 96px; padding: 6px 9px; text-align: right; }
.map-actions { margin-left: auto; display: inline-flex; gap: 8px; }
.rest-map { height: max(720px, 75vh); border-radius: 14px; border: 1px solid var(--line); overflow: hidden; background: var(--bg-2); z-index: 0; }
.rest-map .leaflet-container, .rest-map.leaflet-container { font: inherit; background: var(--bg-2); }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.map-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.map-dot { --dot: #16a35f; --glow: rgba(22, 163, 95, 0.55); display: block; width: 14px; height: 14px; margin: 2px; border-radius: 50%; background: var(--dot); border: 2px solid #fff; box-shadow: 0 0 0 0 var(--glow), 0 1px 4px rgba(0, 0, 0, 0.35); animation: mapPulse 2.2s ease-out infinite; }
/* gelb = Stripe fehlt / Onboarding offen, rot = Bestellpause - pulsieren wie gruen, nur in ihrer Farbe (Marcel 13.10.) */
.map-dot.warn { --dot: #f6ec00; --glow: rgba(246, 236, 0, 0.65); }
.map-dot.pause { --dot: #e11d48; --glow: rgba(225, 29, 72, 0.55); }
/* blau = alles bereit (Stripe ok), nur gerade ausserhalb der Oeffnungszeiten */
.map-dot.closed { --dot: #2f80ed; --glow: rgba(47, 128, 237, 0.55); }
.map-dot.off { --dot: #94a3b8; --glow: rgba(148, 163, 184, 0.5); }
/* schwarz = deaktiviert (active: false) - pulsiert wie alle anderen (Marcel 13.10.) */
.map-dot.inactive { --dot: #111827; --glow: rgba(17, 24, 39, 0.5); }
.leaflet-popup-content a.map-open { color: var(--navy); font-weight: 700; text-decoration: none; }
.map-legend .map-dot { margin: 2px; width: 12px; height: 12px; }
.map-legend.above { margin: 0 0 10px; padding: 8px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; font-weight: 600; }
@keyframes mapPulse { 0% { box-shadow: 0 0 0 0 var(--glow), 0 1px 4px rgba(0, 0, 0, 0.35); } 70% { box-shadow: 0 0 0 14px transparent, 0 1px 4px rgba(0, 0, 0, 0.35); } 100% { box-shadow: 0 0 0 0 transparent, 0 1px 4px rgba(0, 0, 0, 0.35); } }
@media (prefers-reduced-motion: reduce) { .map-dot { animation: none; } }
:root[data-theme="dark"] .rest-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.6); }
:root[data-theme="dark"] .leaflet-popup-content-wrapper, :root[data-theme="dark"] .leaflet-popup-tip { background: var(--surface); color: var(--text); }
@media (max-width: 700px) { .rest-map { height: 340px; } }

/* ───────── Restaurant-Detailseite (Einstellungen wie in der App) ───────── */
.rd-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rd-head-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.rd-logo { width: 64px; height: 64px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; font-size: 26px; }
.rd-logo img { width: 100%; height: 100%; object-fit: cover; }
.rd-title { font-size: 20px; font-weight: 900; letter-spacing: -0.3px; }
.rd-sub { font-size: 13px; margin-top: 2px; }
.rd-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.rd-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rd-tabs { margin: 14px 0; }
.rd-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rd-range { width: 100%; accent-color: var(--navy); }
.rd-time { width: 86px; text-align: center; font-variant-numeric: tabular-nums; }
.rd-hours td { vertical-align: middle; }
.rd-hours .check { white-space: nowrap; }
.rd-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.rd-img { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; }
.rd-img-box { width: 84px; height: 84px; border-radius: 10px; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; flex: none; font-size: 11px; }
.rd-img-box.banner { width: 120px; height: 68px; }
.rd-img-box.fastFinder { width: 52px; height: 92px; }
.rd-img-box img { width: 100%; height: 100%; object-fit: cover; }
.rd-img-meta { flex: 1; min-width: 0; font-size: 13px; }
.rd-map { height: 420px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.pg-dot { display: block; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--navy); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); cursor: grab; }
.rd-cat h3 { margin: 16px 0 6px; font-size: 14px; font-weight: 800; }
.rd-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--bg-2); display: block; }
.rd-thumb.empty { border: 1px dashed var(--line-2); }
div.rd-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.rd-sizes { display: grid; gap: 8px; }
.rd-size { display: grid; grid-template-columns: 70px 1fr 1fr auto 90px; gap: 10px; align-items: end; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.rd-size > b { font-size: 12.5px; padding-bottom: 10px; }
.rd-size .check { padding-bottom: 10px; }
.table tbody tr[data-id] { cursor: pointer; }
.table tbody tr[data-id]:hover td { background: var(--surface-2); }
@media (max-width: 720px) {
  .rd-size { grid-template-columns: 1fr 1fr; }
  .rd-size > b { grid-column: 1 / -1; padding-bottom: 0; }
  .rd-map { height: 320px; }
}

/* ── Systemstatus als Workflow-Canvas (n8n-Stil, 04.10.2026) ─────────────── */
.fn-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow); }
.fn-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.fn-legend { display: flex; align-items: center; gap: 6px 10px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.fn-legend .fn-dot { margin-right: 2px; }
.fn-tools { display: flex; gap: 6px; }
.fn-tools .btn { min-width: 34px; padding: 4px 10px; }
.fn-stage { position: relative; height: 700px; display: flex; }
.fn-canvas {
  position: relative; flex: 1; min-width: 0; overflow: hidden; cursor: grab; outline: none;
  background-color: var(--bg);
  background-image: radial-gradient(var(--line-2) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
.fn-canvas.dragging { cursor: grabbing; }
.fn-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.fn-edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.fn-edge { fill: none; stroke-width: 2; stroke: var(--line-2); stroke-linecap: round; color: var(--line-2); transition: opacity .2s, stroke .2s; }
.fn-edge.ok { stroke: #8fd3ad; color: #8fd3ad; stroke-dasharray: 6 8; animation: fnFlow 1.4s linear infinite; }
.fn-edge.warn { stroke: var(--amber); color: var(--amber); stroke-dasharray: 6 8; animation: fnFlow 1.4s linear infinite; }
.fn-edge.error { stroke: var(--red); color: var(--red); stroke-width: 2.5; stroke-dasharray: 4 6; animation: fnFlow .7s linear infinite; }
.fn-edge.unknown { stroke: var(--line-2); color: var(--line-2); stroke-dasharray: 2 6; }
.fn-edge.dim { opacity: .25; animation: none; }
.fn-edge.lit { stroke-width: 3; }
@keyframes fnFlow { to { stroke-dashoffset: -28; } }
@media (prefers-reduced-motion: reduce) { .fn-edge { animation: none !important; } }

.fn-node {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 10px; box-sizing: border-box;
  background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 12px; cursor: pointer; user-select: none;
  box-shadow: 0 2px 10px rgba(16, 40, 74, .08); transition: transform .15s, box-shadow .15s, opacity .2s, border-color .15s;
}
.fn-node:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(16, 40, 74, .14); }
.fn-node.selected { box-shadow: 0 0 0 3px rgba(90, 162, 255, .35), 0 8px 22px rgba(16, 40, 74, .16); border-color: var(--sky); }
.fn-node.dim { opacity: .5; }
.fn-node.ok { border-color: rgba(21, 154, 90, .55); }
.fn-node.warn { border-color: rgba(217, 139, 0, .7); }
.fn-node.error { border-color: var(--red); box-shadow: 0 0 0 4px rgba(220, 38, 80, .14), 0 2px 10px rgba(16, 40, 74, .08); }
.fn-node.unknown { border-style: dashed; }
.fn-node.virtual { background: var(--surface-2); border-radius: 999px; padding-left: 14px; }
.fn-port { position: absolute; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.fn-port.in { left: -6px; } .fn-port.out { right: -6px; }
.fn-node.ok .fn-port { border-color: #5fbf8c; } .fn-node.warn .fn-port { border-color: var(--amber); } .fn-node.error .fn-port { border-color: var(--red); }
.fn-ico { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--bg-2); color: var(--navy); }
.fn-ico svg { width: 21px; height: 21px; }
.fn-node.ok .fn-ico { background: var(--green-bg); color: var(--green); }
.fn-node.warn .fn-ico { background: var(--amber-bg); color: var(--amber); }
.fn-node.error .fn-ico { background: var(--red-bg); color: var(--red); }
.fn-node.unknown .fn-ico { color: var(--muted); }
.fn-body { flex: 1; min-width: 0; }
.fn-title { font-weight: 700; font-size: 12.5px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fn-detail { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fn-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.fn-ms { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fn-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--line-2); flex: none; }
.fn-dot.ok, .fn-node.ok .fn-dot, .fn-row.ok .fn-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(21, 154, 90, .18); }
.fn-dot.warn, .fn-node.warn .fn-dot, .fn-row.warn .fn-dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(217, 139, 0, .2); }
.fn-dot.error, .fn-node.error .fn-dot, .fn-row.error .fn-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 80, .2); animation: fnPulse 1.2s ease-in-out infinite; }
.fn-dot.unknown { background: var(--line-2); }
@keyframes fnPulse { 50% { box-shadow: 0 0 0 7px rgba(220, 38, 80, .08); } }

.fn-panel {
  width: 0; flex: none; overflow: hidden; border-left: 1px solid transparent; background: var(--surface);
  transition: width .2s ease; font-size: 13px;
}
.fn-panel.open { width: 320px; border-left-color: var(--line); overflow-y: auto; padding: 16px; box-sizing: border-box; }
.fn-panel-empty { color: var(--muted); padding: 16px; }
.fn-panel-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.fn-panel-head.ok .fn-ico { background: var(--green-bg); color: var(--green); }
.fn-panel-head.warn .fn-ico { background: var(--amber-bg); color: var(--amber); }
.fn-panel-head.error .fn-ico { background: var(--red-bg); color: var(--red); }
.fn-panel-title { font-weight: 800; font-size: 15px; }
.fn-kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.fn-kv span { color: var(--muted); flex: none; }
.fn-kv b { text-align: right; font-weight: 600; word-break: break-word; }
.fn-state.ok { color: var(--green); } .fn-state.warn { color: var(--amber); } .fn-state.error { color: var(--red); }
.fn-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; font-weight: 700; }
.fn-msg { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; line-height: 1.4; }
.fn-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.fn-row i { margin-left: auto; color: var(--muted); font-style: normal; font-size: 12px; }
.fn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fn-chip { border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.fn-chip:hover { border-color: var(--sky); color: var(--navy); }
.status-details summary { cursor: pointer; list-style: none; }
.status-details summary::-webkit-details-marker { display: none; }
.status-details summary::before { content: "▸"; display: inline-block; margin-right: 8px; transition: transform .15s; color: var(--muted); }
.status-details[open] summary::before { transform: rotate(90deg); }
@media (max-width: 900px) {
  .fn-stage { height: 520px; flex-direction: column; }
  .fn-panel.open { width: 100%; max-height: 45%; border-left: 0; border-top: 1px solid var(--line); }
}
:root[data-theme="dark"] .fn-canvas { background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1.2px); }
:root[data-theme="dark"] .fn-node { box-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
:root[data-theme="dark"] .fn-edge.ok { stroke: #3fa871; color: #3fa871; }
