/* ============================================================
   PLANBAR · CRM & Lager — Stylesheet
   CI: keine runden Ecken, Ink-Rahmen, Papier, harte Offset-Schatten.
   ============================================================ */

@font-face {
  font-family: 'Zalando Sans';
  src: url('/assets/ZalandoSans-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --orange: #f3562e;
  --orange-hover: #d9431d;
  --rhubarb: #ffb09c;
  --pickle: #00363e;
  --seaweed: #565438;
  --matcha: #e0ebde;
  --cherry: #531f28;
  --almond: #bcad96;
  --paper: #fef7ec;
  --card: #FBFAF5;
  --ink: #171511;
  --ink-soft: #5d584f;
  --line: rgba(23, 21, 17, 0.16);
  --border: 1.5px solid var(--ink);
  --shadow: 4px 4px 0 rgba(23, 21, 17, 0.14);
}

* { box-sizing: border-box; border-radius: 0 !important; margin: 0; padding: 0; }
body {
  font-family: 'Zalando Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--paper); color: var(--ink);
  font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--rhubarb); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14.5px; color: var(--ink); }
a { color: var(--pickle); }
.boot { padding: 60px; text-align: center; color: var(--ink-soft); font-weight: 650; }

/* ---------- Formulare ---------- */
.input, input.input, select.input, textarea.input {
  background: #fff; border: var(--border); padding: 9px 12px; width: 100%;
}
.input:focus { outline: none; box-shadow: 3px 3px 0 var(--rhubarb); }
label.field { display: block; margin: 12px 0 0; }
label.field > span {
  display: block; font-size: 11px; font-weight: 750; letter-spacing: .09em;
  text-transform: uppercase; color: var(--pickle); margin-bottom: 5px;
}
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .frow { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  background: var(--card); border: var(--border); padding: 9px 16px; font-weight: 650; font-size: 14px;
  color: var(--ink); display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { box-shadow: 3px 3px 0 rgba(23, 21, 17, .2); transform: translate(-1px, -1px); }
.btn:active { box-shadow: none; transform: none; }
.btn.primary { background: var(--orange); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--orange-hover); }
.btn.dark { background: var(--pickle); color: #fff; }
.btn.danger { background: var(--cherry); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.tiny { padding: 3px 8px; font-size: 12px; font-weight: 750; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn.ghost:hover { border-color: var(--ink); color: var(--ink); box-shadow: none; transform: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Chips & Kleinzeug ---------- */
.tag {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; border: 1.5px solid var(--pickle); padding: 2px 7px; background: #fff; color: var(--pickle);
  white-space: nowrap;
}
.tag.orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.tag.matcha { background: var(--matcha); color: var(--pickle); }
.tag.cherry { background: var(--cherry); border-color: var(--cherry); color: #fff; }
.tag.pickle { background: var(--pickle); color: #fff; }
.tag.almond { background: var(--almond); border-color: var(--almond); color: var(--ink); }
.tag.rhubarb { background: var(--rhubarb); border-color: var(--rhubarb); color: var(--cherry); }
.tag.soft { border-color: var(--line); color: var(--ink-soft); }
.avatar {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; border: 1.5px solid var(--ink); flex: none;
}
.avatar.a1 { background: var(--pickle); } .avatar.a2 { background: var(--orange); }
.avatar.a3 { background: var(--seaweed); } .avatar.a4 { background: var(--cherry); }
.avatar.a5 { background: var(--almond); color: var(--ink); }
.avatar.big { width: 42px; height: 42px; font-size: 15px; }
.muted { color: var(--ink-soft); }
.small { font-size: 12.5px; }
.qty { color: var(--orange); font-weight: 800; }
.spacer { flex: 1; }
.right { margin-left: auto; }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: 0; }
.dot.ok { background: var(--pickle); }
.dot.warn { background: var(--orange); }
.dot.bad { background: var(--cherry); }
.dot.off { background: #fff; border: 1.5px solid var(--ink-soft); }

/* ---------- Shell / Sidebar / Topbar ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; background: var(--card); border-right: var(--border);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto;
}
.side-head { padding: 18px 16px 12px; border-bottom: var(--border); }
.side-head img { height: 40px; display: block; }
.side-head .sub { font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--pickle); margin-top: 7px; }
.side-nav { padding: 12px 10px; display: grid; gap: 3px; }
.side-caption { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); padding: 12px 8px 4px; }
.side-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: transparent; border: 1.5px solid transparent; padding: 8px 10px; font-size: 14.5px; font-weight: 650; color: var(--ink);
}
.side-item:hover { border-color: var(--ink); background: #fff; }
.side-item.active { background: var(--pickle); color: #fff; border-color: var(--ink); }
.side-item .count { margin-left: auto; font-size: 11.5px; font-weight: 800; color: var(--orange); }
.side-item.active .count { color: var(--rhubarb); }
.side-item .count.bad { color: var(--cherry); }
.side-item.active .count.bad { color: var(--rhubarb); }
.side-foot { margin-top: auto; border-top: var(--border); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.side-foot .who { line-height: 1.2; }
.side-foot .who b { font-size: 13.5px; display: block; }
.side-foot .who span { font-size: 11px; color: var(--ink-soft); }

.main { flex: 1; min-width: 0; }
.topbar {
  padding: 16px 28px; border-bottom: var(--border); position: sticky; top: 0; z-index: 5;
  background: var(--paper); display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.topbar h1 { font-size: 21px; font-weight: 850; letter-spacing: -.01em; }
.topbar .crumb { font-size: 12px; color: var(--ink-soft); }
.content { padding: 26px 28px 60px; }

/* ---------- Panels / KPI ---------- */
.panel { background: var(--card); border: var(--border); margin-bottom: 22px; }
.panel > header {
  background: #fff; border-bottom: var(--border); padding: 10px 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.panel > header h2 { font-size: 14px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.panel .pbody { padding: 14px 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--card); border: var(--border); box-shadow: var(--shadow); padding: 13px 15px; }
.kpi .num { font-size: 30px; font-weight: 850; color: var(--orange); line-height: 1.1; }
.kpi .num.bad { color: var(--cherry); }
.kpi .num.ink { color: var(--ink); }
.kpi .lbl { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--pickle); margin-top: 3px; }
.kpi .sub { font-size: 12px; color: var(--ink-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- Zeilen & Tabellen ---------- */
.row { display: flex; align-items: center; gap: 11px; padding: 9px 2px; border-bottom: 1.5px dotted var(--line); flex-wrap: wrap; }
.row:last-child { border-bottom: none; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--pickle); padding: 7px 9px; border-bottom: var(--border); background: #fff; white-space: nowrap;
}
.tbl td { padding: 8px 9px; border-bottom: 1.5px dotted var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fff6f2; }
.tblwrap { overflow-x: auto; }

/* ---------- Werkzeugleiste / Segmented ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { width: auto; min-width: 240px; }
.toolbar select { width: auto; }
.seg { display: inline-flex; border: var(--border); background: #fff; }
.seg button {
  background: transparent; border: none; border-right: 1.5px solid var(--ink); padding: 7px 13px;
  font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft);
}
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--pickle); color: #fff; }

/* ---------- Gästeliste ---------- */
.grow { display: flex; align-items: center; gap: 13px; padding: 11px 4px; border-bottom: 1.5px dotted var(--line); cursor: pointer; flex-wrap: wrap; }
.grow:last-child { border-bottom: none; }
.grow:hover { background: #fff6f2; outline: 2px solid var(--orange); outline-offset: -2px; }
.grow .nm { font-weight: 800; font-size: 15px; line-height: 1.25; }
.grow .sub { font-size: 12px; color: var(--ink-soft); }
.grow .chips { display: flex; gap: 5px; flex-wrap: wrap; }
.grow .nums { margin-left: auto; text-align: right; font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.grow .nums b { color: var(--ink); }

/* ---------- Gastprofil ---------- */
.pgrid { display: grid; grid-template-columns: 330px 1fr; gap: 22px; align-items: start; }
@media (max-width: 1050px) { .pgrid { grid-template-columns: 1fr; } }
.kv { padding: 8px 0; border-bottom: 1.5px dotted var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { display: block; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.favrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1.5px dotted var(--line); font-size: 13.5px; }
.favrow:last-child { border-bottom: none; }
.favrow .n { min-width: 210px; font-weight: 650; }
.favbar { height: 10px; background: var(--orange); flex: none; }
.tl { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1.5px dotted var(--line); font-size: 13.5px; }
.tl:last-child { border-bottom: none; }
.tl .ts { flex: none; width: 78px; font-size: 11.5px; font-weight: 800; color: var(--ink-soft); padding-top: 2px; }
.tl .who { font-size: 11px; color: var(--ink-soft); }

/* ---------- Lager ---------- */
.ampel { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
.bestand-num { font-weight: 800; white-space: nowrap; }
.bestand-num.bad { color: var(--cherry); }
.bestand-num.warn { color: var(--orange); }
.inv-input { width: 90px; text-align: right; }
.inv-diff { font-weight: 800; white-space: nowrap; }
.inv-diff.plus { color: var(--pickle); }
.inv-diff.minus { color: var(--cherry); }

/* ---------- Segmente-Karten ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.scard { background: var(--card); border: var(--border); padding: 15px; display: flex; flex-direction: column; gap: 8px; }
.scard h3 { font-size: 15.5px; font-weight: 800; }
.scard .cnt { font-size: 28px; font-weight: 850; color: var(--orange); line-height: 1; }
.scard .rule { font-size: 12px; color: var(--ink-soft); border-top: 1.5px dotted var(--line); padding-top: 8px; }
.scard .foot { display: flex; gap: 7px; flex-wrap: wrap; border-top: 1.5px dotted var(--line); padding-top: 9px; margin-top: auto; }
.scard.new { border-style: dashed; align-items: center; justify-content: center; min-height: 140px; color: var(--ink-soft); font-weight: 700; cursor: pointer; }
.scard.new:hover { color: var(--orange); border-color: var(--orange); }

/* ---------- Feedback ---------- */
.stars { color: var(--orange); font-size: 15px; letter-spacing: 2px; white-space: nowrap; }
.stars .off { color: rgba(23, 21, 17, .22); }
.fbrow { padding: 12px 2px; border-bottom: 1.5px dotted var(--line); }
.fbrow:last-child { border-bottom: none; }
.fbrow .hd { display: flex; gap: 11px; align-items: center; flex-wrap: wrap; }
.fbrow .txt { margin-top: 5px; font-size: 14px; }
.fbrow .antwort { margin-top: 8px; border-left: 3px solid var(--pickle); background: #fff; padding: 8px 12px; font-size: 13px; }
.fbrow .antwort .a { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--pickle); }

.linklike { background: none; border: none; padding: 0; font: inherit; font-weight: 750; color: var(--pickle); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.linklike:hover { color: var(--orange); }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(23, 21, 17, .45);
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px 40px; z-index: 50; overflow-y: auto;
}
.modal { background: var(--paper); border: 2px solid var(--ink); box-shadow: 8px 8px 0 rgba(23, 21, 17, .3); width: 720px; max-width: 100%; }
.modal.narrow { width: 460px; }
.modal.wide { width: 940px; }
.modal > header { background: var(--card); border-bottom: var(--border); padding: 12px 18px; display: flex; align-items: center; gap: 10px; }
.modal > header h2 { font-size: 16px; font-weight: 800; flex: 1; }
.modal .xbtn { background: none; border: none; font-size: 20px; font-weight: 800; color: var(--ink-soft); padding: 0 4px; }
.modal .xbtn:hover { color: var(--orange); }
.modal .mbody { padding: 16px 18px; max-height: 65vh; overflow-y: auto; }
.modal .mfoot { background: var(--card); border-top: var(--border); padding: 12px 18px; display: flex; gap: 10px; align-items: center; }
#modal-layer:empty { display: none; }

/* ---------- Toast ---------- */
#toast-layer { position: fixed; bottom: 22px; right: 22px; z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--pickle); color: #fff; border: 2px solid var(--ink); box-shadow: 4px 4px 0 rgba(23, 21, 17, .3); padding: 11px 16px; font-weight: 650; max-width: 380px; }
.toast.error { background: var(--cherry); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; }
.login-wrap img { height: 54px; }
.login-box { width: 380px; max-width: 100%; background: var(--card); border: 2px solid var(--ink); box-shadow: 8px 8px 0 rgba(23, 21, 17, .25); padding: 26px; }
.login-box h1 { font-size: 22px; font-weight: 850; }
.login-box .sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.login-error { background: var(--cherry); color: #fff; font-size: 13px; font-weight: 650; padding: 9px 12px; margin: 10px 0 2px; }
.login-claim { font-size: 12px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 840px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: var(--border); }
  .side-nav { display: flex; flex-wrap: wrap; }
  .side-foot { margin-top: 0; }
  .content { padding: 18px 14px 50px; }
  .topbar { padding: 12px 14px; }
}
