/**
 * style.css — Dark Theme (v59-kompatibel)
 * W-Make Batch 1.1 by JMW
 * Autor: J-M Wagner / Umbau auf v7-Architektur
 */

/* ═══════════════════════════════════════════════════════════════════════════
   1. CSS Custom Properties — v59 Dark Theme
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg0: #09090f;
  --bg1: #111118;
  --bg2: #1a1a24;
  --bg3: #252535;
  --bg4: #32324a;

  /* Lines / Borders */
  --line: rgba(120, 120, 180, .15);
  --line2: rgba(120, 120, 180, .08);

  /* Text */
  --t1: #eeeef5;
  --t2: #b0b0c8;
  --t3: #7070a0;
  --t4: #4a4a70;

  /* Accent colors */
  --accent: #6c8fff;
  --accent2: #4d6fff;
  --acc: var(--accent);
  --success: #2de09c;
  --warn: #ffc844;
  --error: #ff5c5c;
  --purple: #b06eff;
  --orange: #ff9446;
  --teal: #44e5cc;
  --glass-green: #1eff88;
  --water: #5bc8f5;

  /* Typography */
  --mono: 'JetBrains Mono', 'Consolas', monospace;
  --sans: 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
  --font: var(--sans);

  /* Layout */
  --side-w: 230px;
  --top-h: 52px;

  /* Radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;

  /* Shadows */
  --shadow: 0 2px 8px rgba(0, 0, 0, .4);
  --shadow-lg: 0 6px 24px rgba(0, 0, 0, .6);
  --card-shadow: 0 0px 0px rgba(0, 0, 0, 0);
  /* Dark mode uses pure borders/glows */

  /* Card-Hintergrund (konsistent mit .card, .kpi-card, .stat-card) */
  --card: var(--bg2);

  /* Semantische Farb-Varianten (subtile Hintergründe + Rahmen) */
  --accent-subtle: rgba(108, 143, 255, .12);
  --accent-border: rgba(108, 143, 255, .30);
  --success-subtle: rgba(45, 224, 156, .10);
  --success-border: rgba(45, 224, 156, .28);
  --warn-subtle: rgba(255, 200, 68, .10);
  --warn-border: rgba(255, 200, 68, .28);
  --error-subtle: rgba(255, 92, 92, .10);
  --error-border: rgba(255, 92, 92, .28);
  --purple-subtle: rgba(176, 110, 255, .12);
  --purple-border: rgba(176, 110, 255, .30);
  --orange-subtle: rgba(255, 148, 70, .12);
  --orange-border: rgba(255, 148, 70, .30);

  /* Erweiterter Radius */
  --r-xl: 14px;

  /* Transitions & Animationen */
  --trans-fast: .12s ease;
  --trans-base: .18s ease;
  --trans-slow: .28s ease;
  --blink-slow: 1.2s ease-in-out;
  --blink-fast: .6s ease-in-out;
}

/* ═══════════════════════════════════════════════════════════════════════════
   1.5 Light Mode Theme
   ═══════════════════════════════════════════════════════════════════════════ */
body.light-mode {
  /* Premium Slate & Crisp White Backgrounds */
  --bg0: #f8fafc;
  --bg1: #ffffff;
  --bg2: #ffffff;
  --bg3: #f1f5f9;
  --bg4: #e2e8f0;

  /* Refined, subtle lines */
  --line: rgba(15, 23, 42, 0.08);
  --line2: rgba(15, 23, 42, 0.04);

  /* Sophisticated Slate Typography */
  --t1: #0f172a;
  --t2: #334155;
  --t3: #64748b;
  --t4: #94a3b8;

  /* Vibrant, Modern Accent Colors */
  --accent: #2563eb;
  --accent2: #1d4ed8;
  --success: #10b981;
  --warn: #f59e0b;
  --error: #ef4444;
  --purple: #8b5cf6;
  --orange: #f97316;
  --teal: #14b8a6;
  --glass-green: #059669;

  /* Elegant, soft drop shadows */
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);
  --card-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);

  /* Card Background */
  --card: var(--bg1);

  /* Water Color */
  --water: #0ea5e9;

  /* Semantic Subtle & Border Variants (RGB matched to new accents) */
  --accent-subtle: rgba(37, 99, 235, 0.08);
  --accent-border: rgba(37, 99, 235, 0.25);
  --success-subtle: rgba(16, 185, 129, 0.10);
  --success-border: rgba(16, 185, 129, 0.30);
  --warn-subtle: rgba(245, 158, 11, 0.10);
  --warn-border: rgba(245, 158, 11, 0.35);
  --error-subtle: rgba(239, 68, 68, 0.08);
  --error-border: rgba(239, 68, 68, 0.25);
  --purple-subtle: rgba(139, 92, 246, 0.08);
  --orange-border: rgba(249, 115, 22, 0.25);

  /* ── Overrides for inline login styles in Light Mode ── */
  & #login-box {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
  }

  & #login-box h2 {
    background: linear-gradient(135deg, var(--t1) 0%, var(--t3) 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }

  & #login-username,
  & #login-password {
    background: rgba(15, 23, 42, 0.04) !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   2. Reset & Base
   ═══════════════════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
}

body {
  font-family: var(--font);
  color: var(--t1);
  background: var(--bg0);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. App-Wrapper & Topbar
   ═══════════════════════════════════════════════════════════════════════════ */
#app-wrapper {
  margin-left: var(--side-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--top-h);
  background: var(--bg2);
  color: var(--t1);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.hamburger {
  background: none;
  border: none;
  color: var(--t2);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  display: none;
}

.breadcrumb {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.alarm-badge {
  background: var(--error);
  color: #fff;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.alarm-item {
  transition: all .22s ease;
  overflow: hidden;
}

.alarm-reset-btn {
  font-size: 0.9em;
  opacity: 0.85;
}

/* Alarm-Banner */
.alarm-banner {
  background: var(--error-subtle);
  border-bottom: 2px solid var(--error-border);
  padding: 6px 16px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   5. Seiten (.page)
   ═══════════════════════════════════════════════════════════════════════════ */
.page {
  display: none;
  padding: 20px;
  max-width: 1280px;
  width: 100%;
}

.page.active {
  display: block;
}

/* ─── Page-Header (v59-Stil) ─── */
.page-header {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.page-header h1,
.page-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--t1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header p {
  color: var(--t3);
  font-size: 12px;
  margin-top: 3px;
}

.ph-title {
  flex: 1;
  min-width: 0;
}

.ph-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}


/* ═══════════════════════════════════════════════════════════════════════════
   6. Buttons (Premium & Glassmorphism Update)
   ═══════════════════════════════════════════════════════════════════════════ */
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-ghost,
.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  background: var(--bg3);
  color: var(--t2);
  user-select: none;
  position: relative;
  overflow: hidden;
}

/* Subtle inner glow for depth and glassmorphism light-streak */
.btn::after,
.btn-primary::after,
.btn-secondary::after,
.btn-danger::after,
.btn-ghost::after,
.btn-success::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.btn:hover::after,
.btn-primary:hover::after,
.btn-secondary:hover::after,
.btn-danger:hover::after,
.btn-success:hover::after {
  opacity: 1;
}

.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-danger:active,
.btn-ghost:active,
.btn-success:active {
  transform: translateY(1px) scale(0.97);
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: var(--bg4);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 100%);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: 0 6px 16px rgba(108, 143, 255, 0.25);
}

.btn-secondary {
  background: var(--bg2);
  color: var(--t1);
  border: 1px solid var(--line);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  /* Softer shadow */
}

.btn-secondary:hover {
  border-color: var(--line2);
  color: var(--t1);
  background: var(--bg3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--error);
  color: #fff;
  border-color: transparent;
}

.btn-danger:hover {
  background: #d42020;
  /* Darker error */
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 92, 92, 0.25);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--t2);
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  /* very subtle hover */
  border-color: transparent;
  color: var(--t1);
  box-shadow: none;
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #00995c 100%);
  color: #fff;
  /* Changed to white for better contrast */
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-success:hover {
  background: linear-gradient(135deg, #00995c 0%, var(--success) 100%);
  box-shadow: 0 6px 16px rgba(45, 224, 156, 0.25);
  color: #fff;
}

/* Size modifiers */
.btn-sm {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
}

button:disabled,
.btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Mode-Toggle */
.mode-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.mode-toggle button {
  background: transparent;
  border: none;
  color: var(--t3);
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.mode-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.mode-toggle button:hover:not(.active) {
  background: var(--bg4);
  color: var(--t1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   7. Filter-Bar, Tabs
   ═══════════════════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}

.filter-bar input[type="text"],
.filter-bar select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: var(--font);
  background: var(--bg3);
  color: var(--t1);
}

.filter-btn {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg3);
  color: var(--t2);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s, color .15s;
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.filter-btn:hover:not(.active) {
  border-color: var(--t3);
  color: var(--t1);
}

/* Hub-Tabs */
.hub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}

.tab-btn {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--bg3);
  color: var(--t3);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
  font-weight: 500;
}

.tab-btn.active {
  background: var(--bg2);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.tab-btn:hover:not(.active) {
  color: var(--t1);
}

/* Sub-Tabs */
.sub-tab {
  display: none;
  padding-top: 10px;
}

.sub-tab.active {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. Cards
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 12px;
}

body.light-mode .card {
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(0, 0, 40, 0.08);
  /* sharper light mode border */
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--t1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. Data Tables
   ═══════════════════════════════════════════════════════════════════════════ */
.data-table,
#satztabelle {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th,
#satztabelle thead th {
  background: var(--bg3);
  color: var(--t3);
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

body.light-mode .data-table thead th,
body.light-mode #satztabelle thead th {
  color: var(--t1);
  /* Strong contrast for light mode table headers */
  background: var(--bg4);
  /* Distinct header background */
}

.data-table thead th:hover,
#satztabelle thead th:hover {
  color: var(--t1);
}

.data-table tbody tr,
#satztabelle tbody tr {
  border-bottom: 1px solid var(--line2);
  transition: background .1s;
}

.data-table tbody tr:nth-child(even),
#satztabelle tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, .015);
}

.data-table tbody tr:hover,
#satztabelle tbody tr:hover {
  background: var(--bg3);
}

.data-table td,
#satztabelle td {
  padding: 8px 12px;
  color: var(--t1);
}

.data-table .num,
.td-right {
  text-align: right;
  font-family: var(--mono);
}

.data-table .center,
.td-center {
  text-align: center;
}

/* Satztabelle — Hilfszellen-Klassen */
.td-nr {
  color: var(--t4);
  font-size: 11px;
  font-family: var(--mono);
  user-select: none;
}

.td-bkr {
  color: var(--t3);
  font-size: 11px;
  font-family: var(--mono);
}

.data-table .summe-row {
  font-weight: 700;
  background: var(--bg3) !important;
  border-top: 1px solid var(--line);
}

.data-table .row-alarm {
  background: var(--error-subtle) !important;
}

.data-table .row-scherbe {
  font-style: italic;
  color: var(--t3);
}

.data-table .muted {
  color: var(--t3);
}

.sort-ind {
  font-size: 9px;
  margin-left: 3px;
  color: var(--t4);
}

.table-info {
  font-size: 12px;
  color: var(--t3);
  margin-bottom: 6px;
}

/* Zell-Farben */
.cell-ok {
  color: var(--success);
}

.cell-warn {
  color: var(--warn);
  font-weight: 600;
}

.cell-critical {
  color: var(--error);
  font-weight: 700;
}

.cell-high {
  color: var(--error);
  font-weight: 700;
}

.cell-mid {
  color: var(--warn);
  font-weight: 600;
}

.pos {
  color: var(--warn);
}

.neg {
  color: var(--success);
}

/* ═══════════════════════════════════════════════════════════════════════════
   10. Formulare & Inputs
   ═══════════════════════════════════════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 16px;
  margin-bottom: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-family: var(--font);
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  background: var(--bg3);
  color: var(--t1);
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(108, 143, 255, .15);
}

input::placeholder {
  color: var(--t4);
}

.input-sm {
  padding: 4px 8px;
  font-size: 12px;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--t1);
  font-family: var(--font);
}

/* ═══════════════════════════════════════════════════════════════════════════
   12. KPI-Kacheln
   ═══════════════════════════════════════════════════════════════════════════ */
.kpi-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}

.kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
  line-height: 1.2;
}

.kpi-label {
  font-size: 10px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 3px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   13. Stat-Cards (v59)
   ═══════════════════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
  transition: background var(--trans-fast), border-color var(--trans-fast);
}

.stat-card:hover {
  background: var(--bg3);
  border-color: rgba(120, 120, 180, .28);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

.stat-card.green::before {
  background: var(--success);
}

.stat-card.orange::before {
  background: var(--orange);
}

.stat-card.purple::before {
  background: var(--purple);
}

.stat-card.warn::before {
  background: var(--warn);
}

.stat-card.red::before {
  background: var(--error);
}

.stat-label {
  font-size: 10px;
  color: var(--t3);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--t1);
  line-height: 1.2;
}

.stat-unit {
  font-size: 12px;
  color: var(--t3);
  margin-left: 3px;
  font-family: var(--sans);
}

.stat-sub {
  font-size: 10px;
  color: var(--t3);
  margin-top: 3px;
}

.ausw-trend {
  font-size: 9px;
  font-family: var(--mono);
  letter-spacing: 0.03em;
  margin-top: 5px;
  min-height: 11px;
  line-height: 1.2;
}

.ausw-trend .tr-label {
  color: var(--t3);
  margin-right: 3px;
  font-style: normal;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ausw-trend .tr-up {
  color: var(--success);
  font-weight: 600;
}

.ausw-trend .tr-down {
  color: var(--error);
  font-weight: 600;
}

.ausw-trend .tr-flat {
  color: var(--t3);
  font-weight: 500;
}


/* ═══════════════════════════════════════════════════════════════════════════
   14. Silo-Kacheln
   ═══════════════════════════════════════════════════════════════════════════ */
.silo-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.silo-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.silo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  /* Feiner weicher Schatten */
  background: var(--bg3);
  border-color: var(--line2);
}

.silo-card.silo-crit {
  border-color: var(--error);
}

/* ── Waagen Farbcodierung ────────────────────────────────────────────────── */
.silo-card.waage-1,
.ls-card.waage-1 {
  border-top: 2px solid #5D8AA8;
}

/* Blau / Sand & Pellets */
.silo-card.waage-2,
.ls-card.waage-2 {
  border-top: 2px solid #50C878;
}

/* Grün / Soda & Mineralien */
.silo-card.waage-3,
.ls-card.waage-3 {
  border-top: 2px solid #D2691E;
}

/* Braun-Orange / Kalk & Chromerz */
.silo-card.waage-5,
.ls-card.waage-5 {
  border-top: 2px solid #FFD700;
}

/* Gelb / Sulfate & Salpeter */
.silo-card.waage-7,
.ls-card.waage-7 {
  border-top: 2px solid #20B2AA;
}

/* Teal / Eigen-Scherben */
.silo-card.waage-8,
.ls-card.waage-8 {
  border-top: 2px solid #9966cc;
}

/* Violett / Feinwaage */
.silo-card.waage-9,
.ls-card.waage-9 {
  border-top: 2px solid #2E8B57;
}

/* Dunkelgrün / Fremdscherben */


.silo-card.silo-warn {
  border-color: var(--warn);
}

/* ── Silo-Karte: Buchungs-Leiste ─────────────────────────────────────────── */
.silo-buchung-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* Primär-Button LKW-Anlieferung — volle Breite, hervorgehoben */
.silo-lkw-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  flex-wrap: wrap;
}

.silo-lkw-btn:hover {
  background: var(--accent-hi, var(--accent));
  filter: brightness(1.1);
}

.silo-lkw-btn:active {
  transform: scale(.97);
}

/* Freier-Platz-Badge neben dem Button-Label */
.silo-lkw-frei {
  font-size: 10px;
  font-weight: 400;
  opacity: .85;
  font-family: var(--mono);
  background: rgba(255, 255, 255, .18);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Sekundär-Button Manuelle Korrektur — dezent, volle Breite */
.silo-man-btn {
  width: 100%;
  font-size: 11px;
  color: var(--t3);
  text-align: center;
  border: 1px solid var(--line);
  background: transparent;
}

.silo-man-btn:hover {
  color: var(--t1);
  border-color: var(--t2);
}

/* ── Silo-Karte: Unified Buchen-Button ───────────────────────────────────── */
.silo-buchen-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(108, 143, 255, 0.25);
  background: rgba(108, 143, 255, 0.06);
  color: var(--accent);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.silo-buchen-btn:hover {
  background: rgba(108, 143, 255, 0.15);
  border-color: rgba(108, 143, 255, 0.6);
  box-shadow: 0 3px 8px rgba(108, 143, 255, 0.12);
  transform: translateY(-1px);
}

.silo-buchen-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.silo-buchen-frei {
  font-size: 10px;
  font-weight: 400;
  font-family: var(--mono);
  opacity: .85;
  background: rgba(108, 143, 255, .18);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── Buchen-Auswahl-Popup (für 'both'-Silos) ─────────────────────────────── */
.silo-buchen-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
}

.silo-buchen-overlay.open {
  display: block;
}

.silo-buchen-backdrop {
  position: absolute;
  inset: 0;
}

.silo-buchen-popup {
  position: absolute;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  min-width: 210px;
  z-index: 901;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.silo-buchen-popup-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--t1);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line2);
  margin-bottom: 2px;
}

.silo-buchen-popup .silo-lkw-btn {
  font-size: 12px;
  padding: 7px 10px;
}

/* Fill-Bars */
.fill-bar-wrap {
  height: 8px;
  background: var(--bg4);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
  /* Plastische Tiefe */
  position: relative;
  /* Für den Shimmer-Effekt */
}

.fill-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .4s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Micro-Animation: Shimmer über den gefüllten Bereich */
.fill-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 200%;
  }
}

.fill-ok {
  background: linear-gradient(90deg, #1fa371, #2de09c);
  box-shadow: 0 0 8px rgba(45, 224, 156, 0.3);
}

.fill-warn {
  background: linear-gradient(90deg, #d4952c, #f5a623);
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.3);
}

.fill-crit {
  background: linear-gradient(90deg, #cc3b4b, #ff4c5f);
  box-shadow: 0 0 8px rgba(255, 76, 95, 0.3);
}

/* Batch-Rechner */
.batch-rechner-panel {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin: 8px 0;
}

.batch-rechner-panel label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .87rem;
  color: var(--t2);
}

.batch-rechner-panel input[type="number"] {
  width: 140px;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--t1);
  padding: 4px 8px;
  margin-top: 2px;
}

.batch-result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.batch-result-table td,
.batch-result-table th {
  padding: 3px 8px;
  font-size: .85rem;
  border-bottom: 1px solid var(--line);
}

/* ═══════════════════════════════════════════════════════════════════════════
   16. Redox-Gauge-Card (v59)
   ═══════════════════════════════════════════════════════════════════════════ */
.redox-gauge-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.redox-gauge-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 0% 50%, rgba(108, 143, 255, .06) 0%, transparent 70%);
}

.rdx-led {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
  transition: background .3s, color .3s;
}

.rdx-led.green {
  background: var(--success);
  color: var(--success);
}

.rdx-led.yellow {
  background: var(--warn);
  color: var(--warn);
}

.rdx-led.red {
  background: var(--error);
  color: var(--error);
  box-shadow: 0 0 12px var(--error);
}

.rdx-label {
  font-size: 10px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}

.rdx-value-big {
  font-size: 36px;
  font-weight: 800;
  font-family: var(--mono);
  line-height: 1;
  min-width: 90px;
  text-align: center;
  letter-spacing: -1px;
  transition: color .3s;
  color: var(--t1);
}

.rdx-value-big.green {
  color: var(--success);
}

.rdx-value-big.yellow {
  color: var(--warn);
}

.rdx-value-big.red {
  color: var(--error);
}

.rdx-meta {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--t2);
  gap: 2px;
  min-width: 80px;
}

.rdx-ziel {
  color: var(--t1);
  font-family: var(--mono);
}

.rdx-trend-arrow {
  font-size: 18px;
  color: var(--t2);
}

.rdx-bar-section {
  flex: 1;
  min-width: 200px;
}

.rdx-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--t3);
  margin-bottom: 3px;
}

.rdx-bar-wrap {
  position: relative;
  height: 14px;
  border-radius: 7px;
  overflow: visible;
  background: linear-gradient(90deg,
      var(--error) 0%,
      var(--warn) 30%,
      var(--success) 50%,
      var(--warn) 70%,
      var(--error) 100%);
}

.rdx-zone-ok {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 7px;
  background: var(--success-subtle);
  border: 1.5px solid var(--success-border);
}

.rdx-needle {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 24px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, .6);
  transform: translateX(-50%);
  transition: left .35s cubic-bezier(.4, 0, .2, 1);
}


.rdx-spark-section {
  min-width: 120px;
}

.rdx-spark-label {
  font-size: 10px;
  color: var(--t3);
  margin-bottom: 3px;
}

/* ─── Redox Gauge ────────────────────────────────────────────────────────── */
/* Haupt-Gauge-Container (renderRedoxGauge) */
.gauge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 24px 14px;
  margin-bottom: 14px;
}

/* Legacy alias */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-svg {
  max-width: 300px;
  width: 100%;
}

.gauge-label {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 18px;
  border-radius: 20px;
  margin-top: 8px;
  letter-spacing: .04em;
}


.sparkline-container {
  margin-top: 14px;
  width: 100%;
}

.sparkline-label {
  font-size: 11px;
  color: var(--t3);
  display: block;
  margin-bottom: 4px;
}

.sparkline-svg {
  border-radius: 6px;
  background: var(--bg3);
}

/* ─── Oxide-Tabelle spezifisch ───────────────────────────────────────────── */
.oxide-table {
  margin-top: 0;
}

.oxide-table td:first-child {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
}

.oxide-table .num {
  font-family: var(--mono);
}

/* ═══════════════════════════════════════════════════════════════════════════
   21. Modal
   ═══════════════════════════════════════════════════════════════════════════ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal[style*="flex"] {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .7);
}

.modal-box {
  position: relative;
  z-index: 1;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  max-width: 680px;
  width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-box--wide {
  max-width: 960px;
}

.modal-header {
  background: var(--bg3);
  color: var(--t1);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--t1);
}

.modal-close {
  background: none;
  border: none;
  color: var(--t3);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--r-sm);
}

.modal-close:hover {
  color: var(--error);
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  color: var(--t2);
}

.modal-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: var(--bg3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   22. Bottom-Tabs (Mobile)
   ═══════════════════════════════════════════════════════════════════════════ */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg1);
  border-top: 1px solid var(--line);
  z-index: 300;
}

.btab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px 6px;
  color: var(--t4);
  font-size: 10px;
  cursor: pointer;
  border: none;
  background: none;
  gap: 2px;
  font-family: var(--font);
  transition: color .15s;
}

.btab:first-child {
  font-size: 20px;
}

.btab.active {
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   23. Diverse Komponenten
   ═══════════════════════════════════════════════════════════════════════════ */
/* Rezept-Badge */
.rezept-badge {
  display: inline-block;
  color: var(--t1);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}

/* Gemengebuch Quick-Filter */
.gb-quickfilter {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.gb-qf-btn {
  padding: 3px 9px;
  font-size: 11px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--bg3);
  color: var(--t2);
  cursor: pointer;
  transition: all .1s;
  white-space: nowrap;
}

.gb-qf-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.gb-qf-btn.active {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

/* Wissen-Karten */
.wissen-ok {
  background: var(--success-subtle);
  color: var(--success);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 6px;
  border: 1px solid var(--success-border);
}


/* Pfad-Karten */
.pfad-karte {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 16px;
  margin-bottom: 10px;
}

.pfad-header {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.pfad-info {
  font-size: 13px;
  color: var(--t2);
  margin-bottom: 8px;
}

/* Category Badge (Rohstoff-Datenbank) */
.badge {
  display: inline-block;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--bg4);
  color: var(--t3);
  border: 1px solid var(--line);
}


/* Activity-Feed */
.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.activity-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px;
}

.activity-date {
  color: var(--t3);
  font-size: 11px;
  min-width: 72px;
  font-family: var(--mono);
}

.activity-label {
  flex: 1;
  font-weight: 500;
  color: var(--t1);
}

.activity-meta {
  color: var(--t3);
  font-size: 11px;
  font-family: var(--mono);
}



/* ═══════════════════════════════════════════════════════════════
   Toast-System v3
   Alle visuellen Eigenschaften in CSS — kein inline-Style im JS.
   ═══════════════════════════════════════════════════════════════ */

/* Container — position via CSS, mobil über Bottom-Tabs gehoben */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 340px;
  max-width: calc(100vw - 24px);
  pointer-events: none;
  /* Durchklickbar wenn kein Toast aktiv */
}

@media (max-width: 640px) {
  #toast-container {
    bottom: 72px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

/* Basis-Toast */
.toast {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 38px 15px 13px;
  /* rechts Platz für X */
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.4;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35), 0 1px 4px rgba(0, 0, 0, .2);
  border: 1px solid rgba(255, 255, 255, .09);
  cursor: pointer;
  pointer-events: auto;
  /* Eintritts-Startposition */
  transform: translateX(110%);
  opacity: 0;
  animation: toastIn .28s cubic-bezier(.22, .68, 0, 1.2) forwards;
  transition: box-shadow .15s;
}

.toast:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .25);
}

/* Typ-Farben */
.toast-success {
  background: #1a4a33;
  border-color: rgba(74, 186, 74, .2);
}

.toast-info {
  background: #132d4a;
  border-color: rgba(74, 144, 226, .2);
}

.toast-warn {
  background: #4a2e0a;
  border-color: rgba(255, 160, 0, .25);
}

.toast-error {
  background: #4a1010;
  border-color: rgba(220, 53, 69, .3);
}

/* Icon */
.toast-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}

.toast-success .toast-icon {
  color: #6ee88a;
}

.toast-info .toast-icon {
  color: #7ab8f5;
}

.toast-warn .toast-icon {
  color: #ffc947;
}

.toast-error .toast-icon {
  color: #ff7979;
}

/* Text */
.toast-msg {
  flex: 1;
  font-size: 13px;
}

/* Close-Button */
.toast-close {
  position: absolute;
  top: 7px;
  right: 8px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, .4);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  line-height: 1;
  transition: color .15s, background .15s;
}

.toast-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, .15);
}

/* Fortschrittsbalken */
.toast-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 8px 8px;
  animation: toastBar linear forwards;
  transform-origin: left;
}

.toast-success .toast-bar {
  background: #6ee88a;
}

.toast-info .toast-bar {
  background: #7ab8f5;
}

.toast-warn .toast-bar {
  background: #ffc947;
}

.toast-error .toast-bar {
  background: #ff7979;
}

/* Pausiert (hover) — Progress-Bar einfrieren */
.toast-paused .toast-bar {
  animation-play-state: paused;
}

/* Eintritts-Animation */
@keyframes toastIn {
  from {
    transform: translateX(110%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Austritts-Animation */
.toast-out {
  animation: toastOut .34s ease forwards !important;
}

@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
    max-height: 80px;
    margin-bottom: 0;
  }

  to {
    transform: translateX(110%);
    opacity: 0;
    max-height: 0;
    margin-bottom: -8px;
  }
}

/* Schüttel-Animation (Dedup) */
.toast-shake {
  animation: toastShake .35s ease !important;
}

@keyframes toastShake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(5px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(3px);
  }
}

/* Progress-Bar Keyframe */
@keyframes toastBar {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

/* ── Satzzettel: Zeilen-Highlight beim Bearbeiten ───────────────────────── */
@keyframes satz-row-flash {
  0% {
    background: var(--accent-subtle);
  }

  100% {
    background: transparent;
  }
}

.satz-row-flash {
  animation: satz-row-flash 900ms ease-out forwards;
}

@media print {
  #toast-container {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Oxide-Tab — Professionelles Layout
   ═══════════════════════════════════════════════════════════════════════════ */

.ox-tab-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 12px;
  align-items: start;
}

.ox-tab-col-l,
.ox-tab-col-r {
  min-width: 0;
}

/* ── Oxide-Tabelle ──────────────────────────────────────── */
.ox-tbl-card {
  padding: 0;
  overflow: hidden;
}

.ox-tbl-card .card-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--line);
}

.ox-tbl-row:hover {
  background: var(--bg3);
}

.ox-name-cell {
  font-size: 13px;
}

.ox-name-cell b {
  font-family: var(--mono);
}

.ox-bar-col-hd,
.ox-bar-col {
  width: 90px;
}

.ox-bar-col {
  vertical-align: middle;
  padding: 0 8px;
}

.ox-tbl-bar-bg {
  position: relative;
  height: 8px;
  background: var(--bg4);
  border-radius: 4px;
  overflow: visible;
}

.ox-tbl-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  opacity: .6;
  transition: width .3s ease;
}

.ox-tbl-target {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 16px;
  background: var(--t1);
  opacity: .7;
  border-radius: 1px;
  transform: translateX(-1px);
  transition: left .3s ease;
}

.ox-tbl-hint {
  font-size: 10px;
  color: var(--t4);
  padding: 5px 14px 7px;
  text-align: right;
}

.ox-sum-badge {
  font-size: 11px;
  color: var(--t3);
  font-family: var(--mono);
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 2px 8px;
}

/* ── Physik-KPI-Cards ───────────────────────────────────── */
.ox-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

.ox-kpi-card {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px 10px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.ox-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--kpi-color, var(--accent));
}

.ox-kpi-val {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--kpi-color, var(--accent));
  line-height: 1.25;
  margin-top: 3px;
  word-break: break-all;
}

.ox-kpi-lbl {
  font-size: .68rem;
  font-weight: 600;
  color: var(--t2);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 3px;
}

.ox-kpi-sub {
  font-size: .6rem;
  color: var(--t4);
  margin-top: 1px;
}

/* ── Viskositätskurve ───────────────────────────────────── */
.ox-visk-card {
  padding: 0;
  overflow: hidden;
}

.ox-visk-card .card-header {
  padding: 8px 14px 7px;
  border-bottom: 1px solid var(--line);
}

.ox-visk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 7px 14px 8px;
  border-top: 1px solid var(--line);
}

.ox-leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--t3);
}

.ox-leg-dot {
  display: inline-block;
  width: 20px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

.ox-leg-dash {
  display: inline-block;
  width: 20px;
  height: 0;
  border-top: 2px dashed;
  flex-shrink: 0;
}

/* ── Batch-Rechner ──────────────────────────────────────── */
.ox-batch-card {
  padding: 0;
  overflow: hidden;
}

.ox-batch-card .card-header {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}

.ox-batch-body {
  padding: 12px 14px;
}

.ox-batch-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ox-batch-label {
  font-size: 12px;
  color: var(--t2);
  white-space: nowrap;
}

.ox-batch-input-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.ox-batch-input {
  width: 90px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  background: transparent;
  border: none;
  color: var(--t1);
  padding: 5px 8px;
  outline: none;
}

.ox-batch-input:focus {
  background: var(--bg3);
}

.ox-batch-unit {
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  color: var(--t3);
  background: var(--bg3);
  border-left: 1px solid var(--line);
}

.ox-batch-desc {
  font-size: 11px;
  color: var(--t3);
  margin: 0 0 10px;
  line-height: 1.5;
}

.ox-residual-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg3);
  font-family: var(--mono);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 960px) {
  .ox-tab-layout {
    grid-template-columns: 1fr;
  }
}

/* Einstellungen — Vorschau-Zeile für Ziehleistung */
.cfg-vorschau-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 3px 0;
  color: var(--t2);
  border-bottom: 1px solid var(--line2);
}

.cfg-vorschau-row:last-child {
  border-bottom: none;
}

/* Einstellungen — Sektions-Header */
.cfg-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  padding: 5px 0 6px;
  border-bottom: 1px solid var(--line);
  margin: 14px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cfg-section:first-child {
  margin-top: 2px;
}

.cfg-section .cfg-section-note {
  font-weight: 400;
  font-size: 10px;
  color: var(--t3);
  text-transform: none;
  letter-spacing: 0;
  margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════════
   Einstellungen — Card-System (cfg-card)
   ═══════════════════════════════════════════════════════════════ */

.cfg-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
  padding-bottom: 48px;
}

/* Card Wrapper */
.cfg-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow var(--trans-base);
}

.cfg-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
}

/* Card Header */
.cfg-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--line);
  cursor: default;
}

.cfg-card-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  line-height: 1;
}

.cfg-card-htext {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.cfg-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--t1);
}

.cfg-card-desc {
  font-size: 11px;
  color: var(--t3);
}

/* Card Body */
.cfg-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Subsection label inside card */
.cfg-subsection-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--t3);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  margin-bottom: -2px;
}

/* Field Grid */
.cfg-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px 22px;
}

.cfg-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cfg-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--t2);
  cursor: default;
}

.cfg-hint {
  font-size: 10px;
  color: var(--t3);
  line-height: 1.45;
}

.cfg-input-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cfg-unit {
  font-size: 11px;
  color: var(--t3);
  white-space: nowrap;
}

/* Number input */
.cfg-num {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--t1);
  background: var(--bg1);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  width: 88px;
  text-align: right;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}

.cfg-num::-webkit-inner-spin-button,
.cfg-num::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.cfg-num:hover {
  border-color: var(--accent-border);
}

.cfg-num:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2.5px rgba(74, 144, 226, .14);
}

.cfg-num-sm {
  width: 62px;
}

/* Text input */
.cfg-input {
  font-size: 13px;
  color: var(--t1);
  background: var(--bg1);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.cfg-input-full {
  width: 100%;
}

.cfg-input:hover {
  border-color: var(--accent-border);
}

.cfg-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2.5px rgba(74, 144, 226, .14);
}

/* Select */
.cfg-select {
  font-size: 13px;
  color: var(--t1);
  background: var(--bg1);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
  outline: none;
  width: 100%;
  cursor: pointer;
  transition: border-color .15s;
}

.cfg-select:focus {
  border-color: var(--accent);
}

/* Toggle Switch */
.cfg-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background .15s;
}

.cfg-toggle:hover {
  background: var(--bg3);
}

.cfg-toggle input[type="checkbox"] {
  display: none;
}

.cfg-toggle-track {
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  background: var(--bg3);
  border-radius: 10px;
  border: 1.5px solid var(--line);
  position: relative;
  transition: background .2s, border-color .2s;
  margin-top: 1px;
}

.cfg-toggle-track::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 13px;
  height: 13px;
  background: var(--t3);
  border-radius: 50%;
  transition: left .18s, background .18s;
}

.cfg-toggle input:checked+.cfg-toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.cfg-toggle input:checked+.cfg-toggle-track::after {
  left: 18px;
  background: #fff;
}

.cfg-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cfg-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
}

.cfg-toggle-hint {
  font-size: 11px;
  color: var(--t3);
}

/* Inline Toggle (Alarm-Grid) */
.cfg-toggle-inline {
  padding: 6px 10px;
  align-items: center;
}

.cfg-toggle-inline .cfg-toggle-label {
  font-size: 12px;
}

/* Alarm toggle row */
.cfg-alarm-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Warn box inside toggle */
.cfg-warn-box {
  display: block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  background: rgba(255, 160, 0, .1);
  color: var(--warn);
  margin-top: 4px;
  line-height: 1.4;
}

/* Radio Button (VZ Modus) */
.cfg-vz-modus-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 12px;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 7px;
  flex-wrap: wrap;
}

.cfg-vz-modus-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--t3);
}

.cfg-radio {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 12px;
  color: var(--t2);
}

.cfg-radio input[type="radio"] {
  display: none;
}

.cfg-radio-box {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-radius: 50%;
  transition: border-color .15s;
  flex-shrink: 0;
  position: relative;
}

.cfg-radio-box::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity .15s;
}

.cfg-radio input:checked~.cfg-radio-box {
  border-color: var(--accent);
}

.cfg-radio input:checked~.cfg-radio-box::after {
  opacity: 1;
}

/* Preview Box (Tagesproduktions-Vorschau) */
.cfg-preview-box {
  background: var(--accent-subtle, rgba(74, 144, 226, .06));
  border: 1px solid var(--accent-border, rgba(74, 144, 226, .2));
  border-radius: 7px;
  padding: 10px 14px;
}

.cfg-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2px;
}

/* Schicht Grid */
.cfg-schicht-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.cfg-schicht-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--bg1);
}

.cfg-schicht-code {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--mono);
  line-height: 1;
}

.cfg-schicht-f .cfg-schicht-code {
  color: #f59e0b;
}

.cfg-schicht-s .cfg-schicht-code {
  color: #f97316;
}

.cfg-schicht-n .cfg-schicht-code {
  color: #8b5cf6;
}

.cfg-schicht-f {
  border-color: rgba(245, 158, 11, .25);
}

.cfg-schicht-s {
  border-color: rgba(249, 115, 22, .25);
}

.cfg-schicht-n {
  border-color: rgba(139, 92, 246, .25);
}

/* Signature Grid (PDF) */
.cfg-sig-grid {
  display: grid;
  grid-template-columns: 52px 1fr 1fr;
  gap: 6px;
  align-items: center;
}

.cfg-sig-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--t3);
}

.cfg-sig-nr {
  font-size: 11px;
  color: var(--t3);
}

/* Button row */
.cfg-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Danger Zone */
.cfg-danger-zone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(220, 53, 69, .25);
  border-radius: 8px;
  background: rgba(220, 53, 69, .04);
  flex-wrap: wrap;
}

.cfg-btn-danger {
  background: var(--error);
  color: #fff;
  border: none;
  font-weight: 600;
}

.cfg-btn-danger:hover {
  filter: brightness(1.1);
}

/* Details / Collapsible Card */
.cfg-details {
  overflow: visible;
}

.cfg-details-summary {
  cursor: pointer;
  list-style: none;
  border-bottom: none;
}

.cfg-details[open] .cfg-details-summary {
  border-bottom: 1px solid var(--line);
}

.cfg-details-summary::-webkit-details-marker {
  display: none;
}

.cfg-details-arrow {
  font-size: 18px;
  color: var(--t3);
  margin-left: auto;
  padding-left: 8px;
  transition: transform .2s;
  flex-shrink: 0;
}

.cfg-details[open] .cfg-details-arrow {
  transform: rotate(90deg);
}

/* Einstellungen — Auto-berechnete Info-Kacheln */
.cfg-auto-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  grid-column: 1 / -1;
}

.cfg-auto-info {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cfg-auto-label {
  font-size: 10px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.cfg-auto-val {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--success);
}

.cfg-auto-src {
  font-size: 10px;
  color: var(--t3);
}

/* Einstellungen — Schichtzeilen kompakt */
.cfg-schicht-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 0 8px;
}

.cfg-schicht-row>label {
  flex: 1;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--t2);
}

.cfg-schicht-row input {
  width: 64px;
  font-family: var(--mono);
  font-weight: 700;
}

/* Einstellungen — Technische Konstanten (collapsed) */
.cfg-advanced summary {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--t3);
  padding: 5px 0 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cfg-advanced summary:hover {
  color: var(--t2);
}

.cfg-advanced[open] summary {
  color: var(--accent);
}

/* ═══ Section 26: Umfärbungs-Panel Erweiterungen ═════════════════════════════ */

.uf-typ-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 0 4px;
  display: block;
}

.uf-typ-badge.startsatz {
  color: var(--error);
}

.uf-typ-badge.uebergang {
  color: var(--accent);
}

.uf-typ-badge.endsatz {
  color: var(--success);
}

.uf-charge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 4px 0;
  font-size: 11px;
}

.uf-charge-count {
  font-family: var(--mono);
  color: var(--t3);
  min-width: 130px;
}

.uf-charge-progress {
  flex: 1;
  height: 5px;
  background: var(--bg3);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.uf-charge-bar {
  height: 100%;
  background: var(--success);
  border-radius: var(--r-sm);
  transition: width .35s ease;
}

/* ── 25. Druck-Stylesheet ────────────────────────────────────────────────── */
@page {
  margin: 20mm 18mm 25mm;
  size: A4 portrait;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Login / Overlay Animations & Components
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes blobMover1 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(10vw, 5vw) scale(1.1);
  }
}

@keyframes blobMover2 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-5vw, -10vw) scale(1.05);
  }
}

@keyframes loginEntrance {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floatIcon {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes loginShake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-6px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(6px);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.login-box-error {
  animation: loginShake 0.55s cubic-bezier(.36, .07, .19, .97) both;
}

.login-box-error .floating-input {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 1px var(--error), inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Floating Input Groups */
.floating-input-group {
  position: relative;
  z-index: 1;
}

.floating-input {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.floating-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(108, 143, 255, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  background: rgba(0, 0, 0, 0.4) !important;
}

.floating-label {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Label moves up on focus OR not-empty */
.floating-input:focus+.floating-label,
.floating-input:not(:placeholder-shown)+.floating-label {
  transform: translateY(-28px) scale(0.85) !important;
  left: 10px !important;
  color: var(--accent) !important;
  font-weight: 500;
  background: transparent;
  padding: 0 4px;
}

.floating-input:not(:placeholder-shown):not(:focus)+.floating-label {
  color: var(--t3) !important;
}

.input-icon {
  transition: stroke 0.3s ease !important;
}

/* Icons respond to focus */
.floating-input:focus~.input-icon {
  stroke: var(--accent) !important;
}

.btn-spinner circle {
  opacity: 0.25;
}

.btn-spinner path {
  opacity: 0.75;
}