:root {
  --navy: #0d1b33;
  --navy-soft: #16263f;
  --red: #b23a2a;
  --ink: #131a24;
  --muted: #5b6675;
  --line: #e2e6ec;
  --paper: #f6f7f9;
  --white: #fff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(13, 27, 51, .06), 0 8px 24px rgba(13, 27, 51, .06);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--navy); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 12px; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 14px; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* Kopf */
.top { background: var(--navy); color: #fff; }
.top__inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: #fff; }
.brand__mark { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; font-style: italic; }
.brand__label {
  font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255,255,255,.62); border-left: 1px solid rgba(255,255,255,.25); padding-left: 10px;
}
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: rgba(255,255,255,.78); text-decoration: none; font-size: .9rem;
  padding: 8px 12px; border-radius: 8px; transition: background .2s, color .2s;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.is-active { color: #fff; background: rgba(255,255,255,.14); }
.top__actions { display: flex; gap: 8px; align-items: center; }
.top__actions form { margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: #9c3122; }
.btn--dark { background: var(--navy); color: #fff; }
.btn--dark:hover { background: var(--navy-soft); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--navy); }
.top .btn--ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.top .btn--ghost:hover { border-color: #fff; }
.btn--sm { padding: 8px 14px; font-size: .84rem; }
.btn--block { width: 100%; }

/* Flächen */
.main { padding: 32px 0 64px; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }

/* Flash */
.flash {
  padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: .92rem; border: 1px solid;
}
.flash--ok { background: #eef7f1; border-color: #cfe8d8; color: #1c5c33; }
.flash--err { background: #fdf0ee; border-color: #f3d3cd; color: #8f2d1f; }

/* Hero / Landing */
.hero {
  background: linear-gradient(140deg, #0d1b33 0%, #16263f 60%, #1d3050 100%);
  color: #fff; border-radius: 16px; padding: 48px; margin-bottom: 24px;
}
.hero h1 { color: #fff; max-width: 18ch; }
.hero p { color: rgba(255,255,255,.78); max-width: 58ch; }
.hero__actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.hero .btn--ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.hero .btn--ghost:hover { border-color: #fff; }
.eyebrow {
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--red);
  font-weight: 700; margin-bottom: 10px;
}
.hero .eyebrow { color: #e0796c; }

/* Formulare */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 6px; color: #26313f; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(13,27,51,.18); border-color: var(--navy);
}
.field small { display: block; color: var(--muted); font-size: .78rem; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-narrow { max-width: 440px; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
tbody tr:hover { background: #fafbfc; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .02em;
}
.badge--pending { background: #fff4e0; color: #8a5a00; }
.badge--active { background: #eef7f1; color: #1c5c33; }
.badge--rejected { background: #fdf0ee; color: #8f2d1f; }
.badge--blocked { background: #eceff3; color: #3c4654; }
.badge--new { background: #e8f0fb; color: #1c4b8a; }
.badge--confirmed { background: #eef7f1; color: #1c5c33; }
.badge--delivered { background: #eceff3; color: #3c4654; }
.badge--cancelled { background: #fdf0ee; color: #8f2d1f; }

/* Katalog */
.cat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 28px 0 12px; flex-wrap: wrap;
}
.cat-head h2 { margin: 0; }
.product { display: flex; flex-direction: column; gap: 10px; }
.product__img {
  aspect-ratio: 4 / 3; background: #eef1f5 center/contain no-repeat; border-radius: 10px;
  border: 1px solid var(--line);
}
.product__title { font-weight: 600; font-size: .98rem; margin: 0; }
.product__meta { font-size: .8rem; color: var(--muted); }
.price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.price strong { font-size: 1.1rem; }
.price s { color: var(--muted); font-size: .84rem; }
.price__hint { font-size: .74rem; color: var(--muted); }
.add-form { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.add-form input[type="number"] { width: 64px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

/* KPI */
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.kpi span { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.kpi strong { display: block; font-size: 1.9rem; margin-top: 6px; letter-spacing: -0.02em; }

/* Sonstiges */
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.right { text-align: right; }
.stack > * + * { margin-top: 12px; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 20px 0; border: 0; }
.notice {
  border-left: 3px solid var(--red); background: #fff; padding: 14px 16px; border-radius: 6px;
  font-size: .9rem; color: var(--muted);
}
.foot { border-top: 1px solid var(--line); background: #fff; }
.foot__inner {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 0; font-size: .8rem; color: var(--muted);
}
.foot a { color: var(--muted); text-decoration: none; margin-left: 16px; }
.foot a:hover { color: var(--navy); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

@media (max-width: 860px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: 1fr; }
  .grid--2 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding: 32px 24px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: 6px; }
  .top__inner { flex-wrap: wrap; padding: 10px 0; gap: 12px; }
}

/* Lieferauswahl im Warenkorb */
.delivery {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
  min-width: 0;
}

.delivery legend {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  padding: 0;
  font-weight: 700;
}

.choice {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.choice:hover {
  border-color: #b9c4d6;
}

.choice:has(input:checked) {
  border-color: var(--navy);
  background: #f5f8fc;
  box-shadow: 0 0 0 1px rgba(16, 32, 63, 0.07);
}

.choice input {
  margin: 2px 0 0;
  accent-color: var(--navy);
  flex: 0 0 auto;
}

.choice > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.choice strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy);
}

.choice .small {
  display: block;
  font-size: 0.78rem;
  line-height: 1.4;
}

.ship-box {
  border-left: 3px solid var(--navy);
  padding: 4px 0 4px 14px;
  margin: 0 0 18px;
}

.ship-box .field {
  margin-bottom: 10px;
}

.ship-box .field:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .cart-table th:nth-child(2),
  .cart-table td:nth-child(2) {
    display: none;
  }

  .cart-table th,
  .cart-table td {
    padding: 10px 8px;
    font-size: 0.86rem;
  }

  .cart-table th:first-child,
  .cart-table td:first-child {
    padding-left: 0;
  }

  .cart-table td.num,
  .cart-table th.num {
    white-space: nowrap;
  }

  .cart-table .btn--sm {
    padding: 6px 8px;
    font-size: 0.74rem;
  }

  .cart-table input[type="number"] {
    width: 50px !important;
  }
}

.show-sm {
  display: none;
}

@media (max-width: 640px) {
  .hide-sm {
    display: none;
  }

  .show-sm {
    display: inline;
  }
}
