/* ─── RESET & VARS ────────────────────────────────────────────────────────── */
:root {
  --red:       #C0392B;
  --red-dark:  #96281B;
  --red-light: #E74C3C;
  --red-bg:    #FDF0EF;
  --yellow:    #E67E22;
  --yellow-bg: #FEF9EF;
  --green:     #27AE60;
  --green-bg:  #EAFAF1;
  --blue:      #2980B9;
  --blue-bg:   #EBF5FB;
  --purple:    #8E44AD;
  --purple-bg: #F5EEF8;
  --grey-900:  #1A1A2E;
  --grey-800:  #2C2C3E;
  --grey-600:  #5A5A7A;
  --grey-400:  #9B9BB4;
  --grey-200:  #E8E8F0;
  --grey-100:  #F4F4F8;
  --white:     #FFFFFF;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 2px 8px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.14);
  --nav-h:     60px;  /* mobile bottom nav height */
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--grey-100);
  color: var(--grey-900);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  /* mobile: no sidebar, content fills screen */
  padding-bottom: var(--nav-h);
}

/* ─── MOBILE BOTTOM NAV ──────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--grey-900);
  display: flex;
  align-items: stretch;
  z-index: 200;
  border-top: 1px solid rgba(255,255,255,.07);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--grey-400);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 6px 4px;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.bottom-nav-item.active { color: var(--red-light); }
.bottom-nav-item:active { background: rgba(255,255,255,.06); }

/* ─── MEHR-DRAWER (nur Mobile) ───────────────────────────────────────────── */
#mehr-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 198;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s, visibility 0s .25s;
}
#mehr-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .25s, visibility 0s 0s;
}

.mehr-drawer {
  position: fixed;
  bottom: var(--nav-h);
  left: 0; right: 0;
  background: var(--grey-900);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 8px 16px 20px;
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(24px);
  transition: opacity .25s, visibility 0s .25s, transform .25s cubic-bezier(.4,0,.2,1);
}
.mehr-drawer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity .25s, visibility 0s 0s, transform .25s cubic-bezier(.4,0,.2,1);
}

.mehr-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 2px;
  margin: 0 auto 14px;
}

.mehr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mehr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 12px;
  color: var(--grey-400);
  font-size: 10px;
  font-weight: 600;
  background: rgba(255,255,255,.06);
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .4px;
  width: 100%;
  transition: color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.mehr-item svg { width: 22px; height: 22px; }
.mehr-item.active { color: var(--red-light); background: rgba(239,68,68,.12); }
.mehr-item:active { background: rgba(255,255,255,.12); }

/* ─── DESKTOP SIDEBAR (≥ 768px) ──────────────────────────────────────────── */
@media (min-width: 768px) {
  body {
    display: flex;
    padding-bottom: 0;
  }

  .bottom-nav { display: none; }
  #mehr-overlay, #mehr-drawer { display: none !important; }

  .sidebar {
    display: flex !important;
    width: 220px;
    background: var(--grey-900);
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
  }

  .content { margin-left: 220px; }
}

.sidebar { display: none; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-icon { width: 30px; height: 30px; color: var(--red-light); flex-shrink: 0; }
.brand-title { font-size: 14px; font-weight: 700; color: var(--white); }
.brand-sub { font-size: 11px; color: var(--grey-400); text-transform: uppercase; letter-spacing: .5px; }

.nav-links { list-style: none; padding: 10px 0; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: var(--grey-400);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: color .15s, background .15s;
}

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { color: var(--white); background: rgba(255,255,255,.05); }
.nav-item.active { color: var(--white); background: rgba(192,57,43,.15); border-left-color: var(--red-light); }

.sidebar-footer { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.05); }
.sidebar-user-avatar { width: 34px; height: 34px; border-radius: 8px; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; letter-spacing: .5px; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: var(--grey-400); text-transform: uppercase; letter-spacing: .4px; margin-top: 1px; }
.sidebar-logout-btn { width: 30px; height: 30px; border-radius: 7px; border: none; background: transparent; cursor: pointer; color: var(--grey-400); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s, color .15s; }
.sidebar-logout-btn:hover { background: rgba(192,57,43,.25); color: var(--red-light); }
.sidebar-logout-btn svg { width: 15px; height: 15px; }

/* ─── CONTENT AREA ───────────────────────────────────────────────────────── */
.content { flex: 1; padding: 16px; }

@media (min-width: 768px) {
  .content { padding: 28px 32px; }
}

.page { display: none; }
.page.active { display: block; }

/* ─── PAGE HEADER ────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
  flex-wrap: wrap;
}

.page-header h1 { font-size: 18px; font-weight: 700; flex-shrink: 0; }
.page-header > div { display: flex; gap: 6px; flex-wrap: wrap; }

@media (min-width: 768px) {
  .page-header { margin-bottom: 24px; flex-wrap: nowrap; }
  .page-header h1 { font-size: 24px; }
}

.page-date { color: var(--grey-400); font-size: 12px; white-space: nowrap; }

/* ─── CARDS ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--grey-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 { font-size: 13px; font-weight: 600; color: var(--grey-600); }

/* ─── STATS GRID ─────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 480px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 24px; } }

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 12px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--grey-200);
  text-align: center;
}

.stat-card.red    { border-top-color: var(--red); }
.stat-card.yellow { border-top-color: var(--yellow); }
.stat-card.green  { border-top-color: var(--green); }
.stat-card.blue   { border-top-color: var(--blue); }
.stat-card.purple { border-top-color: var(--purple); }

.stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--grey-400); margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; color: var(--grey-900); }
.stat-value.red    { color: var(--red); }
.stat-value.green  { color: var(--green); }
.stat-value.blue   { color: var(--blue); }
.stat-value.yellow { color: var(--yellow); }
.stat-value.purple { color: var(--purple); }

/* ─── DASHBOARD BOTTOM ───────────────────────────────────────────────────── */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 900px) { .dashboard-bottom { grid-template-columns: 1fr 1fr; } }

.bewegung-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--grey-100);
}
.bewegung-item:last-child { border-bottom: none; }

.bewegung-badge {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  flex-shrink: 0; text-transform: uppercase; letter-spacing: .3px;
  white-space: nowrap;
}
.badge-ausgabe    { background: var(--red-bg); color: var(--red); }
.badge-rueckgabe  { background: var(--green-bg); color: var(--green); }
.badge-status_waesche { background: var(--blue-bg); color: var(--blue); }
.badge-status_defekt  { background: var(--yellow-bg); color: var(--yellow); }
.badge-status_lager   { background: var(--green-bg); color: var(--green); }

.bewegung-info { flex: 1; min-width: 0; }
.bewegung-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bewegung-meta { font-size: 11px; color: var(--grey-400); margin-top: 1px; }

.kat-bar-wrap { padding: 14px 16px; }
.kat-row { margin-bottom: 10px; }
.kat-label { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 12px; }
.kat-bar { height: 7px; background: var(--grey-200); border-radius: 4px; overflow: hidden; }
.kat-bar-fill { height: 100%; background: var(--red); border-radius: 4px; transition: width .6s; }

/* ─── FILTER BAR ─────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-input, .select-filter {
  padding: 9px 12px;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--white);
  color: var(--grey-900);
  outline: none;
  -webkit-appearance: none;
  transition: border-color .15s;
}
.search-input { flex: 1; min-width: 160px; }
.search-input:focus, .select-filter:focus { border-color: var(--red); }

/* ─── EXPORT BAR ─────────────────────────────────────────────────────────── */
.export-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}

.export-bar .export-label { font-size: 12px; font-weight: 600; color: var(--grey-400); text-transform: uppercase; letter-spacing: .4px; }

/* ─── ARTIKEL CARDS (mobile) / TABLE (desktop) ───────────────────────────── */
.artikel-list { display: flex; flex-direction: column; gap: 10px; }

.artikel-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  border-left: 4px solid var(--grey-200);
}
.artikel-card.status-lager    { border-left-color: var(--blue); }
.artikel-card.status-ausgegeben { border-left-color: var(--red); }
.artikel-card.status-waesche  { border-left-color: var(--yellow); }
.artikel-card.status-defekt   { border-left-color: var(--grey-400); }

.artikel-card-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.artikel-card-icon { font-size: 22px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.artikel-card-title { font-weight: 700; font-size: 15px; flex: 1; }
.artikel-card-barcode { font-family: monospace; font-size: 11px; color: var(--grey-400); margin-top: 2px; }
.artikel-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.meta-chip { font-size: 11px; background: var(--grey-100); color: var(--grey-600); padding: 2px 8px; border-radius: 20px; }
.artikel-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Desktop: show table instead of cards */
@media (max-width: 767px) {
  .artikel-table-wrap { display: none !important; }
}
@media (min-width: 768px) {
  .artikel-list { display: none !important; }
  .artikel-table-wrap { display: block !important; }
}

/* artikel-table-wrap shown via media query above */

.table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--grey-400);
  border-bottom: 1.5px solid var(--grey-200);
  white-space: nowrap;
}

tbody td { padding: 11px 14px; border-bottom: 1px solid var(--grey-100); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--grey-100); }
.td-actions { display: flex; gap: 6px; }

/* ─── STATUS BADGES ──────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .3px;
  white-space: nowrap;
}
.status-lager     { background: var(--blue-bg); color: var(--blue); }
.status-ausgegeben{ background: var(--red-bg); color: var(--red); }
.status-waesche   { background: var(--yellow-bg); color: var(--yellow); }
.status-defekt    { background: var(--grey-200); color: var(--grey-600); }

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s, opacity .15s; text-decoration: none;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-primary { background: var(--red); color: white; }
.btn-primary:active { background: var(--red-dark); }
.btn-secondary { background: var(--grey-200); color: var(--grey-600); }
.btn-secondary:active { background: var(--grey-400); color: white; }
.btn-success { background: var(--green); color: white; }
.btn-warning { background: var(--yellow); color: white; }
.btn-danger  { background: var(--red-light); color: white; }
.btn-small   { padding: 5px 10px; font-size: 12px; }
.btn-full    { width: 100%; }
.btn-icon    { padding: 8px; }

@media (min-width: 768px) {
  .btn-primary:hover   { background: var(--red-dark); }
  .btn-secondary:hover { background: var(--grey-400); color: white; }
}

/* ─── SCANNER ────────────────────────────────────────────────────────────── */
.scanner-layout { display: flex; flex-direction: column; gap: 16px; }

@media (min-width: 768px) {
  .scanner-layout { flex-direction: row; align-items: flex-start; }
  .scanner-card { width: 440px; flex-shrink: 0; }
}

.scanner-card { padding: 16px; }

.scanner-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.scan-tab {
  flex: 1; padding: 9px;
  border: 1.5px solid var(--grey-200); background: white;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.scan-tab.active { background: var(--red); color: white; border-color: var(--red); }

.video-wrapper {
  position: relative; width: 100%; aspect-ratio: 4/3;
  background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 12px;
}
#scanner-video { width: 100%; height: 100%; object-fit: cover; display: block; }

.scan-overlay { position: absolute; inset: 0; pointer-events: none; }
.scan-frame {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 65%; aspect-ratio: 2/1;
  border: 2px solid rgba(255,255,255,.7); border-radius: 6px;
}
.scan-line {
  position: absolute; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--red-light), transparent);
  animation: scanline 2s ease-in-out infinite;
}
@keyframes scanline {
  0%,100% { top: 15%; opacity: .6; }
  50% { top: 85%; opacity: 1; }
}

.input-group { margin-bottom: 14px; }
.input-group label { display: block; font-size: 11px; font-weight: 700; color: var(--grey-400); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.input-row { display: flex; gap: 8px; }
.input-barcode { flex: 1; padding: 10px 12px; border: 1.5px solid var(--grey-200); border-radius: var(--radius-sm); font-size: 15px; font-family: monospace; outline: none; }
.input-barcode:focus { border-color: var(--red); }

/* ─── SCAN RESULT ─────────────────────────────────────────────────────────── */
.scan-result-artikel { padding: 16px; }
.result-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.result-icon { width: 44px; height: 44px; background: var(--red-bg); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.result-title { font-size: 17px; font-weight: 700; line-height: 1.2; }
.result-barcode { font-size: 11px; color: var(--grey-400); font-family: monospace; margin-top: 3px; }
.result-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.detail-item label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--grey-400); }
.detail-item p { font-size: 14px; font-weight: 600; margin-top: 2px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── PERSONEN CARDS (mobile) ─────────────────────────────────────────────── */
.personen-list { display: flex; flex-direction: column; gap: 10px; }

.person-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.person-avatar {
  width: 42px; height: 42px;
  background: var(--red-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: var(--red);
  flex-shrink: 0;
}

.person-info { flex: 1; min-width: 0; }
.person-name { font-weight: 700; font-size: 15px; }
.person-meta { font-size: 12px; color: var(--grey-400); margin-top: 2px; }
.person-actions { display: flex; gap: 6px; }

@media (max-width: 767px) {
  .personen-table-wrap { display: none !important; }
}
@media (min-width: 768px) {
  .personen-list { display: none !important; }
  .personen-table-wrap { display: block !important; }
}
/* personen-table-wrap shown via media query above */

/* ─── MODAL ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 1000; padding: 0;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--white);
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 100%;
  max-height: 92vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 20px; }
  .modal { border-radius: 14px; max-width: 520px; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--grey-200);
  position: sticky; top: 0; background: white; z-index: 1;
}
.modal-header h2 { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--grey-400); padding: 4px 8px; border-radius: 6px; }
.modal-body { padding: 18px 20px 28px; }

/* ─── FORMS ──────────────────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 11px; font-weight: 700; color: var(--grey-600); text-transform: uppercase; letter-spacing: .4px; }

.form-group input, .form-group select, .form-group textarea {
  padding: 10px 12px; border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-sm); font-size: 15px; outline: none;
  font-family: var(--font); transition: border-color .15s;
  -webkit-appearance: none; background: white;
  width: 100%; min-width: 0;
}

/* Grid-/Flex-Kinder haben min-width:auto und werden sonst von der intrinsischen
   Feldbreite aufgeblasen -> Formulare liefen auf schmalen Displays über */
.form-grid, .form-row, .form-group, .typ-toggle, .modal-actions { min-width: 0; }
.form-grid > *, .form-row > *, .typ-toggle > *, .modal-actions > * { min-width: 0; }
.modal-actions { flex-wrap: wrap; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--red); }

.barcode-input-wrap { display: flex; gap: 8px; align-items: center; }
.barcode-input-wrap input { flex: 1; }
.btn-scan-inline { padding: 10px 12px; background: var(--grey-100); border: 1.5px solid var(--grey-200); border-radius: var(--radius-sm); cursor: pointer; font-size: 18px; transition: background .15s; }
.btn-scan-inline:hover { background: var(--grey-200); }

.modal-actions { display: flex; justify-content: stretch; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--grey-200); }
.modal-actions .btn { flex: 1; padding: 12px; }

/* ─── STATUS PICKER ──────────────────────────────────────────────────────── */
.status-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.status-option {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px; border: 2px solid var(--grey-200); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12px; font-weight: 600; transition: all .15s;
  text-align: center; background: white;
  -webkit-tap-highlight-color: transparent;
}
.status-option:hover { border-color: var(--grey-400); }
.status-option.selected-lager    { border-color: var(--blue);   background: var(--blue-bg);   color: var(--blue); }
.status-option.selected-waesche  { border-color: var(--yellow); background: var(--yellow-bg); color: var(--yellow); }
.status-option.selected-defekt   { border-color: var(--grey-600); background: var(--grey-100); color: var(--grey-600); }
.status-option .status-emoji { font-size: 22px; }

/* ─── TOAST ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%);
  background: var(--grey-900); color: white;
  padding: 11px 20px; border-radius: 30px;
  font-size: 14px; font-weight: 500; z-index: 9999;
  box-shadow: var(--shadow-lg); white-space: nowrap;
  transition: opacity .3s; pointer-events: none;
}
.toast.hidden { display: none; }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

@media (min-width: 768px) {
  .toast { bottom: 24px; left: auto; right: 24px; transform: none; border-radius: var(--radius); }
}

/* ─── UTILITIES ──────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.barcode-mono { font-family: monospace; font-size: 12px; color: var(--grey-400); }
.traeger-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--red-bg); color: var(--red); padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--grey-400); }
.empty-state-icon { font-size: 44px; margin-bottom: 10px; }
.empty-state p { font-size: 14px; }

/* ─── MINI-CAMERA MODAL ──────────────────────────────────────────────────── */
#barcode-cam-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 2000; padding: 20px;
}
#barcode-cam-overlay.hidden { display: none; }
#barcode-cam-video { width: 100%; max-width: 400px; border-radius: var(--radius); background: #000; }
#barcode-cam-close { margin-top: 16px; }

/* ─── TYP TOGGLE ─────────────────────────────────────────────────────────── */
.typ-toggle { display: flex; gap: 8px; }
.typ-btn {
  flex: 1; padding: 10px; border: 2px solid var(--grey-200); background: white;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; -webkit-tap-highlight-color: transparent;
}
.typ-btn.active { border-color: var(--red); background: var(--red-bg); color: var(--red); }

/* ─── WÄSCHE PAGE ─────────────────────────────────────────────────────────── */
.waesche-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--grey-400);
  padding: 16px 0 8px; margin-bottom: 0;
}
.warn-title { color: var(--yellow); }

.waesche-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
  border-left: 4px solid var(--blue);
}
.waesche-warn { border-left-color: var(--yellow); background: #FFFBF0; }

.waesche-card-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.waesche-icon { font-size: 24px; flex-shrink: 0; }
.waesche-name { font-weight: 700; font-size: 14px; }
.waesche-meta { font-size: 12px; color: var(--grey-400); margin-top: 2px; }
.waesche-seit { font-size: 12px; color: var(--grey-600); margin-top: 2px; }
.text-warn { color: var(--yellow); font-weight: 700; }

/* ─── KAT CHECKBOXES ─────────────────────────────────────────────────────── */
.kat-checkboxes { display: flex; flex-direction: column; gap: 8px; }
.kat-checkbox-label {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px;
  transition: border-color .15s; -webkit-tap-highlight-color: transparent;
}
.kat-checkbox-label:has(input:checked) { border-color: var(--blue); background: var(--blue-bg); }
.kat-checkbox-label input { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }

/* ─── META CHIPS ─────────────────────────────────────────────────────────── */
.chip-warn { background: var(--yellow-bg) !important; color: var(--yellow) !important; font-weight: 700; }
.chip-muted { color: var(--grey-400) !important; }

/* ─── WÄSCHE GRUPPEN ─────────────────────────────────────────────────────── */
.waesche-person-group {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden;
  border-left: 4px solid var(--blue);
}
.group-warn { border-left-color: var(--yellow); }

.waesche-person-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--grey-100);
  border-bottom: 1px solid var(--grey-200); gap: 10px; flex-wrap: wrap;
}
.waesche-person-name { font-weight: 700; font-size: 15px; }
.waesche-person-actions { display: flex; align-items: center; gap: 10px; }
.waesche-count { font-size: 12px; color: var(--grey-400); }

.waesche-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--grey-100);
}
.waesche-item:last-child { border-bottom: none; }
.waesche-item-warn { background: #FFFBF0; }
.waesche-item-icon { font-size: 20px; flex-shrink: 0; }
.waesche-item-info { flex: 1; min-width: 0; }

/* ─── WÄSCHE KOLLABIERBAR ─────────────────────────────────────────────────── */
.waesche-chevron {
  display: inline-block;
  font-size: 11px;
  margin-right: 6px;
  color: var(--grey-400);
  transition: transform .2s;
}
.waesche-group-body {
  display: block; /* offen by default */
}

/* ─── AUTOCOMPLETE ────────────────────────────────────────────────────────── */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid var(--grey-200);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 1000;
  overflow: hidden;
  margin-top: 3px;
}
.autocomplete-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--grey-100);
  transition: background .1s;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--grey-50); }
.autocomplete-kat {
  font-size: 11px;
  color: var(--grey-400);
  white-space: nowrap;
  margin-left: 8px;
}
