/* The dashboard's panels. Loaded by the till (app/index.html) and by the standalone
   page, which imports this file and then paints its own navy ground over the chrome.
   Both draw the same markup from src/dashview.mjs, so the classes live in one place.

   Every rule is scoped to .dashboard. The two stylesheets share twenty class names — .card,
   .big, .sub, .tot among them — and unscoped, the till's rules land on the dashboard's
   markup: .tot is the order-total panel in style.css, which is why the dashboard's
   totals row used to turn up wearing a white box. */
:root{
  /* the POS palette, verbatim — the two apps are one product */
  /* --ground is the page. --cream stays the light ink on navy. */
  --ground:#FFFFFF;
  --cream:#F9F4EA; --surface:#FCF9F3; --white:#fff; --line:#F0E7D9; --line2:#EFE6D8; --line3:#E3D6C2;
  --navy:#133755; --navy2:#234F70; --sec:#5D6E7D; --mut:#5D6E7D; --sub:#5D6E7D; --lgt:#5D6E7D;   /* text greys that clear 4.5:1 */
  --orange:#F0521B; --orange2:#FCA13A; --grad:linear-gradient(135deg,#FCA13A,#F0521B);
  --action:var(--grad); --action-2:var(--grad); --accent-ink:var(--orange);   /* the brand gradient under a label; orange text (owner's choice) */
  --green:#2F6B4A; --gold:#E0A34D; --red:#F4552B; --peach:#FCE8D8;
  /* One blue, and it is the app's own: the ramp lightens from the navy in the sidebar,
     so a chart reads as part of the till rather than a chart from somewhere else.
     Orange is never in here — on this page it only ever means "press me". */
  --d1:#133755; --d2:#35618A; --d3:#7FA2BF; --d4:#C2D5E1;
  --well:#F3EADC;
}
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:Inter,-apple-system,'Helvetica Neue',Arial,sans-serif;background:var(--ground);color:var(--navy);-webkit-font-smoothing:antialiased}
button{font:inherit;color:inherit;border:0;background:none;cursor:pointer}
#boot{position:fixed;inset:0;display:grid;place-items:center;background:var(--ground);z-index:99}
#boot .box{max-width:640px;padding:28px;text-align:center}
#boot h1{font-size:19px;font-weight:700;margin:0 0 6px}
#boot p{margin:0;color:var(--mut);font-size:13.5px}
#boot pre{white-space:pre-wrap;word-break:break-word;background:#fff;border:1px solid #F7C9AC;color:#A33F13;border-radius:12px;padding:14px;text-align:left;font:12px/1.6 ui-monospace,Menlo,monospace}

.dashboard .wrap{max-width:1440px;margin:0 auto;padding:20px}
.dashboard .top{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:18px}
.dashboard .brand{display:flex;align-items:center;gap:10px;font-size:19px;font-weight:700;letter-spacing:.02em}
.dashboard .brand i{width:28px;height:28px;border-radius:9px;background:var(--grad);display:grid;place-items:center;flex-shrink:0}
.dashboard .brand small{display:block;font-size:12px;font-weight:500;color:var(--sub);letter-spacing:0}
.dashboard .ranges{display:flex;gap:6px;flex-wrap:wrap}
.dashboard .rg{height:44px;padding:0 14px;border-radius:999px;background:#fff;border:1px solid var(--line);font-size:12.5px;font-weight:600;color:var(--sec);white-space:nowrap}
.dashboard .rg.on{background:var(--navy);border-color:var(--navy);color:var(--cream);font-weight:700}
.dashboard .dates{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--sub)}
.dashboard .dates input{height:36px;border:1px solid var(--line);border-radius:10px;padding:0 10px;font:inherit;font-size:12.5px;background:#fff;color:var(--navy)}

.dashboard .grid{display:grid;gap:14px}
/* minmax(0,…), not a bare fr: a bare fr will not go narrower than its widest line, so one
   long dish name pushed the whole page past the screen and it slid sideways under a finger */
.dashboard .c3{grid-template-columns:repeat(3,minmax(0,1fr))}
.dashboard .c2{grid-template-columns:repeat(2,minmax(0,1fr))}
.dashboard .c21{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
/* A card is white and the tiles inside it are cream — the way round every other screen
   in the till does it. This page had it inverted, so each inner tile read as a hole
   punched in the card rather than a thing sitting on it. */
.dashboard .card{background:var(--white);border:1px solid var(--line2);border-radius:16px;padding:16px}
.dashboard .h{font-size:14px;font-weight:700;margin-bottom:12px}
.dashboard .sub{color:var(--sub)} .dashboard .mut{color:var(--mut)} .dashboard .b{font-weight:700}
.dashboard .big{font-size:33px;font-weight:700;letter-spacing:-.025em;line-height:1.05;color:var(--navy);font-variant-numeric:tabular-nums}
.dashboard .unit{font-size:14px;font-weight:600;color:var(--mut);margin-left:5px}
.dashboard .kv{display:flex;justify-content:space-between;gap:10px;padding:6px 0;font-size:13px}
.dashboard .kv .k{color:var(--sec)} .dashboard .kv .v{font-weight:600;font-variant-numeric:tabular-nums}
.dashboard .kv.total{border-top:1px solid var(--line);margin-top:6px;padding-top:10px;font-weight:700}
.dashboard .split{height:10px;border-radius:8px;overflow:hidden;display:flex;margin:14px 0 8px;background:var(--line2)}
.dashboard .split i{display:block;height:100%}
.dashboard .legend{display:flex;justify-content:space-between;font-size:12px}

.dashboard .stat{background:var(--surface);border:1px solid var(--line);border-radius:13px;padding:13px;text-align:center}
.dashboard .stat .n{font-size:22px;font-weight:700;letter-spacing:-.02em;line-height:1}
.dashboard .stat .l{font-size:12px;color:var(--mut);margin-top:5px;line-height:1.4}
.dashboard .stats{display:grid;gap:9px}
.dashboard .s2{grid-template-columns:1fr 1fr} .dashboard .s4{grid-template-columns:repeat(4,1fr)}

.dashboard .rank{display:flex;align-items:center;gap:11px;padding:9px 0;border-top:1px solid #F6F0E6;font-size:13px}
.dashboard .rank:first-of-type{border-top:0}
.dashboard .rank .i{width:20px;height:20px;border-radius:999px;background:#EDE6DA;display:grid;place-items:center;font-size:12px;font-weight:700;color:var(--sec);flex-shrink:0}
.dashboard .rank .n{flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dashboard .rank .q{width:54px;text-align:right;color:var(--mut);font-variant-numeric:tabular-nums}
.dashboard .rank .r{width:88px;text-align:right;font-weight:700;font-variant-numeric:tabular-nums}

.dashboard svg.chart{display:block;width:100%;height:auto;overflow:visible}
.dashboard .tick{font-size:12px;font-weight:600;fill:var(--mut)}
.dashboard .axis{stroke:var(--line2);stroke-width:1}
.dashboard .chartwrap{position:relative}
.dashboard .chartcard{display:flex;flex-direction:column}
.dashboard .chartcard .chartwrap{margin-top:auto}
.dashboard .hit{cursor:pointer}
.dashboard .hit .hl{stroke:var(--navy);stroke-width:1;stroke-dasharray:3 3;opacity:0}
.dashboard .hit .hd{fill:#fff;stroke:var(--d1);stroke-width:2.2;opacity:0}
.dashboard .hit .hb{fill:var(--navy);opacity:0}
.dashboard .hit.on .hl,.dashboard .hit.on .hd{opacity:1}
.dashboard .hit.on .hb{opacity:.16}
.dashboard .tip{position:absolute;pointer-events:none;transform:translateX(-50%);background:var(--navy);color:var(--cream);
  padding:8px 12px;border-radius:10px;font-size:12px;font-weight:600;white-space:nowrap;opacity:0;transition:opacity .1s;
  box-shadow:0 6px 16px rgba(19,55,85,.14);z-index:5}
.dashboard .tip.show{opacity:1}
.dashboard .hint{font-size:12px;color:var(--lgt);text-align:right;margin-top:4px}
.dashboard .toggle{display:flex;gap:4px;background:#fff;border:1px solid var(--line);border-radius:999px;padding:3px}
.dashboard .toggle button{height:26px;padding:0 12px;border-radius:999px;font-size:12px;font-weight:600;color:var(--sec)}
.dashboard .toggle button.on{background:var(--navy);color:var(--cream);font-weight:700}
.dashboard .empty{color:var(--lgt);font-size:12.5px;text-align:center;padding:22px 0}
.dashboard .foot{margin-top:20px;padding:16px;border-radius:14px;background:var(--surface);border:1px solid var(--line2);font-size:12px;line-height:1.6;color:var(--mut)}

@media (max-width:1080px){ .dashboard .c3{grid-template-columns:repeat(2,minmax(0,1fr))} .dashboard .c21{grid-template-columns:minmax(0,1fr)} }
/* Inside the till (.dashboard.col) the sidebar takes 212px, so the same step comes 212px
   sooner — a 1280-wide Sunmi otherwise got three cards to a row in a 1068 column. */
@media (max-width:1292px){ .dashboard.col .c3{grid-template-columns:repeat(2,minmax(0,1fr))} .dashboard.col .c21{grid-template-columns:minmax(0,1fr)} }
@media (max-width:760px){
  .dashboard .wrap{padding:14px}
  .dashboard .c3,.dashboard .c2,.dashboard .c21{grid-template-columns:minmax(0,1fr)}
  .dashboard .tick{font-size:13px}
  .dashboard .s4{grid-template-columns:1fr 1fr}
  .dashboard .big{font-size:30px}
  .dashboard .top{gap:12px}
  .dashboard .ranges{width:100%;overflow-x:auto;padding-bottom:2px}
  .dashboard .rank .q{width:44px} .dashboard .rank .r{width:76px}
}

/* view-more + the product breakdown table */
/* a way to another view, not the point of the page: the till's ordinary pill */
.dashboard .more{height:28px;padding:0 12px;border-radius:999px;background:var(--white);border:1px solid var(--line3);color:var(--navy);font-size:12px;font-weight:600;white-space:nowrap}
.dashboard .tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.dashboard .findbox{flex:1;min-width:180px;height:38px;border:1px solid var(--line);border-radius:11px;padding:0 13px;font:inherit;font-size:13px;background:#fff;color:var(--navy)}
.dashboard .findbox:focus{border-color:var(--orange)}
.dashboard .tablewrap{overflow-x:auto}
.dashboard .trow{display:grid;grid-template-columns:34px minmax(190px,1fr) 130px 68px 84px 110px 110px;
  align-items:center;gap:10px;padding:10px 4px;border-top:1px solid #F6F0E6;font-size:13px}
.dashboard .trow.thead{border-top:0;padding-top:0;font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--lgt)}
.dashboard .trow.tfoot{border-top:2px solid var(--navy);font-weight:700;font-size:13.5px}
.dashboard .trow.zero{opacity:.5}
.dashboard .trow .c-q,.dashboard .trow .c-a,.dashboard .trow .c-r{text-align:right;font-variant-numeric:tabular-nums}
.dashboard .th{padding:0;font:inherit;color:inherit;text-align:left;letter-spacing:.06em;text-transform:uppercase}
.dashboard .th.c-q,.dashboard .th.c-r{text-align:right}
.dashboard .th.on{color:var(--accent-ink)}
.dashboard .th:hover{color:var(--sec)}
.dashboard .chip{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:999px;background:var(--peach);color:var(--orange);font-size:12px;font-weight:700}
.dashboard .chip.off{background:#F6E3DF;color:var(--red)}
.dashboard .c-s{position:relative;height:16px;background:var(--line2);border-radius:8px;overflow:hidden;display:flex;align-items:center}
.dashboard .c-s i{position:absolute;left:0;top:0;bottom:0;background:var(--d3);border-radius:999px}
.dashboard .c-s em{position:relative;font-style:normal;font-size:12px;font-weight:700;color:var(--navy);padding-left:7px}
.dashboard .trow.thead .c-s,.dashboard .trow.tfoot .c-s{background:none;height:auto}
@media (max-width:760px){
  .dashboard .trow{grid-template-columns:26px 1fr 62px 96px;gap:8px;font-size:12.5px}
  .dashboard .trow .c-c,.dashboard .trow .c-a,.dashboard .trow .c-s{display:none}
}


/* the only shapes that stay circular: counts, dots, switches and progress bars */
.dashboard .split,.dashboard .split i,.dashboard .c-s,.dashboard .c-s i,.dashboard .rank .i{border-radius:999px}

/* Orange is the colour of an action. Nothing else on this page is one, which is why the
   rank numbers and the size chips are stone rather than peach. */
.dashboard .rg.on{background:var(--action);border-color:transparent;color:#fff}
.dashboard .toggle button.on{background:var(--action);color:#fff}
.dashboard .brand i{background:var(--grad)}
.dashboard .findbox:focus{border-color:var(--orange)}
.dashboard .th.on{color:var(--accent-ink)}
.dashboard .rank .i{background:var(--well);color:var(--sec)}
.dashboard .chip{background:var(--well);color:var(--sec)}

/* The data ramp, named once here and used by the markup through these few hooks, so a
   chart's colour is never typed into a template. s1..s4 paint the SVG gradient stops. */
.dashboard .s1{stop-color:var(--d1)} .dashboard .s2{stop-color:var(--d2)}
.dashboard .s3{stop-color:var(--d3)} .dashboard .s4{stop-color:var(--d4)}
.dashboard .split i.t1{background:var(--d1)} .dashboard .split i.t3{background:var(--d3)}
.dashboard .legend .k1{color:var(--d1)} .dashboard .legend .k3{color:var(--d3)}

/* numbers line up in columns — that alone reads as careful */
.dashboard .kv .v,.dashboard .stat .n,.dashboard .trow .c-q,.dashboard .trow .c-a,.dashboard .trow .c-r,.dashboard .big{font-variant-numeric:tabular-nums}
.dashboard .big{color:var(--green)}

/* money in, money off — one rule, applied everywhere a Baht figure appears */
.dashboard .money-in{color:var(--green)}
.dashboard .money-off{color:var(--red)}
.dashboard .stat .n.money-in,.dashboard .stat .n.money-off{font-weight:700}

