/* BIKEFILL · Screen-Styles (Print-Layout liegt in print.css) */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: #f0f2f5;
  min-height: 100vh; min-height: 100dvh;
  color: #222;
  padding-bottom: env(safe-area-inset-bottom);
}

.hidden { display: none !important; }

/* ── Login ────────────────────────────────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0; z-index: 200;
  background: linear-gradient(135deg, #c1003a 0%, #7a0024 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
  background: white; border-radius: 14px; padding: 32px 28px;
  width: 100%; max-width: 440px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.login-logo-img {
  display: block; margin: 0 auto 14px; width: 220px; max-width: 100%;
}
.login-title {
  text-align: center; color: #c1003a;
  font-size: 1.15rem; font-weight: 900;
  letter-spacing: 1.2px;
  margin-bottom: 24px;
  text-transform: uppercase;
}
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-form label {
  font-size: 0.78rem; font-weight: bold; color: #555;
  text-transform: uppercase; letter-spacing: 0.4px; margin-top: 10px;
}
.login-form input {
  padding: 12px 14px; border: 2px solid #ddd; border-radius: 8px;
  font-size: 16px; background: #fafafa;
}
.login-form input:focus { outline: none; border-color: #c1003a; background: white; }
.role-choice { display: flex; gap: 8px; }
.role-btn {
  flex: 1; padding: 14px 10px; border: 2px solid #ddd; background: white;
  border-radius: 8px; font-size: 0.95rem; font-weight: bold; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: border-color 0.15s, background 0.15s;
  color: #333;
}
.role-btn small { font-size: 0.7rem; font-weight: normal; color: #888; }
.role-btn:hover { border-color: #c1003a; }
.role-btn.active {
  background: #c1003a; color: white; border-color: #c1003a;
}
.role-btn.active small { color: rgba(255,255,255,0.85); }

/* ── Header ───────────────────────────────────────────────────────────── */
.app-header {
  background: #c1003a; color: white;
  display: flex; align-items: center; padding: 8px 12px; gap: 10px;
}
.header-logo {
  height: 40px; width: auto; flex-shrink: 0;
  background: white; border-radius: 6px; padding: 2px;
}
.header-left { display: flex; flex-direction: column; flex: 1; line-height: 1.15; min-width: 0; }
.header-left strong {
  font-size: 0.95rem; letter-spacing: 0.4px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-left small { font-size: 0.72rem; opacity: 0.85; }

@media (max-width: 480px) {
  .app-header { padding: 6px 8px; gap: 6px; }
  .header-logo { height: 30px; }
  .header-left strong { font-size: 0.78rem; }
  .header-left small { font-size: 0.64rem; line-height: 1.1; }
  .user-chip {
    font-size: 0.62rem; padding: 3px 6px;
    max-width: 85px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .btn-icon { width: 28px; height: 28px; font-size: 0.9rem; }
  .sync-dot { width: 8px; height: 8px; }
  .header-right { gap: 6px; }
}
.header-right { display: flex; align-items: center; gap: 10px; }
.user-chip {
  background: rgba(255,255,255,0.18); padding: 5px 10px; border-radius: 14px;
  font-size: 0.78rem; font-weight: bold; white-space: nowrap;
}
.sync-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #4caf50; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
  transition: background 0.3s;
}
.sync-dot.offline { background: #ff9800; }
.sync-dot.error   { background: #f44336; }
.btn-icon {
  background: rgba(255,255,255,0.18); border: none; color: white;
  width: 40px; height: 40px; border-radius: 8px; font-size: 1.15rem;
  cursor: pointer; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: rgba(255,255,255,0.28); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-icon.spinning { animation: spin 0.6s linear; pointer-events: none; }

/* ── Globale Suche (groß, ganz oben) ──────────────────────────────────── */
.global-search { background: #fff; border-bottom: 1px solid #e2e6ea; padding: 10px 14px; position: sticky; top: 0; z-index: 21; }
.global-search input {
  display: block; width: 100%; max-width: 1000px; margin: 0 auto;
  padding: 14px 16px; font-size: 1.05rem;
  border: 2px solid #c1003a; border-radius: 10px; background: #fafafa;
}
.global-search input:focus { outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(193,0,58,0.15); }

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.app-tabs {
  display: flex; background: #a3002f;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  flex: 1; min-width: 100px;
  padding: 12px 8px; border: none; background: transparent;
  color: rgba(255,255,255,0.75); font-size: 0.84rem; font-weight: bold;
  cursor: pointer; border-bottom: 3px solid transparent;
  transition: all 0.15s; touch-action: manipulation;
  white-space: nowrap;
}
.tab-btn:hover { background: rgba(255,255,255,0.07); color: white; }
.tab-btn.active { color: white; border-bottom-color: white; background: rgba(255,255,255,0.12); }
.tab-count {
  display: inline-block; background: rgba(255,255,255,0.22);
  padding: 1px 7px; border-radius: 10px; margin-left: 4px;
  font-size: 0.72rem; font-weight: bold;
}
.tab-btn.active .tab-count { background: white; color: #c1003a; }

/* Mobile: Tab-Leiste umbrechen statt horizontal scrollen — kein Wischen mehr nötig */
@media (max-width: 768px) {
  .app-tabs { flex-wrap: wrap; overflow-x: visible; }
  .tab-btn { flex: 1 1 auto; min-width: 0; padding: 11px 6px; font-size: 0.78rem; }
  .global-search { padding: 8px 10px; }
  .global-search input { padding: 13px 14px; font-size: 1rem; }
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tab-header {
  display: flex; align-items: center; gap: 10px;
  border-bottom: 2px solid #c1003a; padding-bottom: 8px; margin-bottom: 12px;
}
.tab-header h2 { flex: 1; border: none !important; padding: 0 !important; margin: 0 !important; }
.tab-header-actions { display: flex; gap: 6px; }

.card-desc { font-size: 0.85rem; color: #666; margin-bottom: 12px; }

.import-header {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.import-header h2 {
  margin: 0; padding: 0; border: none;
}
.rule-hint {
  display: inline-block;
  background: #fff3cd;
  color: #842029;
  border: 2px solid #dc3545;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 1rem;
  letter-spacing: 0.3px;
  font-weight: 900;
}
/* ── Scan-Felder ──────────────────────────────────────────────────────── */
.scan-input {
  width: 100%; padding: 12px 14px;
  font-family: 'Courier New', monospace; font-size: 1.1rem; font-weight: bold;
  border: 2px solid #0d6efd; border-radius: 6px;
  background: white; letter-spacing: 1px;
}
.scan-input:focus { outline: none; border-color: #c1003a; box-shadow: 0 0 0 3px rgba(193,0,58,0.15); }
.scan-feedback {
  min-height: 22px; margin-top: 8px;
  font-size: 0.88rem; font-weight: bold;
}
.scan-feedback.success { color: #0a3622; }
.scan-feedback.error   { color: #842029; }

/* ── Übersichts-Grid (Excel-Import-Tab) ───────────────────────────────── */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.ov-col {
  background: #fafafa;
  border-radius: 8px;
  padding: 12px;
  border-top: 4px solid #ccc;
}
.ov-col.angefordert      { border-top-color: #f0c040; }
.ov-col.ausgedruckt      { border-top-color: #6b21a8; }
.ov-col.vor_lagermontage { border-top-color: #084298; }
.ov-col.in_lagermontage  { border-top-color: #fd7e14; }
.ov-col.fertig           { border-top-color: #1d6f42; }
.ov-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.ov-title {
  font-weight: bold; color: #333; font-size: 0.92rem;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.ov-count {
  font-size: 1.6rem; font-weight: 900; color: #c1003a;
}
.ov-items { display: flex; flex-direction: column; gap: 4px; }
.ov-item {
  background: white; border-radius: 5px; padding: 6px 8px;
  font-size: 0.78rem; cursor: pointer; border: 1px solid #eee;
  display: flex; flex-direction: column; gap: 2px;
}
.ov-item:hover { border-color: #c1003a; background: #fff7ec; }
.ov-item-id { font-family: 'Courier New', monospace; color: #888; font-size: 0.7rem; }
.ov-item-name { font-weight: bold; color: #222; line-height: 1.15; }
.ov-item-meta { font-size: 0.7rem; color: #666; }
.ov-item .li-position {
  font-size: 0.74rem; padding: 3px 7px; margin-top: 4px;
}
.ov-more { text-align: center; font-size: 0.72rem; color: #888; padding: 4px; font-style: italic; }
.ov-empty { text-align: center; color: #aaa; padding: 12px; font-size: 0.78rem; font-style: italic; }

/* ── Lager-View (Mobile-first) ────────────────────────────────────────── */
.lager-view {
  max-width: 640px; margin: 0 auto; padding: 16px 12px;
}
.lager-card {
  background: white; border-radius: 12px; padding: 20px 16px 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  text-align: center;
}
.lager-card h2 {
  font-size: 1.25rem; color: #084298;
  padding: 0; border: none; margin-bottom: 10px;
}
.lager-formats {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.lager-format-chip {
  display: inline-block;
  background: #084298; color: white;
  padding: 6px 12px; border-radius: 20px;
  font-family: 'Courier New', monospace;
  font-weight: bold; font-size: 0.86rem;
  white-space: nowrap;
}
.scan-input-lg {
  font-size: 1.4rem; padding: 18px 14px; text-align: center;
  letter-spacing: 1.5px; min-height: 60px;
  width: 100%;
}

/* ── Phase 3: getrennte Scan-Felder + Tastatur-Button ─────────────────── */
.scan-field-wrap { position: relative; }
.scan-field-wrap .scan-input { padding-right: 56px; }
/* Platz für den ⌨-Knopf bei allen automatisch umschlossenen Feldern (Suche, Manuell-Anlegen …) */
.scan-field-wrap > input { padding-right: 50px; }
/* natives Such-Clear-X ausblenden — sonst Overlap mit dem ⌨-Knopf */
.scan-field-wrap input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.scan-field-wrap > input.search-input { margin-bottom: 0; }
.global-search .scan-field-wrap { max-width: 1000px; margin: 0 auto; }
.kb-btn {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 7px;
  border: 2px solid #0d6efd; background: #fff; color: #084298;
  font-size: 1.15rem; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.kb-btn:hover { background: #e8f4ff; }
.kb-btn:active { transform: translateY(-50%) scale(0.95); }
.kb-btn.kb-btn-lg { width: 48px; height: 48px; font-size: 1.3rem; }
.scanner-state {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: bold; color: #0a3622;
  background: #d1e7dd; border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.scanner-state .d { width: 8px; height: 8px; border-radius: 50%; background: #28a745; }
.montiert-banner {
  background: #0a3622; color: #fff; border-radius: 8px; padding: 11px 13px;
  margin-bottom: 14px; font-size: 0.88rem; font-weight: bold; line-height: 1.4;
}

/* ── Montiert-Filterleiste + Auswertung ───────────────────────────────── */
.mont-filter { margin-bottom: 10px; }
.aus-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { background: #fafafa; border: 1px solid #eee; border-top: 4px solid #6c757d; border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 3px; }
.kpi.big { border-top-color: #1d6f42; }
.kpi-n { font-size: 2rem; font-weight: 900; color: #c1003a; font-variant-numeric: tabular-nums; line-height: 1; }
.kpi.big .kpi-n { color: #1d6f42; }
.kpi-l { font-size: 0.72rem; color: #666; text-transform: uppercase; letter-spacing: 0.3px; }
.aus-proc { font-size: 0.85rem; color: #555; background: #f0f2f5; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.aus-proc b { color: #222; font-variant-numeric: tabular-nums; }
.aus-h3 { font-size: 0.92rem; margin-bottom: 8px; color: #333; }
.aus-table-wrap { overflow-x: auto; border: 1px solid #eee; border-radius: 6px; }
.aus-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.aus-table th { background: #f0f2f5; text-align: left; padding: 8px 10px; border-bottom: 1px solid #ddd; }
.aus-table td { padding: 7px 10px; border-bottom: 1px solid #f0f0f0; font-variant-numeric: tabular-nums; }
.lager-hint {
  font-size: 0.78rem; color: #888; margin-top: 8px;
  font-style: italic;
}

.lager-stats {
  margin-top: 14px; padding: 12px 6px;
  background: white; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 4px;
}
.lager-stat-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 2px; min-width: 0;
}
.lager-stat-item .stat-n {
  font-size: 1.3rem; font-weight: bold; color: #c1003a;
}
.lager-stat-item .stat-label {
  color: #666; text-transform: uppercase;
  font-size: 0.62rem; letter-spacing: 0.4px;
  text-align: center; white-space: nowrap;
}

@media (max-width: 380px) {
  .lager-card h2 { font-size: 1.1rem; }
  .lager-format-chip { font-size: 0.78rem; padding: 5px 10px; }
  .scan-input-lg { font-size: 1.2rem; padding: 16px 10px; min-height: 54px; }
  .lager-stat-item .stat-n { font-size: 1.1rem; }
  .lager-stat-item .stat-label { font-size: 0.58rem; }
}

/* ── Wizard / Field-Inputs ───────────────────────────────────────────── */
.wizard-context {
  background: #f0f2f5; border-radius: 8px; padding: 12px;
  margin-bottom: 14px; font-size: 0.9rem;
}
.wizard-context .wc-id { font-family: 'Courier New', monospace; font-weight: bold; color: #c1003a; }
.wizard-context .wc-name { font-weight: bold; font-size: 1.05rem; margin-top: 4px; }
.wizard-context .wc-meta { color: #666; font-size: 0.82rem; margin-top: 2px; }

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 0.82rem; font-weight: bold; color: #555;
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px;
}
.field-hint { font-size: 0.78rem; margin-top: 4px; min-height: 18px; }
.field-hint.error { color: #842029; font-weight: bold; }
.field-hint.ok    { color: #0a3622; font-weight: bold; }

/* ── Lager-Detail-Modal-Erweiterungen ─────────────────────────────────── */
.checklist {
  display: flex; flex-direction: column; gap: 8px;
  margin: 14px 0;
  padding: 14px;
  background: #fff7e6;
  border: 2px solid #ffc107;
  border-radius: 8px;
}
.checklist-title {
  font-size: 0.82rem; font-weight: bold; color: #856404;
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px;
}
.checklist label {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.95rem; font-weight: bold; color: #333;
  cursor: pointer; padding: 8px 10px;
  background: white; border-radius: 6px;
  border: 1px solid #f0e4b0;
}
.checklist label.checked {
  background: #d1e7dd; border-color: #28a745; color: #0a3622;
}
.checklist input[type="checkbox"] {
  width: 22px; height: 22px; accent-color: #c1003a; cursor: pointer;
}

.zielinfo-tag {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-size: 0.78rem; font-weight: bold; margin-left: 6px;
}
.zielinfo-tag.verkauf { background: #cfe2ff; color: #084298; }
.zielinfo-tag.intern  { background: #e2e3e5; color: #383d41; }

/* ── Main ─────────────────────────────────────────────────────────────── */
.app-main { max-width: 1000px; margin: 0 auto; padding: 14px; }

.card {
  background: white; border-radius: 10px; padding: 16px;
  margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar .btn { flex: 0 0 auto; min-width: 160px; }

.selection-bar {
  display: none; margin-top: 12px; padding: 10px 12px;
  background: #fff3cd; border: 2px solid #ffc107; border-radius: 8px;
  align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.88rem; font-weight: bold; color: #856404;
}
.selection-bar.visible { display: flex; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  padding: 11px 16px; border: none; border-radius: 7px;
  font-size: 0.92rem; font-weight: bold; cursor: pointer;
  transition: opacity 0.15s, transform 0.05s;
  touch-action: manipulation; min-height: 42px;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-primary   { background: #c1003a; color: white; }
.btn-success   { background: #1d6f42; color: white; }
.btn-danger    { background: #dc3545; color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; min-height: 40px; touch-action: manipulation; }
.btn-block { width: 100%; }

/* ── Filter / Suche ───────────────────────────────────────────────────── */
.filter-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
}
.filter-btn {
  background: white; border: 2px solid #ddd; border-radius: 22px;
  padding: 10px 16px; font-size: 0.85rem; font-weight: bold;
  cursor: pointer; color: #666; min-height: 40px;
  touch-action: manipulation;
}
.filter-btn:active { transform: scale(0.97); }
.filter-btn.active { background: #c1003a; color: white; border-color: #c1003a; }

.search-input {
  width: 100%; padding: 9px 12px; border: 2px solid #ddd; border-radius: 6px;
  font-size: 16px; background: #fafafa; margin-bottom: 8px;
}
.search-input:focus { outline: none; border-color: #c1003a; background: white; }

.count-line { font-size: 0.78rem; color: #999; margin-bottom: 8px; }

/* ── Liste ────────────────────────────────────────────────────────────── */
.list-item {
  background: white; border-radius: 8px; padding: 12px;
  margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex; align-items: center; gap: 12px;
  border-left: 4px solid #28a745;
  transition: box-shadow 0.15s;
}
.list-item.dringend { border-left-color: #dc3545; }
.list-item.selected { background: #fff7e6; box-shadow: 0 1px 3px rgba(193,0,58,0.15); border-left-color: #c1003a; }

.li-checkbox {
  width: 22px; height: 22px; cursor: pointer; flex-shrink: 0;
  accent-color: #c1003a;
}
.li-del {
  background: transparent; border: none; cursor: pointer;
  font-size: 1.2rem; padding: 0;
  width: 44px; height: 44px; border-radius: 8px;
  color: #999; flex-shrink: 0; opacity: 0.6;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  touch-action: manipulation;
}
.li-del:hover, .li-del:active { opacity: 1; background: #f8d7da; color: #842029; }
.reorder-tag {
  display: inline-block; background: #fff3cd; color: #856404;
  border-radius: 10px; padding: 1px 8px; margin-left: 4px;
  font-size: 0.7rem; font-weight: bold; vertical-align: middle;
}
.btn-row-del {
  background: transparent; border: none; cursor: pointer;
  font-size: 1.1rem; padding: 0;
  width: 40px; height: 40px; border-radius: 6px;
  color: #999; opacity: 0.7;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  touch-action: manipulation;
}
.btn-row-del:hover, .btn-row-del:active {
  opacity: 1; background: #f8d7da; color: #842029;
}
.li-main { flex: 1; min-width: 0; cursor: pointer; }
.li-id   { font-family: 'Courier New', monospace; font-size: 0.78rem; color: #888; }
.li-title { font-weight: bold; font-size: 1rem; color: #111; margin: 2px 0; }
.li-sub   { font-size: 0.78rem; color: #666; }
.li-meta  { font-size: 0.76rem; color: #555; margin-top: 4px; }

.li-position {
  display: inline-block; margin-top: 6px;
  padding: 5px 10px; border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-weight: 900; font-size: 0.92rem;
  letter-spacing: 0.6px;
}
.li-position.vor { background: #cfe2ff; color: #084298; border: 2px solid #084298; }
.li-position.in  { background: #ffe0cc; color: #884d11; border: 2px solid #884d11; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 0.7rem; font-weight: bold; text-transform: uppercase; white-space: nowrap;
}
.badge-yellow { background: #fff3cd; color: #856404; }
.badge-purple { background: #e9d5ff; color: #6b21a8; }
.badge-blue   { background: #cfe2ff; color: #084298; }
.badge-orange { background: #ffe0cc; color: #884d11; }
.badge-green  { background: #d1e7dd; color: #0a3622; }
.badge-gray   { background: #e2e3e5; color: #383d41; }
.badge-mont   { background: #0a3622; color: #fff; }
.badge-unmont { background: #f1f3f5; color: #495057; border: 1px solid #adb5bd; }

/* Badge-Spalte + Datum im Listeneintrag */
.li-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex-shrink: 0; }
.li-date   { color: #c1003a; font-weight: bold; }
/* Montiert/Unmontiert-Akzent in der Übersicht */
.ov-item.mont   { border-left: 3px solid #0a3622; }
.ov-item.unmont { border-left: 3px solid #adb5bd; }

.empty-state {
  text-align: center; color: #888; padding: 40px 16px;
  font-size: 0.95rem; line-height: 1.5;
  background: #fafafa; border-radius: 8px; border: 2px dashed #ddd;
}
.empty-state .emoji { font-size: 2rem; display: block; margin-bottom: 8px; opacity: 0.5; }
.empty-state strong { color: #444; }

.alert {
  padding: 12px 14px; border-radius: 8px;
  margin-bottom: 12px; font-size: 0.92rem; font-weight: bold;
  display: flex; align-items: flex-start; gap: 10px;
  line-height: 1.4;
}
.alert::before {
  font-size: 1.15rem; line-height: 1; flex-shrink: 0;
}
.alert-error::before   { content: '⛔'; }
.alert-success::before { content: '✓'; }
.alert-info::before    { content: 'ℹ'; }
.alert-error   { background: #f8d7da; color: #842029; border: 2px solid #dc3545; }
.alert-success { background: #d1e7dd; color: #0a3622; border: 2px solid #28a745; }
.alert-info    { background: #cff4fc; color: #055160; border: 2px solid #0dcaf0; }

/* ── Modals ───────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 150; align-items: flex-start; justify-content: center; padding: 20px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: 10px; padding: 22px;
  max-width: 520px; width: 100%; margin: auto;
  max-height: 90vh; max-height: 90dvh; overflow-y: auto;
}
.modal-wide { max-width: 820px; }
.modal h3 {
  font-size: 1.1rem; color: #333; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 2px solid #c1003a;
}
.modal-row {
  display: flex; justify-content: space-between; padding: 6px 0;
  border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; gap: 12px;
}
.modal-row:last-of-type { border-bottom: none; }
.ml { color: #888; flex-shrink: 0; }
.mv { font-weight: bold; text-align: right; word-break: break-word; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; min-width: 120px; }
.modal-close {
  background: white; border: 2px solid #ddd; color: #666;
  padding: 12px 18px; border-radius: 8px; font-size: 0.95rem;
  cursor: pointer; min-height: 44px; font-weight: bold;
  touch-action: manipulation;
}
.modal-close:active { background: #f0f2f5; }

/* ── Import-Vorschau-Tabelle ─────────────────────────────────────────── */
.imp-summary { font-size: 0.85rem; color: #666; margin-bottom: 10px; }
.imp-table-wrap {
  max-height: 50vh; overflow: auto; border: 1px solid #eee; border-radius: 6px;
}
.imp-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.imp-table th {
  background: #f0f2f5; padding: 6px 8px; text-align: left;
  border-bottom: 1px solid #ddd; position: sticky; top: 0;
}
.imp-table td { padding: 5px 8px; border-bottom: 1px solid #f0f0f0; }
.imp-table tr.rej { background: #fff5f5; color: #842029; }
.imp-table tr.acc { background: #f5fff7; }
.imp-table tr.blocking {
  background: #f8d7da !important;
  color: #842029;
  font-weight: bold;
  border-left: 4px solid #dc3545;
}

.warn-tag {
  display: inline-block;
  background: #fff3cd; color: #856404;
  border: 1px solid #ffc107; border-radius: 4px;
  padding: 2px 6px; font-size: 0.72rem; font-weight: bold;
  white-space: nowrap;
}

/* ── Verlaufslog im Detail ───────────────────────────────────────────── */
.log-section {
  margin-top: 14px;
}
.log-title {
  font-size: 0.74rem; color: #999; text-transform: uppercase;
  font-weight: bold; margin-bottom: 6px; letter-spacing: 0.4px;
}
.log-entry {
  font-size: 0.78rem; color: #555; padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
}

/* ── Print-Root: ausgeblendet auf dem Screen ────────────────────────── */
.print-root { display: none; }

/* ══════════════════════════════════════════════════════════════════════
   v1.2 · Politur — einheitliche Tiefe, weiche Übergänge, animierte Modals
   ══════════════════════════════════════════════════════════════════════ */
:root {
  --t-fast: 0.13s ease;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ring: 0 0 0 3px rgba(193, 0, 58, 0.30);
  --shadow-card: 0 1px 3px rgba(20, 28, 40, 0.08);
  --shadow-lift: 0 4px 16px rgba(20, 28, 40, 0.13);
}

/* Reduzierte Bewegung respektieren (Barrierefreiheit) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Einheitliche, weiche Interaktions-Übergänge */
.btn, .filter-btn, .tab-btn, .role-btn, .btn-icon, .kb-btn, .modal-close,
.li-del, .btn-row-del, .list-item, .ov-item,
.scan-input, .search-input, .field input, .login-form input, .global-search input {
  transition: background-color var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), box-shadow var(--t-fast), transform 0.08s ease;
}
.btn:active, .filter-btn:active, .role-btn:active, .btn-icon:active,
.kb-btn:active, .modal-close:active { transform: translateY(1px); }

/* Sichtbarer, einheitlicher Fokus-Ring für Tastatur-Navigation */
button:focus-visible, .tab-btn:focus-visible, .filter-btn:focus-visible,
.role-btn:focus-visible, .ov-item:focus-visible, a:focus-visible {
  outline: none; box-shadow: var(--ring);
}

/* Karten & Listen: gleiche Tiefe, sanftes Anheben beim Hover */
.card { box-shadow: var(--shadow-card); }
.list-item:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.ov-item:hover { transform: translateY(-1px); }

/* Modals: weiches Einblenden + Scale-in (beim Öffnen) */
.modal-overlay.open { animation: bf-overlay-in 0.16s ease; }
.modal-overlay.open .modal { animation: bf-modal-in 0.22s var(--ease-out); }
@keyframes bf-overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bf-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* Tab-Panels & Alerts: sanft einblenden */
.tab-panel.active { animation: bf-fade-in 0.2s ease; }
.alert { animation: bf-fade-in 0.2s ease; box-shadow: var(--shadow-card); }
@keyframes bf-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Sync-Punkt: dezentes Pulsieren bei Verbindungsabriss */
.sync-dot.error { animation: bf-pulse 1.2s ease-in-out infinite; }
@keyframes bf-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Enger Bestätigungs-Dialog */
.modal-narrow { max-width: 460px; }

/* ── Auswertung: Kommissionier-Auswertung (Filter, Trichter, Übergänge, Zeitverlauf) ── */
.av-filter { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.av-fld { display: flex; flex-direction: column; gap: 3px; }
.av-filter label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b6467; }
.av-filter input[type=date] { font: inherit; font-size: 0.9rem; padding: 8px 9px; border: 1px solid #d9d2d5; border-radius: 8px; background: #fafafa; color: #222; }
.av-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.av-presets button { font: inherit; font-size: 0.78rem; font-weight: 600; padding: 8px 12px; border: 1px solid #d9d2d5; border-radius: 22px; background: #fff; color: #6b6467; cursor: pointer; min-height: 40px; touch-action: manipulation; }
.av-presets button:active { transform: scale(0.97); }
.av-presets button.active { background: #c1003a; color: #fff; border-color: #c1003a; }
.av-rangeinfo { margin-left: auto; font-size: 0.82rem; color: #6b6467; align-self: center; }
.av-rangeinfo b { color: #222; }

.av-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.av-kpi { border: 1px solid #e6e4e6; border-radius: 10px; padding: 13px 14px; display: flex; flex-direction: column; gap: 2px; background: #fff; }
.av-kpi .av-n { font-size: 1.8rem; font-weight: 800; color: #c1003a; line-height: 1; font-variant-numeric: tabular-nums; }
.av-kpi .av-l { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b6467; }
.av-kpi.alt .av-n { color: #0e7c8b; }
.av-kpi.ink .av-n { color: #222; }
.av-kpi .av-sub { font-size: 0.68rem; color: #6b6467; margin-top: 7px; line-height: 1.6; }
.av-teal { color: #0e7c8b; }
.av-red { color: #c1003a; }

.av-h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: #6b6467; margin: 20px 0 8px; }
.av-funnel { display: flex; flex-direction: column; }
.av-stage { display: grid; grid-template-columns: 128px 1fr auto; align-items: center; gap: 12px; padding: 3px 0; }
.av-sname { font-weight: 600; font-size: 0.88rem; }
.av-barwrap { background: #e9e6e8; border-radius: 7px; height: 24px; overflow: hidden; }
.av-bar { height: 100%; border-radius: 7px; background: #c1003a; }
.av-bar.alt { background: #0e7c8b; }
.av-val { font-weight: 800; font-size: 1.02rem; min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.av-flow { display: grid; grid-template-columns: 128px 1fr; gap: 12px; }
.av-arrow { color: #6b6467; font-size: 0.8rem; padding: 2px 0; }
.av-arrow b { color: #222; }

.av-branch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.av-lane { border: 1px solid #e6e4e6; border-radius: 10px; padding: 13px; background: #faf7f8; }
.av-lane h4 { margin: 0 0 9px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; display: flex; gap: 8px; align-items: center; }
.av-tag { font-size: 0.64rem; font-weight: 800; padding: 2px 8px; border-radius: 20px; }
.av-tag.red { background: #f6d9e1; color: #c1003a; }
.av-tag.teal { background: #d5eef1; color: #0e7c8b; }
.av-step { display: flex; align-items: center; gap: 9px; font-size: 0.85rem; padding: 4px 0; }
.av-chip { font-weight: 800; border-radius: 7px; padding: 3px 9px; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.av-chip.red { background: #f6d9e1; color: #c1003a; }
.av-chip.teal { background: #d5eef1; color: #0e7c8b; }
.av-to { color: #6b6467; }
.av-sep { color: #9a9a9a; text-align: center; font-size: 0.85rem; }

.av-trans { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.av-trans td { padding: 10px 8px; border-bottom: 1px solid #e6e4e6; }
.av-trans tr:last-child td { border-bottom: 0; }
.av-lbl { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.av-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.av-rn { text-align: right; font-weight: 800; font-size: 1.04rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.av-trans tr.av-total td { border-top: 2px solid #e6e4e6; padding-top: 13px; }
.av-trans tr.av-total .av-lbl { font-weight: 700; }
.av-trans tr.av-total .av-rn { color: #c1003a; font-size: 1.2rem; }
.av-trans tr.av-subtr .av-lbl { padding-left: 22px; color: #6b6467; font-size: 0.9rem; }
.av-trans tr.av-subtr .av-rn { color: #6b6467; font-size: 0.95rem; }

.av-zvstack { display: flex; flex-direction: column; gap: 18px; }
.av-zvh { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: #6b6467; margin: 0 0 8px; }
.av-tblwrap { overflow: auto; max-height: 440px; border: 1px solid #e6e4e6; border-radius: 8px; }
table.av-t { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
table.av-t th, table.av-t td { padding: 7px 9px; text-align: right; border-bottom: 1px solid #e6e4e6; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.av-t th:first-child, table.av-t td:first-child { text-align: left; position: sticky; left: 0; background: #fff; }
table.av-t thead th { position: sticky; top: 0; background: #fff; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.03em; color: #6b6467; box-shadow: inset 0 -2px 0 #e6e4e6; }
table.av-t td.av-sum, table.av-t th.av-sum { color: #c1003a; font-weight: 800; }
@media (max-width: 640px) { .av-branch { grid-template-columns: 1fr; } .av-stage, .av-flow { grid-template-columns: 92px 1fr auto; } }

/* Zeitverlauf: eigener Monats-/Jahr-Filter */
.av-zv-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.av-zv-ctrl select { font: inherit; font-size: 0.85rem; padding: 7px 9px; border: 1px solid #d9d2d5; border-radius: 8px; background: #fff; color: #222; min-height: 38px; }
.av-zv-nav { font: inherit; font-size: 1.1rem; line-height: 1; width: 38px; height: 38px; border: 1px solid #d9d2d5; border-radius: 8px; background: #fff; color: #c1003a; cursor: pointer; touch-action: manipulation; }
.av-zv-nav:active { transform: scale(0.95); }
.av-zv-note { font-size: 0.72rem; color: #9a9a9a; margin-right: auto; }
