/* VendingPick — Light Theme für Martin Gruppe */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Barlow:wght@400;500;600;700;800;900&family=Barlow+Condensed:wght@600;700;800;900&display=swap');

:root {
  /* Heller Hintergrund */
  --bg:          #f4f5f7;
  --bg2:         #ffffff;
  --bg3:         #f0f1f4;
  --border:      #e2e4ea;
  --border2:     #c8ccd8;

  /* Texte */
  --text:        #1a1d26;
  --text2:       #5a6075;
  --text3:       #9199b0;

  /* Brand */
  --accent:      #e8410a;   /* kräftiges Orange-Rot → passt zu Martin Gruppe */
  --accent-dim:  rgba(232,65,10,0.10);
  --accent2:     #2563eb;

  /* Status */
  --green:       #16a34a;
  --green-dim:   rgba(22,163,74,0.10);
  --red:         #dc2626;
  --yellow:      #ca8a04;
  --purple:      #7c3aed;

  --radius:      10px;
  --shadow:      0 2px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#root { height: 100%; display: flex; flex-direction: column; }
.app  { height: 100%; display: flex; flex-direction: column; }

/* ─── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  height: 64px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-logo-img {
  height: 30px;
  width: auto;
  flex-shrink: 0;
  display: block;
  /* Logo ist schwarz — passt perfekt auf weißem Hintergrund */
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border2);
  flex-shrink: 0;
}

.topbar-product {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.5px;
  color: var(--accent);
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-spacer { flex: 1; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text2);
}

.user-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  color: #fff; flex-shrink: 0;
}

/* ─── Nav ─────────────────────────────────────────────────────────────────── */
.nav { display: flex; gap: 4px; }

.nav-btn {
  height: 36px; padding: 0 14px;
  border-radius: 8px; border: none;
  background: transparent;
  color: var(--text2);
  font-family: 'Barlow', sans-serif;
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.nav-btn:hover  { background: var(--bg3); color: var(--text); }
.nav-btn.active { background: var(--accent-dim); color: var(--accent); }

/* ─── Main ────────────────────────────────────────────────────────────────── */
.main { flex: 1; overflow-y: auto; padding: 28px 24px; }

/* ─── Login ───────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo-img {
  height: 36px;
  width: auto;
  display: block;
  margin-bottom: 6px;
}

.login-product {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 26px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.login-sub {
  color: var(--text2); font-size: 13px;
  margin-bottom: 36px;
}

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text2); margin-bottom: 6px;
}

.form-input {
  width: 100%; height: 48px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Barlow', sans-serif; font-size: 16px;
  padding: 0 14px;
  transition: border-color .15s; outline: none;
}
.form-input:focus     { border-color: var(--accent); background: #fff; }
.form-input::placeholder { color: var(--text3); }
select.form-input     { cursor: pointer; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  height: 48px; padding: 0 24px; border: none;
  border-radius: var(--radius);
  font-family: 'Barlow', sans-serif;
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #c93408; }

.btn-secondary {
  background: var(--bg2);
  border: 1.5px solid var(--border2);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg3); border-color: var(--border2); }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }

.btn-danger  { background: var(--red);   color: #fff; }
.btn-danger:hover:not(:disabled)  { background: #b91c1c; }

.btn-sm   { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg   { height: 56px; padding: 0 32px; font-size: 17px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { width: 44px; padding: 0; justify-content: center; }

/* ─── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.card-body { padding: 20px; }

/* ─── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
}
.badge-open        { background: #dbeafe; color: #1d4ed8; }
.badge-assigned    { background: #ede9fe; color: #6d28d9; }
.badge-in_progress { background: #fef3c7; color: #92400e; }
.badge-completed   { background: var(--green-dim); color: var(--green); }

/* OCR confidence */
.badge-conf-low { background: #fee2e2; color: var(--red);    font-size: 11px; }
.badge-conf-med { background: #fef9c3; color: var(--yellow); font-size: 11px; }

/* ─── Table ───────────────────────────────────────────────────────────────── */
.pick-table { width: 100%; border-collapse: collapse; }

.pick-table th {
  font-family: 'DM Mono', monospace;
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text3);
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.pick-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px; vertical-align: middle;
}
.pick-table tr:last-child td { border-bottom: none; }
.pick-table tbody tr { cursor: pointer; transition: background .1s; }
.pick-table tbody tr:hover { background: var(--bg3); }

/* ─── Pick Session ────────────────────────────────────────────────────────── */
.pick-session { max-width: 860px; margin: 0 auto; }

.pick-session-header {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.pick-meta { flex: 1; min-width: 200px; }
.pick-meta-tour {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px; font-weight: 800;
  color: var(--text); line-height: 1;
}
.pick-meta-customer { font-size: 13px; color: var(--text2); margin-top: 3px; }

.pick-progress-wrap { display: flex; align-items: center; gap: 14px; }

/* Progress ring */
.progress-ring { position: relative; flex-shrink: 0; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px; font-weight: 800; color: var(--text);
}

.pick-stats { display: flex; flex-direction: column; gap: 1px; }
.pick-stats-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px; font-weight: 800; color: var(--green);
}
.pick-stats-label { font-size: 12px; color: var(--text2); }

/* ─── Active Item Hero ────────────────────────────────────────────────────── */
.active-item-hero {
  background: linear-gradient(135deg, rgba(232,65,10,.07) 0%, rgba(232,65,10,.02) 100%);
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 18px;
  box-shadow: 0 4px 16px rgba(232,65,10,.12);
}
.active-item-hero-icon { font-size: 36px; flex-shrink: 0; }
.active-item-hero-desc {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 30px; font-weight: 800;
  color: var(--accent); line-height: 1.1;
}
.active-item-hero-detail { font-size: 13px; color: var(--text2); margin-top: 4px; }
.active-item-hero-qty {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 68px; font-weight: 900;
  color: var(--accent); line-height: 1;
  margin-left: auto; flex-shrink: 0;
}
.active-item-hero-qty-label { font-size: 12px; color: var(--text2); text-align: right; }

/* ─── Pick Items List ─────────────────────────────────────────────────────── */
.pick-items-list { display: flex; flex-direction: column; gap: 6px; }

.pick-item {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px;
  transition: all .15s;
  position: relative; overflow: hidden;
}
.pick-item::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--border); transition: background .15s;
}
.pick-item.active {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 2px 12px rgba(232,65,10,.15);
}
.pick-item.active::before { background: var(--accent); }
.pick-item.done { opacity: .55; }
.pick-item.done::before { background: var(--green); }

.pick-item-pos {
  font-family: 'DM Mono', monospace;
  font-size: 12px; color: var(--text3);
  width: 28px; flex-shrink: 0; text-align: right;
}
.pick-item-info { flex: 1; min-width: 0; }
.pick-item-desc {
  font-size: 15px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pick-item.active .pick-item-desc { color: var(--accent); font-size: 16px; }

.pick-item-meta {
  font-family: 'DM Mono', monospace;
  font-size: 11px; color: var(--text3); margin-top: 2px;
}

.pick-item-qty {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800; font-size: 26px;
  color: var(--text2); line-height: 1; flex-shrink: 0;
}
.pick-item.active .pick-item-qty { color: var(--accent); font-size: 32px; }
.pick-item-unit { font-size: 11px; color: var(--text3); text-align: center; }

.pick-item-check {
  width: 42px; height: 42px;
  border-radius: 9px;
  border: 2px solid var(--border2);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
  flex-shrink: 0; color: var(--text3); font-size: 18px;
}
.pick-item.active .pick-item-check {
  border-color: var(--accent); background: var(--accent);
  color: #fff; box-shadow: 0 2px 10px rgba(232,65,10,.35);
}
.pick-item.done .pick-item-check {
  border-color: var(--green); background: var(--green-dim); color: var(--green);
}
.pick-item-check:hover { transform: scale(1.08); }

/* Route position badge */
.route-pos {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-dim); color: var(--accent);
  border-radius: 5px;
  font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 600;
  padding: 2px 5px; min-width: 24px;
}

/* ─── Scan Bar ────────────────────────────────────────────────────────────── */
.scan-bar {
  position: sticky; bottom: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,.07);
  padding: 14px 24px;
  display: flex; gap: 10px; align-items: center;
  margin-left: -24px; margin-right: -24px; margin-bottom: -28px;
}

.scan-input {
  flex: 1; height: 52px;
  background: var(--bg3);
  border: 2px solid var(--accent);
  border-radius: 10px;
  color: var(--text);
  font-family: 'DM Mono', monospace; font-size: 17px;
  padding: 0 16px; outline: none;
  letter-spacing: 1px;
}
.scan-input::placeholder {
  color: var(--text3); letter-spacing: 0;
  font-size: 14px; font-family: 'Barlow', sans-serif;
}

/* ─── OCR Banner & Icons ──────────────────────────────────────────────────── */
.ocr-banner {
  display: flex; align-items: center; gap: 10px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 10px; padding: 12px 16px;
  margin-bottom: 14px;
  color: var(--red); font-size: 14px; font-weight: 600;
}
.ocr-warning-dot { margin-left: 5px; font-size: 13px; color: var(--yellow); }

/* ─── Progress bar ────────────────────────────────────────────────────────── */
.progress-bar-wrap {
  height: 6px; background: var(--border);
  border-radius: 99px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 99px;
  background: var(--green);
  transition: width .4s ease;
}

/* ─── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg3);
}
.modal-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 19px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px;
}
.modal-body   { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  background: var(--bg3);
}

/* ─── Toast ───────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 90px; right: 24px;
  z-index: 2000; display: flex; flex-direction: column;
  gap: 8px; pointer-events: none;
}
.toast {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 10px; padding: 11px 16px;
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: slideIn .2s ease;
  min-width: 200px; max-width: 340px; color: var(--text);
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent2); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ─── Upload zone ─────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border2);
  border-radius: 12px; padding: 48px 24px;
  text-align: center; cursor: pointer;
  transition: all .2s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent); background: var(--accent-dim);
}
.upload-zone-icon { font-size: 44px; margin-bottom: 12px; }
.upload-zone-text { font-size: 16px; color: var(--text2); }
.upload-zone-hint { font-size: 13px; color: var(--text3); margin-top: 6px; }

/* ─── Duplicate warning ───────────────────────────────────────────────────── */
.duplicate-warning {
  display: flex; align-items: flex-start; gap: 16px;
  background: #fefce8; border: 1px solid #fde047;
  border-radius: 10px; padding: 16px;
}
.duplicate-icon { font-size: 30px; flex-shrink: 0; }

/* ─── Camera Scanner ──────────────────────────────────────────────────────── */
.scan-reticle {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 220px; height: 120px;
  border: 3px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.45);
  pointer-events: none;
}

/* ─── Wrong scan flash ────────────────────────────────────────────────────── */
.active-item-hero.wrong-scan {
  border-color: var(--red) !important;
  background: #fff5f5 !important;
  animation: wrongFlash .3s ease;
}
@keyframes wrongFlash {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-8px); }
  75%  { transform: translateX(8px); }
  100% { transform: translateX(0); }
}

/* ─── Completed overlay ───────────────────────────────────────────────────── */
.completed-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; backdrop-filter: blur(6px);
}
.completed-card {
  background: var(--bg2);
  border: 2px solid var(--green);
  border-radius: 24px; padding: 52px 44px;
  text-align: center; max-width: 460px;
  box-shadow: 0 8px 48px rgba(22,163,74,.2);
}
.completed-icon  { font-size: 72px; margin-bottom: 14px; }
.completed-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 42px; font-weight: 900; color: var(--green);
  text-transform: uppercase;
}
.completed-sub { font-size: 16px; color: var(--text2); margin-top: 8px; margin-bottom: 28px; }

/* ─── Page title ──────────────────────────────────────────────────────────── */
.page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text);
}

/* ─── Empty state ─────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 64px 24px; color: var(--text3); }
.empty-state-icon { font-size: 52px; margin-bottom: 14px; }
.empty-state-text { font-size: 16px; color: var(--text2); }
.empty-state-hint { font-size: 13px; margin-top: 8px; }

/* ─── Color chips ─────────────────────────────────────────────────────────── */
.color-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.color-chip {
  width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; border: 3px solid transparent;
  transition: transform .15s;
}
.color-chip:hover    { transform: scale(1.15); }
.color-chip.selected { border-color: var(--text); }

/* ─── Utilities ───────────────────────────────────────────────────────────── */
.flex             { display: flex; }
.flex-col         { flex-direction: column; }
.items-center     { align-items: center; }
.justify-between  { justify-content: space-between; }
.gap-2 { gap: 8px; }  .gap-3 { gap: 12px; }  .gap-4 { gap: 16px; }
.mt-2  { margin-top: 8px; }  .mt-4 { margin-top: 16px; }
.mt-6  { margin-top: 24px; } .mb-4 { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 11px; }
.text-muted { color: var(--text2); }
.text-danger{ color: var(--red); }
.text-success{ color: var(--green); }
.text-accent{ color: var(--accent); }
.mono       { font-family: 'DM Mono', monospace; }
.bold       { font-weight: 700; }

/* ─── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap {
  display: flex; align-items: center; justify-content: center; padding: 64px;
}

/* ─── Responsive iPad ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .main        { padding: 16px; }
  .topbar      { padding: 0 16px; height: 56px; }
  .topbar-logo-img { height: 24px; }
  .pick-item-desc  { font-size: 14px; }
  .active-item-hero-desc { font-size: 24px; }
  .active-item-hero-qty  { font-size: 52px; }
  .nav-btn { padding: 0 10px; font-size: 13px; }
  .scan-bar { padding: 12px 16px; margin-left:-16px; margin-right:-16px; margin-bottom:-16px; }
  .topbar-product { font-size: 16px; }
}
