/* Back-office views (branch tablet, head-office dashboard) for the Lindgrün demo. */
@font-face { font-family: "DM Serif Display"; src: url("../fonts/dm-serif-display-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/dm-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }

:root {
  --bg: #eef0ea;
  --paper: #fffefb;
  --green: #1f3a2e;
  --green-2: #2e5243;
  --sage: #dfe6dc;
  --rose: #b4566a;
  --ink: #1c1c1a;
  --soft: #5b5d55;
  --muted: #8a8c84;
  --line: rgb(28 28 26 / .1);
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; }
.demo-band { background: var(--ink); color: #e8e4dc; font-size: 13px; text-align: center; padding: 7px 16px; }
.demo-band a { color: #fff; }

.app-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px clamp(16px, 3vw, 32px); background: var(--paper); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.app-brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.app-brand .mark { font: 400 26px/1 var(--serif); color: var(--green); }
.app-brand .where { font-weight: 600; color: var(--soft); }
.app-nav { display: flex; flex-wrap: wrap; gap: 6px; background: var(--bg); padding: 4px; border-radius: 18px; }
.app-nav a { text-decoration: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--soft); }
.app-nav a[aria-current="page"] { background: var(--green); color: #fff; }
.app-date { font-weight: 600; color: var(--green); }

.panel { background: var(--paper); border-radius: 18px; padding: 22px; border: 1px solid var(--line); min-width: 0; }
.panel h1, .panel h2 { font-family: var(--serif); font-weight: 400; color: var(--green); margin: 0; }
.panel h1 { font-size: 30px; line-height: 1.1; }
.panel h2 { font-size: 22px; line-height: 1.15; }
.muted { color: var(--soft); font-size: 14.5px; margin: 6px 0 16px; }
.btn { display: inline-block; border: 0; background: var(--green); color: #fff; font: 600 15px var(--sans); padding: 13px 20px; border-radius: 999px; cursor: pointer; text-align: center; }
.btn-wide { width: 100%; }

/* Branch tablet */
.tablet { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; padding: 20px clamp(16px, 3vw, 32px) 40px; align-items: start; }
.orders-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 4px; }
.tabs button { border: 0; background: none; padding: 8px 18px; border-radius: 999px; font: 600 15px var(--sans); color: var(--soft); }
.tabs [aria-selected="true"] { background: var(--green); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.stat { border-radius: 14px; padding: 12px 16px; background: var(--bg); display: flex; align-items: baseline; gap: 10px; }
.stat strong { font: 400 30px/1 var(--serif); }
.stat span { color: var(--soft); font-weight: 600; }
.stat.s0 strong { color: var(--rose); }
.stat.s1 strong { color: var(--green); }
.stat.s2 strong { color: #3c7a52; }
.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.order { display: grid; grid-template-columns: 74px 1fr auto; gap: 16px; align-items: center; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); border-left: 5px solid var(--rose); background: #fff; }
.order.s1 { border-left-color: var(--green); }
.order.s2 { border-left-color: #3c9a5d; opacity: .6; }
.o-time { font-weight: 700; font-size: 14px; color: var(--soft); line-height: 1.3; }
.o-main strong { display: block; font-size: 17px; }
.o-main em { font-style: normal; background: var(--bg); border-radius: 6px; padding: 1px 7px; font-size: 13px; margin-left: 4px; }
.o-main span { color: var(--soft); font-size: 15px; }
.o-main q { display: block; font-size: 14px; color: var(--green); margin-top: 4px; font-style: italic; }
.o-act { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.badge-st { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); }
.o-act button { border: 1.5px solid var(--green); background: none; color: var(--green); border-radius: 999px; padding: 9px 14px; font: 600 14px var(--sans); cursor: pointer; white-space: nowrap; }
.order.s0 .o-act button { background: var(--green); color: #fff; }
.stock { list-style: none; margin: 0 0 18px; padding: 0; border-top: 1px solid var(--line); }
.stock li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.stock strong { display: block; font-size: 15.5px; }
.stock span { color: var(--soft); font-size: 13.5px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font: 600 20px var(--sans); cursor: pointer; color: var(--green); }
.stepper output { min-width: 32px; text-align: center; font-weight: 700; font-size: 17px; }
.sent { margin: 12px 0 0; color: #3c7a52; font-weight: 600; }

/* Head-office dashboard */
.dash { padding: 20px clamp(16px, 3vw, 32px) 40px; display: grid; gap: 20px; }
.dash-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.dash-head h1 { font: 400 34px/1.1 var(--serif); color: var(--green); margin: 0; }
.range { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.range button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font: 600 14px var(--sans); color: var(--soft); cursor: pointer; }
.range button[aria-pressed="true"] { background: var(--green); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.kpi span { display: block; color: var(--soft); font-size: 14px; font-weight: 600; }
.kpi strong { display: block; font: 400 38px/1.1 var(--serif); color: var(--ink); margin: 6px 0 4px; }
.kpi small { color: var(--soft); font-size: 13.5px; }
.kpi small b { color: #2f6b45; font-weight: 700; }
.kpi small b.up { color: #9b3a22; }
.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.chart { position: relative; margin-top: 14px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { font: 500 12px var(--sans); fill: var(--muted); }
.chart .bar { fill: var(--green); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar, .chart .bar.hl { fill: var(--rose); }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; padding: 7px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .12s; }
.tip.show { opacity: 1; }
.hbars { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.hbars li { display: grid; grid-template-columns: 110px 1fr 44px; gap: 10px; align-items: center; font-size: 14.5px; }
.hbars .track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.hbars .fill { height: 100%; background: var(--green); border-radius: 0 4px 4px 0; }
.hbars b { text-align: right; font-weight: 700; }
.table-wrap { overflow-x: auto; }
.table-wrap table { min-width: 560px; }
table.branches { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
.branches th { text-align: left; color: var(--soft); font-weight: 600; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.branches td { padding: 12px 0; border-bottom: 1px solid var(--line); }
.branches td.num, .branches th.num { text-align: right; font-variant-numeric: tabular-nums; }
.flag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #8a5a00; background: #fbf0d9; padding: 3px 8px; border-radius: 999px; }
.flag::before { content: "!"; font-weight: 800; }


/* Inventory */
.stock-app { padding: 20px clamp(16px, 3vw, 32px) 40px; display: grid; gap: 18px; }
.stock-head .range { flex-wrap: wrap; }
.stock-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.stock-kpis { display: flex; gap: 12px; flex-wrap: wrap; }
.stock-kpis div { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; min-width: 150px; }
.stock-kpis span { display: block; font-size: 13px; color: var(--soft); font-weight: 600; }
.stock-kpis strong { font: 400 24px/1.2 var(--serif); }
.stock-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; align-items: start; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; font: 600 13.5px var(--sans); color: var(--soft); cursor: pointer; }
.chips button b { margin-left: 4px; color: var(--ink); }
.chips button[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.chips button[aria-pressed="true"] b { color: #fff; }
.stock-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 680px; }
.stock-table th { text-align: left; color: var(--soft); font-weight: 600; font-size: 12.5px; padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); }
.stock-table td { padding: 11px 8px 11px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.stock-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stock-table td strong { display: block; font-weight: 600; }
.stock-table td small { color: var(--muted); font-size: 12.5px; }
.qty { font-size: 16px; }
.fresh { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.fresh-bar { width: 60px; height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.fresh-bar i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.fresh-bar i.warn { background: #c26a1f; }
.fresh span, .fresh-na { color: var(--soft); font-size: 13px; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 3px 9px 3px 6px; border-radius: 999px; white-space: nowrap; }
.st i { font-style: normal; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; color: #fff; }
.st-ok { background: #e6f0e8; color: #2f6b45; } .st-ok i { background: #3c8a57; }
.st-low { background: #fbf0d9; color: #8a5a00; } .st-low i { background: #b07a12; }
.st-expire { background: #f9e3dc; color: #9b3a22; } .st-expire i { background: #c0502e; }
.book { display: inline-flex; gap: 6px; }
.book button { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 6px 9px; font: 600 12.5px var(--sans); cursor: pointer; color: var(--green); white-space: nowrap; }
.book button:hover { border-color: var(--green); }
.suggest h2 { margin-bottom: 4px; }
.sug-list { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--line); }
.sug-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.sug-list strong { display: block; font-size: 15px; }
.sug-list small { color: var(--muted); font-size: 12.5px; }
.sug-list b { white-space: nowrap; color: var(--green); }
.sug-sum { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 16px; color: var(--soft); font-size: 14px; }
.sug-sum strong { color: var(--ink); font-size: 17px; }
.how { color: var(--muted); font-size: 12px; margin: 14px 0 0; line-height: 1.5; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.empty { color: var(--soft); text-align: center; padding: 18px 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 60; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Dashboard: inventory section */
.dash-sub { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.dash-sub h2 { font: 400 28px/1.1 var(--serif); color: var(--green); margin: 0; }

@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, 1fr); } .dash-grid, .tablet, .stock-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .order { grid-template-columns: 1fr; }
  .o-act { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .o-act button { white-space: normal; }
  .stat { flex-direction: column; gap: 2px; padding: 10px; }
  .kpis { grid-template-columns: 1fr; }
  .hbars li { grid-template-columns: 90px 1fr 36px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
