/* ===== DESIGN-TOKENS (iVoodoo Schwester-App) =====
   Quelle: liste.ivoodoo.de style.css — gleiche Farb-, Typo- und Radius-Sprache,
   damit beide Apps als Familie wirken. Kaufland-Rot/DHL-Gelb bleiben nur als
   sekundaere Marken-Akzente (Logos, Danger, Status), nicht als Primary-Flaechen. */
:root{
  --blue:#2563eb;--blue2:#1d4ed8;
  --white:#ffffff;--gray1:#f8fafc;--gray2:#f1f5f9;--gray3:#e2e8f0;--gray4:#94a3b8;--gray5:#64748b;
  --text:#0f172a;--text2:#334155;--text3:#64748b;
  --yellow:#f59e0b;--yellow-bg:#fefce8;--yellow-border:#fde68a;--yellow-text:#92400e;
  --green:#16a34a;--green2:#15803d;--green-bg:#f0fdf4;--green-border:#bbf7d0;--green-text:#14532d;
  --red:#dc2626;--red-bg:#fef2f2;
  --kaufland:#d40511;--dhl-yellow:#ffcc00;
  --border:#e2e8f0;
  --font:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --mono:'JetBrains Mono',ui-monospace,'Cascadia Code',Consolas,monospace;
  --r:8px;--r-lg:12px;
  --shadow:0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.06);
  --shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--gray1);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.hidden { display: none !important; }

/* ===== LOGIN ===== */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f5f7fa;
}
.login-card {
  position: relative;
  background: #fff;
  padding: 56px 56px 28px;
  border-radius: 24px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 24px 48px rgba(15, 23, 42, 0.08);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}
.brand-accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    to right,
    #d40511 0%,
    #d40511 50%,
    #ffcc00 50%,
    #ffcc00 100%
  );
}

/* Logo-Zeile oben
   Die Logos sitzen in zwei gleich breiten Slots links und rechts vom "x".
   Dadurch ist die gesamte Gruppe symmetrisch:
   - Gruppe zentriert in der Card (justify-content: center)
   - x in der Mitte der Gruppe = Card-Mitte = ueber dem 50/50-Uebergang
     des roten/gelben Akzentbalkens
   - Kaufland-Logo am rechten Slot-Rand, DHL-Logo am linken Slot-Rand:
     dadurch ist der Abstand vom "x" zu beiden Logos exakt gleich,
     unabhaengig von den unterschiedlichen Logo-Breiten. */
.brand-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 36px;
}
.brand-logo-slot {
  width: 150px;
  display: flex;
  align-items: center;
}
.brand-logo-slot-left { justify-content: flex-end; }
.brand-logo-slot-right { justify-content: flex-start; }
/* Beide Logos auf gleiche Breite (statt Hoehe), damit sie optisch
   genau gleich gross und symmetrisch in ihren Slots sitzen.
   Hoehe ergibt sich proportional aus dem SVG-aspect-ratio. */
.brand-logo {
  display: block;
  width: 150px;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}
.brand-cross {
  font-size: 24px;
  font-weight: 300;
  color: #cbd5e1;
  line-height: 1;
}

/* Haupttitel + Untertitel */
.login-title {
  font-size: 36px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.6px;
  line-height: 1.15;
  margin-bottom: 12px;
}
.login-subtitle {
  font-size: 15px;
  color: #64748b;
  line-height: 1.55;
  margin-bottom: 36px;
}

/* Form */
.login-card label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 22px 0 8px;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
}
.input-icon-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.input-icon-btn:hover {
  color: #475569;
  background: #f1f5f9;
}
.input-icon-btn.is-active {
  color: var(--green);
}
.login-card input {
  width: 100%;
  height: 48px;
  padding: 12px 14px 12px 46px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-wrap:has(.input-icon-btn) input {
  padding-right: 48px;
}
.login-card input::placeholder { color: #94a3b8; }
.login-card input:hover {
  border-color: #cbd5e1;
}
.login-card input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.login-card button[type="submit"] {
  width: 100%;
  margin-top: 32px;
  padding: 16px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--r-lg);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.20);
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.login-card button[type="submit"]:hover {
  background: var(--green2);
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.30);
}
.login-card button[type="submit"]:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(22, 163, 74, 0.20);
}

.login-card .err {
  margin-top: 16px;
  padding: 10px 14px;
  color: #b00410;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 13px;
}

/* Sicherheitszeile unter dem Button */
.security-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}
.security-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  flex-shrink: 0;
}

/* Footer der Card */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 32px -16px 0;
  padding-top: 24px;
  border-top: 1px solid #f1f5f9;
}
.footer-line {
  flex: 1;
  height: 1px;
  background: transparent;
}
.footer-text {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Responsive: bei sehr schmalen Cards */
@media (max-width: 480px) {
  .login-card {
    padding: 40px 28px 24px;
    border-radius: 20px;
  }
  .brand-logos {
    gap: 14px;
    margin-bottom: 28px;
  }
  .brand-logo-slot { width: 110px; }
  .brand-logo { width: 110px; }
  .login-title { font-size: 28px; }
  .login-subtitle { font-size: 14px; margin-bottom: 28px; }
}

/* ===== APP SHELL ===== */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
/* Topbar-Brand: gleiche Logo-Methode wie im Login (width-basiert, gleich gross) */
.topbar-brand {
  display: flex;
  align-items: center;
}
.topbar-logos {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-logo {
  display: block;
  width: 130px;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}
.topbar-cross {
  font-size: 22px;
  font-weight: 300;
  color: #cbd5e1;
  line-height: 1;
}

.topbar .right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #475569;
}
.topbar button.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.topbar button.icon-btn svg { flex-shrink: 0; color: #64748b; }
.topbar button.icon-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1a1a1a;
}
.topbar button.icon-btn:hover svg { color: #1a1a1a; }

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px;
}

/* ===== ACTION BAR ===== */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.action-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
/* Button-System nach iVoodoo-Vorbild (.btn / .btn-green / .btn-outline / .btn-ghost).
   Klassennamen der Bridge bleiben erhalten (JS/HTML unangetastet), nur der Look
   folgt jetzt dem iVoodoo-Token-System. */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--r);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.btn-primary:hover:not(:disabled) {
  background: var(--green2);
  transform: translateY(-1px);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.btn-secondary:hover:not(:disabled) {
  background: var(--gray2);
  color: var(--text);
}
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--r);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.btn-danger-outline:hover:not(:disabled) {
  background: var(--red);
  color: #fff;
}
.btn-danger-outline:disabled { opacity: 0.5; cursor: not-allowed; }
.status-msg {
  font-size: 13px;
  font-weight: 500;
}

/* ===== ORDERS LIST ===== */
.empty-state {
  background: #fff;
  border: 2px dashed #d0d5dd;
  border-radius: 12px;
  padding: 60px 40px;
  text-align: center;
  color: #666;
}
.empty-state h2 { font-size: 18px; margin-bottom: 8px; color: #1a1a1a; }
.empty-state p { font-size: 14px; line-height: 1.6; }

.orders-table {
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  border: 1px solid #eef0f3;
}
.orders-table-header {
  padding: 14px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: 36px 130px 1fr 1.1fr 1fr 180px 150px;
  gap: 18px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.7px;
}
.order-card {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: grid;
  grid-template-columns: 36px 130px 1fr 1.1fr 1fr 180px 150px;
  gap: 18px;
  align-items: flex-start;
  font-size: 13px;
  transition: background-color 0.12s ease;
}

/* Bulk-Select Checkboxes (1. Spalte) */
.th-checkbox,
.bulk-checkbox-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}
.bulk-checkbox-cell { padding-top: 2px; align-items: flex-start; }
.bulk-checkbox,
#masterCheckbox {
  width: 17px;
  height: 17px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--green);
}
.bulk-checkbox-cell .bulk-checkbox-disabled {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  background: #f1f5f9;
  display: inline-block;
}
.order-card:last-child { border-bottom: none; }
.order-card:hover { background: #fafbfc; }

.order-id {
  font-weight: 700;
  color: #d40511;
  font-family: var(--mono);
  font-size: 13px;
}
.order-customer {
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
}
.order-customer .email {
  color: #94a3b8;
  font-size: 11px;
  display: block;
  margin-top: 3px;
  font-weight: 400;
  word-break: break-word;
}
.order-address {
  color: #475569;
  line-height: 1.55;
  font-size: 12.5px;
}
.order-items {
  font-size: 12px;
  color: #475569;
  line-height: 1.55;
}
.order-items .item-line { display: block; }
.order-price {
  font-weight: 700;
  text-align: right;
  font-size: 14px;
  color: #1a1a1a;
  display: block;
}
.order-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.order-actions .order-status {
  align-self: flex-end;
}
.order-actions .report-status,
.order-actions .storno-status,
.order-actions .paket-masse {
  align-self: flex-end;
  margin-top: 0;
}

/* ===== STATUS BADGES (Pill-Style fuer alle Status-Indikatoren) ===== */
.order-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: center;
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-open {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}
.status-shipped {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.status-done {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* Erledigte Bestellung optisch dezent markieren */
.order-card.is-erledigt { opacity: 0.65; }
.order-card.is-erledigt:hover { opacity: 0.95; }

/* "Erledigte anzeigen" Toggle in Action-Bar */
.show-done-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.show-done-toggle:hover { border-color: #cbd5e1; }
.show-done-toggle input {
  margin: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--green);
}

/* "Als erledigt markieren" / "Wieder aktivieren" Buttons in der Tabelle */
.btn-mark-done {
  padding: 6px 10px;
  background: #fff;
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.btn-mark-done:hover:not(:disabled) {
  background: #f0fdf4;
  border-color: #16a34a;
}
.btn-mark-done:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-reactivate {
  padding: 6px 10px;
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn-reactivate:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1a1a1a;
}
.btn-reactivate:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== ACTIONS / BUTTONS in Tabelle ===== */
.btn-label {
  padding: 8px 12px;
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
  border-radius: var(--r);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
  transition: background-color 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.btn-label:hover:not(:disabled) {
  background: var(--green2);
  border-color: var(--green2);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.18);
}
.btn-label:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-pdf {
  padding: 8px 12px;
  background: #ffcc00;
  color: #1a1a1a;
  border: 1px solid #e6b800;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  width: 100%;
  text-align: center;
  margin-top: 6px;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}
.btn-pdf:hover {
  background: #f0c000;
  box-shadow: 0 2px 8px rgba(255, 204, 0, 0.35);
}
.btn-delete-label {
  padding: 6px 10px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 10px;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.btn-delete-label:hover {
  color: #dc2626;
  border-color: #dc2626;
}
.tracking-nr {
  font-family: var(--mono);
  font-size: 11px;
  color: #475569;
  font-weight: 600;
  word-break: break-all;
  background: #f8fafc;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  display: block;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 520px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { font-size: 18px; margin-bottom: 16px; }
.modal-row { display: flex; gap: 12px; margin-bottom: 12px; }
.modal-row > div { flex: 1; }
.modal label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}
.modal input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 13px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}
.modal-err {
  color: #dc2626;
  font-size: 13px;
  margin-top: 8px;
}
.icon-btn {
  background: transparent;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
}
.icon-btn:hover { background: #f4f6f8; }

/* ===== ENV BADGE (DHL Sandbox/Production) ===== */
.env-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.env-badge.env-prod {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #16a34a;
}
.env-badge.env-sandbox {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #d97706;
}

/* ===== REPORT STATUS (Kaufland-Meldung) ===== */
.report-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.report-ok {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.report-fail {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
.btn-retry-report {
  padding: 6px 10px;
  background: #fff;
  color: #b45309;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.btn-retry-report:hover:not(:disabled) {
  background: #fffbeb;
  border-color: #f59e0b;
}
.btn-retry-report:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== GEWICHT-BOX (pro Bestellung, 6. Spalte) ===== */
.gewicht-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
  width: 100%;
}
.gewicht-box:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.gewicht-box-text {
  flex: 1;
  min-width: 0;
}
.gewicht-box-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.gewicht-box-value {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  font-variant-numeric: tabular-nums;
}
.gewicht-box-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #94a3b8;
  flex-shrink: 0;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.gewicht-box:hover .gewicht-box-icon {
  color: #d40511;
  border-color: #d40511;
}

/* ===== ADRESS-EXTRAS (Firma / Zusatz / Postnummer) ===== */
.address-extra {
  display: block;
  font-size: 11px;
  color: #555;
  line-height: 1.4;
}
.address-extra.address-firma { color: #1a1a1a; font-weight: 500; }
.address-extra.address-postnr { color: #d40511; font-weight: 600; font-family: var(--mono); }

/* ===== STORNO STATUS (DHL Label Cancel) ===== */
.btn-cancel-dhl {
  padding: 6px 10px;
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn-cancel-dhl:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
}
.btn-cancel-dhl:disabled { opacity: 0.6; cursor: not-allowed; }

.storno-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 6px;
  border: 1px solid transparent;
  line-height: 1.3;
  white-space: nowrap;
}
.storno-status.storno-ok {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.storno-status.storno-fail {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
.storno-status.storno-locked {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.storno-detail {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
  word-break: break-word;
  line-height: 1.35;
  max-height: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== TOPBAR TABS (Bestellungen / DHL Tracking) ===== */
.topbar-tabs {
  display: flex;
  gap: 4px;
  margin: 0 24px;
}
.topbar-tab {
  background: transparent;
  border: 1px solid transparent;
  color: #64748b;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.topbar-tab:hover {
  background: #f8fafc;
  color: #1a1a1a;
}
.topbar-tab.is-active {
  background: var(--green-bg);
  color: var(--green2);
  border-color: var(--green-border);
}

/* ===== APP VIEWS (Bestellungen / Tracking) ===== */
.app-view.hidden { display: none; }

/* ===== TABELLEN-TOOLBAR: Suche + Anzahl-Anzeige ===== */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.table-toolbar.hidden { display: none; }
.table-search {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.table-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
}
.table-search input {
  width: 100%;
  padding: 9px 38px 9px 38px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.table-search input::placeholder { color: #94a3b8; }
.table-search input:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}
.table-search .search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.table-search .search-clear:hover { background: #e2e8f0; color: #0f172a; }
.table-search .search-clear.hidden { display: none; }
.table-count {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ===== SORTIERBARE TABELLEN-HEADER ===== */
.th-sortable {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.12s ease;
}
.th-sortable:hover { color: #0f172a; }
.th-sortable.is-active { color: #d40511; }
.sort-arrow {
  display: inline-flex;
  font-size: 9px;
  width: 10px;
  line-height: 1;
  opacity: 0.4;
}
.th-sortable.is-active .sort-arrow { opacity: 1; }
.th-sortable[data-align="right"] { justify-content: flex-end; width: 100%; }
.link-btn {
  background: none;
  border: none;
  color: #d40511;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}
.link-btn:hover { color: #b30410; }

/* ===== DASHBOARD-KACHEL: DHL Tracking Uebersicht ===== */
.dashboard-kachel {
  background: #fff;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
  border: 1px solid #eef0f3;
}
.dashboard-kachel.hidden { display: none; }
.kachel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.kachel-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.1px;
}
.kachel-link {
  font-size: 12px;
  color: #d40511;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.kachel-link:hover { text-decoration: underline; }

.kachel-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kachel-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.kachel-stat:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.kachel-stat-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.kachel-stat-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kachel-stat-problem .kachel-stat-num,
.kachel-stat-return  .kachel-stat-num { color: #b91c1c; }
.kachel-stat-undelivered .kachel-stat-num { color: #1d4ed8; }
.kachel-stat-stuck       .kachel-stat-num { color: #b45309; }

@media (max-width: 768px) {
  .kachel-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===== KAUFLAND INSIGHTS ===== */
.inline-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.inline-control input {
  width: 86px;
  padding: 6px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  font-size: 13px;
  color: #0f172a;
}
.insights-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.insight-stat {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.insight-stat-num {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.insight-stat-label {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.insights-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(7, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
}
.insights-filters input,
.insights-filters select {
  width: 100%;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
}
.insights-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.insight-panel {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.03);
  min-width: 0;
}
.insight-panel.panel-wide {
  grid-column: span 2;
}
.panel-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.mini-stack {
  display: grid;
  gap: 8px;
}
.mini-insight {
  display: grid;
  gap: 5px;
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.mini-insight:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.mini-title {
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.mini-meta {
  color: #64748b;
  font-size: 10px;
  line-height: 1.3;
}
.mini-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mini-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  border-radius: 7px;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-size: 12px;
  font-weight: 800;
}
.mini-badge {
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.mini-empty {
  padding: 14px;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  font-size: 12px;
}
.category-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #475569;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.category-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.category-chip strong {
  color: #d40511;
  font-variant-numeric: tabular-nums;
}
.insights-table {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  border: 1px solid #eef0f3;
}
.insights-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.55fr) minmax(150px, 0.85fr) 130px 130px 135px 130px minmax(150px, 0.9fr);
  gap: 16px;
  align-items: start;
  padding: 17px 22px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.insights-row:last-child { border-bottom: none; }
.insights-row:hover { background: #fafbfc; }
.insights-row-header {
  padding: 12px 22px;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.insight-title {
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}
.insight-meta {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.35;
}
.insight-category {
  color: #334155;
  font-weight: 600;
  line-height: 1.35;
}
.insight-tags,
.insight-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.insight-tag,
.insight-flag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
}
.insight-tag {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.insight-tag.tag-keyword {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.flag-red { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.flag-blue { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.flag-amber { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.trend-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  white-space: nowrap;
}
.demand-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
}
.demand-high,
.demand-very-high {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.demand-medium {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.demand-low,
.demand-very-low {
  color: #64748b;
  background: #f8fafc;
  border-color: #e2e8f0;
}
.insight-rank,
.insight-price {
  color: #0f172a;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.delta-line {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.delta-down {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.delta-up {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.strong-meta {
  color: #0f172a;
  font-weight: 700;
}
.insight-rank span,
.insight-price span,
.score-caption {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
}
.score-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.score-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.score-demand {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.score-opportunity {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.score-hype {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.score-reseller {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.score-caption {
  grid-column: 1 / -1;
  text-align: center;
}
.insights-footnote {
  margin: 10px 2px 0;
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .insights-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-panel.panel-wide { grid-column: span 2; }
  .insights-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insights-row {
    grid-template-columns: minmax(220px, 1.4fr) minmax(130px, 1fr) 120px 120px;
  }
  .insights-row > span:nth-child(5),
  .insights-row > span:nth-child(7) { display: none; }
}
@media (max-width: 760px) {
  .insights-stats { grid-template-columns: repeat(2, 1fr); }
  .insights-dashboard { grid-template-columns: 1fr; }
  .insight-panel.panel-wide { grid-column: auto; }
  .mini-grid { grid-template-columns: 1fr; }
  .insights-filters { grid-template-columns: 1fr; }
  .insights-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .insights-row-header { display: none; }
}

/* ===== KAUFLAND INSIGHTS: UI POLISH ===== */
.insights-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.insight-stat {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 16px 16px 14px;
  overflow: hidden;
}
.insight-stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: #e2e8f0;
}
.insight-stat:nth-child(1)::before { background: #d40511; }
.insight-stat:nth-child(2)::before { background: #16a34a; }
.insight-stat:nth-child(3)::before { background: #f97316; }
.insight-stat:nth-child(4)::before { background: #d97706; }
.insight-stat:nth-child(5)::before { background: #2563eb; }
.insight-stat:nth-child(6)::before { background: #475569; }
.insight-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 900;
}
.insight-stat-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.insight-stat-num {
  margin-top: 2px;
  font-size: 26px;
}
.insight-stat:nth-child(5) .insight-stat-num,
.insight-stat:nth-child(6) .insight-stat-num {
  font-size: 19px;
  line-height: 1.15;
  white-space: normal;
}
.insight-stat-sub {
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.3;
}
.insights-filters {
  position: sticky;
  top: 64px;
  z-index: 3;
  grid-template-columns: minmax(220px, 1.4fr) repeat(7, minmax(120px, 1fr));
  padding: 14px;
  border-radius: 16px;
  border-color: #e5e7eb;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.insights-filters input,
.insights-filters select {
  border-radius: 10px;
  background: #f8fafc;
}
.insights-filters input:focus,
.insights-filters select:focus {
  outline: none;
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}
.insights-dashboard {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.insight-panel {
  border-radius: 16px;
  border-color: #e7ebf0;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}
.insight-panel.panel-wide {
  grid-column: span 2;
}
.insight-priority-panel {
  background: linear-gradient(180deg, #fff 0%, #fff7f8 100%);
}
.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-kicker {
  margin-bottom: 4px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.panel-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}
.priority-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.priority-cat,
.category-chip {
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.priority-cat {
  display: grid;
  gap: 8px;
  min-height: 74px;
  padding: 12px;
  text-align: left;
  border-radius: 14px;
  background: #fff;
}
.priority-cat:hover,
.category-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}
.priority-cat span {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.priority-cat strong {
  color: #0f172a;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.insight-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.insight-card,
.insight-result-card {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
}
.insight-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}
.insight-card.is-compact {
  gap: 8px;
}
.insight-card-top,
.result-topline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.insight-card-title,
.result-title-link {
  display: block;
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.result-title-link {
  font-size: 14px;
}
.insight-card-title:hover,
.result-title-link:hover {
  color: #d40511;
}
.result-title-link.no-link:hover {
  color: #0f172a;
}
.insight-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}
.insight-card-meta span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
.insight-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 20px;
}
.category-badge,
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}
.category-badge {
  min-height: 24px;
  padding: 5px 9px;
}
.score-badge {
  min-width: 38px;
  min-height: 26px;
  padding: 5px 9px;
  font-variant-numeric: tabular-nums;
}
.cat-smartphones { color: #075985; background: #e0f2fe; border-color: #bae6fd; }
.cat-tablets { color: #155e75; background: #ecfeff; border-color: #a5f3fc; }
.cat-macbooks { color: #334155; background: #f1f5f9; border-color: #cbd5e1; }
.cat-tcg { color: #7c2d12; background: #ffedd5; border-color: #fed7aa; }
.cat-electronics { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.cat-other { color: #475569; background: #f8fafc; border-color: #e2e8f0; }
.score-low { color: #64748b; background: #f8fafc; border-color: #e2e8f0; }
.score-watch { color: #a16207; background: #fef9c3; border-color: #fde68a; }
.score-good { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.score-very { color: #fff; background: #15803d; border-color: #15803d; }
.score-bar {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}
.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b 0%, #16a34a 100%);
}
.open-product-btn,
.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: var(--r);
  border: 1px solid var(--green-border);
  color: var(--green2);
  background: var(--green-bg);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.open-product-btn:hover,
.mini-action:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.open-product-btn.is-disabled {
  color: #94a3b8;
  background: #f8fafc;
  border-color: #e2e8f0;
  cursor: default;
}
.open-product-btn.is-disabled:hover {
  color: #94a3b8;
  background: #f8fafc;
  border-color: #e2e8f0;
}
.insight-empty {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
}
.insight-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #d40511;
  background: #fff5f5;
  border: 1px solid #fecaca;
  font-weight: 900;
}
.insight-empty strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
}
.insight-empty span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}
.insight-results-section {
  padding: 16px;
  border: 1px solid #e7ebf0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}
.insight-results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.insight-results-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.2;
}
.insight-results-header > span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.insight-result-list {
  display: grid;
  gap: 10px;
}
.insight-result-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.55fr) minmax(150px, 0.75fr) minmax(180px, 0.9fr) minmax(120px, 0.55fr) minmax(140px, 0.65fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
}
.insight-result-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}
.result-main,
.result-market,
.result-details,
.result-score,
.result-actions {
  min-width: 0;
}
.result-price {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.result-price span {
  display: block;
  margin-top: 4px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}
.result-details {
  display: grid;
  gap: 6px;
  color: #64748b;
  font-size: 11px;
}
.result-details span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 5px;
}
.result-details strong {
  color: #0f172a;
  font-weight: 800;
  text-align: right;
}
.result-score {
  display: grid;
  gap: 7px;
  justify-items: start;
}
.result-score .score-badge {
  min-width: 48px;
  min-height: 34px;
  font-size: 16px;
}
.result-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}
.result-actions .insight-flags {
  justify-content: flex-end;
  margin-top: 0;
}

@media (max-width: 1280px) {
  .insights-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .insights-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .priority-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .insight-result-card {
    grid-template-columns: minmax(260px, 1.4fr) minmax(150px, 0.8fr) minmax(160px, 0.8fr);
  }
  .result-score,
  .result-actions {
    grid-column: auto;
  }
}
@media (max-width: 920px) {
  .insights-filters {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .insight-card-grid { grid-template-columns: 1fr; }
  .priority-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-result-card {
    grid-template-columns: 1fr 1fr;
  }
  .result-main {
    grid-column: 1 / -1;
  }
  .result-actions {
    justify-items: start;
  }
  .result-actions .insight-flags {
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  .insights-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insights-dashboard { grid-template-columns: 1fr; }
  .insight-panel.panel-wide { grid-column: auto; }
  .insights-filters { grid-template-columns: 1fr; }
  .priority-grid { grid-template-columns: 1fr; }
  .insight-result-card { grid-template-columns: 1fr; }
  .insight-results-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .insight-empty {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .open-product-btn,
  .mini-action {
    width: 100%;
  }
}

/* ===== KAUFLAND INSIGHTS: iVoodoo-Look (konsolidierte Override-Schicht) =====
   Ersetzt die fruehere "Calm Business View"-Schicht. Bringt die Insights-Seite
   auf die iVoodoo-Designsprache von liste.ivoodoo.de:
   - KPI-Karten im .sc-Stil (Label oben, Wert 26px/800, keine Icons/Farbstreifen)
   - flache --shadow-Karten mit 1px --border und 12px Radius
   - gruene Akzente statt Rot, neutrale Badges
   - Schnellfilter-Panel ueber volle Breite (behebt das Layout-Loch) */

/* --- KPI-Zeile im .sc-Stil --- */
.insights-stats {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
}
.insight-stat {
  gap: 0;
  align-content: start;
  min-height: 0;
  padding: 18px 20px;
  background: var(--white);
  border-color: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.insight-stat::before,
.insight-stat:nth-child(1)::before,
.insight-stat:nth-child(2)::before,
.insight-stat:nth-child(3)::before,
.insight-stat:nth-child(4)::before,
.insight-stat:nth-child(5)::before,
.insight-stat:nth-child(6)::before {
  content: none;
}
.insight-stat-icon { display: none; }
.insight-stat-label {
  order: -1;
  margin-bottom: 10px;
  color: var(--text3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.insight-stat-num {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
}
.insight-stat:nth-child(5) .insight-stat-num,
.insight-stat:nth-child(6) .insight-stat-num {
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -0.2px;
  white-space: normal;
}
.insight-stat-sub {
  color: var(--gray4);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

/* --- Filter-Leiste --- */
.insights-filters {
  position: static;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  border-color: var(--border);
  box-shadow: var(--shadow);
  /* 10 Filter-Elemente: flexibel umbrechen statt festem 8-Spalten-Raster */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
@media (min-width: 921px) {
  .insights-filters #insightsSearch { grid-column: span 2; }
}
.insights-filters input,
.insights-filters select {
  height: 34px;
  background: var(--gray1);
  border-color: var(--border);
  border-radius: var(--r);
  font-size: 12px;
}

/* --- Dashboard-Panels --- */
.insights-dashboard {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.insight-panel,
.insight-results-section {
  border-radius: var(--r-lg);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
/* Schnellfilter ueber die volle Breite -> kein leeres Grid-Loch mehr */
.insight-priority-panel {
  grid-column: 1 / -1;
  background: var(--white);
}
.panel-kicker { color: var(--text3); }
.panel-title { color: var(--text); font-size: 14px; font-weight: 700; }

/* --- Schnellfilter-Kacheln --- */
.priority-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.priority-cat {
  min-height: 64px;
  border-radius: var(--r);
  background: var(--gray1);
  border-color: var(--border);
  box-shadow: none;
}
.priority-cat span {
  color: var(--text3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.priority-cat strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}
.priority-cat:hover,
.category-chip:hover {
  transform: none;
  background: var(--green-bg);
  border-color: var(--green-border);
  box-shadow: none;
}

/* --- Produkt-Karten --- */
.insight-card,
.insight-result-card {
  border-color: var(--border);
  border-radius: var(--r-lg);
  box-shadow: none;
}
.insight-card {
  gap: 8px;
  padding: 12px 14px;
  background: var(--white);
}
.insight-card:hover,
.insight-result-card:hover {
  transform: none;
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
}
.insight-card-grid,
.mini-stack { gap: 8px; }
.insight-card-title,
.result-title-link {
  color: var(--text);
  font-weight: 700;
}
.insight-card-title:hover,
.result-title-link:hover { color: var(--green2); }
.result-title-link.no-link:hover { color: var(--text); }
.insight-card-meta,
.insight-meta,
.score-caption { color: var(--text3); }

/* --- Badges & Pills: neutral, gruen nur als Bedeutung --- */
.insight-tag {
  color: var(--text3);
  background: var(--gray1);
  border-color: var(--border);
  font-weight: 600;
}
.insight-tag.tag-keyword {
  color: var(--text2);
  background: var(--gray1);
  border-color: var(--border);
}
.category-badge,
.category-chip,
.cat-smartphones, .cat-tablets, .cat-macbooks, .cat-tcg, .cat-laptops,
.cat-apple, .cat-audio, .cat-wearables, .cat-gaming, .cat-accessory,
.cat-home, .cat-beauty, .cat-electronics, .cat-other {
  color: var(--text2);
  background: var(--gray1);
  border-color: var(--border);
}
.category-badge {
  font-size: 10px;
  font-weight: 700;
}
.category-chip strong { color: var(--text); }
.trend-badge {
  color: var(--text2);
  background: var(--white);
  border-color: var(--border);
  font-weight: 700;
}
.trend-badge.status-positive {
  color: var(--green-text);
  background: var(--green-bg);
  border-color: var(--green-border);
}
.trend-badge.status-warning,
.flag-amber {
  color: var(--yellow-text);
  background: var(--yellow-bg);
  border-color: var(--yellow-border);
}
.trend-badge.status-info {
  color: var(--text2);
  background: var(--gray1);
  border-color: var(--border);
}
.trend-badge.status-neutral {
  color: var(--text3);
  background: var(--white);
  border-color: var(--border);
}
.demand-pill {
  color: var(--text3);
  background: var(--white);
  border-color: var(--border);
  letter-spacing: 0;
  text-transform: none;
}
.demand-high,
.demand-very-high {
  color: var(--green-text);
  background: var(--green-bg);
  border-color: var(--green-border);
}
.demand-medium {
  color: var(--text2);
  background: var(--gray1);
  border-color: var(--border);
}

/* --- Score-Badges + Balken --- */
.score-badge.score-low {
  color: var(--text3);
  background: var(--gray1);
  border-color: var(--border);
}
.score-badge.score-watch {
  color: var(--yellow-text);
  background: var(--yellow-bg);
  border-color: var(--yellow-border);
}
.score-badge.score-good {
  color: var(--green-text);
  background: var(--green-bg);
  border-color: var(--green-border);
}
.score-badge.score-very {
  color: #fff;
  background: var(--green2);
  border-color: var(--green2);
}
.score-bar {
  height: 4px;
  background: var(--gray2);
}
.score-bar span { background: var(--gray4); }
.score-bar.score-watch span { background: var(--yellow); }
.score-bar.score-good span { background: #22c55e; }
.score-bar.score-very span { background: var(--green2); }

/* --- "Oeffnen"-Buttons: ruhiger btn-outline --- */
.open-product-btn,
.mini-action {
  min-height: 30px;
  padding: 6px 11px;
  color: var(--text2);
  background: var(--white);
  border-color: var(--border);
  border-radius: var(--r);
  font-size: 12px;
  font-weight: 600;
}
.open-product-btn:hover,
.mini-action:hover {
  color: var(--text);
  background: var(--gray2);
  border-color: #cbd5e1;
}

/* --- Empty-State + Ergebnisliste --- */
.insight-empty {
  border-radius: var(--r);
  background: var(--gray1);
}
.insight-empty-icon {
  color: var(--text3);
  background: var(--white);
  border-color: var(--border);
}
.insight-result-card {
  grid-template-columns: minmax(280px, 1.65fr) minmax(165px, 0.8fr) minmax(190px, 0.9fr) minmax(118px, 0.5fr) minmax(150px, 0.65fr);
  gap: 16px;
  padding: 14px 16px;
}
.result-price { font-size: 14px; }
.result-details span { border-bottom-color: var(--gray2); }
.result-actions { gap: 8px; }

@media (max-width: 1280px) {
  .insights-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .priority-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 920px) {
  .insight-result-card {
    grid-template-columns: 1fr 1fr;
  }
  .result-main {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .insights-stats {
    grid-template-columns: 1fr 1fr;
  }
  .insights-dashboard,
  .insights-filters,
  .priority-grid,
  .insight-result-card {
    grid-template-columns: 1fr;
  }
}

/* ===== BESTSELLER-EXPLORER (Kategorie-Nav + Top-Strip + Rangliste) ===== */
/* Kategorie-Navigation: klickbare Filter-Chips */
.insights-catnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.insights-catnav.hidden { display: none; }
.catnav-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: var(--gray1);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: background-color .13s, border-color .13s, color .13s;
}
.catnav-chip:hover {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green-text);
}
.catnav-chip.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.catnav-count {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  background: rgba(15, 23, 42, .06);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.catnav-chip.is-active .catnav-count { background: rgba(255, 255, 255, .22); }

/* Top-Chancen-Strip */
.insights-topstrip { margin-bottom: 14px; }
.insights-topstrip.hidden { display: none; }
.strip-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin-bottom: 8px;
}
.strip-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.strip-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  min-width: 0;
  transition: border-color .13s, box-shadow .13s;
}
a.strip-card:hover {
  border-color: var(--green-border);
  box-shadow: 0 4px 12px rgba(22, 163, 74, .10);
}
.strip-rank {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green-bg);
  color: var(--green-text);
  border: 1px solid var(--green-border);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.strip-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.strip-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strip-meta {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bestseller-Rangliste */
.insight-results-section.bs-table { padding: 0; overflow: hidden; }
.bs-table .insight-results-header {
  padding: 14px 16px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.bs-head,
.bs-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1.9fr) 120px 150px 200px 120px 92px;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
}
.bs-head {
  background: var(--gray1);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
}
.bs-row { border-bottom: 1px solid var(--gray2); }
.bs-row:last-child { border-bottom: none; }
.bs-row:hover { background: #fafbfc; }
.bs-rank {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gray1);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.bs-row-top .bs-rank {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.bs-product { min-width: 0; display: grid; gap: 3px; justify-items: start; }
.bs-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
a.bs-title:hover { color: var(--green2); }
.bs-sub { font-size: 11px; color: var(--text3); line-height: 1.3; }
.bs-sub strong { color: var(--text2); }
.bs-sub.delta-down { color: var(--green2); font-weight: 700; }
.bs-sub.delta-up { color: var(--red); font-weight: 700; }
.bs-price, .bs-rankinfo { display: grid; gap: 2px; }
.bs-price strong { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.bs-score { display: grid; gap: 4px; }
.bs-score-badges { display: flex; align-items: center; gap: 8px; }
.bs-reason { font-size: 10.5px; color: var(--text3); line-height: 1.3; }
.bs-signal { display: flex; flex-wrap: wrap; gap: 4px; }
.bs-action { display: flex; justify-content: flex-end; }

@media (max-width: 1280px) {
  .strip-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bs-head, .bs-row {
    grid-template-columns: 40px minmax(0, 1.8fr) 110px 130px 170px 92px;
  }
  .bs-signal { display: none; }
  .bs-head span:nth-child(6) { display: none; }
}
@media (max-width: 920px) {
  .bs-head { display: none; }
  .bs-row { grid-template-columns: 40px minmax(0, 1fr); row-gap: 6px; }
  .bs-rank { grid-row: 1; }
  .bs-product, .bs-price, .bs-rankinfo, .bs-score, .bs-signal, .bs-action { grid-column: 2; }
  .bs-signal { display: flex; }
  .bs-action { justify-content: flex-start; }
  .bs-action .open-product-btn { width: 100%; }
}
@media (max-width: 640px) {
  .strip-row { grid-template-columns: 1fr; }
  .insights-catnav { padding: 10px 12px; }
}

/* ===== TRACKING: Mock-Banner (sichtbar wenn DHL_TRACKING_API_KEY fehlt) ===== */
.mock-banner {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.mock-banner code {
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
}
.mock-banner.hidden { display: none; }

/* ===== TRACKING: Filter-Bar ===== */
.tracking-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eef0f3;
}
.tracking-filter {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tracking-filter:hover {
  background: #f8fafc;
  color: #1a1a1a;
  border-color: #cbd5e1;
}
.tracking-filter.is-active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* ===== TRACKING: Tabelle ===== */
.tracking-table {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  border: 1px solid #eef0f3;
}
.tracking-row {
  padding: 18px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: grid;
  grid-template-columns: 170px 1fr 1fr 130px 1fr 140px;
  gap: 18px;
  align-items: flex-start;
  font-size: 13px;
  transition: background-color 0.12s ease;
}
.tracking-row:last-child { border-bottom: none; }
.tracking-row:hover { background: #fafbfc; }
.tracking-row.tracking-row-header {
  background: #f8fafc;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.7px;
  padding: 12px 24px;
}

.tracking-number {
  font-family: var(--mono);
  font-weight: 700;
  color: #d40511;
  font-size: 12px;
  word-break: break-all;
}
.tracking-source {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 4px;
}
.tracking-customer {
  color: #1a1a1a;
  font-weight: 500;
}
.tracking-customer .order-ref {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  margin-top: 2px;
  font-family: var(--mono);
}
.tracking-event {
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}
.tracking-event .loc {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}
.tracking-event-time {
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--mono);
}

/* Status-Badges (Pill) */
.t-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.t-status-DELIVERED        { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.t-status-IN_TRANSIT       { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.t-status-OUT_FOR_DELIVERY { color: #1d4ed8; background: #dbeafe; border-color: #93c5fd; }
.t-status-FAILED_DELIVERY  { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.t-status-PICKUP_READY     { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.t-status-RETURNED_OR_RETURNING { color: #b91c1c; background: #fff1f2; border-color: #fda4af; }
.t-status-STUCK            { color: #b45309; background: #fff7ed; border-color: #fed7aa; }
.t-status-UNKNOWN          { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }

.t-problem-reason {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #b91c1c;
  line-height: 1.35;
}

.tracking-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.t-btn {
  padding: 6px 10px;
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.t-btn:hover { background: #f8fafc; color: #1a1a1a; border-color: #cbd5e1; }
.t-btn-dhl  { color: #b45309; border-color: #fed7aa; }
.t-btn-dhl:hover  { background: #fffbeb; border-color: #f59e0b; }
.t-btn-msg  { color: #1d4ed8; border-color: #bfdbfe; }
.t-btn-msg:hover  { background: #eff6ff; border-color: #60a5fa; }
.t-btn-done { color: #15803d; border-color: #bbf7d0; }
.t-btn-done:hover { background: #f0fdf4; border-color: #16a34a; }
.t-btn-reopen { color: #475569; border-color: #cbd5e1; }
.t-btn-reopen:hover { background: #f1f5f9; }

/* ===== HISTORY MODAL: Event-Timeline ===== */
.t-timeline { list-style: none; padding: 0; margin: 0; }
.t-timeline li {
  position: relative;
  padding: 12px 14px 12px 32px;
  border-left: 2px solid #e2e8f0;
  margin-left: 12px;
}
.t-timeline li:first-child::before {
  background: #d40511;
  border-color: #d40511;
}
.t-timeline li::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 16px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #cbd5e1;
}
.t-timeline .ev-time {
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--mono);
}
.t-timeline .ev-text {
  font-size: 13px;
  color: #1a1a1a;
  margin-top: 3px;
  line-height: 1.45;
}
.t-timeline .ev-loc {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

/* ===== CSV-DATEPICKER ===== */
.csv-date-wrap {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
}
.csv-date-wrap input[type="date"] {
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 13px;
}
.csv-date-wrap .btn-secondary {
  border-radius: 0 8px 8px 0;
}
