@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

/* ─── foodforecast brand tokens (shared with arti) ─────────────────────── */
:root {
  --ff-navy:       #1E4150;
  --ff-teal:       #326973;
  --ff-teal-mid:   #4A6975;
  --ff-teal-soft:  #D9CDBC;
  --ff-mint:       #D6EEE7;
  --ff-mint-soft:  #F9F6F3;
  --ff-cream:      #F2EBE3;
  --ff-cream-50:   #FAF6F0;
  --ff-coral:      #ED8578;
  --ff-coral-dark: #D96A5B;
  --ff-coral-soft: #FBE3DE;
  --ff-line:       #E8DFD3;
  --ff-sand:       #D9CDBC;
  --ff-muted:      #4A6975;
  --ff-muted-2:    #768E97;
  --ff-ink:        #1E4150;
  --ff-good:       #2E8B6E;
  --ff-warn:       #D98E2B;
  --ff-bad:        #C94F43;
  --ff-shadow-sm:  0 1px 2px rgba(30,65,80,.06), 0 1px 3px rgba(30,65,80,.04);
  --ff-shadow-md:  0 6px 18px rgba(30,65,80,.08), 0 2px 4px rgba(30,65,80,.04);
  --sidebar-w: 236px;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  color: var(--ff-ink);
  background: var(--ff-cream);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ff-teal); }
h1, h2, h3 { margin: 0; font-weight: 600; }
code, .code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
[hidden] { display: none !important; }
.muted { color: var(--ff-muted-2); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--end { justify-content: flex-end; margin-top: 10px; }
.h2 { font-size: 18px; }

/* ─── App shell ────────────────────────────────────────────────────────── */
body.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: #fff; border-right: 1px solid var(--ff-line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar__brand { padding: 22px 20px 12px; }
.brand { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ff-navy); }
.brand__logo { height: 30px; width: auto; align-self: flex-start; }
.brand__product { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.brand__product span { color: var(--ff-coral); }
.nav { padding: 6px 0 12px; overflow-y: auto; flex: 1; }
.nav__group { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ff-muted-2); padding: 14px 20px 6px; font-weight: 500; }
.nav__link {
  display: flex; align-items: center; gap: 12px; padding: 9px 20px; color: var(--ff-teal-mid);
  text-decoration: none; font-weight: 500; border-left: 3px solid transparent; transition: background .12s, color .12s;
}
.nav__link:hover { background: var(--ff-mint-soft); color: var(--ff-navy); }
.nav__link.is-active { color: var(--ff-coral-dark); background: var(--ff-coral-soft); border-left-color: var(--ff-coral); }
.nav__icon { width: 18px; height: 18px; display: inline-flex; }
.nav__icon svg { width: 18px; height: 18px; }
.sidebar__foot { padding: 14px 20px; border-top: 1px solid var(--ff-line); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 11.5px; font-weight: 500; }
.pill--demo { background: var(--ff-coral-soft); color: var(--ff-coral-dark); }
.pill--live { background: var(--ff-mint); color: var(--ff-teal); }
.pill--readonly { background: var(--ff-cream-50); color: var(--ff-muted-2); border: 1px solid var(--ff-line); }

.app__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 28px; background: #fff; border-bottom: 1px solid var(--ff-line); position: sticky; top: 0; z-index: 20;
}
.topbar__left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar__title { font-size: 22px; letter-spacing: -.01em; }
.topbar__subtitle { margin: 2px 0 0; color: var(--ff-muted-2); font-size: 12.5px; }
.topbar__right { display: flex; align-items: center; gap: 10px; }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--ff-muted); text-decoration: none; font-size: 12.5px; }
.backlink svg { width: 16px; height: 16px; }
.page { padding: 22px 28px 40px; display: flex; flex-direction: column; gap: 18px; }

.picker { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ff-line); border-radius: 10px; padding: 0 8px 0 10px; background: #fff; height: 38px; }
.picker--location { border-color: var(--ff-sand); }
.picker__icon svg { width: 16px; height: 16px; color: var(--ff-coral); display: block; }
.picker__select { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--ff-navy); padding: 6px 2px; cursor: pointer; max-width: 240px; }
.picker__select:focus { outline: none; }
.picker__tag { background: var(--ff-coral); color: #fff; font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--ff-line); background: #fff; color: var(--ff-teal-mid); cursor: pointer; }
.iconbtn svg { width: 17px; height: 17px; }
.iconbtn:hover { border-color: var(--ff-coral); color: var(--ff-coral-dark); }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--ff-coral); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; }
.usermenu, .dropdownwrap { position: relative; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--ff-line); border-radius: 12px;
  box-shadow: var(--ff-shadow-md); min-width: 220px; z-index: 40; padding: 8px; display: flex; flex-direction: column; gap: 4px;
}
.dropdown--form { min-width: 280px; padding: 14px; }
.dropdown__meta { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; font-size: 12.5px; color: var(--ff-muted); border-bottom: 1px solid var(--ff-line); margin-bottom: 4px; }
.dropdown__item { width: 100%; text-align: left; border: 0; background: transparent; font: inherit; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ff-ink); }
.dropdown__item:hover { background: var(--ff-mint-soft); }
.checklist { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; }
.checklist__item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.checklist__item:hover { background: var(--ff-mint-soft); }

.flash { padding: 10px 14px; border-radius: 10px; font-size: 13px; background: var(--ff-mint); color: var(--ff-teal); }
.flash--alert { background: var(--ff-coral-soft); color: var(--ff-coral-dark); }

/* ─── Toolbar / date navigation ───────────────────────────────────────── */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.datenav { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--ff-line); border-radius: 10px; padding: 3px; }
.datenav__btn { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 8px; color: var(--ff-teal-mid); }
.datenav__btn:hover { background: var(--ff-mint-soft); }
.datenav__btn svg { width: 16px; height: 16px; }
.datenav__form { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0 6px; }
.datenav__label { font-weight: 600; white-space: nowrap; }
.datenav__input { border: 0; background: transparent; font: inherit; color: var(--ff-muted-2); width: 24px; padding: 0; cursor: pointer; }
.datenav__input::-webkit-calendar-picker-indicator { cursor: pointer; }
.datenav__today { font-size: 12px; padding: 0 10px; color: var(--ff-coral-dark); text-decoration: none; font-weight: 500; }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--ff-sand); background: #fff; color: var(--ff-teal);
  border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; transition: border-color .12s, background .12s, color .12s;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--ff-coral); color: var(--ff-coral-dark); background: var(--ff-coral-soft); }
.btn--primary { background: var(--ff-coral); border-color: var(--ff-coral); color: #fff; }
.btn--primary:hover { background: var(--ff-coral-dark); border-color: var(--ff-coral-dark); color: #fff; }
.btn--ghost { border-color: transparent; }
.btn--lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; justify-content: center; }
.btn--block { width: 100%; justify-content: center; margin-top: 8px; }
.linkbtn { border: 0; background: transparent; font: inherit; color: var(--ff-navy); cursor: pointer; padding: 0; text-align: left; }
.linkbtn:hover { color: var(--ff-coral-dark); }
.linkbtn--coral { color: var(--ff-coral-dark); font-weight: 500; }
.inlineform { margin: 0; display: inline; }

/* ─── KPI tiles ───────────────────────────────────────────────────────── */
.kpis { display: grid; gap: 14px; }
.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi { background: #fff; border: 1px solid var(--ff-line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--ff-shadow-sm); min-width: 0; }
.kpi__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kpi__label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ff-muted-2); font-weight: 500; display: flex; flex-direction: column; gap: 2px; }
.kpi__eyebrow { color: var(--ff-teal-mid); }
.kpi__value { font-size: 24px; font-weight: 600; margin-top: 8px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi__sub { color: var(--ff-muted-2); font-size: 11.5px; margin-top: 6px; }
.kpiedit { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.kpiedit__unit { font-size: 22px; font-weight: 600; }
.kpiedit__input { border: 0; border-bottom: 1px dashed var(--ff-sand); background: transparent; font: inherit; font-size: 24px; font-weight: 600; color: var(--ff-ink); width: 140px; padding: 0 2px; }
.kpiedit__input:focus { outline: none; border-bottom-color: var(--ff-coral); }
.kpiedit__icon svg { width: 15px; height: 15px; color: var(--ff-muted-2); }

/* ─── Badges / chips ──────────────────────────────────────────────────── */
.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.badge--ok { background: var(--ff-mint); color: var(--ff-good); }
.badge--almost { background: #E3F0F3; color: var(--ff-teal); }
.badge--low { background: #FCE9D9; color: var(--ff-warn); }
.badge--none { background: var(--ff-cream-50); color: var(--ff-muted-2); border: 1px solid var(--ff-line); }
.chip { display: inline-block; border: 1px solid var(--ff-line); background: var(--ff-cream-50); padding: 2px 8px; border-radius: 6px; font-size: 11.5px; }
.rankpill { display: inline-block; background: var(--ff-navy); color: #fff; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.ean { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; background: var(--ff-cream-50); border: 1px solid var(--ff-line); border-radius: 4px; padding: 1px 6px; color: var(--ff-muted); }
.daychip { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 600; background: var(--ff-cream-50); color: var(--ff-muted-2); border: 1px solid var(--ff-line); margin-right: 2px; }
.daychip--on { background: var(--ff-coral); border-color: var(--ff-coral); color: #fff; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; vertical-align: middle; }
.dot--coral { background: var(--ff-coral); }
.dot--teal { background: var(--ff-teal); }
.dot--live { background: var(--ff-good); }
.live { color: var(--ff-good); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.num--good { color: var(--ff-good); }
.num--warn { color: var(--ff-warn); }
.num--bad { color: var(--ff-bad); }

/* ─── Cards & tables ──────────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--ff-line); border-radius: var(--radius); box-shadow: var(--ff-shadow-sm); overflow: hidden; }
.card--pad { padding: 18px 20px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--ff-line); flex-wrap: wrap; }
.card__head--tools { background: var(--ff-cream-50); }
.card__head--flush { padding: 0 0 12px; border-bottom: 0; }
.card__title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ff-navy); font-weight: 600; }
.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ff-muted-2); font-weight: 500; padding: 12px 14px; border-bottom: 1px solid var(--ff-line); white-space: nowrap; background: #fff; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--ff-cream-50); vertical-align: middle; }
.table tbody tr:hover td { background: var(--ff-mint-soft); }
.table tr.is-selected td { background: var(--ff-cream-50); }
.table tr.is-today .daylink__num { color: var(--ff-coral-dark); }
.table tfoot td { font-weight: 600; background: var(--ff-cream-50); border-top: 1px solid var(--ff-line); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .empty { text-align: center; color: var(--ff-muted-2); padding: 28px; }
.table .note { min-width: 180px; color: var(--ff-muted); }
.th__info svg { width: 13px; height: 13px; vertical-align: -2px; color: var(--ff-muted-2); }
.sub { font-size: 11.5px; color: var(--ff-muted-2); margin-top: 2px; }
.sub.inline { display: inline; margin-left: 4px; }
.product__name { color: var(--ff-navy); text-decoration: none; font-weight: 500; }
.product__name:hover { color: var(--ff-coral-dark); }
.w-chev { width: 36px; }
.w-act { width: 70px; }
.daylink { display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ff-navy); line-height: 1.05; }
.daylink__dow { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ff-muted-2); }
.daylink__num { font-size: 18px; font-weight: 600; }

/* inline editable cell */
.inlineedit { display: inline-flex; align-items: center; gap: 4px; border-bottom: 1px dashed var(--ff-sand); padding-bottom: 1px; }
.inlineedit--set { border-bottom-color: var(--ff-coral); }
.inlineedit--set .inlineedit__input { color: var(--ff-coral-dark); font-weight: 600; }
.inlineedit__unit { color: var(--ff-muted-2); }
.inlineedit__input { border: 0; background: transparent; font: inherit; font-variant-numeric: tabular-nums; text-align: right; width: 84px; color: var(--ff-ink); padding: 2px 0; }
.inlineedit--units .inlineedit__input { width: 56px; }
.inlineedit__input:focus { outline: none; }
.inlineedit__icon svg { width: 13px; height: 13px; color: var(--ff-muted-2); }
.noteinput { border: 0; background: transparent; font: inherit; color: var(--ff-ink); width: 100%; min-width: 160px; padding: 4px 0; border-bottom: 1px dashed transparent; }
.noteinput:hover, .noteinput:focus { border-bottom-color: var(--ff-sand); outline: none; }
.noteinput::placeholder { color: var(--ff-muted-2); }

/* ─── Layout helpers ──────────────────────────────────────────────────── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.split--wide { grid-template-columns: minmax(0, 1fr) 380px; }
.split--equal { grid-template-columns: 1fr 1fr; }
.split--detail { grid-template-columns: minmax(0, 1fr) 380px; }
.section { padding: 14px 0; border-bottom: 1px solid var(--ff-line); }
.section:last-of-type { border-bottom: 0; }
.section__label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ff-muted-2); font-weight: 500; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.section__label svg { width: 14px; height: 14px; }
.daypanel__head { display: flex; align-items: baseline; justify-content: space-between; }
.bigedit { display: flex; align-items: baseline; gap: 6px; border: 1px solid var(--ff-line); border-radius: 10px; padding: 10px 14px; background: var(--ff-cream-50); margin: 0; }
.bigedit__unit { font-size: 22px; font-weight: 600; }
.bigedit__input { border: 0; background: transparent; font: inherit; font-size: 26px; font-weight: 600; color: var(--ff-ink); width: 150px; letter-spacing: -.01em; }
.bigedit__input:focus { outline: none; }
.bigedit__goal { color: var(--ff-muted-2); }
.breakdown { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; }
.breakdown dt { color: var(--ff-muted); }
.breakdown dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.breakdown .total { font-weight: 600; color: var(--ff-navy); border-top: 1px solid var(--ff-line); padding-top: 6px; }
.textarea, .input, .select {
  width: 100%; border: 1px solid var(--ff-line); border-radius: 10px; padding: 9px 12px; font: inherit; color: var(--ff-ink); background: #fff;
}
.textarea:focus, .input:focus, .select:focus { outline: none; border-color: var(--ff-coral); }
.select { width: auto; }
.searchform { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 280px; margin: 0; }
.searchform__icon svg { width: 16px; height: 16px; color: var(--ff-muted-2); }
.searchform__input { flex: 1; border: 1px solid var(--ff-line); border-radius: 10px; padding: 8px 12px; font: inherit; background: #fff; max-width: 420px; }
.searchform__input:focus { outline: none; border-color: var(--ff-coral); }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--ff-muted); text-decoration: none; font-size: 12.5px; }
.toggle__knob { width: 30px; height: 16px; border-radius: 999px; background: var(--ff-sand); position: relative; transition: background .12s; }
.toggle__knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: left .12s; }
.toggle.is-on .toggle__knob { background: var(--ff-coral); }
.toggle.is-on .toggle__knob::after { left: 16px; }

/* product-mix grouping */
.group__row { cursor: pointer; }
.group__row td { background: var(--ff-cream-50); }
.chev svg { width: 16px; height: 16px; color: var(--ff-muted-2); transition: transform .15s; }
.chev.is-open svg { transform: rotate(180deg); }
.mixbar { display: inline-block; width: 60px; height: 6px; background: var(--ff-cream); border-radius: 999px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.mixbar__fill { display: block; height: 100%; background: var(--ff-navy); border-radius: 999px; }

/* chart */
.chart { position: relative; height: 280px; }
.chart canvas { width: 100% !important; height: 100% !important; }
.legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--ff-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw--navy { background: var(--ff-navy); } .sw--teal { background: var(--ff-teal); } .sw--coral { background: var(--ff-coral); } .sw--sand { background: var(--ff-sand); }

/* top list */
.toplist { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.toplist li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--ff-cream-50); }
.toplist__rank { width: 20px; color: var(--ff-muted-2); font-size: 12px; }
.toplist__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.toplist__body .product__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toplist__val { text-align: right; display: flex; flex-direction: column; }
.toplist .empty { color: var(--ff-muted-2); justify-content: center; }

/* product detail */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0 0; }
.fields .span2 { grid-column: span 2; }
.fields dt { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ff-muted-2); margin-bottom: 4px; }
.fields dd { margin: 0; background: var(--ff-cream-50); border: 1px solid var(--ff-line); border-radius: 8px; padding: 9px 12px; overflow-wrap: anywhere; }
.form { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.field__label { display: flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ff-muted-2); margin-bottom: 6px; }
.field__label svg { width: 12px; height: 12px; }
.field__hint { margin: 6px 0 0; font-size: 11.5px; color: var(--ff-muted-2); }
.checkline { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.daypick { display: flex; gap: 6px; }
.daypick__day input { position: absolute; opacity: 0; width: 0; height: 0; }
.daypick__day span { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--ff-cream-50); color: var(--ff-muted-2); border: 1px solid var(--ff-line); cursor: pointer; }
.daypick__day input:checked + span { background: var(--ff-coral); border-color: var(--ff-coral); color: #fff; }

/* ranking */
.ranklist { list-style: none; margin: 12px 0 0; padding: 6px; min-height: 240px; max-height: 60vh; overflow: auto; border: 1px dashed var(--ff-sand); border-radius: 10px; display: flex; flex-direction: column; gap: 4px; background: var(--ff-cream-50); counter-reset: rank; }
.ranklist--pool { border-style: solid; border-color: var(--ff-line); background: #fff; }
.ranklist.is-over { border-color: var(--ff-coral); background: var(--ff-coral-soft); }
.ranklist__item { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--ff-line); border-radius: 8px; padding: 8px 10px; cursor: grab; }
.ranklist__item.is-dragging { opacity: .4; }
.ranklist__item .ranklist__body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ranklist__item strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranklist__grip svg { width: 16px; height: 16px; color: var(--ff-muted-2); }
.ranklist__num { width: 22px; height: 22px; border-radius: 50%; background: var(--ff-navy); color: #fff; font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.ranklist__num:empty::before { counter-increment: rank; content: counter(rank); }
.ranklist__btn { border: 1px solid var(--ff-line); background: #fff; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; color: var(--ff-teal); font-size: 15px; line-height: 1; }
.ranklist__btn:hover { border-color: var(--ff-coral); color: var(--ff-coral-dark); }
.ranklist__empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 12px; text-align: center; color: var(--ff-muted); }
.ranklist__emptyicon svg { width: 40px; height: 40px; color: var(--ff-sand); }
.savebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

.errorbox { background: var(--ff-cream-50); border: 1px solid var(--ff-line); border-radius: 8px; padding: 12px; white-space: pre-wrap; font-size: 12px; }

/* ─── Login ───────────────────────────────────────────────────────────── */
body.login { display: grid; place-items: center; min-height: 100vh; background: var(--ff-cream); }
.login__card { background: #fff; border: 1px solid var(--ff-line); border-radius: 18px; padding: 40px 44px; width: min(520px, 92vw); box-shadow: var(--ff-shadow-md); display: flex; flex-direction: column; gap: 14px; }
.login__logo { height: 34px; width: auto; align-self: flex-start; }
.login__title { font-size: 34px; letter-spacing: -.02em; }
.login__title span { color: var(--ff-coral); }
.login__lead { margin: 0; color: var(--ff-muted); line-height: 1.5; }
.login__actions { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.login__actions form { margin: 0; display: flex; }
.login__actions form .btn { flex: 1; }
.login__hint { margin: 0; font-size: 12px; color: var(--ff-muted-2); line-height: 1.5; }

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .kpis--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split--wide, .split--detail { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  body.app { flex-direction: column; }
  .sidebar { width: auto; flex: none; height: auto; position: static; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 8px 10px; }
  .nav__group { display: none; }
  .nav__link { border-left: 0; border-radius: 8px; padding: 7px 10px; }
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .kpis--3, .kpis--4, .kpis--5 { grid-template-columns: 1fr 1fr; }
  .split--equal { grid-template-columns: 1fr; }
}

/* ─── Compact week table (Revenue) so it fits beside the day panel ─────── */
.table--week th, .table--week td { padding: 10px 9px; }
.table--week .inlineedit__input { width: 70px; }
.table--week .note { min-width: 130px; }
.table--week .noteinput { min-width: 120px; }
.split { grid-template-columns: minmax(0, 1fr) 330px; }
@media (max-width: 1280px) { .split { grid-template-columns: 1fr; } }
