/* ═══════════════════════════════════════════════════════════
   ImkerApp – Design System v2.0
   Einheitliches, modernes UI für alle Seiten
   ═══════════════════════════════════════════════════════════ */

/* ── 1. CSS Custom Properties (Theme) ────────────────────── */
:root {
  /* Primärfarben – warmes Honig-Amber */
  --honey:       #F59E0B;
  --honey-light: #FEF3C7;
  --honey-dark:  #D97706;
  --honey-deep:  #92400E;

  /* Neutrals */
  --ink:         #111827;
  --ink-soft:    #374151;
  --muted:       #6B7280;
  --muted-light: #9CA3AF;
  --border:      #E5E7EB;
  --bg:          #F9FAFB;
  --bg-warm:     #FFFBEB;
  --card:        #FFFFFF;

  /* Status */
  --success:     #059669;
  --success-bg:  #D1FAE5;
  --danger:      #DC2626;
  --danger-bg:   #FEE2E2;
  --info:        #0EA5E9;
  --info-bg:     #E0F2FE;
  --purple:      #7C3AED;
  --purple-bg:   #EDE9FE;

  /* Schatten */
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:      0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 30px rgba(0,0,0,.10);
  --shadow-glow: 0 0 0 4px rgba(245,158,11,.15);

  /* Rundungen */
  --radius-sm:   10px;
  --radius:      16px;
  --radius-lg:   22px;
  --radius-full: 999px;

  /* Abstände */
  --space-xs:    4px;
  --space-sm:    8px;
  --space-md:    16px;
  --space-lg:    24px;
  --space-xl:    32px;

  /* Bottom-Nav Höhe */
  --nav-h:       64px;
}

/* ── 2. Base / Reset ─────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  padding-bottom: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--honey-dark); }
a:hover { color: var(--honey-deep); }

/* ── 3. Typography ───────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1.25;
}

.text-muted, .muted { color: var(--muted) !important; }
.text-ink { color: var(--ink); }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.fs-xxs { font-size: .65rem; }
.fs-xs  { font-size: .75rem; }

/* ── 4. Cards ────────────────────────────────────────────── */
.card-soft {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: var(--space-lg);
}

.card-hover {
  transition: transform .15s ease, box-shadow .15s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.bg-soft { background: var(--bg); }

/* ── 5. Top Navbar ───────────────────────────────────────── */
.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -.02em;
}
.app-brand:hover { color: var(--honey-dark); }

.app-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.hamburger-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--ink);
  transition: background .15s;
}
.hamburger-btn:hover {
  background: var(--bg);
}

/* ── 6. Bottom Tab Bar (removed – sidebar navigation only) ── */

/* ── 7. Sidebar / Offcanvas ──────────────────────────────── */
.sidebar-header {
  background: var(--ink);
  color: #fff;
  padding: 20px;
}
.sidebar-header h5 {
  color: #fff;
  margin: 0;
}

.sidebar-body {
  padding: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: .95rem;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.sidebar-link:hover {
  background: var(--honey-light);
  color: var(--honey-dark);
}
.sidebar-link .sl-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.sidebar-section {
  padding: 10px 20px 6px;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted-light);
}

.sidebar-link-danger {
  color: var(--danger);
}
.sidebar-link-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ── 8. Page Header ──────────────────────────────────────── */
.page-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: var(--space-lg);
}
.page-title h1 {
  font-size: 1.5rem;
  margin: 0;
}
.page-sub {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  margin-top: 2px;
}

/* ── 9. KPI Grid ─────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.kpi {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
}
.kpi .label {
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 4px;
}
.kpi .val {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.2;
}
.kpi .val.text-danger { color: var(--danger) !important; }
.kpi .val.text-warning { color: var(--honey-dark) !important; }

/* ── 10. Standort Tiles (2-col grid) ─────────────────────── */
.standort-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.standort-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 12px 16px;
  min-height: 120px;
  position: relative;
  transition: transform .12s, box-shadow .15s;
}
.standort-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}
.standort-tile:active {
  transform: scale(.97);
}

.standort-tile .tile-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 6px;
}
.standort-tile .tile-name {
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 2px;
}
.standort-tile .tile-sub {
  font-size: .7rem;
  color: var(--muted);
  font-weight: 600;
}
.standort-tile .tile-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  padding: 0 6px;
}

.standort-tile.tile-add {
  border: 2px dashed var(--border);
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.standort-tile.tile-add:hover {
  border-color: var(--honey);
  color: var(--honey-dark);
  box-shadow: none;
}
.standort-tile.tile-add .tile-icon {
  font-size: 1.5rem;
  opacity: .6;
}

/* ── 11. Task Cards (mobile-optimized) ───────────────────── */
.task-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  transition: background .12s;
  border-left: 4px solid var(--border);
}
.task-card:hover {
  background: var(--bg);
  color: var(--ink);
}
.task-card.task-danger { border-left-color: var(--danger); }
.task-card.task-warning { border-left-color: var(--honey); }
.task-card.task-info { border-left-color: var(--info); }

.task-card .task-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}
.task-card .task-body {
  flex: 1;
  min-width: 0;
}
.task-card .task-title {
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.2;
}
.task-card .task-meta {
  font-size: .68rem;
  color: var(--muted);
  font-weight: 500;
}
.task-card .task-arrow {
  color: var(--muted);
  font-size: .9rem;
  flex-shrink: 0;
}

/* Legacy task pills */
.task-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.task-red    { background: var(--danger-bg); color: var(--danger); }
.task-blue   { background: var(--info-bg);   color: var(--info); }
.task-purple { background: var(--purple-bg); color: var(--purple); }
.task-green  { background: var(--success-bg);color: var(--success); }
.task-yellow { background: var(--honey-light); color: var(--honey-deep); }

/* ── 12. Open-Row (Card Footer) ──────────────────────────── */
.open-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}
.open-hint {
  font-size: .8rem;
  color: var(--muted);
}
.btn-open {
  font-size: .8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

/* ── 13. Buttons ─────────────────────────────────────────── */
.btn-honey {
  background: var(--honey);
  border-color: var(--honey);
  color: var(--ink);
  font-weight: 800;
  border-radius: var(--radius);
  padding: .75rem 1.2rem;
  transition: all .15s;
}
.btn-honey:hover {
  background: var(--honey-dark);
  border-color: var(--honey-dark);
  color: var(--ink);
  box-shadow: var(--shadow-glow);
}

.pill { border-radius: var(--radius-full) !important; }

/* ── 14. Forms ───────────────────────────────────────────── */
.form-control,
.form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  padding: .6rem .85rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--honey);
  box-shadow: var(--shadow-glow);
}

.form-label {
  font-weight: 700;
  font-size: .85rem;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

/* ── 15. Alerts (Bootstrap override) ─────────────────────── */
.alert {
  border-radius: var(--radius);
  border: none;
  font-size: .9rem;
}

/* ── 16. Timeline ────────────────────────────────────────── */
.timeline-item {
  position: relative;
  padding-left: 30px;
  border-left: 2px solid var(--border);
  margin-bottom: 24px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 0;
  width: 16px;
  height: 16px;
  background: var(--honey);
  border: 3px solid var(--card);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.log-card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  transition: transform .15s;
}
.log-card:hover {
  transform: translateX(4px);
}

.icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── 17. Accordion (Bootstrap override) ──────────────────── */
.accordion-item {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
}
.accordion-button {
  border-radius: var(--radius) !important;
  font-weight: 700;
}
.accordion-button:not(.collapsed) {
  background: var(--honey-light);
  color: var(--ink);
  box-shadow: none;
}
.accordion-button:focus {
  box-shadow: var(--shadow-glow);
  border-color: var(--honey);
}

/* ── 18. Tower / Beuten UI ───────────────────────────────── */
.tower-wrap {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 640px) {
  .tower-wrap { grid-template-columns: 1fr; }
}

.tower-panel, .tower-side {
  border-radius: var(--radius);
  padding: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.tower-title {
  font-weight: 800;
  font-size: 14px;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tower-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}
.tower-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tower-row  { display: flex; align-items: center; gap: 8px; }
.tower-seg {
  flex: 1;
  height: 34px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-weight: 800;
  font-size: 12px;
  box-shadow: var(--shadow-sm);
}
.drag-handle { cursor: grab; opacity: .65; margin-right: 8px; font-weight: 900; }
.badge-mini {
  font-weight: 800;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(0,0,0,.06);
}
.tower-controls .btn { padding: 6px 8px; line-height: 1; border-radius: var(--radius-sm); }
.tower-windel {
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--danger);
  margin: 8px 0 12px 0;
  box-shadow: 0 4px 14px rgba(220,38,38,.25);
}

/* Tower Farben – Imker-Farbschema */
.seg-boden       { background: #1a1a1a; color: #fff; height: 8px !important; }             /* Schwarz */
.seg-windel      { background: #ef4444; color: #fff; height: 8px !important; }             /* Rot */
.seg-br          { background: #8B5E3C; color: #fff; }                                     /* Braun */
.seg-hr          { background: var(--honey); color: var(--ink); }                           /* Honiggelb */
.seg-med         { background: #fff; color: var(--ink); border: 1.5px solid #ccc; }         /* Weiß */
.seg-gitter      { background: #D946EF; color: #fff; height: 8px !important; }             /* Magenta */
.seg-folie       { background: transparent; height: 6px !important; border: 2px dashed #9CA3AF; } /* Gestrichelt */
.seg-innendeckel { background: #A0764A; color: #fff; height: 10px !important; }             /* Braun (dunkler) */
.seg-aussendeckel{ background: #A8A9AD; color: var(--ink); height: 12px !important; border-radius: 6px 6px 2px 2px; } /* Zinkfarbe */
.seg-lz          { background: #3B82F6; color: #fff; }                                     /* Blau */
.seg-deckel      { background: #A8A9AD; color: var(--ink); }                                /* Legacy fallback */
.seg-schieber    { background: #374151; color: #fff; }

/* Tower Insert-Buttons zwischen Ebenen */
.tower-insert-row {
  display: flex;
  justify-content: center;
  margin: -2px 0;
}
.tower-insert-btn {
  background: none;
  border: 1.5px dashed #ccc;
  border-radius: 8px;
  padding: 1px 12px;
  font-size: 0.65rem;
  color: #aaa;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
}
.tower-insert-btn:hover {
  border-color: var(--honey);
  color: var(--ink);
  background: rgba(234,179,8,.08);
}
.tower-seg.drag-over {
  outline: 2px solid var(--honey);
  outline-offset: 2px;
  box-shadow: 0 0 8px rgba(234,179,8,.3);
}
/* Insert Dropdown */
.insert-menu {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  z-index: 100;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.insert-menu-item {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .12s;
}
.insert-menu-item:hover {
  background: var(--honey);
  color: var(--ink);
  border-color: var(--honey);
}

.badge-sperre {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: .65rem;
  font-weight: 700;
  background: var(--danger-bg);
  color: var(--danger);
  white-space: nowrap;
}

/* ── Volk Action Grid ────────────────────────────────────── */
.volk-actions {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 6px;
  margin-top: 12px;
  width: 100%;
}
a.volk-action,
.volk-action {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none !important;
  color: var(--ink) !important;
  background: var(--honey-light) !important;
  border: 1.5px solid var(--honey) !important;
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  min-height: 60px;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.2;
  transition: background .12s, transform .1s;
}
a.volk-action:hover,
.volk-action:hover {
  background: var(--honey) !important;
  color: var(--ink) !important;
  transform: translateY(-1px);
}
.volk-action:active { transform: scale(.96); }
.volk-action .va-icon {
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: 3px;
}

.tower-preview {
  width: 100%;
  min-height: 200px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.preview-stack {
  width: 96px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.preview-seg {
  height: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: var(--shadow-sm);
}
.preview-windel {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--danger);
  box-shadow: 0 4px 12px rgba(220,38,38,.25);
  margin-bottom: 10px;
}

/* Inspektion Chips */
.stack-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 38px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  border: 1px solid rgba(0,0,0,.06);
  margin: 0 6px 8px 0;
  cursor: pointer;
  transition: transform .1s;
}
.stack-chip:hover { transform: scale(1.08); }
.chip-BR { background: #8B6B60; color: #fff; }
.chip-HR { background: var(--honey); color: var(--ink); }
.chip-LZ { background: var(--info); color: #fff; }
.chip-AS { background: #F1F3F5; color: var(--ink); }
.chip-XX { background: #E9ECEF; color: var(--ink); }

/* Modal table */
.zb-table th, .zb-table td { vertical-align: middle; }
.zb-btn { width: 40px; height: 34px; padding: 0; border-radius: var(--radius-sm); font-weight: 900; }

/* ── 19. Login Page ──────────────────────────────────────── */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 40%, #FDE68A 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
  text-align: center;
}
.login-card .login-logo-img {
  display: block;
  width: 100px;
  height: 100px;
  max-width: 100px;
  max-height: 100px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.login-card h3 {
  font-size: 1.3rem;
  margin-bottom: 24px;
}
.login-card .btn-login {
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  border: none;
  border-radius: var(--radius);
  padding: 14px;
  font-size: .95rem;
  letter-spacing: .02em;
  transition: background .15s, box-shadow .15s;
}
.login-card .btn-login:hover {
  background: #1F2937;
  box-shadow: 0 8px 24px rgba(17,24,39,.18);
}

/* ── 20. Inspektion Modal Shell ──────────────────────────── */
.modal-shell {
  max-width: 720px;
  margin: 18px auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--card);
}
.modal-head {
  background: var(--ink);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h1 {
  font-size: 1.15rem;
  margin: 0;
  font-weight: 800;
  color: #fff;
}
.xbtn {
  color: #fff;
  text-decoration: none;
  font-size: 1.8rem;
  line-height: 1;
  opacity: .85;
}
.xbtn:hover { opacity: 1; color: #fff; }
.modal-bodyy { padding: 14px; }

.bigsave {
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  border-radius: var(--radius);
  padding: 16px 14px;
  border: 0;
  width: 100%;
  box-shadow: 0 12px 30px rgba(0,0,0,.15);
  transition: background .15s, box-shadow .15s;
}
.bigsave:hover {
  background: #1F2937;
  box-shadow: 0 16px 40px rgba(0,0,0,.2);
}

.seg {
  display: flex;
  gap: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.12);
  background: var(--card);
}
.seg button {
  flex: 1;
  padding: 14px 10px;
  border: 0;
  font-weight: 900;
  letter-spacing: .02em;
  transition: opacity .1s;
}
.seg button:hover { opacity: .85; }
.seg .b-br  { background: var(--ink); color: #fff; }
.seg .b-hr  { background: var(--honey); color: var(--ink); }
.seg .b-lz  { background: var(--info); color: #fff; }
.seg .b-as  { background: var(--card); color: var(--muted); border-left: 1px solid rgba(0,0,0,.08); }

.label-red  { color: var(--danger); font-weight: 900; }
.label-blue { color: var(--info); font-weight: 900; }

.range-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.range-val { min-width: 70px; text-align: right; font-weight: 900; }
input[type="range"] { width: 100%; accent-color: var(--honey); }

.hrline { height: 1px; background: var(--border); margin: 14px 0; }

/* ── 21. Badges ──────────────────────────────────────────── */
.badge-soft         { background: var(--honey-light); color: var(--honey-deep); }
.badge-soft-danger  { background: var(--danger-bg);   color: var(--danger); }
.badge-soft-primary { background: var(--info-bg);     color: var(--info); }
.badge-soft-success { background: var(--success-bg);  color: var(--success); }

/* ── 22. PRINT DOCUMENT (Arzneibuch) ─────────────────────── */
.print-page {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.doc-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.doc-title .brand {
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: 2px;
}
.doc-title h2 {
  font-weight: 900;
  letter-spacing: -.02em;
  margin: 0;
}
.doc-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.doc-meta {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: var(--bg);
}
.doc-meta > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  padding: 2px 0;
  font-size: 12px;
}
.doc-meta .k { color: var(--muted); }
.doc-meta .v { font-weight: 700; color: var(--ink); }

/* Table */
.table-wrap {
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
.doc-table thead th {
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: none;
  padding: 10px;
  border-bottom: 1px solid var(--ink);
  vertical-align: middle;
}
.doc-table tbody td {
  font-size: 12px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.doc-table tbody tr:nth-child(even) {
  background: var(--bg);
}

.doc-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.doc-footer .sign { min-width: 220px; text-align: right; }
.doc-footer .line { height: 1px; background: var(--ink); margin-bottom: 6px; }

/* ── 23. Futter-Monitor ──────────────────────────────────── */
.futter-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  background: var(--card);
  padding: var(--space-md);
}
.progress-futter {
  height: 25px;
  border-radius: var(--radius-sm);
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.progress-bar-text {
  position: absolute;
  width: 100%;
  text-align: center;
  font-weight: 800;
  font-size: .75rem;
  line-height: 25px;
  color: var(--ink);
}
.delta-badge {
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ── 24. Kunden-Suche ────────────────────────────────────── */
#sucheErgebnisse {
  z-index: 2000 !important;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 250px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.suggestion-item {
  cursor: pointer;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  text-align: left;
  width: 100%;
  background: var(--card);
  transition: background .1s;
}
.suggestion-item:hover {
  background: var(--honey-light);
}

/* ── 25. Rahmen-Lager ────────────────────────────────────── */
.badge-z { font-weight: 800; }

/* ── 26. Historie Border-Colors ──────────────────────────── */
.card.border-danger  { border-left-color: var(--danger) !important; }
.card.border-warning { border-left-color: var(--honey) !important; }
.card.border-info    { border-left-color: var(--info) !important; }
.card.border-primary { border-left-color: var(--info) !important; }
.card.border-secondary { border-left-color: var(--muted) !important; }

/* ── 27. Mini-Tower (Volk-Card Preview) ──────────────────── */
.mini-tower {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 62px;
  flex-shrink: 0;
}
.mini-seg {
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.1);
  box-shadow: var(--shadow-sm);
  font-size: .5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* ── 28. KI-Loading-Overlay ──────────────────────────────── */
.ki-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255,255,255,.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  backdrop-filter: blur(4px);
}
.ki-spinner {
  width: 64px;
  height: 64px;
  border: 6px solid var(--border);
  border-top-color: var(--honey);
  border-radius: 50%;
  animation: ki-spin .8s linear infinite;
}
@keyframes ki-spin {
  to { transform: rotate(360deg); }
}
.ki-overlay h3 {
  font-size: 1.2rem;
  margin: 0;
}
.ki-overlay p {
  color: var(--muted);
  margin: 0;
  font-size: .9rem;
}

/* ── 29. Arzneibuch (Browser-Version) ────────────────────── */
.page-wrap { max-width: 1100px; margin: 0 auto; }
.bb-card {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.bb-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.bb-title h1 { font-size: 1.35rem; margin: 0; }
.bb-title .sub { color: var(--muted); font-size: .95rem; margin-top: 2px; }
.bb-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.bb-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.bb-pill {
  padding: 6px 10px;
  border-radius: var(--radius-full);
  background: var(--bg);
  font-weight: 600;
  font-size: .85rem;
}
.table-bb th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.table-bb td { vertical-align: top; }
.table-bb .small { color: var(--muted); font-size: .85rem; }

/* ── 28. Responsive ──────────────────────────────────────── */

/* Global: Seiten-Inhalt auf Desktop begrenzen */
.container { max-width: 960px !important; }

/* Volk-Grid: Basis (1 Spalte mobil) */
.volk-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.volk-grid > .card { margin-bottom: 0 !important; }

/* Mobile-First */
@media (max-width: 576px) {
  .page-title { flex-direction: column; gap: 8px; }
  .page-title h1 { font-size: 1.25rem; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi .val { font-size: 1.25rem; }
}

/* Desktop: ab 768px */
@media (min-width: 768px) {
  /* Volk-Cards nebeneinander */
  .volk-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Action-Buttons 4 Spalten auf Desktop */
  .volk-actions {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Mini-Tower etwas breiter */
  .mini-tower { width: 72px; }
  .mini-seg { height: 22px; font-size: .55rem; }

  /* Standort-Tiles 3er-Grid */
  .standort-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Formular-Seiten schmaler halten */
  .form-page-wrap {
    max-width: 600px;
    margin: 0 auto;
  }
}

/* Große Bildschirme */
@media (min-width: 1200px) {
  .container { max-width: 1080px; }

  .volk-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .standort-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── 24. Print Rules ─────────────────────────────────────── */
@media print {
  body {
    background: #fff !important;
    padding-bottom: 0 !important;
  }
  .app-navbar, .nav-bottom, .d-print-none,
  .offcanvas, .offcanvas-backdrop { display: none !important; }

  .print-page {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }
  .table-wrap {
    border: 0 !important;
    border-radius: 0 !important;
  }
  .doc-table thead th {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .doc-table tbody tr:nth-child(even) {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .bb-card {
    box-shadow: none !important;
    border: none !important;
  }
  .page-wrap {
    max-width: 100% !important;
    margin: 0 !important;
  }
  .page-break { page-break-before: always; }
  .table { page-break-inside: auto; }
  tr { page-break-inside: avoid; page-break-after: auto; }
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }

  @page { size: A4; margin: 12mm; }
}
