/* ============================================================
   Platzhirsch Fulfillment OS — Design System
   Hell & clean · weiß · hellblaue Akzente · Inter
   ============================================================ */

:root {
  /* Canvas & surfaces */
  --bg: #eef2f7;
  --bg-grad-a: #f3f6fa;
  --bg-grad-b: #e9eef5;
  --surface: #ffffff;
  --surface-muted: #f7f9fc;
  --surface-sunken: #f1f4f9;

  /* Ink */
  --ink: #0f2742;
  --ink-2: #51637b;
  --ink-3: #8595ab;
  --ink-on-brand: #ffffff;

  /* Lines */
  --line: #e5eaf1;
  --line-strong: #d2dbe6;

  /* Brand — light blue / petrol */
  --brand: #1f86c4;
  --brand-strong: #1670a8;
  --brand-ink: #0d5a8c;
  --brand-soft: #e9f3fb;
  --brand-soft-2: #d8ebf8;

  /* Semantic tones */
  --red: #cf4a3f;
  --red-soft: #fceceb;
  --red-line: #f3d2cf;
  --amber: #c2841c;
  --amber-soft: #fbf2df;
  --green: #1d9a62;
  --green-soft: #e8f6ef;
  --green-line: #c9e9d8;

  /* Effects */
  --r-xs: 7px;
  --r-sm: 9px;
  --r: 13px;
  --r-lg: 18px;
  --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(15,27,45,.05);
  --sh-2: 0 2px 5px rgba(15,27,45,.05), 0 8px 22px rgba(15,27,45,.06);
  --sh-3: 0 12px 40px rgba(15,27,45,.14);
  --sh-pop: 0 18px 50px rgba(15,27,45,.20);
  --ring: 0 0 0 3px rgba(31,134,196,.18);

  --sidebar-w: 248px;
  --topbar-h: 64px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(160deg, var(--bg-grad-a), var(--bg-grad-b));
  background-attachment: fixed;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
::selection { background: var(--brand-soft-2); }
h1,h2,h3,h4 { font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }

.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

/* ===================== App shell ===================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #0f2742;
  color: #c4d2e2;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 14px;
  z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 8px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark { width: 34px; height: 34px; flex: 0 0 34px; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-name { font-size: 14.5px; font-weight: 650; color: #fff; letter-spacing: -0.02em; line-height: 1.15; }
.brand-name small { display: block; font-size: 10.5px; font-weight: 500; color: #7f93ad; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nav-label { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #647a96; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: #b3c3d6; font-weight: 500; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav a svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; box-shadow: var(--sh-1); }
.nav a.active svg { opacity: 1; }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 600; background: rgba(255,255,255,.14); color: #dce6f2; padding: 1px 7px; border-radius: var(--r-pill); }
.nav a.active .count { background: rgba(255,255,255,.25); color: #fff; }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); transition: background .15s; }
.user-chip:hover { background: rgba(255,255,255,.06); }
.user-chip .avatar { width: 30px; height: 30px; flex: 0 0 30px; }
.user-chip .u-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.2; }
.user-chip .u-role { font-size: 11px; color: #8298b2; }

/* ===================== Main / topbar ===================== */
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 30px;
  position: sticky; top: 0; z-index: 20;
  background: rgba(244,247,251,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 18px; }
.topbar .crumb { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.topbar .crumb a:hover { color: var(--brand); }
.topbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-strong);
  padding: 8px 13px; border-radius: var(--r-pill); width: 260px;
  color: var(--ink-3); box-shadow: var(--sh-1);
}
.search input { border: none; outline: none; background: none; width: 100%; }
.search svg { width: 15px; height: 15px; flex: 0 0 15px; }
.search { position: relative; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 320px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-pop); padding: 6px; z-index: 60; display: none; max-height: 380px; overflow-y: auto;
}
.search-results.open { display: block; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-sm); cursor: pointer; }
.sr-item:hover { background: var(--surface-muted); }
.sr-item .sr-type { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand-soft); padding: 2px 7px; border-radius: 5px; flex: 0 0 auto; }
.sr-item .sr-text { font-size: 13px; color: var(--ink); }
.sr-empty { padding: 16px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* Bell / notifications */
.bell-wrap { position: relative; }
.bell-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 1.5px solid var(--bg); display: none; }
.bell-dot.on { display: block; }
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 340px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-pop); z-index: 60; display: none; overflow: hidden;
}
.notif-panel.open { display: block; }
.notif-head { padding: 13px 16px; border-bottom: 1px solid var(--line); font-weight: 650; font-size: 13.5px; display: flex; align-items: center; justify-content: space-between; }
.notif-head .tag-soft { font-weight: 600; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: flex; align-items: flex-start; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-muted); }
.notif-item .ni-ic { width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px; display: flex; align-items: center; justify-content: center; }
.notif-item .ni-ic svg { width: 16px; height: 16px; }
.notif-item .ni-ic.blue { background: var(--brand-soft); color: var(--brand-ink); }
.notif-item .ni-ic.amber { background: var(--amber-soft); color: #8a5d10; }
.notif-item .ni-text { font-size: 13px; line-height: 1.4; }
.notif-item .ni-when { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.notif-empty { padding: 30px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }

.content { padding: 26px 30px 60px; max-width: 1380px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.page-head .ph-titles h2 { font-size: 23px; letter-spacing: -0.025em; }
.page-head .ph-titles p { color: var(--ink-2); margin-top: 4px; font-size: 13.5px; }
.page-head .ph-actions { margin-left: auto; display: flex; gap: 10px; }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--sh-1); transition: all .15s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--ink-3); transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand-strong); }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-sunken); border-color: transparent; box-shadow: none; color: var(--ink); }
.btn-danger { color: var(--red); border-color: var(--red-line); background: var(--red-soft); }
.btn-danger:hover { background: #f8ddda; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-icon { padding: 8px; }
.btn-icon svg { width: 17px; height: 17px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ===================== Cards & surfaces ===================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--sh-1);
}
.card-pad { padding: 20px; }
.section-title { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }

/* ===================== KPI tiles ===================== */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px 24px 22px; box-shadow: var(--sh-1); position: relative; overflow: hidden;
}
.kpi::after { content:''; position:absolute; right:-24px; top:-24px; width:104px; height:104px; border-radius:50%; background: var(--brand-soft); opacity:.5; }
.kpi .kpi-label { font-size: 13px; color: var(--ink-2); font-weight: 600; display:flex; align-items:center; gap:8px; position:relative; }
.kpi .kpi-label svg { width: 17px; height: 17px; color: var(--brand); }
.kpi .kpi-val { font-size: 42px; font-weight: 700; letter-spacing: -0.035em; margin-top: 12px; line-height: 1; position:relative; }
.kpi .kpi-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; position:relative; }
.kpi .kpi-sub b { color: var(--green); }

/* ===================== Badges / pills ===================== */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; line-height: 1.4;
  background: var(--surface-sunken); color: var(--ink-2);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-blue { background: var(--brand-soft); color: var(--brand-ink); }
.pill-green { background: var(--green-soft); color: #137a4b; }
.pill-amber { background: var(--amber-soft); color: #8a5d10; }
.pill-red { background: var(--red-soft); color: #a83228; }
.pill-grey { background: var(--surface-sunken); color: var(--ink-2); }

/* ===================== Avatar ===================== */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 650; color: #fff;
  background: var(--brand); flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.a1{background:#1f86c4}.avatar.a2{background:#7a5cd6}.avatar.a3{background:#1d9a62}
.avatar.a4{background:#c2841c}.avatar.a5{background:#cf4a3f}.avatar.a6{background:#0f2742}
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ===================== Tables ===================== */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding: 11px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-muted); }
.table .row-click { cursor: pointer; }

/* ===================== Progress / stepper (Onboarding) ===================== */
.progress { height: 7px; background: var(--surface-sunken); border-radius: var(--r-pill); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #44a3da); border-radius: inherit; transition: width .5s var(--ease); }

/* ===================== Forms ===================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
  outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: var(--ring); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.input-row { display: flex; gap: 12px; }
.input-row > * { flex: 1; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }

/* ===================== Modal ===================== */
.scrim {
  position: fixed; inset: 0; background: rgba(15,27,45,.42);
  backdrop-filter: blur(3px); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 30px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-pop);
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  transform: translateY(12px) scale(.99); transition: transform .22s var(--ease);
}
.scrim.open .modal { transform: none; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.modal-head h3 { font-size: 17px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); }

/* ===================== Banner / toast ===================== */
.banner {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border-radius: var(--r); margin-bottom: 18px; font-weight: 500; font-size: 13.5px;
}
.banner-blue { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand-soft-2); }
.banner-green { background: var(--green-soft); color: #137a4b; border: 1px solid var(--green-line); }
.banner svg { width: 19px; height: 19px; flex: 0 0 19px; }
.banner .b-strong { font-weight: 700; }
.banner .b-actions { margin-left: auto; }

.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-sm);
  box-shadow: var(--sh-3); font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 10px;
  transform: translateX(120%); transition: transform .3s var(--ease); max-width: 340px;
}
.toast.show { transform: none; }
.toast svg { width: 17px; height: 17px; color: #5fd39a; flex: 0 0 17px; }

/* ===================== Empty state ===================== */
.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty svg { width: 40px; height: 40px; opacity: .5; margin-bottom: 12px; }
.empty h4 { color: var(--ink-2); font-size: 15px; margin-bottom: 5px; }

/* ===================== Misc layout ===================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.wrap-2col { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.tag-soft { font-size: 11.5px; color: var(--ink-2); background: var(--surface-sunken); padding: 2px 8px; border-radius: var(--r-xs); font-weight: 500; }
.link { color: var(--brand); font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }
.mt-s{margin-top:8px}.mt-m{margin-top:16px}.mt-l{margin-top:24px}
.fade-in { animation: fadeIn .35s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Fragebogen (intern) ---------- */
.fb-linkbox { margin-bottom: 12px; }
.fb-ans-sec { margin-bottom: 18px; }
.fb-ans-sec:last-child { margin-bottom: 0; }
.fb-ans-sec .section-title { margin-bottom: 8px; }
.fb-ans-row { display: grid; grid-template-columns: 220px 1fr; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.fb-ans-row:first-of-type { border-top: none; }
.fb-ans-k { color: var(--ink-3); font-weight: 500; }
.fb-ans-v { color: var(--ink); line-height: 1.5; word-break: break-word; }
