/* One — Wiseo-style colours. Existing layout and typography preserved. */
@font-face {
  font-family: "Quicksand"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/fonts/quicksand-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Quicksand"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("/fonts/quicksand-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font: "Quicksand", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-title: 23px; --fs-section: 14.5px; --fs-body: 14px; --fs-cell: 13.5px;
  --fs-small: 13px; --fs-meta: 12.5px; --fs-th: 11.5px; --fs-kpi: 23px;

  /* Wiseo's own values, taken from its stylesheet rather than matched by eye.
     The two are the same business and were within a shade of each other
     anyway; this makes them the same colours, so a man moving between the
     inbox and the orders screen is not told by the page that he has changed
     product. */
  --bg: #F5F6F8; --surface: #FFFFFF; --subtle: #F8F9FB;
  --hover: #F2F4F7; --lit: rgba(2, 206, 171, .10);
  --line: #E6E8EC; --line-strong: #D5D9E0;
  --text: #0B1628; --text-2: #3A4556; --muted: #697386; --placeholder: #9AA3B2;
  /* The one place One keeps its own answer: a table row is the data, not a
     note about it, so it is drawn in the full ink. Wiseo has no forty-row
     grids to make that decision for it. */
  --grid-text: #0B1628;

  /* Navy controls with white text. */
  --brand-50: #EAF0F7; --brand-100: #CDDBEC; --brand-300: #809ABA;
  --brand: #082552; --brand-600: #0E3270; --brand-700: #082552; --brand-800: #0B1628;
  --logo-navy: #032C5A;
  /* the two names the rest of this file presses and follows */
  --navy: #082552; --navy-600: #0E3270; --navy-50: #EEF2F9;
  /* Wiseo's mint, and the dark one it uses where mint on white would not be
     read. */
  --teal: #02CEAB; --teal-600: #007A65; --teal-50: #E5F9F4;
  --ring: rgba(2, 206, 171, .28);

  /* Wiseo-style navy navigation, muted text and a logo-inspired teal selection. */
  --side-bg: #082552; --side-bg-2: #0B1628;
  --side-text: rgba(226, 236, 255, .66); --side-strong: #FFFFFF; --side-dim: rgba(226, 236, 255, .42);
  --side-hover: rgba(255, 255, 255, .06); --side-line: rgba(255, 255, 255, .09);
  --side-chip: rgba(255, 255, 255, .08); --side-on: rgba(0, 184, 179, .14);
  --side-accent: #00B8B3;

  /* status: soft tint, dark text of the same hue */
  --ok-bg: #E8F3ED; --ok: #2C6A4A; --warn-bg: #FAF0D8; --warn: #876520;
  --bad-bg: #FEE4E2; --bad: #B42318; --info-bg: #EAF0FA; --info: #365FA0;
  --violet-bg: #EDE9FE; --violet: #5B21B6; --idle-bg: #EAF0F7; --idle: #46566C;
  --green: #0B6B31;

  --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(11, 36, 66, .05);
  --shadow: 0 1px 2px rgba(11, 36, 66, .04), 0 2px 8px -2px rgba(11, 36, 66, .06);
  --shadow-lg: 0 12px 32px rgba(11, 36, 66, .12), 0 2px 6px rgba(11, 36, 66, .06);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --side: 204px; --top: 54px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-body)/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -.02em; }
h1 { font-size: var(--fs-title); font-weight: 650; letter-spacing: -.025em; }
h2 { font-size: var(--fs-section); font-weight: 600; }
h3 { font-size: var(--fs-body); font-weight: 600; }
p { margin: 0 0 var(--s2); }
a { color: var(--teal-600); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
::selection { background: var(--lit); color: var(--text); }
.muted { color: var(--muted); }
.mono { font: 500 var(--fs-meta)/1.4 var(--mono); white-space: nowrap; }
.spacer { flex: 1 1 auto; }
.hint { font-size: var(--fs-meta); color: var(--muted); }
.note { background: var(--teal-50); border: 1px solid #D3DFF1; color: var(--text-2);
  border-radius: var(--r); padding: 10px 12px; font-size: var(--fs-small); }
.err { background: var(--bad-bg); color: var(--bad); border-radius: var(--r-sm);
  padding: 9px 11px; font-size: var(--fs-small); font-weight: 500; }
.boot { display: grid; place-items: center; height: 100vh; gap: 14px; color: var(--muted); }
.boot img { width: 120px; }

/* ---------------------------------------------------------------- sign in */
.login { display: grid; place-items: center; min-height: 100vh; padding: 24px;
  background: radial-gradient(900px 420px at 50% -8%, #EAF0FA 0%, var(--bg) 62%); }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 32px 28px; width: 100%; max-width: 380px; }
.login-card img { width: 190px; display: block; margin: 0 auto 4px; }
.login-card .sub { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: var(--fs-small); }

/* ---------------------------------------------------------------- shell */
.shell { position: relative; display: grid; min-height: 100vh;
  grid-template-columns: var(--side-w, var(--side)) minmax(0, 1fr); }

/* drag the edge of the menu to widen it; double-click to put it back */
.side-grip { position: absolute; top: 0; bottom: 0; left: var(--side-w, var(--side));
  width: 9px; margin-left: -5px; cursor: col-resize; z-index: 40; }
.side-grip::after { content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px;
  background: transparent; transition: background .12s; }
.side-grip:hover::after, body.resizing .side-grip::after { background: var(--teal); }
.shell.narrow .side-grip { display: none; }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none; }
.side { background: linear-gradient(180deg, var(--side-bg), var(--side-bg-2));
  border-right: 1px solid var(--side-line);
  color: var(--side-text); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 14px 10px; min-width: 0; }
.side-top { display: flex; align-items: center; gap: 9px; padding: 2px 6px 12px; flex: 0 0 auto; }
.side-top img { width: 26px; height: 26px; border-radius: 7px; }
.side-top .side-mark { display: none; }
.side-top b { color: var(--side-strong); font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.side-top .side-wm { width: auto; height: 22px; border-radius: 5px; background: #fff;
  padding: 3px 7px; box-sizing: content-box; }
.side-collapse { width: 26px; height: 26px; padding: 0; border: 0; background: none;
  color: var(--side-dim); border-radius: var(--r-sm); display: grid; place-items: center; }
.side-collapse:hover { background: var(--side-hover); color: var(--side-strong); }

.side-search { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; padding: 7px 10px;
  border-radius: 8px; border: 1px solid var(--side-line); background: rgba(255, 255, 255, .04);
  color: var(--side-text); font-size: var(--fs-small); cursor: pointer; width: calc(100% - 4px); }
.side-search:hover { background: var(--side-chip); color: var(--side-strong); }
.side-search kbd { margin-left: auto; font: 600 10.5px var(--font); background: var(--side-chip);
  border-radius: 5px; padding: 2px 5px; color: var(--side-dim); }

.side nav { flex: 1; overflow-y: auto; margin: 0 -2px; padding: 0 2px 8px; display: grid;
  align-content: start; gap: 1px; }
.side .group { font-size: var(--fs-th); text-transform: uppercase; letter-spacing: .06em;
  color: var(--side-dim); padding: 14px 10px 5px; font-weight: 600; }
.side .group:first-child { padding-top: 2px; }
.side nav > a { position: relative; display: flex; align-items: center; gap: 10px; height: 31px;
  padding: 0 10px; border-radius: 8px; color: var(--side-text);
  font-size: var(--fs-cell); font-weight: 500; white-space: nowrap;
  transition: background .12s, color .12s; }
.side nav > a:hover { background: var(--side-on); color: var(--side-strong); text-decoration: none; border-radius: 8px; }
.side nav > a.on { background: var(--side-on); color: var(--side-strong); font-weight: 600;
  box-shadow: none; }
.side nav > a.on::before { content: none; }
.side nav > a > span:first-child { width: 17px; height: 17px; flex: 0 0 auto; display: grid;
  place-items: center; opacity: .9; }
.side nav > a.on > span:first-child { color: var(--side-accent); opacity: 1; }
.side a .pill { margin-left: auto; background: var(--side-accent); color: #062833; border-radius: 999px;
  min-width: 19px; height: 18px; display: grid; place-items: center; padding: 0 5px;
  font-size: 11.5px; font-weight: 700; }

/* the sections of the module you are in, opened underneath it */
.side .sub { margin: 2px 0 4px 20px; padding-left: 12px;
  border-left: 1px solid var(--side-line); display: grid; gap: 1px; }
.side .sub a { display: flex; align-items: center; height: 29px; padding: 0 9px; border-radius: var(--r-sm);
  font-size: var(--fs-small); color: var(--side-text); white-space: nowrap; }
.side .sub a:hover { background: var(--side-on); color: var(--side-strong); text-decoration: none; }
.side .sub a.on { background: var(--side-on); color: var(--side-strong); font-weight: 600; }
.side .sub a i { width: 5px; height: 5px; border-radius: 50%; background: var(--side-accent);
  margin-right: 8px; opacity: 0; flex: 0 0 auto; }
.side .sub a.on i { opacity: 1; }

/* the person at the foot, boxed the way Wiseo boxes theirs */
.side-foot { border: 1px solid var(--side-line); background: rgba(255, 255, 255, .03);
  border-radius: 10px; padding: 8px; margin-top: 8px;
  display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.side-foot .av { width: 28px; height: 28px; border-radius: 8px; background: var(--side-chip);
  color: var(--side-strong); display: grid; place-items: center; font: 600 11px var(--font); flex: 0 0 auto; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot b { display: block; color: var(--side-strong); font-size: var(--fs-cell); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot span { display: block; font-size: 12px; color: var(--side-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot button { width: 28px; height: 28px; padding: 0; border: 0; background: none;
  color: var(--side-dim); border-radius: var(--r-sm); flex: 0 0 auto; }
.side-foot button:hover { background: var(--side-hover); color: var(--side-strong); }

/* narrow: icons only. A column of twenty icons with nothing else to read, so
   everything here is about telling one icon from the next: even tiles, a rule
   between the groups, and one unmistakable mark for the page you are on. */
.shell.narrow { grid-template-columns: 56px minmax(0, 1fr); }
.shell.narrow .side { padding: 14px 8px; align-items: stretch; }
.shell.narrow .side-top { flex-direction: column; gap: 8px; justify-content: center; padding: 2px 0 12px; }
.shell.narrow .side-top .side-mark { display: block; }
.shell.narrow .side-top b, .shell.narrow .side-top .side-wm, .shell.narrow .side-top .spacer, .shell.narrow .side-search span,
.shell.narrow .side-search kbd, .shell.narrow .side .sub,
.shell.narrow .side-foot .who { display: none; }

/* The label is the SECOND span, and that is how it has to be addressed. Hiding
   :last-child instead leaves the label showing on exactly the items that carry
   a count, because refreshBadges() appends the pill after it - which is why the
   collapsed rail used to read "Expo..." next to the rupee icon. */
.shell.narrow .side nav > a > span:nth-child(2) { display: none; }

.shell.narrow .side-search { justify-content: center; padding: 0; height: 34px; margin: 0 0 8px; width: 100%; }

.shell.narrow .side nav { gap: 2px; }
.shell.narrow .side nav > a { justify-content: center; padding: 0; gap: 0; height: 34px; border-radius: 9px; }
.shell.narrow .side nav > a > span:first-child { width: 18px; height: 18px; opacity: .72; }
.shell.narrow .side nav > a:hover > span:first-child { opacity: 1; }

/* A group heading has no room for its words at this width, so it becomes the
   hairline that keeps one group of icons from running into the next. */
.shell.narrow .side .group { height: 1px; padding: 0; margin: 5px 10px; font-size: 0;
  background: var(--side-line); }
.shell.narrow .side .group:first-child { display: none; }

/* Where you are: the tile, the icon in the accent colour, and a bar on the edge
   that can be found by running an eye down the rail without reading anything. */
.shell.narrow .side nav > a.on > span:first-child { opacity: 1; }
.shell.narrow .side nav > a.on::after { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--side-accent); }

/* A count cannot sit beside an icon here, so it rides the corner. The dark ring
   keeps the digits off the icon underneath. */
.shell.narrow .side nav > a .pill { position: absolute; top: 1px; right: 1px; margin: 0;
  min-width: 15px; height: 15px; padding: 0 3px; font-size: 10px; font-weight: 700;
  box-shadow: 0 0 0 2px rgba(6, 20, 40, .92); }

/* Three controls will not sit side by side in a forty-pixel box, which is why
   the avatar and sign-out were being pushed out of sight and only the bell
   showed. Stacked, all three fit. */
.shell.narrow .side-foot { flex-direction: column; gap: 6px; padding: 7px 4px; justify-content: center; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); flex: 0 0 auto;
  display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4);
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .crumb { color: var(--muted); font-size: var(--fs-body); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.topbar .crumb b { color: var(--text); font-weight: 600; }
.topbar .crumb s { color: var(--placeholder); text-decoration: none; margin: 0 2px; }
.content { padding: 10px 14px 20px; flex: 1; }

/* the title line — the crumb above already names the screen, so this stays small */
.page-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: 8px; flex-wrap: wrap; min-height: 30px; }
.page-head h1 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.page-head p { display: none; }
.page-head .acts { display: flex; align-items: center; gap: var(--s2); }
.page-head .acts .btn, .page-head .acts button { height: 28px; padding: 0 11px; font-size: var(--fs-small); }

/* ---------------------------------------------------------------- pieces */
.card { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.card > header { padding: 4px 0 8px; min-height: 36px; border-bottom: 0;
  display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.card > header input, .card > header select { height: 28px; font-size: var(--fs-small); }
.card > header .btn, .card > header button { height: 28px; padding: 0 10px; font-size: var(--fs-small); }
.card > header .spacer { flex: 1; }
.card > .body { padding: var(--s3) 0; }
.grid { display: grid; gap: var(--s4); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }

.kpis { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.kpi { background: var(--subtle); border: 1px solid var(--line); border-radius: 7px;
  padding: 5px 10px; display: flex; align-items: baseline; gap: 7px; flex: 0 0 auto; }
.kpi .v { order: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.kpi .k { order: 1; font-size: 12px; }
.kpi .k i { display: none; }
.kpi .s { display: none; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px 15px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .k, .stat .k { font-size: var(--fs-meta); color: var(--muted); font-weight: 500;
  display: flex; align-items: center; gap: 6px; }
.kpi .k i, .stat .k i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); flex: 0 0 auto; }
.kpi .v, .stat .v { font-size: var(--fs-kpi); font-weight: 650; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .s, .stat .s { font-size: var(--fs-meta); color: var(--placeholder); }
.stat.tap, .kpi.tap { cursor: pointer; }
.stat.tap:hover, .kpi.tap:hover { background: var(--hover); border-color: var(--teal); box-shadow: none; }

/* ---------------------------------------------------------------- tables */
/* The grid sits on white, a field of its own on the ivory page. */
.tbl-wrap { overflow: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); position: relative; }
/* the heading row's bottom edge doubles as the row-height handle */
thead.row-edge, thead.row-edge th { cursor: row-resize; }
thead.row-edge th, body.row-resizing thead th { border-bottom-color: var(--teal); }
body.row-resizing { cursor: row-resize; user-select: none; }
table tbody td { height: var(--row-h, auto); }
table { width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 5px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 12px; }
th:last-child, td:last-child { padding-right: 12px; }
thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); font-size: var(--fs-th);
  text-transform: uppercase; letter-spacing: .055em; color: var(--text-2); font-weight: 600; white-space: nowrap;
  border-bottom: 1px solid var(--line-strong); }
tbody tr:last-child td { border-bottom: 0; }
/* Nothing in a grid shouts: every row reads at one weight. But it reads in
 * the page's own ink, because forty rows of grey is a wash. */
tbody td { color: var(--grid-text); font-weight: 400; }
tbody td b, tbody td strong, tbody td .mono, tbody td .badge { font-weight: 400; }

/* a heading sorts when clicked, and resizes by the line on its right */
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--teal-600); background: var(--hover); }
thead th { position: relative; }
thead th .caret { font-style: normal; margin-left: 4px; color: var(--teal-600); font-size: 10px; }
thead th.num .caret { margin: 0 0 0 4px; }
.col-grip { position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; z-index: 3; }
.col-grip::after { content: ''; position: absolute; top: 4px; bottom: 4px; left: 3px; width: 1px;
  background: transparent; }
thead th:hover .col-grip::after, body.col-resizing .col-grip::after { background: var(--teal); opacity: .45; }
.col-grip:hover::after, body.col-resizing .col-grip:active::after { background: var(--teal); opacity: 1; }
body.col-resizing { cursor: col-resize; user-select: none; }
/* a heading can also be dragged onto another to move the column */
thead th.dragging { opacity: .4; }
thead th.drop-before, thead th.drop-after { position: relative; }
thead th.drop-before::before, thead th.drop-after::before { content: ''; position: absolute;
  top: 0; bottom: 0; width: 2px; background: var(--teal); }
thead th.drop-before::before { left: -1px; }
thead th.drop-after::before { right: -1px; }
table td, table th { overflow: hidden; text-overflow: ellipsis; }
tbody tr:hover { background: var(--hover); }
tr.tap { cursor: pointer; }
.tbl-wrap .order-list-edit { min-height:20px; height:20px; padding:1px 8px; font-size:11.5px; }
tfoot th { background: var(--surface); font-size: var(--fs-meta); color: var(--text-2);
  font-weight: 500; border-top: 1px solid var(--line-strong); }
.num { text-align: right; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); font-size: var(--fs-small); }

/* ---------------------------------------------------------------- chips */
.badge { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-mute { background: var(--idle-bg); color: var(--idle); }
.b-acc { background: var(--teal-50); color: var(--teal-600); }

/* ---------------------------------------------------------------- buttons */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: 500 var(--fs-cell)/1 var(--font);
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
button:hover, .btn:hover { background: var(--hover); border-color: var(--line-strong); text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
/* Warehouse row actions: one line, same order on every row, never wrapped. */
.wh-acts { display: flex; gap: 4px; flex-wrap: nowrap; justify-content: flex-end; }
.wh-acts > button { white-space: nowrap; flex: none; padding: 0 8px; }
.btn-p { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-p:hover { background: var(--navy-600); border-color: var(--navy-600); color: #fff; }
.btn-d { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-d:hover { filter: brightness(.94); color: #fff; }
.btn-s { height: 28px; padding: 0 10px; font-size: var(--fs-small); }
.btn-link { border: 0; background: none; color: var(--teal-600); height: auto; padding: 2px 4px; }
.btn-link:hover { background: none; text-decoration: underline; }
.burger { display: none; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-size: var(--fs-small); font-weight: 500; color: var(--text-2); margin-bottom: 5px; }
input, select, textarea { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--surface); color: var(--text);
  font: 400 var(--fs-cell)/1 var(--font); }
textarea { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
select { padding-right: 6px; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--ring); }
input[type=checkbox] { width: auto; height: auto; }
.field { margin-bottom: var(--s3); }
.fields { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields .wide { grid-column: 1 / -1; }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 8px; overflow-x: auto; }
.tabs button { border: 0; background: none; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--muted); height: 28px; padding: 0 10px; font-size: var(--fs-small); }
.tabs button:hover { background: none; color: var(--teal-600); }
.tabs button.on { color: var(--navy); border-bottom-color: var(--teal); font-weight: 600; }

/* ------------------------------------------------- products & price lists */
.prod-thumb { width: 24px; height: 24px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--line); background: var(--subtle); display: block; }
.prod-thumb.blank { display: grid; place-items: center; color: var(--placeholder);
  font: 600 10px/1 var(--font); letter-spacing: .04em; }
.child-code { color: var(--muted); padding-left: 14px; }
/* a status chip you can click */
button.chip-btn { height: 22px; padding: 0 10px; border: 1px solid transparent; font-weight: 600;
  font-size: var(--fs-meta); border-radius: 999px; }
button.chip-btn:hover:not(:disabled) { filter: brightness(.96); border-color: currentColor; }
button.chip-btn:disabled { opacity: 1; }

.form-pic { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.dist-form { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.pic-field { margin-bottom: var(--s4); }
.pic-field img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--subtle); margin-bottom: var(--s2); }
.pic-empty { width: 100%; aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--r);
  border: 1px dashed var(--line-strong); color: var(--placeholder); font-size: var(--fs-small);
  background: var(--subtle); margin-bottom: var(--s2); }

.subcard { border: 1px solid var(--line); border-radius: var(--r); margin-top: var(--s4); overflow: hidden; }
.subcard > header { padding: 9px var(--s3); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s3); background: var(--subtle); }
.subcard > header h3 { margin: 0; }
.subcard > header .spacer { flex: 1; }

input.disc { height: 28px; width: 74px; padding: 0 7px; text-align: right; display: inline-block; }

.pick-list { max-height: 46vh; overflow: auto; border: 1px solid var(--line);
  border-radius: var(--r); margin-top: var(--s3); }
.pick { display: flex; align-items: center; gap: 9px; padding: 7px 11px; margin: 0;
  border-bottom: 1px solid var(--line); font-size: var(--fs-cell); font-weight: 400; cursor: pointer; }
.pick:last-child { border-bottom: 0; }
.pick:hover { background: var(--hover); }
.pick .mono { min-width: 116px; color: var(--text-2); }

/* ---------------------------------------------------------------- modal */
.modal-bg { position: fixed; inset: 0; background: rgba(6, 22, 40, .42); z-index: 200;
  display: grid; place-items: center; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; max-height: 88vh; display: flex; flex-direction: column; }
.modal.wide { max-width: 820px; }
.modal > header { padding: 13px var(--s4); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s3); }
.modal > header h2 { font-size: var(--fs-section); }
.modal > .body { padding: var(--s4); overflow-y: auto; }
.modal > footer { padding: 12px var(--s4); border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: var(--s2); }

/* ---------------------------------------------------------------- palette */
.pal-bg { position: fixed; inset: 0; background: rgba(6, 22, 40, .38); z-index: 300;
  display: flex; justify-content: center; padding: 12vh 20px 20px; }
.pal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 64vh; display: flex; flex-direction: column; overflow: hidden; }
.pal input { height: 48px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  font-size: 15px; padding: 0 var(--s4); }
.pal input:focus { box-shadow: none; border-color: var(--line); }
.pal .res { overflow-y: auto; padding: 6px; }
.pal .res .grp { font-size: var(--fs-th); text-transform: uppercase; letter-spacing: .06em;
  color: var(--placeholder); font-weight: 600; padding: 9px 10px 4px; }
.pal .res a { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px;
  border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-cell); }
.pal .res a:hover, .pal .res a.on { background: var(--lit); text-decoration: none; }
.pal .res a .mono { color: var(--muted); margin-left: auto; }
.pal .res a > span:first-child { color: var(--muted); display: grid; place-items: center; }

/* ---------------------------------------------------------------- misc */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 400;
  background: var(--text); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  font-size: var(--fs-small); font-weight: 500; box-shadow: var(--shadow-lg); }
.toast.ok { background: var(--green); }
.toast.bad { background: var(--bad); }
.bar { height: 6px; background: var(--subtle); border-radius: 4px; overflow: hidden; min-width: 72px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--teal)); border-radius: 4px; }
.bar i.over { background: var(--green); }
.map { width: 100%; height: 420px; border-radius: var(--r); border: 1px solid var(--line); background: var(--brand-50); }

/* Live board: everyone who is out, on a real map, the way the rider board works. */
.live-map { height: 420px; border-bottom: 1px solid var(--line); background: var(--brand-50); }
.live-pin { background: none; border: 0; }
.live-pin span {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  color: #fff; font-size: 11.5px; font-weight: 650; letter-spacing: .2px;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(6, 24, 55, .35);
}
.leaflet-container { font: inherit; }

/* Map | Satellite, on Google's map (as Quickly has it) */
.one-maptype { display: flex; background: #fff; }
.one-maptype button { border: 0; background: #fff; padding: 6px 11px; font: 600 12px/1 inherit; color: #334; cursor: pointer; }
.one-maptype button[aria-pressed="true"] { background: var(--brand, #06305C); color: #fff; }

/* Daily activity: one screen, nothing scrolls but the side panel */
.main:has(.act-page) { height: 100vh; overflow: hidden; }
.content:has(.act-page) { display: flex; flex-direction: column; min-height: 0; padding-bottom: 12px; }
/* the router wraps every screen in two plain divs: on this page they must pass the height down */
.content:has(.act-page) > div:has(.act-page), .content:has(.act-page) > div:has(.act-page) > div:has(.act-page) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.act-page { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }

/* the header card: who, and the day in numbers, on navy */
.act-strip { flex: none; display: grid; grid-template-columns: minmax(230px, 1.2fr) minmax(0, 4fr); gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 16px; color: #fff;
  background: linear-gradient(120deg, #061837 0%, #0B244A 60%, #0E2F60 100%); box-shadow: 0 8px 24px rgba(6, 24, 55, .18); }
.act-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.act-who img, .act-who-initials { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.7); flex: none; }
.act-who-initials { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; background: rgba(255,255,255,.14); }
.act-who > div { min-width: 0; }
.act-who-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-who-sub { font-size: 12.5px; opacity: .78; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.act-tile { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 8px 11px; min-width: 0; }
.act-tile .k { font-size: 10px; font-weight: 650; letter-spacing: .5px; text-transform: uppercase; color: rgba(255,255,255,.65); }
.act-tile .v { font-size: 17px; font-weight: 700; margin-top: 2px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.act-tile .s { font-size: 11px; color: rgba(255,255,255,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the map and the side panel, one rounded card */
.act-card { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(6, 24, 55, .06); }
.act-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr); }
.act-map { height: 100%; min-height: 0; background: var(--brand-50); }
.act-side { min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #fff; }
.act-tabs { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.act-tabs .seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--subtle); }
.act-tabs .seg button { border: 0; background: transparent; border-radius: 8px; padding: 6px 11px; font: 600 12.5px/1 inherit; color: var(--muted); cursor: pointer; }
.act-tabs .seg button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(6, 24, 55, .14); }
.act-tabs .spacer { flex: 1; }
.act-tabs .btn-s, .act-tabs button.btn-s { height: 28px; padding: 0 10px; font-size: 12px; }
.act-list, .act-visits, .act-slots { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.act-visits table { font-size: 12.5px; }

/* the event list */
.act-row { display: grid; grid-template-columns: 50px 28px minmax(0, 1fr) auto; gap: 8px; align-items: start;
  padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.act-row:hover { background: var(--brand-50); }
.act-time { font-size: 12px; font-weight: 650; color: var(--muted); padding-top: 5px; }
.act-dot { width: 26px; height: 26px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.act-dot.gap { background: #fff; color: #B3261E; border: 2px dashed #B3261E; }
.act-row.k-gap b { color: #B3261E; }
.act-what { min-width: 0; font-size: 13px; }
.act-what .muted { font-size: 12px; margin-top: 2px; }
.act-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.act-tags:empty { display: none; }
.act-note { font-size: 12px; margin-top: 4px; padding: 5px 8px; background: var(--brand-50); border-radius: 8px; }
.act-photo { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.badge.b-info { background: #E8EFFA; color: #06305C; }

/* the ten-minute report: a rail down the left, a dot per slot coloured by what he was doing */
.slot-head { display: grid; grid-template-columns: 78px 18px minmax(0, 1fr) 62px; gap: 0 8px; padding: 8px 14px 8px 12px; position: sticky; top: 0; z-index: 1;
  background: #fff; border-bottom: 1px solid var(--line); font-size: 10.5px; font-weight: 650; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.slot-head span:nth-child(2) { grid-column: 2 / 4; }
.slot-row { position: relative; display: grid; grid-template-columns: 78px 18px minmax(0, 1fr) 62px; gap: 2px 8px; align-items: start;
  padding: 11px 14px 11px 12px; cursor: pointer; font-size: 13px; }
.slot-row::before { content: ''; position: absolute; left: 98px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.slot-row:first-of-type::before { top: 18px; }
.slot-row:last-child::before { bottom: auto; height: 18px; }
.slot-row:hover { background: var(--brand-50); }
.slot-time { font-size: 12px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; line-height: 1.3; }
.slot-rail { position: relative; z-index: 1; width: 12px; height: 12px; margin: 4px 0 0 1px; border-radius: 50%; background: #06305C; box-shadow: 0 0 0 3px #fff; }
.slot-row.k-moving .slot-rail { background: #0B7A4B; }
.slot-row.k-silent .slot-rail { background: #fff; border: 2px solid #B3261E; width: 8px; height: 8px; margin-left: 3px; }
.slot-where { min-width: 0; }
.slot-where b { font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.005em; }
.slot-doing { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.slot-doing .muted { font-size: 11.5px; }
.slot-moved { text-align: right; font-variant-numeric: tabular-nums; padding-top: 2px; font-weight: 600; color: var(--muted); }
.slot-events { grid-column: 3 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip.c-still { background: #E8EFFA; color: #06305C; }
.chip.c-moving { background: #E3F4EA; color: #0B7A4B; }
.chip.c-silent { background: #FBE9E7; color: #B3261E; }
.slot-row.k-silent .slot-where b { color: #B3261E; font-weight: 500; }

@media (max-width: 1100px) { .act-strip { grid-template-columns: 1fr; } .act-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .main:has(.act-page) { height: auto; overflow: visible; }
  .act-body { grid-template-columns: 1fr; }
  .act-map { height: 340px; }
  .act-side { border-left: 0; border-top: 1px solid var(--line); }
  .act-list, .act-visits, .act-slots { max-height: 60vh; }
}

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell, .shell.narrow { grid-template-columns: 1fr; }
  .side-grip { display: none; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: var(--side); z-index: 60;
    transform: translateX(-100%); transition: transform .18s ease; }
  .side.open { transform: none; }
  .side-collapse { display: none; }
  .burger { display: inline-flex; border: 0; background: none; width: 34px; padding: 0; }
  .content { padding: var(--s4); }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .kpi, .stat { padding: 11px 12px; }
  .page-head { gap: var(--s2); }
  .fields, .form-pic, .dist-form { grid-template-columns: 1fr; }
  .scrim { position: fixed; inset: 0; background: rgba(6, 22, 40, .35); z-index: 50; }
}

/* Item editor: compact code and MRP, with space for the description. */
.item-editor-fields { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.item-editor-fields > .field { min-width: 0; grid-column: span 6; margin-bottom: 0; }
.item-editor-fields > .item-field-sku { grid-column: span 3; }
.item-editor-fields > .item-field-name { grid-column: span 7; }
.item-editor-fields > .item-field-mrp { grid-column: span 2; }
.item-editor-fields > .item-field-hsn { grid-column: span 4; }
.item-editor-fields > .item-field-gst_rate { grid-column: span 2; }
.item-editor-fields > .wide { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .item-editor-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-editor-fields > .field { grid-column: span 1; }
  .item-editor-fields > .item-field-name, .item-editor-fields > .wide { grid-column: 1 / -1; }
  .item-editor-fields > .item-field-name { grid-row: 2; }
}
@media (max-width: 420px) {
  .item-editor-fields { grid-template-columns: minmax(0, 1fr); }
  .item-editor-fields > .item-field-name { grid-row: auto; }
}

/* Individual colour details and photos within the item editor. */
.colour-editor-hint { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.colour-editor-empty { padding: 22px 14px; color: var(--muted); font-size: var(--fs-small); }
.colour-editor-empty[hidden] { display: none; }
.colour-editor-row { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 18px; padding: 16px 14px; }
.colour-editor-row + .colour-editor-row { border-top: 1px solid var(--line); }
.colour-editor-row .pic-field { margin: 0; }
.colour-editor-row .pic-field .row { flex-wrap: wrap; gap: 4px; }
.colour-editor-row .pic-field button { padding: 5px 8px; font-size: var(--fs-meta); }
.colour-editor-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(80px, .65fr); gap: 12px; align-content: start; }
.colour-editor-fields .field { min-width: 0; margin: 0; }
.colour-editor-actions { display: flex; justify-content: flex-end; align-items: flex-end; padding-bottom: 7px; }
@media (max-width: 600px) {
  .colour-editor-row { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
  .colour-editor-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .colour-editor-fields .colour-ean { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .colour-editor-row { grid-template-columns: minmax(0, 1fr); }
  .colour-editor-row .pic-field { width: 94px; }
  .colour-editor > header { flex-wrap: wrap; }
}

.gst-add-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 8px; }
.gst-add-rate[hidden] { display: none; }
.gst-add-rate input { min-width: 0; flex: 1 1 70px; }
.gst-add-rate button { padding: 5px 8px; font-size: var(--fs-meta); }

/* Larger item popup; keep additional colours within their own scroll area. */
.modal.wide.item-editor-modal { max-width: 1060px; max-height: 94vh; }
.item-editor-modal > header, .item-editor-modal > footer { flex-shrink: 0; }
.item-editor-modal .colour-editor-list { overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }

/* Full-window item editor, scoped to this screen only. */
.modal-bg.item-editor-overlay { padding: 0; }
.modal.wide.item-editor-modal { width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; border-radius: 0; }
.item-editor-modal > header { padding: 16px 24px; }
.item-editor-modal > .body { flex: 1; min-height: 0; padding: 24px; }
.item-editor-modal > footer { padding: 14px 24px; }
.item-editor-modal .item-editor { grid-template-columns: 148px minmax(0, 1fr); gap: 24px; }
.item-editor-modal .colour-editor-row { grid-template-columns: 112px minmax(0, 1fr); gap: 24px; padding: 18px; }
.item-editor-modal .colour-editor-fields { grid-template-columns: minmax(130px, 1fr) minmax(160px, 1.3fr) minmax(100px, .7fr) minmax(130px, 1fr) minmax(100px, .7fr) auto; align-items: start; }
.item-editor-modal .colour-editor-actions { align-self: center; padding: 20px 0 0; }
@media (max-width: 1000px) {
  .item-editor-modal .colour-editor-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .item-editor-modal > header, .item-editor-modal > footer { padding: 12px 16px; }
  .item-editor-modal > .body { padding: 16px; }
  .item-editor-modal .item-editor { grid-template-columns: minmax(0, 1fr); }
  .item-editor-modal .item-editor > .pic-field { width: 112px; }
  .item-editor-modal .colour-editor-row { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .item-editor-modal .colour-editor-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .item-editor-modal .colour-editor-row { grid-template-columns: minmax(0, 1fr); }
}

/* Keep main product details visible; only colour rows scroll. */
.item-editor-modal > .body { display: flex; flex-direction: column; overflow: hidden; }
.item-editor-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.item-editor-content > .item-editor, .item-editor-content > .hint { flex-shrink: 0; }
.item-editor-content > .colour-editor { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.item-editor-content > .colour-editor > header,
.item-editor-content > .colour-editor > .colour-editor-hint { flex-shrink: 0; }
.item-editor-modal .colour-editor-list { flex: 1; min-height: 0; overflow-y: auto; }
@media (max-width: 600px) {
  .item-editor-modal .item-editor { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
  .item-editor-modal .item-editor > .pic-field { width: 76px; }
  .item-editor-modal .item-editor-fields { gap: 8px; }
  .item-editor-modal .item-editor-fields > .field { grid-column: span 1; }
  .item-editor-modal .item-editor-fields > .item-field-name,
  .item-editor-modal .item-editor-fields > .wide { grid-column: 1 / -1; }
  .item-editor-modal .colour-editor-hint { padding: 8px 12px; }
}

/* Item editor occupies the workspace beside the existing sidebar. */
.shell > .item-editor-overlay { left: var(--side-w, var(--side)); }
.shell.narrow > .item-editor-overlay { left: 56px; }
@media (max-width: 860px) {
  .shell.item-editor-open > .item-editor-overlay { left: 56px; }
  .shell.item-editor-open > .side { width: 56px; transform: none; padding: 14px 8px; }
  .shell.item-editor-open .side-top { flex-direction: column; }
  .shell.item-editor-open .side-top .side-mark { display: block; }
  .shell.item-editor-open .side-top b,
  .shell.item-editor-open .side-top .spacer,
  .shell.item-editor-open .side-search span,
  .shell.item-editor-open .side-search kbd,
  .shell.item-editor-open .side .group,
  .shell.item-editor-open .side .sub,
  .shell.item-editor-open .side-foot .who,
  .shell.item-editor-open .side-foot button { display: none; }
  .shell.item-editor-open .side-search { justify-content: center; padding: 7px 0; }
  .shell.item-editor-open .side nav > a { justify-content: center; padding: 0; gap: 0; }
  .shell.item-editor-open .side nav > a > span:last-child { display: none; }
  .shell.item-editor-open .side-foot { justify-content: center; }
}

/* Compact colour cards side by side within the scrolling section. */
.item-editor-modal .colour-editor-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px; align-content: start; }
.item-editor-modal .colour-editor-empty { grid-column: 1 / -1; }
.item-editor-modal .colour-editor-row { grid-template-columns: 86px minmax(0, 1fr); gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); align-items: start; }
.item-editor-modal .colour-editor-row + .colour-editor-row { border-top: 1px solid var(--line); }
.item-editor-modal .colour-editor-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px 10px; }
.item-editor-modal .colour-editor-fields .colour-code,
.item-editor-modal .colour-editor-fields .colour-ean { grid-column: 1 / -1; }
.item-editor-modal .colour-editor-fields .colour-name { grid-column: 1 / -1; }
.item-editor-modal .colour-editor-fields .colour-mrp { grid-row: 4; grid-column: 1; }
.item-editor-modal .colour-editor-fields .colour-gst { grid-row: 4; grid-column: 2; }
.item-editor-modal .colour-editor-fields input,
.item-editor-modal .colour-editor-fields select { padding: 6px 9px; }
.item-editor-modal .colour-editor-actions { grid-column: 1 / -1; padding: 0; }
@media (max-width: 1050px) {
  .item-editor-modal .colour-editor-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .item-editor-modal .colour-editor-row { grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .item-editor-modal .colour-editor-row .pic-field { width: 70px; }
}

/* Two aligned field rows in each colour card. */
.item-editor-modal .colour-editor-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, .8fr); }
.item-editor-modal .colour-editor-fields .colour-name { grid-row: 1; grid-column: 1; }
.item-editor-modal .colour-editor-fields .colour-code { grid-row: 1; grid-column: 2; }
.item-editor-modal .colour-editor-fields .colour-mrp { grid-row: 1; grid-column: 3; }
.item-editor-modal .colour-editor-fields .colour-hsn { grid-row: 2; grid-column: 1; }
.item-editor-modal .colour-editor-fields .colour-gst { grid-row: 2; grid-column: 2; }
.item-editor-modal .colour-editor-fields .colour-ean { grid-row: 2; grid-column: 3; }
.item-editor-modal .colour-editor-actions { grid-row: 3; }
@media (max-width: 600px) {
  .item-editor-modal .colour-editor-row { grid-template-columns: minmax(0, 1fr); }
  .item-editor-modal .colour-editor-row .pic-field { width: 80px; }
}

/* Fit four compact colour cards as two rows of two on desktop. */
.item-editor-modal .colour-editor-list { gap: 10px; padding: 10px; }
.item-editor-modal .colour-editor-row { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 10px; }
.item-editor-modal .colour-editor-row .pic-field { width: 72px; }
.item-editor-modal .colour-editor-fields { gap: 6px 8px; }
.item-editor-modal .colour-editor-fields label { margin-bottom: 3px; }
.item-editor-modal .colour-editor-fields input,
.item-editor-modal .colour-editor-fields select { height: 30px; padding: 4px 7px; }
.item-editor-modal .colour-editor-actions button { padding: 3px 0; }
.item-editor-modal .colour-editor-row .pic-field button { padding: 4px 6px; }
@media (max-width: 1050px) {
  .item-editor-modal .colour-editor-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .item-editor-modal .colour-editor-row { grid-template-columns: minmax(0, 1fr); }
}

/* Quieter, compact item editor. */
.item-editor-modal input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.item-editor-modal input[type="number"]::-webkit-inner-spin-button,
.item-editor-modal input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.item-editor-modal > header { padding: 10px 18px; }
.item-editor-modal > .body { padding: 14px 18px; }
.item-editor-modal > footer { padding: 9px 18px; }
.item-editor-modal .item-editor { grid-template-columns: 100px minmax(0, 1fr); gap: 18px; }
.item-editor-modal .item-editor > .pic-field { width: 100px; margin-bottom: 0; }
.item-editor-modal .item-editor-fields { gap: 8px 12px; }
.item-editor-modal .item-editor-fields label { margin-bottom: 3px; }
.item-editor-modal .item-editor-fields input:not([type="checkbox"]),
.item-editor-modal .item-editor-fields select { height: 32px; padding: 5px 9px; }
.item-editor-modal .item-field-active { display: flex; align-items: center; gap: 8px; }
.item-editor-modal .item-field-active label { margin: 0; order: 1; }
.item-editor-modal .item-field-active input { margin: 0; }
.item-editor-modal .colour-editor { margin-top: 12px; }
.item-editor-modal .colour-editor > header { padding: 7px 10px; }
.item-editor-modal .colour-editor-row { border-radius: 8px; padding: 9px; grid-template-columns: 64px minmax(0, 1fr); }
.item-editor-modal .colour-editor-row .pic-field { width: 64px; }
.item-editor-modal .colour-editor-row .pic-field > label { display: none; }
.item-editor-modal .colour-editor-row .pic-empty { font-size: 11px; }
.item-editor-modal .colour-editor-fields label { font-size: var(--fs-meta); }
.item-editor-modal .pic-field button { padding: 4px 6px; font-size: var(--fs-meta); }
@media (max-width: 600px) {
  .item-editor-modal > .body { padding: 12px; }
  .item-editor-modal .item-editor { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
  .item-editor-modal .item-editor > .pic-field { width: 72px; }
}

/* Simple colour cards: identity and photo only; shared prices/tax above. */
.item-editor-modal .colour-editor-row { grid-template-columns: 78px minmax(0, 1fr); gap: 14px; padding: 12px; }
.item-editor-modal .colour-editor-row .pic-field { width: 78px; }
.item-editor-modal .colour-editor-fields { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 10px; }
.item-editor-modal .colour-editor-fields .colour-name { grid-row: 1; grid-column: 1; }
.item-editor-modal .colour-editor-fields .colour-code { grid-row: 1; grid-column: 2; }
.item-editor-modal .colour-editor-fields .colour-ean { grid-row: 2; grid-column: 1 / -1; }
.item-editor-modal .colour-editor-actions { grid-row: 3; grid-column: 1 / -1; }
@media (max-width: 420px) {
  .item-editor-modal .colour-editor-row { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .item-editor-modal .colour-editor-row .pic-field { width: 64px; }
}

/* Plain Colours heading without an enclosing section box. */
.item-editor-modal .colour-editor { border: 0; border-radius: 0; background: transparent; }
.item-editor-modal .colour-editor > header { padding: 8px 0 10px; background: transparent; border-bottom: 0; }
.item-editor-modal .colour-editor-list { padding: 0; }

/* Colours heading bar and right-aligned product status switch. */
.item-editor-modal > .body { padding-top: 22px; }
.item-editor-modal .item-editor-fields { row-gap: 12px; }
.item-editor-modal .item-editor-content > .colour-editor { margin-top: 24px; }
.item-editor-modal .colour-editor > header { padding: 10px 14px; background: var(--subtle); border: 1px solid var(--line); border-radius: 8px; }
.item-editor-modal .colour-editor-list { padding-top: 12px; }
.item-editor-modal .item-field-active { justify-content: flex-end; }
.item-editor-modal .item-field-active input { appearance: none; -webkit-appearance: none; flex: 0 0 38px; width: 38px; height: 22px; border: 0; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; }
.item-editor-modal .item-field-active input::before { content: ''; position: absolute; width: 16px; height: 16px; top: 3px; left: 3px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.item-editor-modal .item-field-active input:checked { background: var(--teal); }
.item-editor-modal .item-field-active input:checked::before { transform: translateX(16px); }
@media (prefers-reduced-motion: reduce) {
  .item-editor-modal .item-field-active input::before { transition: none; }
}

.product-import-summary { padding: 14px 0; }
.product-import-summary strong { display: block; margin-bottom: 5px; }
.product-import-preview .err { margin-bottom: 12px; }

.product-export-fields { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:20px; }
.product-export-fields label { display:flex; flex-direction:column; gap:7px; }
.product-export-picker { max-height:280px; overflow:auto; border:1px solid var(--border,#dce4ed); border-radius:10px; padding:12px; margin:12px 0; }
.product-export-item { display:flex; align-items:center; gap:10px; padding:10px 0; }
.product-export-item input { width:17px; height:17px; flex:none; }
@media(max-width:600px) { .product-export-fields { grid-template-columns:1fr; gap:12px; } }

.modal.wide.product-import-modal { width:calc(100% - 32px); max-width:640px; }
.modal.wide.product-import-modal.has-preview { max-width:900px; }
.product-import-modal > header, .product-import-modal > .body, .product-import-modal > footer { padding:20px 24px; }
.product-import-modal > footer { display:flex; align-items:center; justify-content:flex-end; gap:10px; padding:16px 24px; }
.product-import-modal > footer button { margin:0; height:40px; }
.product-import-upload { display:flex; flex-direction:column; gap:10px; }
.product-import-upload label { font-weight:600; color:var(--text); }
.product-import-upload input[type=file] { width:100%; height:auto; padding:10px; background:#f7f9fb; border:1px solid var(--line); border-radius:10px; font-size:14px; }
.product-import-upload input::file-selector-button { border:0; border-radius:6px; padding:9px 14px; margin-right:12px; background:#e1f3f2; color:#087d79; font:inherit; font-weight:600; cursor:pointer; }
.product-import-summary:empty, .product-import-preview:empty { display:none; }
.product-import-summary { display:flex; flex-wrap:wrap; gap:12px; padding:20px 0 0; }
.product-import-count { flex:1; min-width:100px; background:#f2f6f9; border-radius:8px; padding:12px; }
.product-import-count strong { font-size:22px; margin-bottom:4px; color:var(--text); }
.product-import-count span { font-size:12px; color:var(--muted); }
.product-import-preview:not(:empty) { margin-top:18px; }
.product-import-mapping:empty { display:none; }
.product-import-mapping { margin-top:22px; }
.product-import-mapping h3 { margin:0 0 14px; }
.product-import-map-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-bottom:16px; }
.product-import-map-grid label { display:flex; flex-direction:column; gap:6px; min-width:0; }
.product-import-map-sample { color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; height:16px; font-size:11px; }
@media(max-width:700px) { .product-import-map-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:430px) { .product-import-map-grid { grid-template-columns:1fr; } }
.product-import-modal > footer .btn-p,
.product-import-modal > footer .btn-p:disabled { background:#071d41; border-color:#071d41; color:#fff; opacity:1; }
.product-import-modal > footer .btn-p:hover:not(:disabled) { background:#123461; border-color:#123461; }
.product-import-modal > footer .btn-p:disabled { cursor:not-allowed; }
.product-import-modal .product-import-map-grid { gap:12px 16px; margin-bottom:12px; }
.product-import-map-grid select { height:38px; padding:6px 10px; font-size:13px; }
.product-import-map-grid label > span { font-size:13px; font-weight:600; }
.product-import-map-grid small:empty { display:none; }
.product-import-extra { margin:10px 0 16px; }
.product-import-extra summary { cursor:pointer; color:#087d79; font-size:13px; padding:6px 0; }
.product-import-extra[open] summary { margin-bottom:10px; }
.product-import-modal .product-import-upload input[type=file] { padding:7px; }
.product-import-diff { min-width:240px; white-space:normal; line-height:1.7; font-size:12px; }
.product-import-preview h3 { margin:0 0 12px; }
.modal.wide.distributor-editor-modal { width:100%; max-width:none; height:100dvh; max-height:100dvh; border-radius:0; }
.distributor-editor-modal > header, .distributor-editor-modal > footer { padding:16px 24px; flex-shrink:0; }
.distributor-editor-modal > .body { flex:1; min-height:0; padding:24px; overflow-y:auto; }
.distributor-editor-modal .dist-form { grid-template-columns:160px minmax(0,1fr); gap:28px; }
.distributor-editor-modal .fields { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.distributor-editor-modal .dist-form + * { margin-top:20px; }
@media(max-width:1050px) { .distributor-editor-modal .fields { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:650px) { .distributor-editor-modal .dist-form,.distributor-editor-modal .fields { grid-template-columns:1fr; } .distributor-editor-modal > .body { padding:16px; } }
.distributor-editor-modal .fields { grid-template-columns:repeat(12,minmax(0,1fr)); gap:12px 16px; }
.distributor-editor-modal .fields > .field { grid-column:span 4; }
.distributor-editor-modal .fields > .dist-field-address { grid-column:span 5; }
.distributor-editor-modal .fields > .dist-field-city { grid-column:span 3; }
.distributor-editor-modal .fields > .dist-field-state,
.distributor-editor-modal .fields > .dist-field-pincode { grid-column:span 2; }
.distributor-editor-modal .fields > .field.wide { grid-column:1 / -1; }
@media(max-width:750px) { .distributor-editor-modal .fields > .field { grid-column:span 6; } }
@media(max-width:500px) { .distributor-editor-modal .fields > .field { grid-column:1 / -1; } }
.distributor-editor-modal .fields > .field:nth-child(-n+4) { grid-column:span 3; }
.distributor-editor-modal .fields > .dist-field-address { grid-column:1 / span 5; }
@media(max-width:750px) { .distributor-editor-modal .fields > .field:nth-child(-n+4), .distributor-editor-modal .fields > .dist-field-address { grid-column:span 6; } }
@media(max-width:500px) { .distributor-editor-modal .fields > .field:nth-child(-n+4), .distributor-editor-modal .fields > .dist-field-address { grid-column:1 / -1; } }
.distributor-doc-heading { margin:24px 0 14px; }
.distributor-documents { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.distributor-documents > .field { border:1px solid var(--line); border-radius:10px; padding:14px; background:var(--surface); min-width:0; }
.distributor-documents .row { flex-wrap:wrap; gap:8px; }
.distributor-documents a { max-width:100%; overflow:hidden; text-overflow:ellipsis; }
@media(max-width:900px) { .distributor-documents { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:550px) { .distributor-documents { grid-template-columns:1fr; } }
.distributor-photos { display:flex; flex-direction:column; gap:18px; }
.distributor-photos .pic-field { width:150px; }
.distributor-photos .pic-field .pic-preview { aspect-ratio:1; }
.distributor-editor-modal .fields > .dist-field-address { grid-column:1 / span 4; }
.distributor-editor-modal .fields > .dist-field-area,
.distributor-editor-modal .fields > .dist-field-city,
.distributor-editor-modal .fields > .dist-field-state,
.distributor-editor-modal .fields > .dist-field-pincode { grid-column:span 2; }
.distributor-editor-modal .dist-field-area button { padding:3px 0; font-size:11px; justify-content:flex-start; }
.distributor-editor-modal .dist-field-pincode small { font-size:11px; color:var(--muted); }
@media(max-width:750px) { .distributor-editor-modal .fields > .dist-field-address,.distributor-editor-modal .fields > .dist-field-area,.distributor-editor-modal .fields > .dist-field-city,.distributor-editor-modal .fields > .dist-field-state,.distributor-editor-modal .fields > .dist-field-pincode { grid-column:span 6; } }
@media(max-width:500px) { .distributor-editor-modal .fields > .dist-field-address,.distributor-editor-modal .fields > .dist-field-area,.distributor-editor-modal .fields > .dist-field-city,.distributor-editor-modal .fields > .dist-field-state,.distributor-editor-modal .fields > .dist-field-pincode { grid-column:1 / -1; } }
.distributor-documents { grid-template-columns:repeat(4,minmax(0,1fr)); }
.distributor-documents > .field { position:relative; }
.distributor-documents > .field > label { padding-right:24px; }
.distributor-attached-mark { position:absolute; right:10px; top:10px; width:22px; height:22px; border-radius:50%; display:grid; place-items:center; color:#fff; background:#087d79; font-weight:700; }
.distributor-attached-mark[hidden] { display:none; }
@media(max-width:900px) { .distributor-documents { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:550px) { .distributor-documents { grid-template-columns:1fr; } }
/* Company, owner contacts, then address in dedicated rows. */
.distributor-editor-modal .fields > .field.dist-field-name { grid-column:1 / span 8; }
.distributor-editor-modal .fields > .field.dist-field-gstin { grid-column:9 / span 4; }
.distributor-editor-modal .fields > .field.dist-field-contact_person { grid-column:1 / span 4; }
.distributor-editor-modal .fields > .field.dist-field-phone { grid-column:5 / span 4; }
.distributor-editor-modal .fields > .field.dist-field-email { grid-column:9 / span 4; }
.distributor-editor-modal .fields > .field.dist-field-address { grid-column:1 / span 4; }
.distributor-editor-modal .fields > .field.dist-field-area { grid-column:5 / span 2; }
.distributor-editor-modal .fields > .field.dist-field-city { grid-column:7 / span 2; }
.distributor-editor-modal .fields > .field.dist-field-state { grid-column:9 / span 2; }
.distributor-editor-modal .fields > .field.dist-field-pincode { grid-column:11 / span 2; }
.distributor-editor-modal .fields > .field.dist-field-pan_number { grid-column:1 / span 3; }
.distributor-editor-modal .fields > .field.dist-field-aadhaar_number,
.distributor-editor-modal .fields > .field.dist-field-credit_days,
.distributor-editor-modal .fields > .field.dist-field-price_list_id { grid-column:span 3; }
@media(max-width:750px) { .distributor-editor-modal .fields > .field[class*="dist-field-"] { grid-column:span 6; } }
@media(max-width:500px) { .distributor-editor-modal .fields > .field[class*="dist-field-"] { grid-column:1 / -1; } }
.distributor-attached-mark { width:16px; height:16px; top:9px; right:9px; font-size:10px; background:var(--side-accent,#00B8B3); }
.distributor-editor-modal .fields { row-gap:10px; }
/* +91 in front of any box that takes a mobile. Where it sits and how tall it is are set by
   mobile-input.js from the box it is placed over, because these boxes are not all the same
   height; this only says what it looks like. */
.has-mob-prefix { position:relative; }
.has-mob-prefix > .mob-prefix {
  position:absolute; display:flex; align-items:center; color:var(--muted);
  pointer-events:none; line-height:1; }
/* The company block on a grid of its own.
 *
 * Twelve columns cannot hold three equal fields across the width of the firm name, which is
 * eight of them. Thirty-six can: the firm name is twenty-four and owner, contact and
 * WhatsApp are eight each beneath it, while the e-mail is twelve and sits exactly under the
 * GST number. Only this block changes - the address and trade blocks are their own grids and
 * keep their twelve. Spans, not start lines, so each row simply fills and the next begins;
 * that is why the fields are moved into the DOM in the order they are read. */
.distributor-editor-modal .distributor-company-fields { grid-template-columns:repeat(36,minmax(0,1fr)); }
.distributor-editor-modal .distributor-company-fields > .field.dist-field-name { grid-column:span 24; }
.distributor-editor-modal .distributor-company-fields > .field.dist-field-gstin { grid-column:span 12; }
.distributor-editor-modal .distributor-company-fields > .field.dist-field-contact_person,
.distributor-editor-modal .distributor-company-fields > .field.dist-field-phone,
.distributor-editor-modal .distributor-company-fields > .field.dist-field-whatsapp { grid-column:span 8; }
.distributor-editor-modal .distributor-company-fields > .field.dist-field-email { grid-column:span 12; }
.distributor-editor-modal .distributor-company-fields > .field.dist-field-pan_number,
.distributor-editor-modal .distributor-company-fields > .field.dist-field-aadhaar_number { grid-column:span 8; }
.distributor-section-heading { grid-column:1 / -1; margin:12px 0 2px; padding:0 0 8px; border-bottom:1px solid var(--line); font-size:15px; font-weight:700; color:var(--navy); }
.distributor-section-heading:first-child { margin-top:0; }
.distributor-editor-modal .fields > .field { gap:5px; }
.distributor-editor-modal .fields > .field > label { font-size:13px; }
.distributor-editor-modal .fields > .field > input,
.distributor-editor-modal .fields > .field > select { min-height:38px; padding:7px 10px; }
.distributor-doc-heading { margin-top:20px; padding-bottom:8px; border-bottom:1px solid var(--line); font-size:15px; }
.distributor-editor-modal .fields > .field.dist-field-credit_days { grid-column:1 / span 4; }
.distributor-editor-modal .fields > .field.dist-field-price_list_id { grid-column:5 / span 4; }
@media(max-width:750px) { .distributor-editor-modal .fields > .field.dist-field-credit_days,.distributor-editor-modal .fields > .field.dist-field-price_list_id { grid-column:span 6; } }
@media(max-width:500px) { .distributor-editor-modal .fields > .field.dist-field-credit_days,.distributor-editor-modal .fields > .field.dist-field-price_list_id { grid-column:1 / -1; } }
/* Compact distributor workspace on desktop. */
@media(min-width:1000px) {
.distributor-editor-modal > header { padding:10px 20px; }
.distributor-editor-modal > footer { padding:10px 20px; }
.distributor-editor-modal > .body { padding:12px 20px; }
.distributor-editor-modal .dist-form { grid-template-columns:110px minmax(0,1fr); gap:20px; }
.distributor-photos { gap:12px; }
.distributor-photos .pic-field { width:100px; }
.distributor-photos .pic-field img,.distributor-photos .pic-empty { width:100px; height:100px; }
.distributor-photos .pic-field button { font-size:11px; padding:5px 7px; }
.distributor-editor-modal .fields { gap:7px 12px; }
.distributor-section-heading { margin:7px 0 0; padding-bottom:5px; font-size:13px; }
.distributor-editor-modal .fields > .field > input,.distributor-editor-modal .fields > .field > select { min-height:32px; height:32px; padding:5px 8px; font-size:13px; }
.distributor-editor-modal .fields > .field > label { font-size:12px; }
.distributor-doc-heading { margin:12px 0 8px; padding-bottom:5px; font-size:13px; }
.distributor-documents { gap:10px; }
.distributor-documents > .field { padding:10px; }
.distributor-documents .row { gap:6px; }
.distributor-documents .row > * { font-size:11px; }
.distributor-documents button,.distributor-documents .attachment-view { padding:5px 8px; }
}
.distributor-editor-modal .dist-form { grid-template-columns:150px minmax(0,1fr); }
.distributor-photos .pic-field { width:140px; }
.distributor-photos .pic-field img,.distributor-photos .pic-empty { width:140px; height:140px; }
.distributor-editor-modal .fields > .field.dist-field-address { grid-column:1 / span 9; }
.distributor-editor-modal .fields > .field.dist-field-zone { grid-column:10 / span 3; }
.distributor-editor-modal .fields > .field.dist-field-zone input { background:var(--brand-50); }
.distributor-editor-modal .fields > .field.dist-field-area { grid-column:1 / span 3; }
.distributor-editor-modal .fields > .field.dist-field-city { grid-column:4 / span 3; }
.distributor-editor-modal .fields > .field.dist-field-state { grid-column:7 / span 3; }
.distributor-editor-modal .fields > .field.dist-field-pincode { grid-column:10 / span 3; }
.distributor-trade-photo { grid-column:1 / span 3; width:130px; }
.distributor-trade-photo img,.distributor-trade-photo .pic-empty { width:130px; height:130px; }
.distributor-editor-modal .fields > .field.dist-field-credit_days { grid-column:4 / span 4; }
.distributor-editor-modal .fields > .field.dist-field-price_list_id { grid-column:8 / span 5; }
@media(max-width:750px) { .distributor-editor-modal .dist-form { grid-template-columns:1fr; } .distributor-editor-modal .fields > .field[class*="dist-field-"] { grid-column:span 6; } .distributor-editor-modal .fields > .field.dist-field-address { grid-column:1 / -1; } .distributor-trade-photo { grid-column:1 / -1; } }
@media(max-width:500px) { .distributor-editor-modal .fields > .field[class*="dist-field-"] { grid-column:1 / -1; } }
@media(min-width:751px) {
/* The whole address on one row: the address widest, then zone and area, and
   city, state and PIN only as wide as they need. */
.distributor-editor-modal .fields.distributor-address-fields {
  grid-template-columns:minmax(0,3.2fr) minmax(0,1.5fr) minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr) minmax(0,.75fr); }
.distributor-editor-modal .distributor-address-fields > .field[class*="dist-field-"] { grid-column:auto; }
}
.distributor-company-heading { margin:0 0 12px; }
.distributor-photos { padding-top:12px; }
.distributor-editor-modal .dist-form .distributor-section-heading { margin-left:-178px; width:calc(100% + 178px); }
@media(min-width:1000px) { .distributor-editor-modal .dist-form .distributor-section-heading { margin-left:-170px; width:calc(100% + 170px); } }
@media(max-width:750px) { .distributor-editor-modal .dist-form .distributor-section-heading { margin-left:0; width:100%; } }
.distributor-editor-modal .distributor-fields-root { display:block; }
.distributor-editor-modal .distributor-fields-root > .distributor-section-heading { margin:14px 0 8px; width:100%; }
.distributor-editor-modal .distributor-company-fields { row-gap:6px; }
.distributor-editor-modal .distributor-company-fields > .field { margin-bottom:0; }
.distributor-editor-modal .distributor-photos { padding-top:6px; }
.distributor-editor-modal .distributor-photos .pic-field { margin-bottom:0; }
.distributor-editor-modal .distributor-trade-fields { grid-template-columns:140px 110px 180px minmax(0,1fr); align-items:start; gap:16px; }
.distributor-editor-modal .distributor-trade-fields > .pic-field { grid-column:1; margin-bottom:0; }
.distributor-editor-modal .distributor-trade-fields > .field.dist-field-credit_days { grid-column:2; }
.distributor-editor-modal .distributor-trade-fields > .field.dist-field-price_list_id { grid-column:3; }
.distributor-editor-modal .distributor-trade-fields > .field.wide { grid-column:4; }
.distributor-editor-modal input[name=credit_days] { appearance:textfield; -moz-appearance:textfield; }
.distributor-editor-modal input[name=credit_days]::-webkit-inner-spin-button,
.distributor-editor-modal input[name=credit_days]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
.distributor-editor-modal .distributor-trade-photo { width:120px; }
.distributor-editor-modal .distributor-trade-photo img,.distributor-editor-modal .distributor-trade-photo .pic-empty { width:120px; height:120px; }
.distributor-editor-modal .distributor-doc-heading { margin:14px 0 8px; padding-bottom:5px; font-weight:700; color:var(--navy); }
.distributor-editor-modal .distributor-company-heading { margin:0 0 8px; padding-bottom:5px; }
.distributor-editor-modal .distributor-address-fields { margin-bottom:2px; }
@media(max-width:750px) { .distributor-editor-modal .distributor-trade-fields { grid-template-columns:130px minmax(0,1fr); } .distributor-editor-modal .distributor-trade-fields > .field.dist-field-credit_days { grid-column:2; } .distributor-editor-modal .distributor-trade-fields > .field.dist-field-price_list_id,.distributor-editor-modal .distributor-trade-fields > .field.wide { grid-column:2; } }
.permission-section { border-bottom:1px solid var(--line); }
.permission-section > summary { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 20px; cursor:pointer; list-style:none; }
.permission-section > summary::before { content:'▸'; color:var(--teal); }
.permission-section[open] > summary::before { content:'▾'; }
.permission-section > summary b { flex:1; }
.permission-section > summary:hover { background:var(--subtle); }
.permission-section input[type=checkbox] { width:18px; height:18px; accent-color:var(--teal); }
.permission-section table th:first-child { min-width:220px; }
.permission-section table th:not(:first-child) { min-width:110px; }

.distributor-editor-modal input[name=city],.distributor-editor-modal input[name=state] { background:#eef1f5; color:#64748b; cursor:default; }

/* Keep the distributor address row close to trade details. */
.distributor-editor-modal .distributor-address-fields > .field { margin-bottom:0; }
.distributor-editor-modal .distributor-address-fields small:empty { display:none; }
.distributor-editor-modal .distributor-address-fields + .distributor-section-heading { margin-top:6px; }

.distributor-editor-modal .distributor-trade-fields { grid-template-columns:140px 110px 180px minmax(140px,240px) minmax(90px,1fr); }
.distributor-editor-modal .distributor-trade-fields > .dist-field-scheme { grid-column:4; margin-bottom:0; }
.distributor-editor-modal .distributor-trade-fields > .field.wide { grid-column:5; justify-self:end; }
.distributor-editor-modal .distributor-trade-fields > .field > input[name=active] { min-height:22px; padding:0; appearance:none; -webkit-appearance:none; width:38px; height:22px; border:0; border-radius:999px; background:var(--line-strong); position:relative; cursor:pointer; }
.distributor-editor-modal input[name=active]::before { content:''; position:absolute; width:16px; height:16px; top:3px; left:3px; border-radius:50%; background:white; }
.distributor-editor-modal input[name=active]:checked { background:var(--side-accent,#00B8B3); }
.distributor-editor-modal input[name=active]:checked::before { transform:translateX(16px); }
@media(max-width:750px) { .distributor-editor-modal .distributor-trade-fields { grid-template-columns:130px minmax(0,1fr); } .distributor-editor-modal .distributor-trade-fields > .dist-field-scheme,.distributor-editor-modal .distributor-trade-fields > .field.wide { grid-column:2; justify-self:stretch; } }

.distributor-list .distributor-company-name { font-weight:600; }
.distributor-list td:first-child { min-width:220px; max-width:360px; }
.distributor-list td:not(:first-child) { white-space:nowrap; }
.distributor-list tbody td { padding-top:14px; padding-bottom:14px; vertical-align:middle; }

.tbl-wrap table.user-sized th,.tbl-wrap table.user-sized td { min-width:0; max-width:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tbl-wrap table.user-sized th { overflow:visible; }
.tbl-wrap table.user-sized th > span { display:inline-block; max-width:calc(100% - 16px); overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }
.col-grip { touch-action:none; width:10px; right:0; }
body.col-resizing,body.col-resizing * { cursor:col-resize !important; user-select:none !important; }

.distributor-list .distributor-owner-name { font-weight:600; }
@media(min-width:751px) {
.distributor-editor-modal .distributor-trade-fields { grid-template-columns:140px 110px minmax(160px,220px) minmax(240px,1fr) 90px; }
.distributor-editor-modal .distributor-trade-fields > .field.dist-field-scheme { grid-column:4; min-width:0; margin-bottom:0; }
.distributor-editor-modal .distributor-trade-fields > .field.dist-field-price_list_id { min-width:0; }
}
@media(max-width:750px) { .distributor-editor-modal .distributor-trade-fields > .field.dist-field-scheme { grid-column:2; min-width:0; } }

@media(min-width:751px) {
.distributor-editor-modal .distributor-trade-fields { grid-template-columns:140px 110px 110px 110px minmax(90px,1fr); }
.distributor-editor-modal .distributor-trade-fields > .field.dist-field-credit_days,
.distributor-editor-modal .distributor-trade-fields > .field.dist-field-price_list_id,
.distributor-editor-modal .distributor-trade-fields > .field.dist-field-scheme { width:110px; min-width:0; }
}

.toast,.toast.ok { background:var(--side-accent,#00B8B3); color:#fff; }
.item-editor-modal .item-field-active input:checked,
.distributor-editor-modal .distributor-trade-fields > .field > input[name=active]:checked { background:var(--side-accent,#00B8B3); }

input.disc { appearance:textfield; -moz-appearance:textfield; }
input.disc::-webkit-inner-spin-button,input.disc::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }

input.disc { width:74px; height:28px; border:1px solid transparent; border-radius:var(--r-sm); background:transparent; box-shadow:none; padding:0 7px; }
input.disc:hover { background:var(--teal-50); border-color:transparent; }
input.disc:focus { outline:none; border-color:var(--side-accent); background:var(--surface); box-shadow:0 0 0 1px var(--side-accent); }

.product-code-emphasis,.product-price-emphasis { font-family:var(--font); font-weight:600; }

.tbl-wrap thead th { font-weight:600; }

.price-list-tools { display:flex; gap:10px; align-items:center; flex-wrap:wrap; padding:12px; border-bottom:1px solid var(--line); }
.price-list-tools input { width:260px; }
.price-list-tools select { width:170px; }
.price-list-tools span { margin-left:auto; color:var(--muted); font-size:12px; }

.customer-editor-modal .fields { grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px 18px; }
.customer-editor-modal .fields > .field { margin-bottom:0; }
.customer-editor-modal .fields > .field.wide { grid-column:1 / -1; }
@media(max-width:900px) { .customer-editor-modal .fields { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:500px) { .customer-editor-modal .fields { grid-template-columns:1fr; } }

.customer-editor-modal .customer-form-layout { display:grid; grid-template-columns:150px minmax(0,1fr); gap:24px; align-items:start; }
.customer-editor-modal .customer-form-layout > .pic-field { width:150px; margin:0; }
.customer-editor-modal .customer-form-layout > .pic-field img,
.customer-editor-modal .customer-form-layout > .pic-field .pic-empty { width:150px; height:150px; aspect-ratio:1; }
.customer-editor-modal .customer-form-layout > .fields { min-width:0; }
@media(max-width:650px) { .customer-editor-modal .customer-form-layout { grid-template-columns:1fr; gap:16px; } }

.customer-editor-modal .customer-editor-content > .distributor-section-heading { margin:14px 0 8px; font-size:13px; padding-bottom:5px; }
.customer-editor-modal .customer-editor-content > .distributor-section-heading:first-child { margin-top:0; }
.customer-editor-modal .customer-company-fields { grid-template-columns:repeat(3,minmax(0,1fr)); }
.customer-editor-modal .customer-address-fields { grid-template-columns:minmax(220px,2fr) repeat(4,minmax(100px,1fr)); }
.customer-editor-modal .customer-address-fields > .field.wide { grid-column:auto; }
.customer-editor-modal .customer-trade-fields { grid-template-columns:minmax(160px,240px) minmax(180px,280px) 110px minmax(90px,1fr); }
.customer-editor-modal .fields input,.customer-editor-modal .fields select { height:32px; min-height:32px; font-size:13px; }
.customer-editor-modal .fields label { font-size:12px; }
.customer-editor-modal input[name=credit_days] { appearance:textfield; -moz-appearance:textfield; }
.customer-editor-modal input[name=credit_days]::-webkit-inner-spin-button,.customer-editor-modal input[name=credit_days]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
@media(max-width:1000px) { .customer-editor-modal .customer-address-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } .customer-editor-modal .customer-address-fields > .field.wide { grid-column:1 / -1; } }
@media(max-width:650px) { .customer-editor-modal .customer-company-fields,.customer-editor-modal .customer-trade-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } }

.customer-location-row { display:flex; align-items:flex-end; gap:12px; margin:12px 0 0; }
.customer-location-row .field { flex:0 1 360px; margin:0; }
.customer-location-row input { width:100%; }
.customer-location-row a[hidden] { display:none; }
@media(max-width:650px){.customer-location-row { flex-wrap:wrap; }}

.customer-map-panel { display:grid; grid-template-columns:minmax(260px,440px) minmax(240px,1fr); gap:16px; margin-top:12px; }
.customer-map-panel[hidden] { display:none; }
@media(max-width:650px){.customer-map-panel{grid-template-columns:1fr;}}

/* Compact customer workspace: details above, trade and location side by side. */
.customer-editor-modal > .body { padding:16px 22px; }
.customer-editor-modal > header,.customer-editor-modal > footer { padding:12px 22px; }
.customer-editor-modal .customer-editor-content { width:100%; }
.customer-editor-modal .customer-form-layout { grid-template-columns:124px minmax(0,1fr); gap:20px; }
.customer-editor-modal .customer-form-layout > .pic-field { width:124px; }
.customer-editor-modal .customer-form-layout > .pic-field img,
.customer-editor-modal .customer-form-layout > .pic-field .pic-empty { width:124px; height:124px; object-fit:cover; }
.customer-editor-modal .pic-field .row { gap:6px; flex-wrap:wrap; }
.customer-editor-modal .pic-field button { padding:5px 8px; font-size:11px; }
.customer-editor-modal .fields { gap:10px 14px; }
.customer-editor-modal .fields label,.customer-editor-modal .pic-field > label { font-size:12px; margin-bottom:5px; }
.customer-editor-modal .customer-editor-content .distributor-section-heading { margin:12px 0 8px; padding-bottom:5px; font-size:13px; font-weight:700; }
.customer-editor-modal .customer-editor-content > .distributor-section-heading:first-child { margin-top:0; }
.customer-editor-modal .customer-bottom-layout { display:grid; grid-template-columns:minmax(260px,.8fr) minmax(0,1.5fr); gap:24px; }
.customer-editor-modal .customer-trade-fields { grid-template-columns:minmax(0,1fr) 100px; }
.customer-editor-modal .customer-field-route_id,
.customer-editor-modal .customer-field-distributor_id { grid-column:1 / -1; }
.customer-editor-modal .customer-trade-fields > .customer-field-active { grid-column:auto; }
.customer-editor-modal .customer-location-row { margin:0; gap:8px; }
.customer-editor-modal .customer-location-row .field { flex:1; min-width:0; }
.customer-editor-modal .customer-location-row label { font-size:12px; margin-bottom:5px; }
.customer-editor-modal .customer-location-row input { height:32px; font-size:12px; }
.customer-editor-modal .customer-location-row .btn-s { padding:7px 10px; font-size:12px; white-space:nowrap; }
.customer-editor-modal .customer-map-panel { grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); gap:12px; margin-top:10px; }
.customer-editor-modal .customer-map-panel .field { margin:0; }
.customer-editor-modal .customer-map-panel label { font-size:12px; margin-bottom:5px; }
.customer-editor-modal .customer-map-panel textarea { height:124px; resize:none; font-size:12px; line-height:1.5; }
@media(max-width:1000px) {
 .customer-editor-modal .customer-bottom-layout { grid-template-columns:1fr; gap:4px; }
 .customer-editor-modal .customer-trade-fields { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .customer-editor-modal .customer-field-route_id,.customer-editor-modal .customer-field-distributor_id { grid-column:auto; }
}
@media(max-width:650px) {
 .customer-editor-modal > .body { padding:14px; }
 .customer-editor-modal .customer-form-layout { grid-template-columns:124px minmax(0,1fr); gap:12px; }
 .customer-editor-modal .customer-company-fields { grid-template-columns:1fr; }
 .customer-editor-modal .customer-trade-fields { grid-template-columns:1fr 1fr; }
 .customer-editor-modal .customer-map-panel { grid-template-columns:1fr; }
 .customer-editor-modal .customer-map-panel textarea { height:64px; }
}

/* Keep the map anchored beside the address and trade fields. */
@media(min-width:1001px) {
 .customer-editor-modal .customer-bottom-layout { grid-template-columns:minmax(0,1.3fr) minmax(340px,1fr); gap:24px; align-items:start; }
 .customer-editor-modal .customer-address-fields { grid-template-columns:repeat(4,minmax(0,1fr)); }
 .customer-editor-modal .customer-address-fields > .customer-field-address { grid-column:1 / -1; }
 .customer-editor-modal .customer-trade-fields { grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) 90px; }
 .customer-editor-modal .customer-field-route_id,.customer-editor-modal .customer-field-distributor_id { grid-column:auto; }
 .customer-editor-modal .customer-location-section { min-width:0; padding-left:20px; border-left:1px solid var(--line); }
 .customer-editor-modal .customer-location-row { flex-wrap:wrap; }
 .customer-editor-modal .customer-location-row .field { flex:1 1 100%; }
 .customer-editor-modal .customer-map-panel { grid-template-columns:1fr; gap:8px; }
 .customer-editor-modal .customer-map-panel iframe { height:150px !important; }
 .customer-editor-modal .customer-map-panel textarea { height:54px; }
}

/* Customer arrangement supplied by the user in customer-layout.json. */
.customer-editor-modal .customer-address-workspace { display:grid; grid-template-columns:minmax(220px,26%) minmax(0,1fr); gap:14px; }
.customer-editor-modal .customer-map-preview { position:relative; height:180px; background:#eef3f6; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.customer-editor-modal .customer-map-preview iframe { height:100% !important; display:block; }
.customer-editor-modal .customer-map-preview iframe[hidden],.customer-editor-modal .customer-map-empty[hidden] { display:none; }
.customer-editor-modal .customer-map-empty { height:100%; display:grid; place-items:center; padding:20px; text-align:center; color:var(--muted); font-size:12px; }
.customer-editor-modal .customer-capture-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); gap:14px; margin-bottom:12px; align-items:end; }
.customer-editor-modal .customer-google-address { margin:0; }
.customer-editor-modal .customer-google-address label { font-size:12px; margin-bottom:5px; }
.customer-editor-modal .customer-google-address textarea { height:46px; resize:none; font-size:12px; line-height:1.4; }
.customer-editor-modal .customer-location-row { flex-wrap:nowrap; gap:8px; }
.customer-editor-modal .customer-location-row .field { flex:1; }
.customer-editor-modal .customer-location-row a { display:none; }
.customer-editor-modal .customer-address-fields { grid-template-columns:1.15fr 1.2fr 1fr 1fr .75fr; }
.customer-editor-modal .customer-address-fields > .customer-field-address { grid-column:auto; }
.customer-editor-modal .customer-trade-fields { grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) 100px minmax(0,.8fr); }
.customer-editor-modal .customer-field-distributor_id { grid-column:1; grid-row:1; }
.customer-editor-modal .customer-field-route_id { grid-column:2; grid-row:1; }
.customer-editor-modal .customer-field-credit_days { grid-column:3; grid-row:1; }
.customer-editor-modal .customer-field-active { grid-column:4; grid-row:1; align-items:flex-end; }
.customer-editor-modal .customer-field-active input { appearance:none; width:38px; height:22px; min-height:22px; border:0; border-radius:20px; background:#cbd5e1; position:relative; cursor:pointer; }
.customer-editor-modal .customer-field-active input::before { content:''; position:absolute; width:16px; height:16px; top:3px; left:3px; background:white; border-radius:50%; }
.customer-editor-modal .customer-field-active input:checked { background:var(--side-accent,#00B8B3); }
.customer-editor-modal .customer-field-active input:checked::before { transform:translateX(16px); }
@media(min-width:1001px) {
 .customer-editor-modal .customer-company-fields { grid-template-columns:1.05fr 1.15fr 1fr .95fr; }
 .customer-editor-modal .customer-field-shop_type { grid-column:1; grid-row:2; }
 .customer-editor-modal .customer-field-gstin { grid-column:3; grid-row:2; }
}
@media(max-width:1000px) {
 .customer-editor-modal > .body { overflow-y:auto; }
 .customer-editor-modal .customer-address-workspace { grid-template-columns:1fr; }
 .customer-editor-modal .customer-address-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .customer-editor-modal .customer-address-fields > .customer-field-address { grid-column:1 / -1; }
 .customer-editor-modal .customer-capture-fields { grid-template-columns:1fr; }
}

/* Revised customer mockup: wider photo and capture below the map. */
.customer-editor-modal .customer-map-stack { display:flex; flex-direction:column; align-items:flex-start; gap:8px; }
.customer-editor-modal .customer-map-stack .customer-map-preview { width:100%; height:160px; }
.customer-editor-modal .customer-map-stack > button { font-size:12px; padding:7px 12px; }
.customer-editor-modal .customer-capture-fields { grid-template-columns:minmax(140px,.8fr) minmax(0,2.8fr); }
.customer-editor-modal .customer-location-row .field { width:100%; }
.customer-editor-modal .customer-location-row input { height:46px; }
@media(min-width:1001px) {
 .customer-editor-modal .customer-form-layout { grid-template-columns:26% minmax(0,1fr); gap:20px; }
 .customer-editor-modal .customer-form-layout > .pic-field { width:100%; }
 .customer-editor-modal .customer-form-layout > .pic-field img,
 .customer-editor-modal .customer-form-layout > .pic-field .pic-empty { width:100%; height:124px; aspect-ratio:auto; }
 .customer-editor-modal .customer-company-fields { grid-template-columns:repeat(3,minmax(0,1fr)); align-content:space-between; min-height:155px; }
 .customer-editor-modal .customer-field-shop_name { grid-column:1; grid-row:1; }
 .customer-editor-modal .customer-field-shop_type { grid-column:2; grid-row:1; }
 .customer-editor-modal .customer-field-gstin { grid-column:3; grid-row:1; }
 .customer-editor-modal .customer-field-owner_name { grid-column:1; grid-row:2; }
 .customer-editor-modal .customer-field-phone { grid-column:2; grid-row:2; }
 .customer-editor-modal .customer-field-contact_role { grid-column:3; grid-row:2; }
 .customer-editor-modal .customer-trade-fields { grid-template-columns:minmax(180px,250px) minmax(150px,200px) 100px 80px; }
}
@media(max-width:650px) {
 .customer-editor-modal .customer-capture-fields { grid-template-columns:1fr; }
}

/* Keep customer detail rows close together rather than stretching to photo height. */
.customer-editor-modal .customer-company-fields { align-content:start; min-height:0; row-gap:12px; }

.customer-editor-modal .customer-capture-fields { align-items:start; margin-bottom:10px; }
.customer-editor-modal .customer-location-row input,
.customer-editor-modal .customer-google-address textarea { height:32px; min-height:32px; padding:6px 10px; font-size:13px; line-height:18px; }
.customer-editor-modal .customer-google-address textarea { white-space:nowrap; overflow:auto; }

/* Matching landscape photo and map frames. */
.customer-editor-modal .customer-form-layout > .pic-field img,
.customer-editor-modal .customer-form-layout > .pic-field .pic-empty { height:auto; aspect-ratio:16 / 9; object-fit:contain; background:#eef3f6; }
.customer-editor-modal .customer-map-stack .customer-map-preview { height:auto; aspect-ratio:16 / 9; }
.customer-editor-modal .customer-map-preview iframe { position:absolute; inset:0; width:100%; height:100% !important; }
.customer-editor-modal .customer-map-stack { gap:5px; }
.customer-editor-modal .customer-map-label { font-size:12px; font-weight:500; margin:0; }
.customer-editor-modal .customer-map-stack > button { margin-top:3px; }
.customer-editor-modal .pic-field .row { gap:6px; }

/* Align Address exactly with the Store location column above. */
@media(min-width:1001px) {
 .customer-editor-modal .customer-capture-fields { grid-template-columns:minmax(0,22%) minmax(0,1fr); gap:14px; }
 .customer-editor-modal .customer-address-fields { grid-template-columns:minmax(0,22%) minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr) minmax(0,.75fr); gap:14px; }
}

/* Full-page forms adapt to phones; desktop grid placement must not leak below this breakpoint. */
@media(max-width:650px) {
 .shell.item-editor-open > .item-editor-overlay,
 .shell.narrow.item-editor-open > .item-editor-overlay { left:0; }
 .shell.item-editor-open > .side { display:none; }
 .item-editor-modal > .body { overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; }
 .item-editor-modal > header,.item-editor-modal > footer { padding:12px 14px; }
 .item-editor-modal > footer { padding-bottom:max(12px,env(safe-area-inset-bottom)); }
 .item-editor-modal input:not([type=checkbox]),.item-editor-modal select,.item-editor-modal textarea { font-size:16px; max-width:100%; }
 .item-editor-modal .field { min-width:0; }
 .customer-editor-modal .customer-form-layout { grid-template-columns:minmax(0,1fr); gap:16px; }
 .customer-editor-modal .customer-form-layout > .pic-field { width:100%; max-width:400px; }
 .customer-editor-modal .customer-form-layout > .pic-field img,
 .customer-editor-modal .customer-form-layout > .pic-field .pic-empty { width:100%; }
 .customer-editor-modal .customer-company-fields,
 .customer-editor-modal .customer-address-fields,
 .customer-editor-modal .customer-trade-fields { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
 .customer-editor-modal .fields > .field { grid-column:auto; grid-row:auto; }
 .customer-editor-modal .customer-address-fields > .customer-field-address { grid-column:1 / -1; }
 .customer-editor-modal .customer-address-workspace,.customer-editor-modal .customer-capture-fields { grid-template-columns:minmax(0,1fr); }
 .customer-editor-modal .customer-map-stack { width:100%; }
 .customer-editor-modal .customer-location-row { width:100%; }
 .customer-editor-modal .fields input:not([type=checkbox]),.customer-editor-modal .fields select,
 .customer-editor-modal .customer-location-row input,.customer-editor-modal .customer-google-address textarea { height:44px; min-height:44px; font-size:16px; padding:10px; }
 .customer-editor-modal .customer-google-address textarea { height:72px; white-space:normal; }
 .customer-editor-modal .pic-field button,.customer-editor-modal .customer-map-stack > button { min-height:40px; padding:8px 12px; font-size:13px; }
 .customer-editor-modal .customer-field-active { align-items:flex-start; }
 .distributor-editor-modal .distributor-trade-fields { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
 .distributor-editor-modal .distributor-trade-fields > .field,
 .distributor-editor-modal .distributor-trade-fields > .pic-field { grid-column:auto !important; width:auto; min-width:0; }
}
@media(max-width:420px) {
 .customer-editor-modal .customer-company-fields,
 .customer-editor-modal .customer-address-fields,
 .customer-editor-modal .customer-trade-fields { grid-template-columns:minmax(0,1fr); }
 .customer-editor-modal .customer-address-fields > .customer-field-address { grid-column:auto; }
}

.area-tree { padding:12px; }
.area-tree details { border:1px solid var(--line); border-radius:6px; margin:6px 0; padding:8px 12px; }
.area-tree details details { margin-left:18px; }
.area-tree summary { cursor:pointer; font-weight:600; padding:4px 0; }
.area-tree input { width:18px; height:18px; margin-right:10px; vertical-align:middle; accent-color:var(--side-accent,#00B8B3); }
.area-tree-leaf { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-left:18px; padding:9px 0; }
.area-tree-leaf small { margin-left:auto; }
@media(max-width:650px){.area-tree { padding:8px; }.area-tree details details { margin-left:8px; }.area-tree-leaf { margin-left:4px; }.area-tree-leaf small { width:100%; margin-left:28px; }}

.distributor-editor-modal .distributor-service-areas { margin-top:6px; align-self:flex-start; height:30px; padding:4px 8px; font-size:11px; white-space:nowrap; }

.distributor-editor-modal .distributor-service-areas { height:32px; min-height:32px; padding:6px 12px; font-size:13px; }
@media(max-width:650px) { .distributor-editor-modal .distributor-service-areas { height:44px; min-height:44px; } }

/* Customer fields follow the requested visual and keyboard sequence. */
.customer-editor-modal .customer-company-fields > .field { grid-column:auto; grid-row:auto; }
@media(min-width:1001px) {
 .customer-editor-modal .customer-company-fields { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .customer-editor-modal .customer-company-fields > .field { grid-column:auto; grid-row:auto; }
}

.distributor-editor-modal .distributor-service-areas { margin-top:0; }
@media(min-width:751px) {
 .distributor-editor-modal .distributor-trade-fields.has-service-areas { grid-template-columns:140px 110px 110px 110px 140px minmax(90px,1fr); }
 .distributor-editor-modal .distributor-trade-fields > .distributor-service-field { grid-column:5; margin:0; }
 .distributor-editor-modal .distributor-trade-fields.has-service-areas > .field.dist-field-active { grid-column:6; }
}

/* Compact customer detail rows, keeping mobile controls easy to tap. */
.customer-editor-modal .customer-company-fields { row-gap:6px; }
.customer-editor-modal .customer-company-fields > .field { margin-bottom:0; }
.customer-editor-modal .customer-company-fields label { margin-bottom:4px; }
@media(max-width:650px) { .customer-editor-modal .customer-company-fields { row-gap:10px; } }

.distributor-editor-modal .distributor-service-field { width:110px; min-width:0; }
.distributor-editor-modal .distributor-service-areas { width:110px; height:32px; min-height:32px; padding:6px 8px; font-size:13px; }
.distributor-editor-modal .distributor-service-areas.has-selection { border-color:var(--side-accent,#00B8B3); }
@media(min-width:751px) { .distributor-editor-modal .distributor-trade-fields.has-service-areas { grid-template-columns:140px 110px 110px 110px 110px minmax(90px,1fr); } }
@media(max-width:650px) { .distributor-editor-modal .distributor-service-areas { width:100%; height:44px; min-height:44px; } }

/* Office photo uses the same landscape frame as customer Store photo. */
.distributor-editor-modal .distributor-trade-fields > .distributor-trade-photo { width:100%; min-width:0; }
.distributor-editor-modal .distributor-trade-photo img,
.distributor-editor-modal .distributor-trade-photo .pic-empty { width:100%; height:auto; aspect-ratio:16 / 9; object-fit:contain; background:#eef3f6; }
.distributor-editor-modal .distributor-trade-photo .row { flex-wrap:wrap; }
@media(min-width:1001px) {
 .distributor-editor-modal .distributor-trade-fields { grid-template-columns:26% 110px 110px 110px minmax(90px,1fr); }
 .distributor-editor-modal .distributor-trade-fields.has-service-areas { grid-template-columns:26% 110px 110px 110px 110px minmax(90px,1fr); }
}
@media(max-width:1000px) {
 .distributor-editor-modal .distributor-trade-fields,
 .distributor-editor-modal .distributor-trade-fields.has-service-areas { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .distributor-editor-modal .distributor-trade-fields > .field { grid-column:auto !important; width:auto; }
 .distributor-editor-modal .distributor-trade-fields > .distributor-trade-photo { grid-column:1 / -1 !important; max-width:400px; }
}

.customer-editor-modal .customer-trade-fields > .field[hidden] { display:none; }
.customer-editor-modal .customer-trade-fields > .field { grid-column:auto; grid-row:auto; }
@media(min-width:1001px) { .customer-editor-modal .customer-trade-fields { grid-template-columns:150px minmax(180px,260px) minmax(150px,220px) 100px 80px; } }
@media(max-width:650px) { .customer-editor-modal .customer-trade-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:420px) { .customer-editor-modal .customer-trade-fields { grid-template-columns:minmax(0,1fr); } }

/* One aligned trade row; hidden alternative suppliers never occupy a cell. */
.customer-editor-modal .customer-trade-fields { grid-template-columns:minmax(160px,1fr) minmax(210px,1.6fr) minmax(160px,1.2fr) 110px 80px; gap:10px 14px; align-items:start; }
.customer-editor-modal .customer-trade-fields > .field { grid-row:auto !important; grid-column:auto !important; min-width:0; margin:0; align-items:stretch; }
.customer-editor-modal .customer-trade-fields > .customer-field-active { align-items:flex-end; }
.customer-editor-modal .customer-trade-fields label { white-space:nowrap; }
.customer-editor-modal .customer-trade-fields input:not([type=checkbox]),.customer-editor-modal .customer-trade-fields select { width:100%; min-width:0; }
@media(max-width:1000px) { .customer-editor-modal .customer-trade-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:420px) { .customer-editor-modal .customer-trade-fields { grid-template-columns:1fr; } }

/* Responsive area picker: only the list scrolls, keeping actions accessible. */
.area-picker-modal > header,.area-picker-modal > footer { flex-shrink:0; }
.area-picker-modal > .body { display:flex; flex:1; min-height:0; overflow:hidden; }
.area-picker-content { display:flex; flex-direction:column; width:100%; min-width:0; min-height:0; }
.area-picker-content > input { flex-shrink:0; }
.area-picker-list { min-height:0; overflow-y:auto; overscroll-behavior:contain; }
.area-picker-modal .area-tree summary { overflow-wrap:anywhere; }
@media(max-width:650px) {
 .modal-bg.area-picker-overlay { padding:0; }
 .modal.area-picker-modal { width:100%; max-width:none; height:100dvh; max-height:100dvh; border-radius:0; }
 .area-picker-modal > header { padding:12px 14px; padding-top:max(12px,env(safe-area-inset-top)); }
 .area-picker-modal > header h2 { font-size:18px; min-width:0; overflow-wrap:anywhere; }
 .area-picker-modal > header button { flex-shrink:0; min-width:44px; min-height:44px; }
 .area-picker-modal > .body { padding:12px 10px; }
 .area-picker-modal > footer { padding:10px 14px max(10px,env(safe-area-inset-bottom)); }
 .area-picker-modal > footer button { flex:1; min-height:44px; }
 .area-picker-content > input { min-height:44px; font-size:16px; }
 .area-picker-modal .area-tree { padding:0; }
 .area-picker-modal .area-tree details { padding:6px 8px; }
 .area-picker-modal .area-tree summary { min-height:44px; line-height:24px; }
 .area-picker-modal .area-tree input[type=checkbox] { width:22px; height:22px; min-height:22px; }
}

.mobile-sign-out { display:none; }
@media(max-width:860px) {
 .mobile-sign-out { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:6px 12px; flex-shrink:0; }
 .side-foot { flex-shrink:0; padding-bottom:max(10px,env(safe-area-inset-bottom)); }
 .side-foot button { min-width:44px; min-height:44px; }
}

.order-items-gate { border:0; padding:0; margin:0; min-width:0; }
.order-items-gate:disabled { opacity:.5; }
.order-location-panel { padding:12px; margin-top:12px; border:1px solid var(--line); border-radius:10px; }
.order-location-panel[hidden],.order-first-verification[hidden] { display:none; }
.order-location-status { margin-top:8px; font-size:13px; overflow-wrap:anywhere; }
.order-first-verification .pic-field { width:240px; max-width:100%; margin-bottom:12px; }
.order-first-verification img,.order-first-verification .pic-empty { width:100%; aspect-ratio:16/9; height:auto; object-fit:contain; }
.order-first-verification > button { margin:0 0 12px; }
@media(max-width:650px) { .order-location-panel button { min-height:44px; } }

@media(max-width:650px) {
 .order-entry-modal > .body { padding:12px; }
 .order-entry-modal .row { flex-wrap:wrap; gap:8px; }
 .order-entry-modal .row > div:first-child { flex:1 1 100% !important; min-width:0; }
 .order-entry-modal select,.order-entry-modal input,.order-entry-modal textarea { font-size:16px; min-width:0; }
 .order-entry-modal > header,.order-entry-modal > footer { flex-shrink:0; }
 .order-entry-modal > footer button { min-height:44px; }
}

.rules-group { margin-top:14px; }
.rules-group > summary { cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 18px; }
.rules-group .fields { grid-template-columns:repeat(3,minmax(0,1fr)); }
.rules-catalogue { display:grid; grid-template-columns:minmax(160px,1fr) minmax(0,3fr); gap:10px 18px; margin:16px 0 0; }
.rules-catalogue dt { font-weight:600; }
.rules-catalogue dd { margin:0; color:var(--muted); overflow-wrap:anywhere; }
.rules-settings .row { flex-wrap:wrap; }
@media(max-width:650px) { .rules-group .fields,.rules-catalogue { grid-template-columns:1fr; } .rules-catalogue { gap:6px; } .rules-catalogue dd { margin-bottom:12px; } .rules-group > summary { flex-wrap:wrap; } .rules-group input { font-size:16px; min-height:44px; } }

/* Order forms use the full workspace with a fixed header and actions. */
/* The modal is a flex column, and a flex box's default min-width:auto lets a
   wide child stretch it past its own max-width — which is how the items table
   pushed the form off the right of the screen. */
.modal.page-form-modal { max-width:100%; min-width:0; }
.modal.page-form-modal > header { padding-right:max(28px,env(safe-area-inset-right)); }
.modal.page-form-modal > .body { display:block; overflow-y:auto; overflow-x:hidden; min-width:0; padding-right:max(32px,env(safe-area-inset-right)); }
.modal.page-form-modal > footer { padding-right:max(28px,env(safe-area-inset-right)); }
.modal.page-form-modal.order-entry-modal > .body { padding-top:12px; }

/* The items table is wider than a narrow window, and that width was pushing
   the whole form past the right edge of the screen. Everything down to the
   table can now shrink, so the table scrolls inside the form instead. */
.simple-order-form > .body > div { width:100%; max-width:none; min-height:100%; margin:0; min-width:0; display:flex; flex-direction:column; }

/* The punch screen is the same kind of page as the order form: a full canvas
   rather than a dialog squeezed into the middle of the screen. */
.punch-page > .body > div { width:100%; max-width:none; min-height:100%; margin:0; min-width:0; }
.punch-page .subcard { border:0; padding:0; margin-top:18px; }
.punch-page .subcard > header { padding:0 0 8px; min-height:auto; border-bottom:0; }
.punch-page .order-basic-fields > .field { margin-bottom:0; }
.punch-page .order-party-field select { height:32px; }
@media(min-width:901px){.punch-page .order-party-field { padding-bottom:6px; }}
/* The punch lines are the order form's lines with different columns: the
   picture, which order the line answers, the item, what is owed, and what
   the invoice says. Everything else — row height, borderless boxes, the
   right-aligned figures — comes from the order form itself. */
.punch-page .order-item-head,
.punch-page .order-item-row { display:grid;
  grid-template-columns:34px minmax(260px,1fr) 62px 62px 62px 66px 66px 82px 130px;
  gap:8px; min-width:846px; align-items:center; }
.punch-page .order-item-head { color:var(--muted); background:var(--subtle); font-size:var(--fs-small); font-weight:600;
  height:32px; padding:0; border:0; border-radius:7px 7px 0 0; box-sizing:border-box; }
.punch-page .order-item-row { height:32px; padding:0; border:0; box-sizing:border-box; }
.punch-page .order-item-row:focus-within { background:var(--hover); box-shadow:inset 2px 0 0 var(--teal); }
.punch-page .order-items-scroll { min-width:0; max-width:100%; width:100%; overflow-x:auto; padding:0 0 4px; }
.punch-page .order-item-lines { height:352px; max-height:352px; overflow-y:auto; scrollbar-gutter:stable; }
.punch-page .order-item-summary { display:grid;
  grid-template-columns:34px minmax(260px,1fr) 62px 62px 62px 66px 66px 82px 130px;
  gap:8px; min-width:846px; height:32px; align-items:center; padding:0; margin-top:2px;
  border-radius:0 0 7px 7px; background:var(--subtle); color:var(--text);
  box-sizing:border-box; font-size:var(--fs-small); font-variant-numeric:tabular-nums; }
.punch-page .order-item-summary > :nth-child(2) { font-weight:700; }
.punch-page .order-item-summary > :nth-child(8),
.punch-page .order-item-summary > :nth-child(9) { padding-right:10px; text-align:right; }
.punch-page .order-item-head > :last-child,
.punch-page .order-item-row > :last-child,
.punch-page .order-item-summary > :last-child { padding-right:16px; }
.punch-page .order-item-head > :last-child { white-space:nowrap; }
.punch-page .order-item-head > :nth-child(n+3),
.punch-page .order-item-row > :nth-child(n+3) { text-align:right; }
.punch-page .order-item-row input { min-width:0; width:100%; text-align:right; padding-right:10px;
  border:1px solid transparent; background:transparent; box-shadow:none; }
.punch-page .order-item-row input:hover { background:var(--teal-50); }
.punch-page .order-item-row input:focus { outline:none; background:var(--surface);
  border-color:var(--teal); box-shadow:0 0 0 1px var(--teal); }
.punch-page .order-line-value { font-variant-numeric:tabular-nums; }
.punch-page .dispatch-item-line { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.simple-order-form .order-items-gate,
.simple-order-form .order-items-scroll { min-width:0; max-width:100%; width:100%; }
/* a clear break between the customer's details and the order itself */
.simple-order-form .order-items-gate { margin:12px 0 0; }
.simple-order-form .order-items-scroll { overflow-x:auto; padding:0 0 4px; }
.simple-order-form .order-item-lines { height:352px; max-height:352px; overflow-y:auto; scrollbar-gutter:stable; }
.simple-order-form .order-item-head,.simple-order-form .order-item-row { display:grid; grid-template-columns:16px 36px minmax(330px,1fr) 26px 62px 54px 56px 62px 64px 120px; gap:8px; min-width:842px; align-items:center; }
.simple-order-form .order-item-summary { display:grid; grid-template-columns:16px 36px minmax(330px,1fr) 26px 62px 54px 56px 62px 64px 120px; gap:8px; min-width:842px; align-items:center; padding:5px 0; margin-top:2px; border-radius:0 0 7px 7px; background:var(--subtle); color:var(--text); font-size:var(--fs-small); font-variant-numeric:tabular-nums; }
.simple-order-form .order-item-summary > :nth-child(3) { padding-left:4px; font-weight:700; }
/* The totals sit under their own headings: the same right inset the
   headings and the figures above them use. */
.simple-order-form .order-item-summary > :nth-child(n+4) { padding-right:10px; text-align:right; }
/* the chosen item's picture, before its name */
.order-line-thumb { width:28px; height:28px; padding:0; box-sizing:border-box; flex:0 0 auto; align-self:center;
  border-radius:6px; border:1px solid var(--line);
  background:var(--subtle); overflow:hidden; display:grid; place-items:center; }
.order-line-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.order-line-thumb.empty::after { content:""; width:16px; height:16px; border-radius:3px;
  border:1.5px solid var(--placeholder); opacity:.55; }
.simple-order-form .order-item-head { color:var(--muted); background:var(--subtle); font-size:var(--fs-small); font-weight:600; padding:0; height:32px; border:0; border-radius:7px 7px 0 0; }
/* No heading wraps. "GST %" over two lines made the heading row taller than
   every row under it, which reads as a gap above the first item. */
.simple-order-form .order-item-head > * { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.simple-order-form .order-item-head > :first-child { text-align:center; }
.simple-order-form .order-item-head > :nth-child(2) { text-align:left; white-space:nowrap; }
.simple-order-form .order-item-head > :nth-child(3) { padding-left:4px; }
.simple-order-form .order-item-head > :nth-child(10) { white-space:nowrap; }
.simple-order-form .order-item-row { height:32px; padding:0; border-bottom:0; box-sizing:border-box; }
.simple-order-form .order-item-row input,.simple-order-form .order-item-row select { min-width:0; width:100%; }
/* An order line reads like a price list line: no boxes until you reach for
   one. The border stays, transparent, so nothing shifts when it appears. */
.simple-order-form .order-item-row input,
.simple-order-form .order-item-row select,
.simple-order-form .order-item-row .btn-s {
  border:1px solid transparent; background:transparent; box-shadow:none; }
.simple-order-form .order-item-row input:hover,
.simple-order-form .order-item-row select:hover,
.simple-order-form .order-item-row .btn-s:hover { background:var(--teal-50); }
.simple-order-form .order-item-row input:focus,
.simple-order-form .order-item-row select:focus {
  outline:none; background:var(--surface); border-color:var(--teal); box-shadow:0 0 0 1px var(--teal); }
/* Numbers right, from MRP onwards. The picture is column 1 and the item is
   column 2, so this counts from the third — before the picture existed the
   item was :first-child and fell out of this rule on its own. */
.simple-order-form .order-item-head > :nth-child(n+4),
.simple-order-form .order-item-row > :nth-child(n+4),
.simple-order-form .order-item-row input:not([aria-label="Search item"]),
.simple-order-form .order-item-row select { text-align:right; }
/* The discounts are dropdowns; without the native arrow they read as figures
   in a column, and the selected value needs telling to sit right as well. */
.simple-order-form .order-item-row select {
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  background-image:none; text-align-last:right; }
/* One right inset for the numeric columns, so a heading sits over its own
   figures instead of a few pixels off them. */
.simple-order-form .order-item-head > :nth-child(n+4),
.simple-order-form .order-item-row > :nth-child(n+4),
.simple-order-form .order-item-row input:not([aria-label="Search item"]),
.simple-order-form .order-item-row select { padding-right:10px; }
.simple-order-form .order-line-value,.simple-order-form .order-line-amount { text-align:right; font-variant-numeric:tabular-nums; }
.simple-order-form .order-line-serial { text-align:left; color:var(--muted); font-variant-numeric:tabular-nums; }
.simple-order-form .order-item-main { display:grid; grid-template-columns:28px minmax(0,1fr); gap:10px; align-items:center; min-width:0; }
.simple-order-form .order-line-amount { font-weight:700; }
.simple-order-form .order-items-gate h3 { font-size:var(--fs-cell); }
.simple-order-form .order-item-row button { padding:8px; }
.simple-order-form .order-item-row .order-line-remove { width:16px; min-width:16px; padding:0; justify-self:center; }
.simple-order-form .order-item-product { position:relative; }
.order-item-results { position:fixed; z-index:1200; max-height:310px; overflow:auto; background:var(--surface); border:1px solid var(--line); border-radius:10px; box-shadow:0 12px 30px #071b3030; padding:5px; }
/* An option is a button, and buttons are 32px tall by default — which cut
   every 42px thumbnail off and stacked them over the row below. */
.order-item-option { display:grid; grid-template-columns:44px minmax(0,1fr) auto; gap:10px; align-items:center;
  width:100%; height:auto; min-height:50px; padding:3px 7px; color:var(--text); background:transparent;
  border:0; border-radius:7px; text-align:left; cursor:pointer; }
.order-item-option:hover,.order-item-option.active { background:var(--teal-soft,#e0f3f2); }
.order-item-option img,.order-item-thumb-empty { width:42px; height:42px; border-radius:6px; object-fit:cover; background:var(--subtle); border:1px solid var(--line); }
.order-item-thumb-empty { display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:9px; text-align:center; }
.order-item-option span { min-width:0; display:flex; flex-direction:column; }
.order-item-option b,.order-item-option small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.order-item-option b { line-height:1.1; }
.order-item-option small { color:var(--muted); margin-top:8px; line-height:1.1; }
.order-item-option strong { font-variant-numeric:tabular-nums; }
.order-item-empty { padding:14px; color:var(--muted); text-align:center; }
@media(max-width:650px){
 .simple-order-form .order-item-head,.simple-order-form .order-item-row { min-width:818px; grid-template-columns:16px 36px 304px 26px 54px 50px 48px 58px 60px 112px; gap:7px; }
 .simple-order-form .order-item-summary { min-width:818px; grid-template-columns:16px 36px 304px 26px 54px 50px 48px 58px 60px 112px; gap:7px; }
}

/* Basic details, Billing details and Items are the same kind of thing, so
   they read the same: one size, one weight, one gap underneath. */
.order-section-title { display:block; margin:0 0 8px; font-size:var(--fs-cell);
  font-weight:700; letter-spacing:-.01em; color:var(--text); }
.order-party-field { position:relative; }
/* The results open under the Customer box but are not tied to its width:
   they grow rightwards to fit the longest shop name, so nothing wraps. */
.order-party-results { position:absolute; top:calc(100% + 4px); left:0; right:auto; z-index:5;
  min-width:100%; width:max-content; max-width:min(1040px, calc(100vw - 300px));
  max-height:330px; overflow:auto; background:var(--surface);
  border:1px solid var(--line); border-radius:8px; box-shadow:0 8px 24px #071b3020; }
.order-party-results table { width:100%; }
.order-party-results td { white-space:nowrap; }
.order-party-results th { position:sticky; top:0; background:var(--subtle); font-weight:700; white-space:nowrap; }
.order-party-results td,.order-party-results th { padding:10px 12px; }
.order-party-results tr.search-active { background:var(--teal-soft,#e0f3f2); }
/* a row walked to with the arrow keys, in any picker */
.picker-rows tbody tr.search-active { background:var(--hover); box-shadow:inset 2px 0 0 var(--teal); }
@media(max-width:650px){.order-party-results { max-height:300px; max-width:calc(100vw - 40px); }}

/* Customer and Billing details share the first line. The four short fields
   form one aligned line below Customer, matching the approved order mockup. */
.order-basic-fields { display:grid;
  grid-template-columns:140px 140px 140px 170px minmax(300px,1fr);
  grid-template-areas:"title title title title billing" "party party party party billing" "date number price supply billing";
  row-gap:7px; column-gap:16px; align-items:start; }
.order-basic-heading { grid-area:title; margin:0; }
.order-basic-fields > .field { margin-bottom:0; }
.order-party-field { position:relative; min-width:0; grid-area:party; }
@media(min-width:901px){.order-basic-fields > .order-party-field { padding-top:7px; }}
.order-date-field { grid-area:date; }
.order-number-field { grid-area:number; }
.order-price-field { grid-area:price; }
.order-supply-field { grid-area:supply; }
.order-basic-fields > .field { min-width:0; }
/* Read-only, because the price list follows the customer. It reads as a
   filled-in field, not as a disabled grey one. */
.order-derived { background:var(--surface); color:var(--text-2); cursor:default; }
.order-derived:focus { border-color:var(--line); box-shadow:none; }
.order-billing-details { grid-area:billing; display:block; width:auto; max-width:100%; min-width:0; box-sizing:border-box; padding:0; margin:0; border:0; font-size:13px; overflow-wrap:anywhere; justify-self:start; }
.order-billing-address { overflow-wrap:anywhere; word-break:break-word; }
.order-billing-address > span { margin-right:5px; }
.order-billing-details > div:first-child { line-height:1.6; }
/* The address lines are set looser than the rest of the form, and that extra
   leading sits above the first line too — so this heading needs 3px less
   under it to leave the same visible gap as the other two. */
.order-billing-details .order-section-title { margin-bottom:5px; }
@media(max-width:1180px){.order-basic-fields { grid-template-columns:repeat(3,120px) 150px minmax(260px,1fr); row-gap:7px; column-gap:10px; }}
@media(max-width:900px){.order-basic-fields { grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-areas:"title title" "party party" "date number" "price supply" "billing billing"; }
  .order-billing-details { width:auto; min-height:0; }}
@media(max-width:650px){.order-basic-fields { grid-template-columns:minmax(0,1fr);
    grid-template-areas:"title" "party" "date" "number" "price" "supply" "billing"; gap:12px; }}
/* Order for (23 Nov 2026): beside the customer search, in the Supplied from
   column, its label on the Customer heading line. Phones: its own line. */
.order-for-field:not([hidden]) { display:contents; }
.order-for-field > label { grid-area:oflabel; align-self:end; margin:0; }
.order-for-field > select { grid-area:orderfor; min-width:0; width:100%; }
@media(min-width:901px){
  .order-basic-fields.has-order-for { grid-template-areas:"title title title oflabel billing" "party party party orderfor billing" "date number price supply billing"; }
  .order-basic-fields > .order-for-field > select { margin-top:7px; }}
@media(max-width:900px){
  .order-basic-fields.has-order-for { grid-template-areas:"title title" "party party" "oflabel oflabel" "orderfor orderfor" "date number" "price supply" "billing billing"; }}
@media(max-width:350px){
  .order-basic-fields.has-order-for { grid-template-areas:"title" "party" "oflabel" "orderfor" "date" "number" "price" "supply" "billing"; }}

.simple-order-form .order-items-titlebar,
.punch-page .order-items-titlebar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:4px; }
.punch-page .order-items-titlebar { min-height:28px; margin-top:12px; }
.simple-order-form .order-items-titlebar .order-section-title,
.punch-page .order-items-titlebar .order-section-title { margin:0; }
.simple-order-form .order-items-titlebar .btn-s,
.punch-page .order-items-titlebar .btn-s { flex:0 0 auto; }
.order-items-gate { border:0; padding:0; margin:0; min-width:0; }
.order-items-gate[disabled] { opacity:1; }
.simple-order-form .order-after-grid { display:grid; grid-template-columns:minmax(0,470px) minmax(360px,1fr); gap:24px; align-items:start; margin-top:0; }
.simple-order-form .order-notes { width:100%; margin:0; padding:0; flex:0 0 auto; }
.simple-order-form .order-notes textarea { height:48px; min-height:48px; }
.simple-order-form .order-totals-breakdown { width:360px; margin-right:0; justify-self:end; font-size:var(--fs-small); font-variant-numeric:tabular-nums; }
.simple-order-form .order-total-line { display:grid; grid-template-columns:minmax(0,1fr) 120px; gap:16px; min-height:20px; align-items:center; line-height:1.15; }
.simple-order-form .order-total-line span { text-align:right; color:var(--text-2); }
.simple-order-form .order-total-line strong { padding-right:10px; text-align:right; }
.simple-order-form .order-total-line.grand { margin-top:1px; padding-top:3px; border-top:1px solid var(--line); font-size:var(--fs-cell); }
.simple-order-form .order-total-line.grand span,.simple-order-form .order-total-line.grand strong { color:var(--text); font-weight:700; }
@media(max-width:900px){
 .simple-order-form .order-after-grid { grid-template-columns:1fr; gap:8px; }
 .simple-order-form .order-totals-breakdown { width:min(360px,100%); margin-right:0; }
}
@media(max-width:650px){.simple-order-form > .body > div { width:100%; }}

@media(max-width:650px){
 .modal.page-form-modal > header { padding-right:max(18px,env(safe-area-inset-right)); }
 .modal.page-form-modal > .body { padding-right:max(20px,env(safe-area-inset-right)); }
 .modal.page-form-modal > footer { padding-right:max(18px,env(safe-area-inset-right)); }
}

.simple-order-form,.simple-order-form input,.simple-order-form select,.simple-order-form textarea,.simple-order-form table { font-family:var(--font); }
.simple-order-form .field > label,.simple-order-form .order-billing-details { font-size:var(--fs-cell); }

.simple-order-form .field > label { font-size:var(--fs-small); }
.simple-order-form .order-section-title { font-size:var(--fs-cell); }

/* Keep Retailer trade details in the established desktop row. */
@media(min-width:1001px){.customer-editor-modal .customer-trade-fields { grid-template-columns:150px 150px minmax(150px,220px) 125px 76px 70px; gap:14px; }}



/* Align the distributor photo preview with the Firm name input. */
.distributor-editor-modal .distributor-photos { padding-top:0; }
.distributor-editor-modal .distributor-photos .pic-field > label { font-size:13px; margin-bottom:5px; }
@media(min-width:1000px){.distributor-editor-modal .distributor-photos .pic-field > label { font-size:12px; }}

/* Use the same outer page spacing as Products throughout all full-page
   editors. Internal grids keep their own field and section gaps. */
.item-editor-modal > header,
.item-editor-modal > .body,
.item-editor-modal > footer,
.distributor-editor-modal > header,
.distributor-editor-modal > .body,
.distributor-editor-modal > footer { padding-left:14px; padding-right:14px; }
.modal.page-form-modal > header,
.modal.page-form-modal > .body,
.modal.page-form-modal > footer { padding-left:14px; padding-right:14px; }
@media(max-width:860px){
  .item-editor-modal > header,
  .item-editor-modal > .body,
  .item-editor-modal > footer,
  .distributor-editor-modal > header,
  .distributor-editor-modal > .body,
  .distributor-editor-modal > footer,
  .modal.page-form-modal > header,
  .modal.page-form-modal > .body,
  .modal.page-form-modal > footer { padding-left:16px; padding-right:16px; }
}

/* ---------------------------------------------------------------- responsive workspace
   Phone and tablet layouts share one rule set. Pages never grow wider than
   the viewport; wide business grids scroll inside their own frame. */
@media(max-width:860px) {
  html,body { max-width:100%; overflow-x:hidden; }
  .shell.item-editor-open > .item-editor-overlay,
  .shell.narrow.item-editor-open > .item-editor-overlay { left:0; }
  .shell.item-editor-open > .side { display:none; }
  .main,.content,.page-head,.card,.card > header,.card > .body { min-width:0; max-width:100%; }
  .content { padding:12px; }
  .topbar { padding-left:12px; padding-right:12px; }
  .page-head { align-items:flex-start; }
  .page-head .acts { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; }
  .card > header { align-items:center; }
  .card > header > input,
  .card > header > select { flex:1 1 150px; min-width:0; max-width:100%; }
  .tbl-wrap,.order-items-scroll { max-width:100%; -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; }
  .map { height:min(52vh,360px); }
  .live-map { height:min(46vh,300px); }
}

@media(max-width:650px) {
  :root { --top:52px; }
  .content { padding:10px; }
  .topbar { padding-left:10px; padding-right:10px; }
  .page-head { margin-bottom:6px; }
  .page-head h1 { font-size:15px; }
  .page-head .acts { width:100%; padding-bottom:2px; }
  .page-head .acts .btn,.page-head .acts button { min-height:40px; height:40px; }

  /* Comfortable touch targets on phone screens. Dense line-entry grids keep
     their deliberate 32px rows and remain horizontally scrollable. */
  .card > header { gap:8px; padding-bottom:8px; }
  .card > header input,.card > header select,
  .card > header .btn,.card > header button { min-height:40px; height:40px; }
  .card > header h2 { flex:1 1 100%; }
  button,.btn { min-height:40px; }
  input:not([type=checkbox]):not([type=radio]),select { min-height:40px; }
  textarea { min-height:72px; }
  form,.fields,.field,.row,.subcard,.modal .body { min-width:0; max-width:100%; }
  .field input:not([type=checkbox]):not([type=radio]),
  .field select,.field textarea,
  .row input:not([type=checkbox]):not([type=radio]),
  .row select,.row textarea { width:100%; min-width:0; max-width:100%; }
  .row > .field { flex:1 1 150px; }
  input[type=file] { width:100%; min-width:0; max-width:100%; overflow:hidden; }
  .simple-order-form .order-item-row input,
  .simple-order-form .order-item-row select,
  .punch-page .order-item-row input { min-height:0; height:30px; }
  .simple-order-form .order-item-row button { min-height:20px; height:20px; }

  /* Every form is usable as a full phone screen, with fixed actions and only
     its body scrolling. Safe-area insets cover modern portrait and landscape
     devices without changing desktop spacing. */
  .modal-bg { padding:0; place-items:stretch; }
  .modal,.modal.wide { width:100%; max-width:none; height:100dvh; max-height:100dvh; border-radius:0; }
  .modal > header { flex:0 0 auto; padding:10px 12px; padding-top:max(10px,env(safe-area-inset-top)); }
  .modal > header h2 { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .modal > .body { flex:1 1 auto; min-height:0; padding:12px; overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; }
  .modal > footer { flex:0 0 auto; padding:8px 12px max(8px,env(safe-area-inset-bottom)); flex-wrap:wrap; }
  .modal > footer button { min-height:44px; flex:1 1 112px; }
  .item-editor-modal > header,.item-editor-modal > .body,.item-editor-modal > footer,
  .distributor-editor-modal > header,.distributor-editor-modal > .body,.distributor-editor-modal > footer,
  .modal.page-form-modal > header,.modal.page-form-modal > .body,.modal.page-form-modal > footer {
    padding-left:12px; padding-right:12px;
  }
  .pal-bg { padding:0; }
  .pal { max-width:none; max-height:100dvh; height:100dvh; border-radius:0; }
  .toast { left:10px; right:10px; bottom:max(10px,env(safe-area-inset-bottom)); transform:none; text-align:center; }
  .map { height:min(48vh,320px); }
  .live-map { height:min(44vh,260px); }

  /* Use the phone width efficiently: ordinary short form fields sit in pairs.
     Fields explicitly marked wide still occupy the complete row. */
  .modal .fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .modal .fields > .field { min-width:0; }
  .modal .fields > .field.wide { grid-column:1 / -1; }

  /* The approved order/dispatch header becomes two compact columns on a
     phone: Date + Number, then Price list + Supplied from. */
  .order-basic-fields {
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-areas:"title title" "party party" "date number" "price supply" "billing billing";
    gap:10px;
  }
  .order-billing-details { width:100%; }

  /* Retailer fields: names, email, address and supplier names need a full
     line; compact contact, location and trade fields can share one. */
  .customer-editor-modal .customer-company-fields,
  .customer-editor-modal .customer-address-fields,
  .customer-editor-modal .customer-trade-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .customer-editor-modal .customer-field-shop_name,
  .customer-editor-modal .customer-field-billing_name,
  .customer-editor-modal .customer-field-email,
  .customer-editor-modal .customer-field-gstin,
  .customer-editor-modal .customer-field-address,
  .customer-editor-modal .customer-field-area,
  .customer-editor-modal .customer-field-distributor_id,
  .customer-editor-modal .customer-field-company_warehouse_id { grid-column:1 / -1 !important; }

  /* Distributor fields follow the same pattern. */
  .distributor-editor-modal .distributor-company-fields,
  .distributor-editor-modal .distributor-address-fields,
  .distributor-editor-modal .distributor-trade-fields,
  .distributor-editor-modal .distributor-trade-fields.has-service-areas { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .distributor-editor-modal .distributor-company-fields > .field,
  .distributor-editor-modal .distributor-address-fields > .field,
  .distributor-editor-modal .distributor-trade-fields > .field { grid-column:auto !important; width:auto; min-width:0; }
  .distributor-editor-modal .dist-field-name,
  .distributor-editor-modal .dist-field-gstin,
  .distributor-editor-modal .dist-field-email,
  .distributor-editor-modal .dist-field-address,
  .distributor-editor-modal .dist-field-area,
  .distributor-editor-modal .distributor-trade-photo { grid-column:1 / -1 !important; }
}

@media(min-width:651px) and (max-width:900px) {
  .modal .fields { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .modal .fields > .field.wide { grid-column:1 / -1; }
  .customer-editor-modal .customer-company-fields,
  .customer-editor-modal .customer-address-fields,
  .customer-editor-modal .customer-trade-fields,
  .distributor-editor-modal .distributor-company-fields,
  .distributor-editor-modal .distributor-address-fields,
  .distributor-editor-modal .distributor-trade-fields,
  .distributor-editor-modal .distributor-trade-fields.has-service-areas { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .customer-editor-modal .customer-field-address,
  .distributor-editor-modal .dist-field-address,
  .distributor-editor-modal .distributor-trade-photo { grid-column:1 / -1 !important; }
}

/* Short phone/tablet landscapes must leave room for the form header, footer,
   notes and totals. The item region scrolls rather than pushing actions below
   the visible screen. */
@media(max-width:900px) and (max-height:650px) {
  .simple-order-form .order-item-lines,
  .punch-page .order-item-lines { height:160px; max-height:160px; }
  .simple-order-form .order-items-gate { margin-top:8px; }
  .punch-page .subcard { margin-top:10px; }
  .simple-order-form .order-after-grid { gap:4px; }
  .simple-order-form .order-notes textarea { height:42px; min-height:42px; }
}

@media(max-width:420px) {
  .kpis { grid-template-columns:1fr; }
  .row > input,.row > select { min-width:0; }
  .login { padding:14px; }
  .login-card { padding:24px 18px; }
}

@media(max-width:350px) {
  .modal .fields,
  .order-basic-fields,
  .customer-editor-modal .customer-company-fields,
  .customer-editor-modal .customer-address-fields,
  .customer-editor-modal .customer-trade-fields,
  .distributor-editor-modal .distributor-company-fields,
  .distributor-editor-modal .distributor-address-fields,
  .distributor-editor-modal .distributor-trade-fields,
  .distributor-editor-modal .distributor-trade-fields.has-service-areas { grid-template-columns:minmax(0,1fr); }
  .order-basic-fields { grid-template-areas:"title" "party" "date" "number" "price" "supply" "billing"; }
}

/* ------------------------------------------------- grids on a small screen
 * A grid of ten columns cannot be read on a phone by scrolling it sideways,
 * so each row becomes a card and every cell prints its own heading beside
 * its value. The heading row, the sort carets and the resize edges go: none
 * of them can be used with a thumb anyway.
 */
@media (max-width: 680px) {
  .tbl-wrap { overflow: visible; border: 0; background: transparent; border-radius: 0; }
  .tbl-wrap > table { width: 100%; min-width: 0; table-layout: auto; }
  .tbl-wrap colgroup, .tbl-wrap thead, .tbl-wrap tfoot { display: none; }
  .tbl-wrap tbody, .tbl-wrap tbody tr, .tbl-wrap tbody td { display: block; width: auto; }
  .tbl-wrap tbody tr {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    padding: 8px 12px; margin-bottom: 8px; }
  .tbl-wrap tbody tr:nth-child(even) { background: var(--surface); }
  .tbl-wrap tbody tr:hover { background: var(--surface); }
  .tbl-wrap tbody td {
    height: auto; border: 0; padding: 3px 0; text-align: left;
    display: flex; align-items: baseline; gap: 12px; white-space: normal; }
  .tbl-wrap tbody td::before {
    content: attr(data-label); flex: 0 0 42%; min-width: 0;
    color: var(--muted); font-size: var(--fs-meta); font-weight: 500; }
  .tbl-wrap tbody td:not([data-label])::before { display: none; }
  .tbl-wrap tbody td > * { min-width: 0; }
  /* the first cell reads as the card's title */
  .tbl-wrap tbody td:first-child { font-weight: 600; padding-bottom: 6px; }
  .tbl-wrap tbody td.num { justify-content: flex-start; }
  .tbl-wrap tbody td.num > * { margin-left: auto; }
}

/* --------------------------------------- order and dispatch lines on a phone
 * Nine columns in 366px means dragging sideways to type a quantity. Each line
 * becomes a card instead, with its heading beside every value, and the two
 * screens share the rule because they share the markup.
 */
@media (max-width: 680px) {
  .simple-order-form .order-items-scroll,
  .punch-page .order-items-scroll { overflow: visible; }
  .simple-order-form .order-item-head,
  .punch-page .order-item-head { display: none; }
  .simple-order-form .order-item-row,
  .punch-page .order-item-row {
    display: block; min-width: 0; padding: 10px 12px; margin-bottom: 8px;
    /* both grids pin the row to 32px for a dense desktop table; a stacked
       card has to grow with what is in it, or the cards overlap */
    height: auto; box-sizing: border-box;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
  .simple-order-form .order-item-row > *,
  .punch-page .order-item-row > * {
    display: flex; align-items: center; gap: 12px; padding: 3px 0;
    text-align: left; width: auto; }
  .simple-order-form .order-item-row > *::before,
  .punch-page .order-item-row > *::before {
    content: attr(data-label); flex: 0 0 42%;
    color: var(--muted); font-size: var(--fs-meta); font-weight: 500; }
  .simple-order-form .order-item-row > *:not([data-label])::before,
  .punch-page .order-item-row > *:not([data-label])::before { display: none; }
  .simple-order-form .order-item-row input,
  .simple-order-form .order-item-row select,
  .punch-page .order-item-row input,
  .punch-page .order-item-row select {
    text-align: left; border-color: var(--line); background: var(--surface); }
  /* the totals strip is a grid of its own width; let it wrap to the screen */
  .simple-order-form .order-item-summary,
  .punch-page .order-item-summary {
    display: flex; justify-content: space-between; min-width: 0; gap: 8px;
    padding: 8px 12px; border-radius: var(--r); }
  .simple-order-form .order-item-summary > div:empty,
  .punch-page .order-item-summary > div:empty { display: none; }
  /* the picture and the item name lead the card */
  .simple-order-form .order-item-row .order-line-thumb,
  .punch-page .order-item-row .order-line-thumb { margin-bottom: 4px; }
  .simple-order-form .order-item-row .order-item-product,
  .punch-page .order-item-row > :nth-child(3) { display: block; }
  .simple-order-form .order-item-row .order-item-product::before,
  .punch-page .order-item-row > :nth-child(3)::before { display: none; }
}

/* iOS enlarges the page as soon as a control below 16px receives text. That
 * looks like the box itself is growing and can expose content beyond the
 * viewport. Keep phone controls at the no-zoom size and clamp every editable
 * control and suggestion panel to its containing cell/screen. */
@media (max-width: 680px) {
  input:not([type=checkbox]):not([type=radio]), select, textarea {
    font-size:16px !important;
    min-inline-size:0;
    max-inline-size:100%;
  }
  .field > input:not([type=checkbox]):not([type=radio]),
  .field > select,
  .field > textarea {
    inline-size:100% !important;
    min-inline-size:0 !important;
    max-inline-size:100% !important;
  }
  .order-party-results {
    left:0; right:0; width:auto; min-width:0; max-width:100%;
  }
  .order-item-results {
    left:12px !important; right:12px !important;
    width:auto !important; max-width:calc(100vw - 24px) !important;
  }
}

/* ---------------------------------------------------------- expense claim */
.expense-claim-modal .body { padding:14px 24px; }
.expense-claim-form { min-width:0; }
.expense-claim-top { display:grid; grid-template-columns:220px 170px 220px; gap:16px; align-items:end; }
.expense-readout { display:flex; flex-direction:column; gap:6px; min-width:0; }
.expense-readout label { color:var(--muted); font-size:var(--fs-meta); }
.expense-readout strong { height:40px; display:flex; align-items:center; padding:0 12px; border:1px solid var(--line); border-radius:var(--r); background:var(--subtle); font-weight:500; }
.expense-top-total strong { justify-content:flex-end; font-weight:650; color:var(--text); }
.expense-suggestion { margin:10px 0 2px; color:var(--muted); font-size:var(--fs-meta); }
.expense-grid-title { display:flex; align-items:center; gap:12px; margin-top:14px; margin-bottom:6px; }
.expense-grid-title h3 { margin:0; font-size:var(--fs-section); }
.expense-line { display:grid; grid-template-columns:34px 54px minmax(170px,1.2fr) 130px 90px minmax(220px,2fr) 190px; align-items:center; min-height:42px; column-gap:8px; padding:4px 10px; box-sizing:border-box; }
.expense-line-head { min-height:40px; background:var(--subtle); border-radius:var(--r) var(--r) 0 0; color:var(--muted); font-size:var(--fs-meta); font-weight:600; }
.expense-lines { max-height:calc(100vh - 350px); overflow:auto; }
.expense-lines .expense-line { border-bottom:1px solid var(--line); }
.expense-lines .expense-line.active { background:var(--teal-soft,#eefaf9); }
.expense-line input,.expense-line select { height:32px; padding:4px 8px; }
.expense-line input[type=number] { text-align:right; }
.expense-line-remove { width:28px; height:28px; padding:0; border:0; border-radius:6px; background:transparent; color:var(--muted); font-size:22px; line-height:1; }
.expense-line-remove:hover { background:#feecec; color:var(--bad); }
.expense-number-cell { color:var(--muted); text-align:center; }
.expense-attachment .field { gap:0; margin:0; }
.expense-attachment .field > label { display:none; }
.expense-attachment .row { gap:4px; flex-wrap:nowrap; }
.expense-attachment .btn-s { height:30px; padding:3px 8px; font-size:var(--fs-meta); }
.expense-total-row { display:grid; grid-template-columns:1fr 220px; gap:16px; align-items:center; min-height:40px; padding:0 14px; background:var(--subtle); border-radius:0 0 var(--r) var(--r); font-weight:650; }
.expense-total-row span { text-align:right; }
.expense-total-row strong { text-align:right; }

@media(max-width:900px) {
  .expense-claim-top { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .expense-line { grid-template-columns:30px 44px minmax(150px,1.2fr) 110px 76px minmax(180px,1.7fr) 170px; min-width:900px; }
  .expense-line-head,.expense-lines { overflow-x:auto; }
}

@media(max-width:680px) {
  .expense-claim-modal .body { padding:10px 12px; }
  .expense-claim-top { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .expense-top-total { grid-column:1/-1; }
  .expense-readout strong,.expense-claim-top input { height:38px; }
  .expense-grid-title { margin-top:10px; }
  .expense-line-head { display:none; }
  .expense-lines { max-height:none; overflow:visible; }
  .expense-line { min-width:0; display:grid; grid-template-columns:34px 44px minmax(0,1fr); gap:5px 8px; height:auto; min-height:0; margin-bottom:8px; padding:8px 10px; border:1px solid var(--line) !important; border-radius:var(--r); background:var(--surface); }
  .expense-lines .expense-line.active { background:var(--teal-soft,#eefaf9); }
  .expense-remove-cell { grid-column:1; grid-row:1; }
  .expense-number-cell { grid-column:2; grid-row:1; align-self:center; }
  .expense-type-cell { grid-column:3; grid-row:1; }
  .expense-amount-cell { grid-column:1/3; grid-row:2; }
  .expense-km-cell { grid-column:3; grid-row:2; }
  .expense-notes-cell { grid-column:1/-1; grid-row:3; }
  .expense-attachment { grid-column:1/-1; grid-row:4; }
  .expense-line > [data-label]::before { content:attr(data-label); display:block; margin-bottom:3px; color:var(--muted); font-size:11px; }
  .expense-number-cell::before { display:none !important; }
  .expense-line input,.expense-line select { width:100%; max-width:100%; height:38px; }
  .expense-attachment .field > label { display:block; }
  .expense-total-row { grid-template-columns:1fr auto; border-radius:var(--r); }
}
@media(max-width:680px) {
  .expense-line.expense-line-head { display:none; }
  .expense-attachment::before { display:none !important; }
}

/* The price lists on an item editor. Five lists sit under the item's own
   fields, so the rows are tighter than a page-level grid: full-height rows
   pushed the item's details off the screen to show five numbers. Scoped to
   this block, so the price list editor's own grid keeps its normal size. */
.item-price-lists th, .item-price-lists td { padding: 1px 10px; }
.item-price-lists input.disc { height: 24px; }
.item-price-lists .btn-s { min-height: 22px; height: 22px; padding: 0 9px; font-size: 11.5px; }


/* The button that opens an item's price lists. */
.item-price-lists-open { display: flex; align-items: center; gap: 10px; margin-top: 16px;
  border-top: 1px solid var(--line); padding-top: 14px; }

/* Zones and the areas inside them. */
.card-tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.card-tab { background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  padding: 9px 12px; font-size: 13.5px; color: var(--text-2); }
.card-tab.on { color: var(--text); font-weight: 650; border-bottom-color: var(--side-accent); }
.zone-city { padding: 16px 16px 4px; }
.zone-city h3 { margin: 0; font-size: 13px; letter-spacing: .7px; text-transform: uppercase; color: var(--text-2); }
.zone-block { margin: 0 16px 14px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.zone-head { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px;
  background: var(--surface-2, #f7f9fc); border-bottom: 1px solid var(--line); }
.zone-head .hint { font-size: 12px; }

/* "One has been updated" — shown when the page has been left open across a deploy. */
.build-stale { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 9000;
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 999px;
  background: var(--ink, #0A1F3B); color: #fff; box-shadow: 0 8px 26px rgba(10,31,59,.28); font-size: 13.5px; }
.build-stale .btn-s { background: #fff; border-color: #fff; min-height: 26px; height: 26px; padding: 0 12px; }

/* A product picture is shown whole, not cropped to a square.
   .pic-field crops to fill, which suits a face or a shop front but takes the
   ends off a wide product shot - and the picture on file was never cropped,
   only the preview, so what you uploaded and what you saw disagreed. */
.item-editor .pic-field img { object-fit: contain; background: #f2f5f8; }

/* A photograph opened to be looked at properly. */
.lightbox { position: fixed; inset: 0; z-index: 9500; background: rgba(8,12,20,.92);
  display: flex; flex-direction: column; }
.lightbox-frame { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 28px; }
.lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;
  border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox-img.is-zoomed { max-width: none; max-height: none; width: auto; height: auto; cursor: zoom-out; }
.lightbox-close { position: absolute; top: 14px; right: 18px; z-index: 2; background: none; border: 0;
  color: #fff; font-size: 30px; line-height: 1; cursor: pointer; opacity: .8; }
.lightbox-close:hover { opacity: 1; }
.lightbox-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px 16px; color: #cbd5e1; font-size: 13px; }
.lightbox-foot a { color: #fff; }

/* Framing a photograph before it goes up. */
.cropbody { display: grid; gap: 12px; justify-items: center; }
.cropstage { background: #11161d; border-radius: var(--r); padding: 10px; display: grid; place-items: center; }
.cropcanvas { width: 320px; max-width: 70vw; height: auto; aspect-ratio: 1; touch-action: none;
  cursor: grab; border-radius: 6px; display: block; }
.cropcanvas:active { cursor: grabbing; }
.cropzoom { width: 320px; max-width: 70vw; }

/* The punch photographs on the attendance list. */
.punch-pics { display: inline-flex; gap: 4px; }
.punch-pic { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; cursor: zoom-in;
  border: 1px solid var(--line); background: var(--subtle); }
.punch-pic:hover { outline: 2px solid var(--side-accent); }

/* Customer visits: a filter over each column */
.visit-filters { display: grid; grid-template-columns: 2fr 1.6fr .8fr 1fr 1.6fr 1.2fr; gap: 8px; padding: 0 0 10px; }
.visit-filters input, .visit-filters select { height: 32px; font-size: var(--fs-small); min-width: 0; }
@media (max-width: 900px) { .visit-filters { grid-template-columns: 1fr 1fr; } }

.visit-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---------------------------------------------------------------- permissions
   One role at a time; each screen a row with four stops across. */
.perm-roles { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:18px; }
.perm-roles-label { font-size:var(--fs-th); font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); margin-right:4px; }
.perm-role { display:flex; flex-direction:column; align-items:flex-start; gap:1px; padding:8px 14px; border:1px solid var(--line-strong); border-radius:12px; background:var(--surface); cursor:pointer; font:inherit; color:var(--text); text-align:left; }
.perm-role b { font-size:var(--fs-body); } .perm-role span { font-size:var(--fs-meta); color:var(--muted); }
.perm-role:hover { background:var(--subtle); }
.perm-role.on { background:var(--navy); border-color:var(--navy); color:#fff; } .perm-role.on span { color:rgba(255,255,255,.7); }
.perm-role-tools { display:flex; gap:10px; margin-left:auto; }
.perm-h { font-size:var(--fs-th); font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--text-2); margin:4px 0 14px; }
.perm-presets { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:18px; }
.perm-preset { display:flex; flex-direction:column; align-items:flex-start; gap:2px; padding:12px 18px; min-width:220px; border:1px solid var(--line-strong); border-radius:14px; background:var(--surface); cursor:pointer; font:inherit; color:var(--text); text-align:left; }
.perm-preset { height:auto; line-height:1.35; white-space:normal; }
.perm-preset b { font-size:15px; letter-spacing:.02em; } .perm-preset span { font-size:var(--fs-small); color:var(--text-2); }
.perm-preset:hover:not(:disabled) { border-color:var(--navy); } .perm-preset:disabled { opacity:.6; cursor:default; }
.perm-preset.bad b { color:#B3261E; }
.perm-tools { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-bottom:18px; }
.perm-tools input { width:300px; max-width:100%; } .perm-tools select { width:auto; min-width:200px; flex:0 0 auto; }
.perm-role { height:auto; line-height:1.3; }
.perm-note { font-size:var(--fs-small); }
.perm-section { padding:0; margin-bottom:22px; overflow:hidden; }
.perm-section-head, .perm-row { display:grid; grid-template-columns:minmax(0,1fr) repeat(4,140px); align-items:center; }
.perm-section-head { background:var(--subtle); border-bottom:1px solid var(--line); padding:0; }
.perm-section-head b { padding:14px 18px; font-size:15.5px; }
.perm-section-head .perm-stop { margin:10px auto; padding:7px 18px; border:1.5px solid var(--navy-600); border-radius:999px; background:var(--surface); color:var(--navy-600); font:inherit; font-size:var(--fs-small); font-weight:700; cursor:pointer; }
.perm-section-head .perm-stop:hover:not(:disabled) { background:var(--navy-50); } .perm-section-head .perm-stop:disabled { opacity:.5; cursor:default; }
.perm-row { border-bottom:1px solid var(--line); min-height:78px; }
.perm-row:last-child { border-bottom:0; }
.perm-name { padding:14px 18px; display:flex; flex-direction:column; gap:3px; min-width:0; }
.perm-name.can-open { cursor:pointer; } .perm-name.can-open:hover b { color:var(--teal); }
.perm-name b { font-size:15px; display:flex; align-items:center; gap:8px; } .perm-name > span { font-size:var(--fs-small); color:var(--text-2); }
.perm-chev { color:var(--muted); font-size:16px; width:10px; display:inline-block; }
.perm-custom { background:#FFF4E5; color:#92400E; margin-left:4px; font-size:10.5px; }
.perm-cell { display:flex; align-items:center; justify-content:center; align-self:stretch; border-left:1px solid var(--line); cursor:pointer; }
.perm-cell.none { cursor:default; background:repeating-linear-gradient(135deg, transparent 0 6px, var(--subtle) 6px 7px); }
.perm-cell.on { background:var(--navy-50); }
.perm-cell input[type=radio] { width:20px; height:20px; accent-color:var(--navy); margin:0; cursor:pointer; }
.perm-cell input[type=radio]:disabled { cursor:default; }
.perm-detail { padding:6px 18px 14px 44px; background:#FAFBFD; border-bottom:1px solid var(--line); display:flex; flex-wrap:wrap; gap:10px 28px; }
.perm-action { display:flex; align-items:center; gap:8px; font-size:var(--fs-small); cursor:pointer; }
.perm-action input { width:16px; height:16px; accent-color:var(--navy); margin:0; }
.perm-action code { font-family:var(--mono); font-size:11px; color:var(--muted); }
/* Where a capability is used. Pushed to the right of its row and set small,
   because it is a rule about one capability and not a second capability. */
.perm-where { display:flex; align-items:center; gap:5px; margin-left:auto; font-size:11px;
  color:var(--muted); white-space:nowrap; }
.perm-where input { width:13px; height:13px; }

/* The invoice copy, looked at over the page. The frame is given a height
   rather than left to the file, because a PDF in an iframe with no height
   collapses to nothing and a photograph of a bill is usually taller than it
   is wide. */
.invoice-preview-wrap { display:flex; justify-content:center; background:var(--bg, #f6f8fc);
  border-radius:10px; padding:8px; outline:none; }
/* Zoomed, the picture is bigger than the window and the window is what scrolls.
   Unzoomed it is centred and whole, so the two states cannot both be flex. */
.invoice-preview-wrap.zoomed { display:block; overflow:auto; max-height:82vh; cursor:zoom-out; }
img.invoice-preview { max-width:100%; max-height:82vh; object-fit:contain; border-radius:6px;
  cursor:zoom-in; transition:none; }
/* Zoomed, the width is set on the file itself, reckoned from how wide it was
   drawn at 100% - see file-preview.js. A frame keeps its height and only grows
   sideways, because the viewer inside it scrolls its own pages. */
.invoice-preview-wrap.zoomed img.invoice-preview { max-width:none; max-height:none;
  height:auto; cursor:zoom-out; }
.invoice-preview-wrap.zoomed iframe.invoice-preview { max-width:none; }
/* The zoom controls sit on the picture rather than beside it, so the invoice
   keeps the whole window. */
.invoice-zoom { position:absolute; right:22px; top:66px; z-index:2; display:flex; align-items:center;
  gap:2px; background:var(--surface); border:1px solid var(--line-strong); border-radius:999px;
  padding:3px; box-shadow:var(--shadow); }
.invoice-zoom button { width:28px; height:28px; padding:0; border:0; background:none; cursor:pointer;
  border-radius:999px; font:600 15px/1 var(--font); color:var(--text-2); }
.invoice-zoom button:hover:not(:disabled) { background:var(--hover); color:var(--text); }
.invoice-zoom button:disabled { opacity:.35; cursor:default; }
.invoice-zoom span { min-width:42px; text-align:center; font:600 11.5px var(--font); color:var(--muted); }
iframe.invoice-preview { width:100%; height:82vh; border:0; border-radius:6px; background:#fff; }
/* An invoice is read, not glanced at: it takes as much of the window as it
   can get while leaving the page visible around it. */
.modal.invoice-modal { max-width:min(1180px, 96vw); width:96vw; position:relative; }
.modal.invoice-modal .body { padding:10px 12px; }

/* The warehouse's four stages. The app's own tab strip, with a count on each
   so a glance says where the work is sitting. */
.warehouse-tabs { margin-bottom: 14px; }
.warehouse-tabs .tab-count { margin-left: 6px; padding: 0 6px; border-radius: 999px;
  background: var(--navy-50); color: var(--navy); font: 700 11px/16px var(--font);
  display: inline-block; min-width: 16px; text-align: center; }
.warehouse-tabs button.on .tab-count { background: var(--teal-50); color: var(--teal-600); }

/* The packing sheet on screen: the printed sheet's columns, so the packer
   reads one against the other without hunting. The serial and the picture are
   as narrow as they can be, the name takes what is left, and the two boxes he
   fills sit together at the end. */
/* The invoice, across the top of the packing page: four things read off one
   piece of paper, so they sit on one line rather than stacked two by two like
   a form somebody fills in at a desk. The slip's own row of buttons lines up
   with the boxes beside it. */
/* The goods in the middle, the paperwork down the side. He lives in the item
   list; the invoice and the carton count are glanced at and keyed. */
.pack-layout { display: grid; grid-template-columns: minmax(0, 1fr) 318px;
  gap: var(--s4); align-items: start; }
.pack-main { min-width: 0; }
/* Up and down only. Nothing here is allowed to go sideways.
 *
 * The height is bounded the way the order form bounds its own line list: let
 * the grid take the whole window and the totals under it are pushed off the
 * bottom, which is exactly where they must not be - they are the figures
 * checked against the invoice before the button is pressed. The list scrolls
 * inside itself instead, and everything below stays on the page. */
.pack-main { display: flex; flex-direction: column; min-height: 0; }
.pack-main .tbl-wrap { max-height: min(50vh, 440px); overflow-y: auto; overflow-x: hidden;
  scrollbar-gutter: stable; }

/* The packing window fills the height it is given: the list takes whatever is
   left once the invoice, the totals and the buttons have had theirs, so the
   last line of the invoice finishes at the foot of the page instead of
   halfway up it. Only this window - the order form has its own ideas. */
/* Written as .modal.pack-modal because .modal.page-form-modal > .body sets
   display:block and outranks a single class - the list stayed as tall as its
   own contents and pushed the totals off the foot of the page. */
.modal.pack-modal > .body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  overflow: hidden; }
/* The columns must be told to fill the row: the layout aligns its columns to
   the top everywhere else, and a column aligned to the top is only as tall as
   what is in it - so the list grew instead of the window holding it. */
.pack-modal .pack-layout { flex: 1 1 auto; min-height: 0; align-items: stretch; }
.pack-modal .pack-main .tbl-wrap { flex: 1 1 auto; max-height: none; min-height: 160px; }
.pack-modal .pack-side { max-height: 100%; overflow-y: auto; scrollbar-gutter: stable; }
@media (max-width: 1100px) {
  .modal.pack-modal > .body { display: block; overflow-y: auto; }
  .pack-modal .pack-main .tbl-wrap { max-height: min(50vh, 440px); }
  .pack-modal .pack-side { max-height: none; overflow: visible; }
}
.pack-main thead th { position: sticky; top: 0; z-index: 1; }
.pack-side { display: flex; flex-direction: column; gap: var(--s3); position: sticky; top: 0; }
/* The paperwork fields in the packing and Ready to dispatch windows: the grid's
   gap is the only space between rows - a field's own bottom margin on top of
   it doubled every gap (Sachin, 24 Nov 2026). */
.pack-side .fields { row-gap: 10px; }
.pack-side .fields > .field { margin-bottom: 0; }
.pack-panel, .pack-head { background: var(--subtle); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 12px 14px; }
/* Two to a line: the date beside the number, the value beside the slip. */
.pack-head { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pack-head .field { margin-bottom: 0; }
.pack-head .field > label { font-weight: 600; }
.pack-head .field > .row { min-height: 34px; align-items: center; }
.pack-head input, .pack-panel input { background: var(--surface); }
.pack-panel-head { display: flex; align-items: center; gap: 8px; }
.pack-panel-head .order-section-title { white-space: nowrap; }
/* The heading, the count and the weight are one line in one voice, and that
   voice is the one the invoice boxes beside them use for their labels - the
   same size, the same weight, the same grey. */
.pack-panel-head .order-section-title, .pack-count, .pack-panel-head .muted {
  font-size: var(--fs-small); font-weight: 600; letter-spacing: 0; color: var(--text-2); }
.pack-count, .pack-panel-head .muted { font-variant-numeric: tabular-nums; }
.pack-panel-head { gap: 10px; }
.pack-panel-head .order-section-title { margin: 0; }
.pack-panel .tbl-wrap { margin-top: 8px; }
.carton-add { width: 100%; margin-top: 10px; justify-content: center; height: 32px; }
/* Room to type in: the boxes carry figures somebody reads back off a scale
   and a tape, so they are not squeezed to the last pixel. */
.carton-sheet th, .carton-sheet td { padding-left: 4px; padding-right: 4px; }
.carton-sheet input { height: 30px; }
/* Eight carton rows before it scrolls, not five. A row is 41px - a 30px box,
   5px of padding above and below, and the line under it - and the sticky
   header takes about 28, so 363px shows eight and the start of the ninth.
   Counted in rows rather than picked by eye, so raising it again is
   arithmetic: 41px a row. */
.pack-panel .tbl-wrap { max-height: 363px; overflow: auto; }
/* Four boxes the same size, because they are four measurements of the same
   carton and nothing about the weight wants more room than the width. */
.carton-sheet { table-layout: fixed; width: 100%; }
.carton-sheet th, .carton-sheet td { padding-left: 3px; padding-right: 3px; }
/* The count the packer types, then the three measurements, then the weight -
   all the same size, because they are all figures he keys in. */
.carton-sheet th:first-child, .carton-sheet td:first-child { width: auto; padding-left: 0; }
.carton-sheet th:last-child, .carton-sheet td:last-child { width: 24px; padding-right: 0; }
/* The read-only cartons on Ready to dispatch: no cross column, so the last
   column is the measurements and must be wide enough to stay on one line. */
.carton-sheet.carton-summary th, .carton-sheet.carton-summary td { white-space: nowrap; }
.carton-sheet.carton-summary th:first-child, .carton-sheet.carton-summary td:first-child { width: 22%; }
.carton-sheet.carton-summary th:nth-child(2), .carton-sheet.carton-summary td:nth-child(2) { width: 22%; }
.carton-sheet.carton-summary th:last-child, .carton-sheet.carton-summary td:last-child { width: auto; padding-right: 10px; }
/* The cross is not a box to fill in, so it does not look like one: it sits on
   the panel's own grey and colours only when it is about to be used. */
.carton-drop { width: 22px; height: 24px; padding: 0; border: 0; background: none;
  color: var(--placeholder); border-radius: 6px; cursor: pointer; font-size: 12px; line-height: 1; }
.carton-drop:hover { background: var(--bad-bg); color: var(--bad); }
.carton-sheet input { max-width: 100%; width: 100%; text-align: right; }
/* How many cartons is the figure the warehouse and the courier both count by,
   so it is set like one. */
.carton-sheet td:first-child input { font-weight: 700; color: var(--text); }
.carton-sheet th:first-child { font-weight: 700; color: var(--text); }
/* The little up-and-down arrows take a third of a box this narrow and nobody
   measures a carton by clicking them. */
.carton-sheet input[type=number], .pack-sheet input[type=number] { appearance: textfield;
  -moz-appearance: textfield; }
.carton-sheet input[type=number]::-webkit-outer-spin-button,
.carton-sheet input[type=number]::-webkit-inner-spin-button,
.pack-sheet input[type=number]::-webkit-outer-spin-button,
.pack-sheet input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

@media (max-width: 1100px) {
  .pack-layout { grid-template-columns: 1fr; }
  .pack-side { position: static; }
  .pack-main .tbl-wrap { max-height: none; }
}

/* The order form's own grid, down to the row height: the packer and the man
   who punched the order are reading the same shape of list. */
.pack-sheet td, .pack-sheet th { vertical-align: middle; }
.pack-sheet thead th { font-size: var(--fs-small); font-weight: 600; letter-spacing: 0;
  color: var(--muted); background: var(--subtle); height: 32px; text-transform: none; }
.pack-sheet tbody td { font-size: var(--fs-small); height: 32px;
  font-variant-numeric: tabular-nums; }
/* Eleven columns of figures want the space given to the figures, not to the
   gutters between them. The serial starts at the edge - there is nothing to
   its left to need a margin - and the product name takes whatever is over. */
/* Shares of the width, not pixel counts. Fixed widths had a floor under them
   and below it the grid went sideways; a share simply gets narrower, and the
   product name - the one thing that can be cut and still understood - takes
   the squeeze. Nine columns: serial, code, product, MRP, ordered, packed,
   both discounts together, GST, taxable. */
.pack-sheet { table-layout: fixed; width: 100%; }
.pack-sheet th, .pack-sheet td { padding-left: 6px; padding-right: 6px; }
/* Nothing sits to the left of the serial, so nothing is set aside for it. */
.pack-sheet th:first-child, .pack-sheet td:first-child { width: 7%; min-width: 46px; padding-left: 0; }
.pack-sheet th:nth-child(2), .pack-sheet td:nth-child(2) { width: 17%; white-space: nowrap; }
.pack-sheet th:nth-child(3), .pack-sheet td:nth-child(3) { width: auto; }
.pack-sheet th:nth-child(4), .pack-sheet td:nth-child(4) { width: 13%; }
.pack-sheet th:nth-child(5), .pack-sheet td:nth-child(5) { width: 9%; }
.pack-sheet th:nth-child(6), .pack-sheet td:nth-child(6) { width: 10%; }
.pack-sheet th:last-child, .pack-sheet td:last-child { width: 13%; padding-right: 10px; }
.pack-sheet td.num, .pack-sheet th.num { white-space: nowrap; }
.pack-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The MRP reads as a figure with a pencil beside it, and becomes a box only
   when the pencil is pressed. */
.pack-mrp-cell { white-space: nowrap; }
.pack-mrp-cell .order-line-remark { display: inline-flex; vertical-align: middle;
  width: 22px; height: 22px; font-size: 13px; margin-left: 2px; }
.pack-mrp-cell input { display: inline-block; width: calc(100% - 26px); min-width: 54px; }
.pack-mrp { font-variant-numeric: tabular-nums; }
.pack-mrp.changed { color: var(--bad); font-weight: 600; }
/* What was changed is marked on the LINE, not on the figure: a red edge down
   the row and a wash across it, found while running an eye down forty of them
   rather than hunted for inside a column. The figure itself stays red so the
   eye lands on it once the row has been found. */
.pack-sheet input.changed { color: var(--bad); font-weight: 600; }
.pack-sheet input.changed:focus { background: var(--surface);
  border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.pack-sheet tfoot td { font-variant-numeric: tabular-nums; }
/* The two a packer fills are the only white boxes on the row, so the eye goes
   to them without being told. */
/* Borderless until wanted, exactly as on the order form. */
.pack-sheet input { text-align: right; font-size: var(--fs-small); height: 28px;
  border: 1px solid transparent; background: transparent; box-shadow: none; padding-right: 8px; }
.pack-sheet input:hover { background: var(--teal-50); }
.pack-sheet input:focus { outline: none; background: var(--surface);
  border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.pack-sheet tbody tr:focus-within { background: var(--hover); box-shadow: inset 2px 0 0 var(--teal); }
/* A changed line is marked in the app's own highlight - the mint wash that
   marks a chosen row everywhere else - rather than in a colour of its own.
   The edge is the brand teal; the figure inside stays red, which is what
   says WHICH number moved once the row has been found. The wash lifts a
   shade while the line is being worked on, so it still answers to the
   cursor. */
.pack-sheet tbody tr.is-changed { background: var(--teal-50); box-shadow: inset 3px 0 0 var(--teal); }
.pack-sheet tbody tr.is-changed:focus-within { background: var(--lit);
  box-shadow: inset 3px 0 0 var(--teal); }
.pack-sheet tbody td { padding-top: 4px; padding-bottom: 4px; }
/* The two figures that came off the order are the quiet ones; what the packer
   is putting in is the loud one. */
.pack-sheet tbody td:nth-child(5) { color: var(--text-2); }
.pack-sheet tbody td:last-child { font-variant-numeric: tabular-nums; }
/* The totals, under the grid and out of it: the grid scrolls and these do
   not, because this is the line somebody reads before pressing the button. */
/* The grid's last line: the same table and the same widths, so a figure sits
   under the column it adds up. */
.pack-sum { margin-top: 0; }
.pack-sum td { background: var(--subtle); border: 0; height: 34px;
  font-variant-numeric: tabular-nums; }
.pack-sum tr td:first-child { border-radius: 0 0 0 var(--r); }
.pack-sum tr td:last-child { border-radius: 0 0 var(--r) 0; }
.pack-sum strong { color: var(--text); font-size: var(--fs-cell); font-weight: 700; }
/* The invoice worked out under the band, set the way the order form sets it:
   the label right-aligned against a column of figures, and the one that is
   paid ruled off at the bottom. */
.pack-breakdown { width: 360px; margin: 8px 0 0 auto; font-size: var(--fs-small);
  font-variant-numeric: tabular-nums; }
.pack-breakdown .order-total-line { display: grid; grid-template-columns: minmax(0, 1fr) 140px;
  gap: 16px; min-height: 24px; align-items: center; }
.pack-breakdown .order-total-line span { text-align: right; color: var(--text-2); }
.pack-breakdown .order-total-line strong { padding-right: 12px; text-align: right; color: var(--text); }
.pack-breakdown .order-total-line.grand { margin-top: 4px; padding-top: 6px;
  border-top: 1px solid var(--line); font-size: var(--fs-cell); }
.pack-breakdown .order-total-line.grand span,
.pack-breakdown .order-total-line.grand strong { color: var(--text); font-weight: 700; }

/* The report builder: three questions, each able to breathe. The ticks sit in
   as many columns as the screen will give them, because a list of twenty-two
   in one column is a scroll nobody reads to the end of. */
/* The report builder.
   One bar across the top carrying the report's own controls, the filters
   under it, and the answer below that. No numbered steps: there are only two
   things to set and a button, and numbering them made a short job look long. */
.report-card { padding-top:12px; }
.report-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  padding-bottom:12px; border-bottom:1px solid var(--line); margin-bottom:14px; }
/* The saved report is the widest thing in the bar because it carries a name
   somebody wrote, and the buttons are as wide as their own words. A row of
   equal buttons made every one of them look like the thing to press. */
.report-bar select { flex:1 1 260px; min-width:220px; max-width:420px; }
.report-act { height:36px; padding:0 15px; flex:0 0 auto; }
/* Run is the one that answers the question; the rest set it up or take it
   away, and they are quieter for it. */
.report-act.btn-p { padding:0 26px; font-weight:600; }
/* Two ways of taking the same thing away, so they are one thing with two
   ends rather than two more buttons competing with Run. */
.report-export { display:flex; align-items:center; gap:7px; margin-left:4px;
  padding-left:12px; border-left:1px solid var(--line); }
.report-export-label { font-size:11.5px; color:var(--muted); }
.report-export .report-act { padding:0 13px; }
.report-status { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:12px; }
.report-only { display:flex; align-items:center; gap:8px; font-size:13px; cursor:pointer; }
.report-only input { width:15px; height:15px; accent-color:var(--navy); margin:0; }

/* A chip is pressed, not ticked. */
.report-chips { display:flex; flex-wrap:wrap; gap:7px; }
.report-chip { font:inherit; font-size:12.5px; line-height:1; cursor:pointer;
  border:1px solid var(--line); background:#fff; color:var(--ink2);
  border-radius:999px; padding:8px 13px; transition:background .12s, border-color .12s, color .12s; }
.report-chip:hover { border-color:var(--lineStrong, #c9d4e2); }
.report-chip.on { background:var(--navy); border-color:var(--navy); color:#fff; font-weight:600; }

/* Report settings.
 *
 * Two panes and the moves between them. It was too airy where nothing was
 * happening and too tight where things were: the rows are closer now, the
 * panes are taller, the buttons sit level with the lists they move things
 * between, and the one sentence worth saying is said small. */
.colman-wrap { display:flex; flex-direction:column; gap:18px; }
.colman { display:grid; grid-template-columns:1fr 128px 1fr; gap:14px; align-items:start; }
.colman-side { min-width:0; display:flex; flex-direction:column; }

.colman-head { display:flex; align-items:center; gap:8px; margin:0 2px 8px; }
.colman-head strong { font-size:13.5px; font-weight:600; color:var(--ink); letter-spacing:-.1px; }
.colman-count { font-size:11px; font-weight:600; color:var(--muted);
  background:var(--wash, #eef2f7); border-radius:999px; padding:2px 8px; min-width:20px;
  text-align:center; }
.colman-sub { font-size:11px; color:var(--muted); }

.colman-side input[type=search] { width:100%; height:34px; margin-bottom:8px; font-size:13px; }
.colman-list { border:1px solid var(--line); border-radius:10px; padding:4px;
  height:296px; overflow:auto; background:var(--surface); }
.colman-list::-webkit-scrollbar { width:10px; }
.colman-list::-webkit-scrollbar-thumb { background:var(--line-strong); border-radius:10px;
  border:3px solid var(--surface); }

/* A row is a row, not a paragraph: 34px, one line, nothing wrapping. */
.colman-row { display:flex; align-items:center; gap:9px; height:34px; padding:0 9px;
  border-radius:7px; font-size:13px; cursor:pointer; user-select:none; }
.colman-row:hover { background:var(--hover); }
.colman-row input { width:15px; height:15px; accent-color:var(--navy); margin:0; flex:none; }
.colman-label { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.colman-tag { font-size:8.5px; font-weight:700; letter-spacing:.6px; text-transform:uppercase;
  background:var(--bg-warning, #fef3c7); color:#92400e; border-radius:4px; padding:2px 5px; flex:none; }
/* Four dots in a square: the thing you take hold of. */
.colman-grip { display:grid; grid-template-columns:3px 3px; gap:3px; flex:none;
  width:9px; cursor:grab; opacity:.55; }
.colman-grip i { width:3px; height:3px; border-radius:50%; background:var(--muted); display:block; }
.colman-row:hover .colman-grip { opacity:1; }
.colman-row:active .colman-grip { cursor:grabbing; }
.colman-row.dragging { opacity:.35; }
.colman-row.over { box-shadow:inset 0 2px 0 var(--navy); }

/* Level with the middle of the lists, not floating above them. */
.colman-mid { display:flex; flex-direction:column; gap:8px; justify-content:center;
  height:296px; margin-top:64px; }
.colman-move { width:100%; height:34px; }
.colman-move:disabled { opacity:.38; cursor:default; }

.colman-side > p { margin:8px 2px 0; font-size:11.5px; color:var(--muted); line-height:1.45; }
.colman-status { border-top:1px solid var(--line); padding-top:14px; }

@media (max-width:820px) {
  .colman { grid-template-columns:1fr; }
  .colman-mid { flex-direction:row; height:auto; margin-top:0; }
  .colman-list { height:210px; }
}

.report-filters { display:grid; grid-template-columns:repeat(auto-fit, minmax(146px, 1fr)); gap:10px 14px; }
@media (max-width: 900px) {
  .perm-section-head, .perm-row { grid-template-columns:minmax(0,1fr) repeat(4,64px); }
  .perm-section-head .perm-stop { padding:6px 8px; font-size:11px; }
}

/* The same totals block on a saved order's own page, where there is no form
   around it. Its figures sit in the last column's own gutter, so GST and the
   total land directly under the column they are made of. */
.card > .order-totals-breakdown { width:360px; margin:12px 0 16px auto; font-size:var(--fs-small); font-variant-numeric:tabular-nums; }
.card > .order-totals-breakdown .order-total-line { display:grid; grid-template-columns:minmax(0,1fr) 140px; gap:16px; min-height:22px; align-items:center; }
.card > .order-totals-breakdown .order-total-line span { text-align:right; color:var(--text-2); }
.card > .order-totals-breakdown .order-total-line strong { padding-right:12px; text-align:right; }

/* An order's items read as a statement: the headings and the Total line in
   the same weight as the figures they describe. */
.order-items-card thead th { font-weight:700; color:var(--text-2); }
.order-items-card tfoot th { font-weight:700; color:var(--text); font-size:var(--fs-cell); }
.card > .order-totals-breakdown .order-total-line.grand { margin-top:4px; padding-top:6px; border-top:1px solid var(--line); font-size:var(--fs-cell); }
.card > .order-totals-breakdown .order-total-line.grand span,
.card > .order-totals-breakdown .order-total-line.grand strong { color:var(--text); font-weight:700; }
.order-list-acts { display:flex; gap:6px; justify-content:flex-end; }

/* ---------------------------------------------------------- the register
   Dates down the page, people across it. The dates stay put while the
   people scroll under them, and a letter is read by its colour first. */
.reg-wrap { max-height: calc(100vh - 290px); }
/* Only as wide as its columns: stretched to the page, the spare width all
   landed on the date column and pushed the people apart. */
table.reg { width: auto; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
table.reg th, table.reg td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.reg-date { position: sticky; left: 0; z-index: 3; background: var(--surface); min-width: 56px;
  text-align: left; font-weight: 500; box-shadow: 1px 0 0 var(--line); white-space: nowrap; }
thead .reg-date, tfoot .reg-date { z-index: 4; }
.reg-dow { color: var(--muted); font-weight: 500; font-size: 11.5px; margin-left: 5px; }
.reg-tick { color: #0B7A4B; margin-left: 5px; font-size: 12px; }
/* Quickly's own measurements, and one width for every person: the gap
   between two columns is four points, the same on all of them.
   The heading is four rows — what they are, their code, their first name,
   their surname — so the words line up across the page however many names
   somebody has. */
.reg-person { width: 68px; min-width: 68px; max-width: 68px; padding: 1px 2px; text-align: center;
  font-size: 11px; line-height: 1.2; font-weight: 600; text-transform: uppercase;
  letter-spacing: .02em; color: var(--text-2); vertical-align: bottom; overflow-wrap: anywhere; }
/* Four rows of heading, each stuck under the one above it — the offsets are
   measured and set when the grid is drawn, because they depend on the type
   size and nobody should have to keep four numbers in a stylesheet in step
   with it. */
table.reg thead th { background: var(--surface); line-height: 1.15; padding-top: 1px; padding-bottom: 1px; }
table.reg thead tr:first-child th { padding-top: 6px; }
table.reg thead tr:last-child th { padding-bottom: 5px; border-bottom: 1px solid var(--line); }
table.reg thead tr:not(:last-child) th { border-bottom: 0; }
.reg-h-type { font-size: 9.5px; font-weight: 600; color: var(--muted); letter-spacing: .05em; }
/* The code sits in a chip under the name, the way Quickly's does. */
.reg-h-code span, .reg-h-code { color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: 0; }
.reg-h-code .reg-code { display: inline-block; padding: 1px 4px; border-radius: 5px; background: var(--subtle); }
.reg-cell { text-align: center; padding: 2px; }
.reg-mark { display: inline-block; width: 22px; height: 22px; line-height: 22px; padding: 0;
  border-radius: 6px; font-size: 11.5px; font-weight: 600; }
/* a letter somebody set by hand outranks one the clock worked out, and says so */
.reg-mark.by-hand { text-decoration: underline; text-underline-offset: 2px; }
.l-present { background: #E9F7EF; color: #0B7A4B; }
.l-half_day { background: #FFF6E5; color: #92400E; }
.l-absent { background: #FDECEA; color: #B3261E; }
.l-leave { background: #EEF2FF; color: #3730A3; }
.l-week_off { background: var(--subtle); color: var(--muted); }
.l-holiday { background: #F3E8FF; color: #6B21A8; }
/* after somebody's last working day: the word, not a letter in a box */
.reg-mark.l-left { width: auto; padding: 0 5px; background: #EEF1F5; color: #67748A; font-size: 10px; letter-spacing: .4px; }
.reg-left-on { display: block; font-size: 10px; font-weight: 600; color: #B3261E; white-space: nowrap; }
tr.reg-ahead .reg-date { color: var(--placeholder); font-weight: 500; }
tr.reg-total th, tr.reg-total td { background: var(--subtle); border-bottom: 0; font-size: 12px; }
tr.reg-total:first-child th, tr.reg-total:first-child td { border-top: 1px solid var(--line-strong); }

/* ------------------------------------------------------------- roll call */
/* One strip, the way Quickly opens this page: the day, where it stands and
   what can be done to it on one line, the count under it, and the roll call
   straight after — instead of three cards stacked down the screen. */
.att-top { padding: 0; margin-top: 10px; }
.att-sign { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.att-title { font-size: var(--fs-section); }
.att-sign input[type=date] { max-width: 150px; }
.att-count { display: flex; align-items: baseline; gap: 14px; padding: 7px 14px; }
.att-count b { font-size: 15px; }
.att-face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--subtle); }
.att-initials { display: flex; align-items: center; justify-content: center; font-size: 12px;
  font-weight: 700; color: var(--teal); background: var(--teal-50); }
.att-code { font-family: var(--mono); background: var(--subtle); color: var(--text-2); }
.att-selfie { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; cursor: zoom-in;
  border: 1px solid var(--line); background: var(--subtle); }
.att-bulk-card { padding: 0; margin-top: 14px; }
.att-bulk { display: flex; align-items: center; gap: 12px; padding: 7px 14px; border-top: 1px solid var(--line); }
.att-bulk select { max-width: 210px; }
.att-bulk input[type=checkbox] { width: 16px; height: 16px; }

/* ------------------------------------------------------- the staff page
   A person on one page, in sections a reader can take one at a time: the
   photograph top left, then where they report, where they live, what they
   are paid, and their papers. */
.sf-page { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.sf-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 1px 2px rgba(16, 32, 54, .04); }
.sf-name { font-size: 17px; font-weight: 700; letter-spacing: -.012em; }
.sf-meta { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* each section is its own card, named by a heading with a mark beside it */
.sf-card { padding: 0; overflow: hidden; border-radius: 12px; }
.sf-sect { display: flex; align-items: center; gap: 9px; margin: 0;
  padding: 12px 20px; background: var(--subtle); border-bottom: 1px solid var(--line);
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-2); }
.sf-sect::before { content: ''; width: 3px; height: 13px; border-radius: 2px; background: var(--teal); }
.sf-card > *:not(.sf-sect) { margin-left: 20px; margin-right: 20px; }
.sf-card > *:not(.sf-sect):first-of-type { margin-top: 18px; }
.sf-card > *:last-child { margin-bottom: 18px; }
/* The staff list (5 Nov 2026): counts on top, one row a person. */
.sl-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sl-chips .sl-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 112px; height: auto; padding: 10px 16px;
  text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
  cursor: pointer; font: inherit; color: inherit; }
.sl-chips .sl-chip b { display: block; font-size: 22px; line-height: 1.1; font-weight: 700; }
.sl-chips .sl-chip span { font-size: 12px; font-weight: 600; color: var(--muted); }
.sl-chips .sl-chip:hover { border-color: var(--line-strong); }
.sl-chips .sl-chip.on { border-color: var(--teal); box-shadow: 0 0 0 2px var(--ring); }
.sl-chips .sl-chip.off b { color: var(--muted); }
.sl-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.sl-tools { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sl-tools .spacer { flex: 1; }
.sl-tools input { width: 100%; }
.sl-wrap { overflow-x: auto; }
table.sl { width: 100%; border-collapse: collapse; }
table.sl th { text-align: left; padding: 10px 14px; background: var(--subtle); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
table.sl td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; white-space: nowrap; }
table.sl tbody tr:last-child td { border-bottom: 0; }
table.sl tbody tr:not(.sl-grp):hover td { background: var(--hover); }
table.sl .sl-r { text-align: right; }
.sl-grp td { padding: 7px 14px; background: var(--subtle); font-size: 11px; font-weight: 700; letter-spacing: .07em; color: var(--text-2); }
.sl-who { display: flex; align-items: center; gap: 11px; }
.sl-who b { display: block; font-size: 14px; font-weight: 700; }
.sl-av { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: flex; align-items: center;
  justify-content: center; background: var(--navy-50); color: var(--navy); font-size: 13px; font-weight: 700; }
.sl-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sl-sub { margin-top: 1px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sl-type { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.sl-type.t-sales { background: var(--teal-50); color: var(--teal-600); }
.sl-type.t-office { background: var(--info-bg); color: var(--info); }
.sl-type.t-wh { background: var(--warn-bg); color: var(--warn); }
.sl-type.t-adm { background: var(--violet-bg); color: var(--violet); }
.sl-old { color: var(--warn); font-weight: 600; }
.sal-cell .sl-set { color: var(--info); font-weight: 600; font-size: 12.5px; }
.sl-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.sl-st i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #10B981; }
.sl-st.off { color: var(--bad); } .sl-st.off i { background: var(--bad); }
.sl-gone td { background: #FAFAFB; color: var(--muted); }
.sl-gone .sl-av { background: #EEEFF2; color: #9AA3B2; } .sl-gone .sl-av img { filter: grayscale(1); opacity: .7; }
/* The attendance day (6 Nov 2026): date stepper, count cards, one row a person. */
.ad-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ad-top .spacer { flex: 1; }
.ad-day { display: inline-flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.ad-day button { border: 0; background: none; padding: 0 12px; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; }
.ad-day button:hover { background: var(--hover); color: var(--text); }
.ad-day input[type=date] { border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; height: 36px;
  padding: 0 10px; font: 600 14px var(--font); background: none; max-width: 160px; }
.ad-note { font-size: 12.5px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 20px; padding: 4px 12px; }
.sl-chips .sl-chip.ad-g b { color: #0B7A4B; } .sl-chips .sl-chip.ad-a b { color: var(--warn); } .sl-chips .sl-chip.ad-r b { color: var(--bad); }
.sl-box > .att-bulk { border-top: 0; border-bottom: 1px solid var(--line); padding: 9px 14px; }
table.sl.ad td { padding-top: 8px; padding-bottom: 8px; }
table.sl.ad th:first-child, table.sl.ad td:first-child { width: 44px; padding-right: 0; }
.ad-punch { display: flex; align-items: center; gap: 8px; }
.ad-punch .att-selfie { width: 34px; height: 34px; border-radius: 8px; flex: none; }
.ad-punch > .muted { width: 34px; text-align: center; }
.ad-late { color: var(--bad); font-weight: 600; }
.ad-on { color: #0B7A4B; font-weight: 700; }
.ad-bar { width: 92px; height: 6px; margin-top: 4px; border-radius: 4px; background: var(--brand-50); overflow: hidden; }
.ad-bar i { display: block; height: 100%; border-radius: 4px; background: var(--teal); }
.ad-st { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.ad-st.t-p { background: var(--ok-bg); color: var(--ok); } .ad-st.t-on { background: var(--teal-50); color: var(--teal-600); }
.ad-st.t-h { background: var(--warn-bg); color: var(--warn); } .ad-st.t-a { background: var(--bad-bg); color: var(--bad); }
.ad-st.t-l { background: var(--info-bg); color: var(--info); } .ad-st.t-w { background: var(--idle-bg); color: var(--idle); }
.ad-st.t-n { background: var(--warn-bg); color: var(--warn); }
.ad-acts { display: inline-flex; gap: 6px; }
.ad-acts select.ad-act { flex: none; width: 84px; min-width: 0; height: 30px; padding: 0 22px 0 10px; border: 1px solid var(--line-strong);
  border-radius: 8px; background-color: var(--surface); font: 600 12.5px var(--font); color: var(--text); cursor: pointer; }
.ad-acts select.ad-act + select.ad-act { width: 104px; }
/* the Salary figure in the staff list: opens the history */
.sal-cell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; border: 0; background: none; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; text-align: right; }
.sal-cell:hover { background: var(--subtle); }
.sal-cell b { text-decoration: underline dotted; text-underline-offset: 3px; }
.sal-cell span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.sal-cell .sal-next { color: var(--warn); }
.sf-salary { margin-top: 4px; }
.sf-salary-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.sf-salary-head .spacer { flex: 1; }
.sf-sub { font-size: 13.5px; font-weight: 700; margin: 0 0 10px; }

.sf-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.sf-f { min-width: 0; } .sf-bottom { display: flex; align-items: flex-end; }
.sf-2 { grid-column: span 2; } .sf-3 { grid-column: span 3; } .sf-4 { grid-column: span 4; }
.sf-5 { grid-column: span 5; } .sf-6 { grid-column: span 6; } .sf-12 { grid-column: span 12; }
.sf-l { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px;
  letter-spacing: .01em; }
.sf-f .in { width: 100%; }
/* A field the office does not fill in: the PIN decides it, so it is shown
   the way the location line above it is shown — flat, grey, readable. */
.sf-f .in[readonly], .sf-f .in:disabled { background: var(--subtle); color: var(--text-2); cursor: default; }
.sf-note { display: block; margin-top: 8px; font-size: 12px; color: var(--text-2); min-height: 15px; }
.sf-places { display: grid; gap: 12px; }
.sf-none { margin: 0; font-size: 13px; color: var(--text-2); }
.sf-read { height: 32px; display: flex; align-items: center; padding: 0 10px; border-radius: 8px;
  background: var(--subtle); border: 1px solid var(--line); font-size: 13px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-tick { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.sf-tick input { width: 17px; height: 17px; accent-color: var(--teal); }
.sf-rule { border-top: 1px solid var(--line); margin: 18px 0 15px; }
.sf-who { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 22px; align-items: start; }

/* The person page (5 Nov 2026): who it is on the left, always in view, and
   the record in five tabs beside it. */
.sp-cols { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.sp-rail, .sp-main { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.sp-rail { position: sticky; top: 12px; padding: 14px 20px 14px; text-align: center; }
.sp-back { display: block; margin: 0 0 12px -4px; padding: 2px 4px; font-size: 13px; font-weight: 600; text-align: left; }
.sp-rail .pic-field { width: 100%; margin: 0 0 12px; }
.sp-rail .pic-field > label { display: none; }
.sp-rail .pic-field img, .sp-rail .pic-field .pic-empty { width: 112px; height: 112px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--teal); font-size: 11.5px; }
.sp-rail .pic-field .row { justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sp-rail .pic-field button { padding: 4px 9px; font-size: 12px; }
.sp-name { font-size: 18px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.sp-meta { margin-top: 4px; font-size: 12.5px; color: var(--muted); display: flex; gap: 7px; justify-content: center; align-items: center; flex-wrap: wrap; }
.sp-chip { font: 600 11.5px var(--mono); background: var(--navy-50); color: var(--navy); border-radius: 6px; padding: 2px 7px; }
.sp-active { margin-top: 14px; display: flex; justify-content: center; }
.sp-facts { margin-top: 16px; border-top: 1px solid var(--line); text-align: left; }
.sp-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.sp-facts > div:last-child { border-bottom: 0; }
.sp-facts span { color: var(--muted); white-space: nowrap; }
.sp-facts b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.sp-facts em { display: block; font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted); }
.sp-main { padding: 0; min-width: 0; }
.sp-tabs { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 2px; padding: 0 14px; background: var(--surface);
  border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; overflow-x: auto; }
.sp-tabs .spacer { flex: 1; min-width: 12px; }
.sp-tabs .sp-act { margin-left: 8px; flex: none; }
.sp-tabs button:not(.sp-act) { border: 0; background: none; padding: 13px 14px; margin-bottom: -1px; font: 600 13.5px var(--font); color: var(--muted);
  border-bottom: 2.5px solid transparent; white-space: nowrap; cursor: pointer; }
.sp-tabs button:not(.sp-act):hover { color: var(--text); }
.sp-tabs button.on:not(.sp-act) { color: var(--navy); border-bottom-color: var(--teal); }
.sp-pane { padding: 20px 22px 24px; }
.sp-pane[hidden] { display: none; }
.sp-sec + .sp-sec, .sp-sal + .sp-sec { margin-top: 24px; }
.sp-h { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-2); }
.sp-h::before { content: ''; width: 3px; height: 13px; border-radius: 2px; background: var(--teal); }
.sp-sec .sf-tick + .sf-tick { margin-top: 10px; }
.sp-pane .btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; padding-right: 8px; }
/* what they are paid now, and what is already entered to follow */
.sp-sal { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border-radius: 12px; background: var(--navy); color: #fff; }
.sp-sal .spacer { flex: 1; }
.sp-sal small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #9FC2E4; }
.sp-sal b { font-size: 24px; font-weight: 700; }
.sp-sal span { font-size: 12.5px; color: #9FC2E4; }
.sp-sal-next { text-align: right; font-size: 13px; font-weight: 600; }
.sp-sal-next:empty { display: none; }
.sp-sal .sp-sal-btn { background: var(--teal); border-color: var(--teal); color: #06263F; font-weight: 700; }
@media (max-width: 1000px) {
  .sp-cols { grid-template-columns: 1fr; }
  .sp-rail { position: static; }
}

/* the one switch on the page: can this person open the app at all */
.sf-toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.sf-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.sf-knob { position: relative; width: 38px; height: 22px; border-radius: 999px; flex: 0 0 auto;
  background: var(--line-strong); transition: background .14s ease; }
.sf-knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .14s ease;
  box-shadow: 0 1px 2px rgba(16, 32, 54, .25); }
.sf-knob.on { background: var(--teal); }
.sf-knob.on::after { transform: translateX(16px); }
.sf-toggle input:focus-visible + .sf-knob { outline: 2px solid var(--ring); outline-offset: 2px; }
.sf-word { font-size: 13.5px; font-weight: 600; }

@media (max-width: 900px) {
  .sf-who { grid-template-columns: 1fr; }
  .sf-grid > .sf-f { grid-column: span 12; }
  .sf-top { flex-wrap: wrap; }
}

/* The remark on a line: a button that holds its own column, so it is in the
   same place whatever the item is called, and the words themselves in red
   under the item — red because it is an instruction to whoever packs the
   order, not part of the item's description. */
.order-line-remark { display:flex; align-items:center; justify-content:center; width:26px; height:26px;
  padding:0; border:0; background:none; border-radius:6px; cursor:pointer; color:var(--muted); font-size:15px; }
.order-line-remark:hover { background:var(--teal-50); color:var(--teal); }
.order-line-remark.has-note { color:#B3261E; }
.simple-order-form .order-item-row.with-note { height:auto; align-items:center; padding:3px 0; row-gap:0; }
/* Under the item name and hard against it: the row's own 10px row-gap and the
   right-alignment every cell past the third one inherits both have to be
   undone here, or the remark drifts to the far right under the amount. */
.order-item-note { grid-column:3 / -1; justify-self:start; text-align:left !important;
  margin:-2px 0 0; padding-left:38px; line-height:1.2; color:#B3261E; font-size:var(--fs-small);
  max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.order-note-editor { grid-column:3 / -1; justify-self:start; display:flex; align-items:center; gap:8px;
  margin:1px 0 0; padding-left:38px; text-align:left; }
.order-note-editor input { flex:1; max-width:420px; text-transform:uppercase; text-align:left !important; }
.order-note-editor .hint { color:var(--muted); font-size:var(--fs-small); white-space:nowrap; }

/* Pointing a partner's code at one of our items, one row each. */
.order-map-row { display:grid; grid-template-columns:150px 70px minmax(0,1fr) 90px; gap:10px;
  align-items:center; padding:7px 0; border-top:1px solid var(--line); }
.order-map-row .mono { font-size:var(--fs-small); }
@media(max-width:700px){ .order-map-row { grid-template-columns:1fr 1fr; } }

/* The manifest import: what it read, and what it still has to ask. */
.import-summary { display:flex; gap:22px; align-items:baseline; padding:2px 0 12px; }
.import-summary b { font-size:19px; }
.import-summary .needs b { color:#B3261E; }
.import-summary .allgood { color:var(--ok, #0B7A4B); font-size:13px; }
/* The imported lines: one line per line, read once and approved. */
.import-lines { border:1px solid var(--line); border-radius:9px; overflow:hidden auto; max-height:46vh; }
.import-line { display:grid; grid-template-columns:170px minmax(0,1fr) 54px 104px; gap:12px;
  align-items:center; padding:7px 12px; border-top:1px solid var(--line); font-size:var(--fs-small); }
.import-line:first-child,.import-line.head { border-top:0; }
.import-line.head { position:sticky; top:0; z-index:1; background:var(--subtle); color:var(--muted);
  font-weight:600; text-transform:uppercase; letter-spacing:.03em; font-size:11px; padding:6px 12px; }
.import-line .mono { font-size:var(--fs-small); color:var(--text-2); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; }
.import-line-item { display:flex; align-items:baseline; gap:8px; min-width:0; }
.import-line-item .muted { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.import-line-qty,.import-line.head > :nth-child(3) { text-align:right; font-variant-numeric:tabular-nums; }
.import-line > :last-child { display:flex; justify-content:flex-end; }
@media(max-width:700px){ .import-line { grid-template-columns:110px minmax(0,1fr) 44px; }
  .import-line > :last-child { display:none; } }
.import-ask { margin:16px 0 6px; font-size:13px; color:var(--muted); }

/* Typing to find an item, rather than scrolling two thousand of them. */
.item-picker { position:relative; }
.item-picker .in { width:100%; }
.item-picker-list { position:fixed; z-index:1300;
  max-height:230px; overflow:auto; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r); box-shadow:0 10px 24px rgba(10,31,59,.14); }
.item-picker-row { display:grid; grid-template-columns:110px minmax(0,1fr); gap:10px; align-items:center;
  width:100%; padding:8px 10px; border:0; background:none; text-align:left; cursor:pointer;
  font-size:var(--fs-small); color:var(--text); }
.item-picker-row:hover { background:var(--hover); }
.item-picker-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); }
.item-picker-none { padding:10px; color:var(--muted); font-size:var(--fs-small); }
.order-items-titlebar .spacer { flex:1; }

/* The manager's tick on one attendance record, and the way to take it off. */
.att-confirmed { display:inline-flex; align-items:center; gap:7px; }
.att-confirmed .btn-link { font-size:12px; }
.att-sign .btn-link { margin-right:4px; }
.att-type { font-size:12px; letter-spacing:.04em; color:var(--text-2); }
/* The day's box is a box on a row, not a form field: it takes the height of
   the line it sits on. */
.daybox { min-width:104px; width:100%; height:28px; padding:2px 8px; font-size:12.5px; }
.daybox.by-hand { border-color:var(--warn,#B26A00); }
/* The roll call opens the same every time — a row tall enough for the selfie
   and the two lines of a name, and headings that print in full. */
.att-roll { margin-top:10px; }
.att-roll table { --row-h:58px; }
.att-roll th { white-space:nowrap; }


/* ---------------------------------------------- WhatsApp: one card a message
 * Each message states its own case - what it is, who it reaches, what it carries, and
 * whether it is on - instead of being read across the columns of a table. */
.msg-cards { display:grid; grid-template-columns:repeat(auto-fill, minmax(268px, 1fr)); gap:14px; }
.msg-card { display:flex; flex-direction:column; gap:10px; padding:16px; border:1px solid var(--line);
  border-radius:14px; background:var(--surface); transition:border-color .12s, box-shadow .12s; }
.msg-card:hover { border-color:var(--line-strong); }
.msg-card.is-on { border-color:var(--teal); box-shadow:0 0 0 3px var(--ring); }
.msg-top { display:flex; align-items:flex-start; gap:11px; }
.msg-ic { display:grid; place-items:center; width:40px; height:40px; flex:none; border-radius:11px;
  font-size:19px; background:var(--subtle); }
.msg-card.green .msg-ic { background:#E6F6ED; } .msg-card.amber .msg-ic { background:#FFF2DD; }
.msg-card.blue  .msg-ic { background:#E8F0FF; } .msg-card.violet .msg-ic { background:#F1EBFF; }
.msg-name { min-width:0; }
.msg-name b { display:block; font-size:14px; color:var(--text); }
.msg-to, .msg-carries { display:flex; gap:7px; font-size:12px; color:var(--text-2); line-height:1.45; }
.msg-to-k { flex:none; font-size:10.5px; font-weight:700; letter-spacing:.3px; text-transform:uppercase;
  color:var(--muted); padding-top:1px; min-width:58px; }
.msg-pick { height:34px; font-size:13px; }
.msg-foot { display:flex; align-items:center; gap:9px; padding-top:2px; border-top:1px solid var(--line); margin-top:auto; padding-top:11px; }
.msg-chip { font-size:10.5px; font-weight:700; color:var(--muted); border:1px dashed var(--line-strong);
  border-radius:99px; padding:3px 9px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:160px; }
.msg-chip.set { border-style:solid; border-color:var(--teal); color:var(--teal); }
.msg-state { font-size:12px; font-weight:700; color:var(--muted); }
.msg-card.is-on .msg-state { color:var(--teal); }
.msg-foot input[type=checkbox] { width:17px; height:17px; accent-color:var(--teal); flex:none; }
@media(max-width:560px) { .msg-cards { grid-template-columns:1fr; } }

/* The bell beside sign-out: notifications in this browser, for anyone with no app. */
.side-foot .side-bell { background:none; border:0; padding:4px 6px; font-size:15px; line-height:1;
  cursor:pointer; opacity:.55; filter:grayscale(1); transition:opacity .12s, filter .12s; }
.side-foot .side-bell:hover { opacity:.9; }
.side-foot .side-bell.on { opacity:1; filter:none; }
.side-foot .side-bell:disabled { cursor:progress; opacity:.4; }

/* ---------------------------------------------- the roll call on a phone
 *
 * Thirteen columns, and the generic rule turns every one of them into its own labelled line:
 * a card four hundred pixels tall per person, so eleven staff is four thousand pixels of
 * scrolling to answer "who is in". The question a phone is holding is that one.
 *
 * So the card answers it in one line - who, and when they came on - and the rest of the day
 * (the selfies, duty off, hours, visits, km, and the manager's word on the day) waits behind
 * a tap on the row. Desktop is untouched: there the columns fit, which is the whole point of
 * a table. */
@media (max-width: 680px) {
  .att-roll .tbl-wrap tbody tr {
    display: grid; grid-template-columns: auto auto minmax(0,1fr) auto;
    align-items: center; gap: 2px 10px; padding: 9px 12px; margin-bottom: 6px;
  }
  .att-roll .tbl-wrap tbody td { padding: 0; }
  .att-roll .tbl-wrap tbody td:nth-child(1) { grid-row: 1; grid-column: 1; }
  .att-roll .tbl-wrap tbody td:nth-child(2) { grid-row: 1; grid-column: 2; }
  .att-roll .tbl-wrap tbody td[data-label="Name"] { grid-row: 1; grid-column: 3; }
  .att-roll .tbl-wrap tbody td[data-label="Duty on"] { grid-row: 1; grid-column: 4; justify-content: flex-end; }
  .att-roll .tbl-wrap tbody td[data-label="Name"]::before,
  .att-roll .tbl-wrap tbody td[data-label="Duty on"]::before { display: none; }
  /* everything else is the detail of the day, and waits for a tap */
  .att-roll .tbl-wrap tbody td[data-label]:not([data-label="Name"]):not([data-label="Duty on"]) { display: none; }
  .att-roll .tbl-wrap tbody tr.att-open td[data-label]:not([data-label="Name"]):not([data-label="Duty on"]) {
    display: flex; grid-column: 1 / -1; padding: 3px 0;
  }
  .att-roll .tbl-wrap tbody tr.att-open { padding-bottom: 12px; }
  .att-roll .tbl-wrap tbody tr.att-open td[data-label="The day"] { padding-top: 7px; }
  .att-roll .att-face { width: 30px; height: 30px; }
  /* a row that can be opened says so, quietly */
  .att-roll .tbl-wrap tbody tr::after {
    content: '⌄'; grid-row: 1; grid-column: 4; align-self: center; margin-left: 8px;
    color: var(--muted); font-size: 13px; }
  .att-roll .tbl-wrap tbody tr.att-open::after { content: '⌃'; }
}

/* A route is built city, then zone, then the localities ticked off a list. */
.route-where { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.route-areas { max-height:260px; overflow:auto; border:1px solid var(--line); border-radius:9px; padding:4px; }
.route-area { display:grid; grid-template-columns:18px minmax(0,1fr) auto; gap:9px; align-items:center;
  padding:6px 9px; border-radius:7px; font-size:var(--fs-small); cursor:pointer; }
.route-area:hover { background:var(--hover); }
.route-area input { width:16px; height:16px; margin:0; }
.route-area .muted { font-variant-numeric:tabular-nums; font-size:12px; }
@media(max-width:650px){ .route-where { grid-template-columns:1fr; } }
/* The route's own page: the form reads down, the buttons sit under it. */
.route-form { padding-top: 4px; }
.route-form .route-areas { max-height: 46vh; }
.route-foot { display: flex; align-items: center; gap: 10px; padding: 12px var(--s4); border-top: 1px solid var(--line); }
/* One person's month: who and when, then a day to a row. */
.plan-pick { display:grid; grid-template-columns:minmax(220px,320px) 190px; gap:14px; padding-top:4px; }
.plan-route { max-width:200px; }
@media(max-width:650px){ .plan-pick { grid-template-columns:1fr; } }
/* The day's beat: the shops of a route, ticked for one day. */
.beat-shops { max-height:50vh; overflow:auto; border:1px solid var(--line); border-radius:9px; }
.beat-shop { display:grid; grid-template-columns:20px minmax(0,1fr) auto; gap:10px; align-items:center;
  padding:8px 12px; border-top:1px solid var(--line); cursor:pointer; }
.beat-shop:first-child { border-top:0; }
.beat-shop:hover { background:var(--hover); }
.beat-shop input { width:16px; height:16px; margin:0; }

/* ---------------------------------------------------------- Integrations --
 * A grid of the outside tools this business connects One to. Cards rather
 * than rows: there will never be fifty of them, and what somebody needs at a
 * glance is which one has stopped working - so the chip carries the weight
 * and the button says the one thing there is to do.
 */
.integ-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.integ { border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
         display: flex; flex-direction: column; overflow: hidden; }
.integ-head { display: flex; gap: 12px; align-items: flex-start; padding: 15px 16px 13px; cursor: pointer; }
.integ-head:hover { background: var(--hover); }
.integ-logo { flex: 0 0 38px; height: 38px; border-radius: 9px; color: #fff;
              display: inline-flex; align-items: center; justify-content: center;
              font-weight: 700; font-size: 17px; }
.integ-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.integ-name b { font-size: var(--fs-body); }
.integ-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between;
              gap: 10px; padding: 11px 16px; border-top: 1px solid var(--line); background: var(--sunken, transparent); }

/* The facts in a detail view: a label and what it says, nothing clever. */
table.facts { width: 100%; border-collapse: collapse; margin: 10px 0 4px; }
table.facts th { text-align: left; font-weight: 600; color: var(--muted); font-size: var(--fs-small);
                 padding: 6px 14px 6px 0; white-space: nowrap; vertical-align: top; width: 1%; }
table.facts td { padding: 6px 0; font-size: var(--fs-small); }
ol.steps { margin: 10px 0 14px 18px; padding: 0; }
ol.steps li { margin: 5px 0; font-size: var(--fs-small); }

/* The connector's settings file, shown so it can be copied when a download cannot. */
pre.keyfile { background: #0F172A; color: #E2E8F0; padding: 12px 14px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.5; overflow-x: auto; user-select: all; margin: 10px 0; }

/* ---------------------------------------------------------------- B2B website: product editor (full page) */
.wpe { display: flex; flex-direction: column; gap: 16px; max-width: 1280px; }
.wpe-top { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.wpe-picbox { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; }
.wpe-photo { width: 220px; height: 220px; object-fit: contain; background: var(--subtle); border: 1px solid var(--line); border-radius: 12px; }
.wpe-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.wpe-sec { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; min-width: 0; }
.wpe-sec > header { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.wpe-sec > header h3 { margin: 0; font-size: var(--fs-section); }
.wpe-sec > header .muted { font-size: var(--fs-meta); }
.wpe-grid { display: grid; gap: 12px 16px; }
.wpe-grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wpe-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wpe-wide { grid-column: 1 / -1; }
.wpe-grid .field input, .wpe-grid .field select { width: 100%; }
.wpe-show { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--fs-small);
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.wpe-show:has(input:checked) { background: var(--teal-50); border-color: var(--teal); color: var(--teal-600); }
.wpe-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.wpe-tag { font-size: var(--fs-meta); padding: 2px 9px; border-radius: 999px; background: var(--subtle); border: 1px solid var(--line); color: var(--text-2); }
.wpe-tag.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.wpe-hint { margin: 10px 0 0; font-size: var(--fs-small); color: var(--text-2); background: var(--subtle); border-radius: 8px; padding: 8px 12px; }
.wpe-gone { margin: 0; padding: 10px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); }
.wpe-vars input.in { width: 100%; min-width: 110px; }
.wpe-vars input.wpe-num { min-width: 96px; }
.wpe-vars input.wpe-missing { border-style: dashed; }
.wpe-thumb { display: block; width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--subtle); }
.wpe-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .wpe-grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .wpe-top { grid-template-columns: 1fr; }
  .wpe-picbox { position: static; flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
  .wpe-photo { width: 140px; height: 140px; }
  .wpe-grid.g2, .wpe-grid.g4 { grid-template-columns: 1fr; }
}

.wpe-vpic { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; }
.wpe-thumbbtn { position: relative; padding: 0; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--subtle); cursor: pointer; overflow: hidden; }
.wpe-thumbbtn span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(8, 37, 82, .72); color: #fff; font-size: 9.5px; text-align: center; padding: 1px 0; opacity: 0; transition: opacity .15s; }
.wpe-thumbbtn:hover span, .wpe-thumbbtn:focus span { opacity: 1; }
.wpe-thumbbtn .wpe-thumb { width: 48px; height: 48px; }
.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cat-admin { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.cat-admin-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }

.cat-admin-pic { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--subtle); cursor: pointer; }
.cat-admin-pic > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-admin-pic > span { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.cat-admin-pic > i { position: absolute; right: 8px; bottom: 8px; font-style: normal; font-size: 12px; background: rgba(8, 37, 82, .8); color: #fff; padding: 3px 9px; border-radius: 999px; }

/* Website setup → Categories: the home page's cards as shops see them, dragged into order */
.cat-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; user-select: none; }
.cat-tile { display: flex; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(13, 44, 79, .06), 0 4px 14px rgba(13, 44, 79, .06); cursor: grab; touch-action: none; transition: box-shadow .15s, transform .15s; }
.cat-tile:hover { box-shadow: 0 2px 4px rgba(13, 44, 79, .08), 0 8px 22px rgba(13, 44, 79, .10); }
.cat-tile.off { opacity: .5; }
.cat-tile.dragging { opacity: .85; transform: scale(1.03); box-shadow: 0 12px 30px rgba(13, 44, 79, .22); cursor: grabbing; z-index: 2; position: relative; }
.cat-board.sorting .cat-tile:not(.dragging) { transition: transform .15s; }
.cat-pic { position: relative; aspect-ratio: 4 / 3; background: #eef2f6; overflow: hidden; cursor: pointer; }
.cat-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cat-pic > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; font-weight: 800; color: #b8c4d0; }
.cat-pic > i { position: absolute; right: 8px; bottom: 8px; font-style: normal; font-size: 11.5px; background: rgba(8, 37, 82, .82); color: #fff;
  padding: 3px 9px; border-radius: 999px; opacity: 0; transition: opacity .15s; }
.cat-tile:hover .cat-pic > i { opacity: 1; }
.cat-txt { padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.cat-txt b { font-size: 15px; color: #16202c; }
.cat-txt span { font-size: 12.5px; color: #66717f; }
.cat-txt small { font-size: 11.5px; color: #66717f; line-height: 1.35; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-ctl { display: flex; align-items: center; gap: 8px; padding: 8px 12px 10px; margin-top: auto; border-top: 1px solid var(--line); font-size: 12.5px; }
.cat-ctl .grip { color: var(--muted); font-size: 16px; line-height: 1; cursor: grab; }
.cat-ctl em { font-style: normal; color: var(--warn); font-weight: 600; }
.cat-ctl label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.cat-ctl a { color: var(--muted); }
.cat-pic { aspect-ratio: 1 / 1; background: #fff; }
.cat-pic img { object-fit: contain; }

.cat-board { grid-template-columns: repeat(var(--board-cols, 6), minmax(0, 1fr)); }
@media (max-width: 1100px) { .cat-board { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
.lay { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px 14px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.lay-h { font-weight: 700; font-size: var(--fs-small); }
.lay-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: var(--fs-small); }
.lay-row > b { min-width: 120px; font-weight: 600; }
.lay-row label { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.lay-row select { min-width: 56px; }

.wpe-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0 0 12px; border-radius: 8px; background: var(--subtle); cursor: pointer; }
.wpe-opt input { margin-top: 3px; }
.wpe-opt span { display: flex; flex-direction: column; gap: 2px; }
.wpe-opt small { color: var(--muted); font-size: var(--fs-meta); }

.wpe-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.wpe-opts .wpe-opt { margin: 0; }
@media (max-width: 760px) { .wpe-opts { grid-template-columns: 1fr; } }

.wpe-unsaved { color: var(--warn); font-weight: 600; margin-left: 6px; }

.wpe-added { font-size: 12px; color: var(--teal-600); font-weight: 600; }
.wpe-show-cell { display: flex; align-items: center; gap: 10px; }
.wpe-show-cell a { font-size: 12px; color: var(--bad, #b91c1c); }
.wpe-addrow { display: flex; align-items: center; gap: 12px; padding: 10px 2px 0; flex-wrap: wrap; }
.wpe-addrow .muted { font-size: var(--fs-meta); }

.wpe-ro { display: inline-block; min-width: 80px; padding: 8px 10px; border-radius: 8px; background: var(--subtle); color: var(--muted); font-weight: 600; text-align: right; }
.wpe-mrp { width: 100px; text-align: right; }
.wpe-onepick { min-width: 170px; }
.wpe-onepick .item-picker input { width: 100%; }

/* Website setup → Products list */
.prod-img { display: block; width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--line); }
.prod-img.none { background: var(--subtle); }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-meta); color: var(--text-2); white-space: nowrap; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--line-strong); transition: background .15s; flex: none; }
.toggle i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.toggle input:checked + i { background: var(--teal-600); }
.toggle input:checked + i::after { transform: translateX(16px); }
.toggle input:checked ~ span { color: var(--teal-600); font-weight: 600; }
.toggle input:disabled + i { opacity: .4; }
.toggle input:focus-visible + i { box-shadow: 0 0 0 3px var(--ring); }
/* The status switch in One's own mint teal (the tab underline and menu
   highlight), and room for its word so "Active" / "Inactive" are not cut. */
.toggle input:checked + i { background: var(--teal); }
.toggle { min-width: 104px; padding-right: 6px; }

/* Bulk edit window */
.bulk-form { display: flex; flex-direction: column; gap: 4px; min-width: min(560px, 90vw); }
.bulk-row { display: grid; grid-template-columns: 86px 190px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.bulk-row:last-child { border-bottom: 0; }
.bulk-on { display: flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--muted); cursor: pointer; }
.bulk-on:has(input:checked) { color: var(--teal-600); font-weight: 600; }
.bulk-l { display: flex; flex-direction: column; }
.bulk-l small { font-size: 11.5px; color: var(--muted); }
.bulk-row select, .bulk-row input.in { width: 100%; }
@media (max-width: 640px) { .bulk-row { grid-template-columns: 1fr; gap: 4px; } }

/* Choosing the product card's picture from the product's own. */
.wpe-choices small { display: block; font-size: 11.5px; color: var(--muted); margin: 2px 0 4px; }
.wpe-choice-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; max-width: 220px; }
.wpe-choice { padding: 0; border: 2px solid transparent; border-radius: 7px; background: #fff; cursor: pointer; aspect-ratio: 1 / 1; overflow: hidden; }
.wpe-choice img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wpe-choice.on { border-color: var(--teal); }
.wpe-choice-cell { position: relative; }
.wpe-choice-cell .wpe-choice { width: 100%; }
.wpe-choice-x { position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-strong); background: #fff; color: var(--muted); font-size: 13px; line-height: 15px; cursor: pointer; }
.wpe-choice-x:hover { color: #c0392b; border-color: #c0392b; }
.wpe-choices small a { color: inherit; text-decoration: underline; }
.wpe-choice:hover { border-color: var(--line-strong); }

/* The four MOQ / colour ticks, 2 x 2, no hints. */
.wpe-ticks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 14px 0 0; }
.wpe-ticks label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); font-weight: 600; color: var(--text); cursor: pointer; }
@media (max-width: 760px) { .wpe-ticks { grid-template-columns: 1fr; } }
/* Each tick in its own light box, like the colour options were. */
.wpe-ticks label { background: var(--subtle); border-radius: 10px; padding: 14px 16px; gap: 10px; font-weight: 600; }
.wpe-ticks label input { width: 18px; height: 18px; flex: none; }
/* Slimmer: the four ticks in one row under the four MOQ boxes. */
.wpe-ticks { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; margin: 10px 0 0; }
.wpe-ticks label { padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.25; gap: 8px; }
.wpe-ticks label input { width: 16px; height: 16px; }
@media (max-width: 1100px) { .wpe-ticks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .wpe-ticks { grid-template-columns: 1fr; } }

.banner-phone { display: flex; align-items: center; gap: 8px; }
.banner-phone img { width: 56px; height: 60px; object-fit: cover; border-radius: 6px; background: #eef1f4; }
.banner-phone > span { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------- attendance: the month tabs
   Register, Totals and Leave in the same dress as the Day tab: a month (or
   group) picker on top, count cards, then one white box with the sheet. */
.ad-day input[type=month] { border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; height: 36px;
  padding: 0 10px; font: 600 14px var(--font); background: none; max-width: 190px; }
.sl-chips div.sl-chip { cursor: default; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.sl-chips div.sl-chip:hover { border-color: var(--line); }
.reg-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-2); }
.reg-key > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.reg-key .reg-tick { margin-left: 0; font-size: 13px; }
.sl-box .reg-wrap { max-height: calc(100vh - 345px); border: 0; border-radius: 0; margin: 0; }
.sl-box table.reg { margin: 0 auto 0 0; }
.sl-box table.reg .reg-date { min-width: 84px; padding-left: 14px; }
.sl-box table.reg thead th { background: var(--subtle); }
.sl-box table.reg thead .reg-date { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; vertical-align: bottom; padding-bottom: 6px; }
/* the department sits over its own people, with a rule under it as wide as they are */
.sl-box table.reg .reg-h-type { width: auto; min-width: 0; max-width: none; padding: 7px 3px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; color: var(--text-2); }
.sl-box table.reg .reg-h-type span { display: block; padding-bottom: 3px; border-bottom: 2px solid var(--line-strong); }
/* The heading rows have to stick: the general "thead th { position: relative }"
   further up (there for the column grips) switched that off, and the offsets
   then pushed the names down over the first days of the month. */
table.reg thead th { position: sticky; z-index: 2; }
table.reg thead th.reg-date { z-index: 4; }
.reg-open { cursor: pointer; }
.reg-open:hover b { text-decoration: underline; }
.reg-hol { color: #6B21A8; font-size: 8px; margin-left: 5px; vertical-align: middle; }
tr.reg-sun th, tr.reg-sun td { background: #FAFBFC; }
tr.reg-sun .reg-dow { color: var(--bad); }
tr.reg-now th.reg-date { box-shadow: inset 3px 0 0 var(--teal), 1px 0 0 var(--line); }
tr.reg-now th, tr.reg-now td { background: var(--teal-50); }
tr.reg-total.reg-paid th, tr.reg-total.reg-paid td { background: var(--navy-50); color: var(--navy); font-size: 13px; border-top: 1px solid var(--line-strong); }
.sl-box table.reg tbody tr:hover td, .sl-box table.reg tbody tr:hover th { background: var(--hover); }
/* totals: figures to the right, the paid days standing out */
table.sl.tot td.sl-r, table.sl.tot th.sl-r { padding-left: 8px; padding-right: 12px; font-variant-numeric: tabular-nums; }
table.sl.tot .tot-paid { background: var(--navy-50); color: var(--navy); }
table.sl.tot tfoot td { background: var(--subtle); border-top: 1px solid var(--line-strong); border-bottom: 0; padding-top: 10px; padding-bottom: 10px; }
table.sl.tot tfoot td.tot-paid { background: var(--navy-50); }
table.sl.tot .ad-st { min-width: 22px; text-align: center; padding: 2px 8px; }
table.sl .reg-left-on { display: inline; }
/* leave */
table.sl.lv td.lv-why { white-space: normal; min-width: 140px; max-width: 220px; line-height: 1.35; }
table.sl.lv td, table.sl.lv th { padding-left: 10px; padding-right: 10px; }
table.sl.lv td:first-child, table.sl.lv th:first-child { padding-left: 14px; }
table.sl.lv .ad-acts button { height: 30px; }

/* ---------------------------------------------------------------- dashboard */
/* The phone's sales home, grown up: a target ring, navy numbers, the period's
   pictures, then the day's work. Rounded 14px cards on the ivory page. */
:root { --dash-accent: #00A9C7; --dash-wash: #E9F0F8; --dash-band-ink: #9FC2E4; }
.dash { display: flex; flex-direction: column; gap: 10px; max-width: 1240px; }
.dash.dash-busy { opacity: .55; pointer-events: none; }
.dash-sel { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; min-width: 140px; }
.dash-seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.dash-seg button { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); background: none; border: 0; border-radius: 7px; padding: 5px 11px; cursor: pointer; }
.dash-seg button.on { background: var(--brand); color: #fff; }
.dash-hero { display: grid; grid-template-columns: minmax(340px, 400px) 1fr 1fr; gap: 10px; }
.dash-target { grid-row: 1 / 3; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; gap: 18px; align-items: center; min-width: 0; }
.dash-target.tap { cursor: pointer; } .dash-target.tap:hover { border-color: var(--teal); }
.dash-target > div:last-child { min-width: 0; }
.dash-target .k, .dash-navy .k { font-size: 10.5px; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.dash-target .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.dash-target .s { color: var(--muted); font-size: 13px; margin-top: 2px; }
.dash-ring { width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.dash-ring div { width: 86px; height: 86px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dash-ring b { font-size: 22px; color: var(--brand); } .dash-ring small { font-size: 9px; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.dash-pills { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.dash-pills .pill { font-size: 11.5px; font-weight: 600; border-radius: 20px; padding: 4px 10px; background: var(--dash-wash); color: var(--brand); white-space: nowrap; }
.dash-pills .pill.w { background: var(--warn-bg); color: var(--warn); }
.dash-navy { background: var(--brand); border-radius: 14px; padding: 13px 16px; color: #fff; min-height: 84px; position: relative; min-width: 0; }
.dash-navy .k { color: var(--dash-band-ink); padding-right: 110px; }
.dash-navy .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 3px; font-variant-numeric: tabular-nums; }
.dash-navy .s, .dash-navy .n { font-size: 12px; color: var(--dash-band-ink); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-navy .n { font-style: italic; opacity: .8; }
.dash-navy .dash-delta { position: absolute; right: 14px; top: 12px; }
.dash-delta { font-size: 11.5px; font-weight: 700; border-radius: 20px; padding: 3px 8px; background: rgba(2, 206, 171, .18); color: #0B7A4B; white-space: nowrap; }
.dash-navy .dash-delta { color: #7EF0D6; }
.dash-delta.down { background: rgba(180, 35, 24, .12); color: var(--bad); } .dash-navy .dash-delta.down { background: rgba(255, 120, 120, .2); color: #FFB3B3; }
.dash-row { display: grid; gap: 10px; } .dash-row.c21 { grid-template-columns: 2fr 1fr; } .dash-row.c2 { grid-template-columns: 1fr 1fr; } .dash-row.c3 { grid-template-columns: 1fr 1fr 1fr; }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.dash-card h2 { font-size: 14.5px; margin: 0 0 10px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dash-card h2 small { color: var(--muted); font-weight: 500; font-size: 12px; }
.dash-link { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--brand); border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px; text-decoration: none; }
.dash-link:hover { border-color: var(--teal); }
.dash-card .tbl-wrap { margin: 0; } .dash-card table { font-size: 13px; }
.dash-card table td, .dash-card table th { padding: 6px 7px; white-space: nowrap; }
.dash-empty, .dash-clear { color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; }
.dash-clear { color: var(--ok); font-weight: 600; }
.dash-barcell { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.dash-bar { height: 6px; border-radius: 4px; background: var(--dash-wash); width: 60px; display: inline-block; overflow: hidden; }
.dash-bar i { display: block; height: 100%; border-radius: 4px; background: var(--dash-accent); } .dash-bar i.w { background: #F5B74E; }
.dash-chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 6px; }
.dash-chart .pair { flex: 1; display: flex; align-items: flex-end; gap: 1px; height: 100%; min-width: 0; }
.dash-chart .pair i { flex: 1; display: block; background: var(--dash-accent); border-radius: 3px 3px 0 0; min-height: 1px; }
.dash-chart .pair i.g { background: var(--dash-wash); } .dash-chart .pair i.t { background: var(--brand); }
.dash-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.dash-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.dash-legend b, .ll b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; flex: 0 0 auto; }
.dash-donut { display: flex; align-items: center; gap: 16px; }
.dash-donut .r { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.dash-donut .r div { width: 84px; height: 84px; background: var(--surface); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; text-align: center; line-height: 1.2; }
.dash-donut .r small { color: var(--muted); font-weight: 500; font-size: 11px; }
.ll { font-size: 12.5px; display: grid; gap: 5px; flex: 1; min-width: 0; } .ll.two { grid-template-columns: 1fr 1fr; }
.ll div { display: flex; align-items: center; gap: 7px; min-width: 0; } .ll span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll em { font-style: normal; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dash-fs { background: var(--bg); border-radius: 10px; padding: 9px 10px; } .dash-fs.w { background: var(--warn-bg); }
.dash-fs .n { font-size: 20px; font-weight: 700; } .dash-fs .t { font-size: 11.5px; color: var(--muted); } .dash-fs .m { font-size: 12px; font-weight: 600; color: var(--brand); margin-top: 2px; }
.dash-fs.w .m { color: var(--warn); }
.dash-stack { display: flex; height: 16px; border-radius: 8px; overflow: hidden; margin: 4px 0 8px; background: var(--dash-wash); } .dash-stack i { display: block; }
.dash-foot { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.dash-foot b { color: var(--text); } .dash-foot b.bad { color: var(--bad); }
.dash-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-content: start; }
.dash-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; display: flex; gap: 11px; align-items: center; cursor: pointer; min-width: 0; }
.dash-tile:hover { border-color: var(--teal); }
.dash-tile .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--dash-wash); color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.dash-tile.w .ic { background: var(--warn-bg); color: var(--warn); }
.dash-tile > div { min-width: 0; } .dash-tile b { font-size: 14px; font-weight: 600; display: block; }
.dash-tile small { color: var(--muted); font-size: 11.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-tile.w small { color: var(--warn); font-weight: 600; }
.dash-look { display: flex; flex-direction: column; gap: 6px; }
.dash-look div { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; background: var(--bg); font-size: 13px; }
.dash-look div.tap { cursor: pointer; } .dash-look div.tap:hover { background: var(--hover); }
.dash-look i { font-style: normal; min-width: 28px; height: 24px; border-radius: 7px; background: var(--warn-bg); color: var(--warn); font-weight: 700; display: grid; place-items: center; font-size: 12px; }
.dash-look i.b { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 1100px) {
  .dash-hero { grid-template-columns: 1fr 1fr; } .dash-target { grid-column: 1 / 3; grid-row: auto; }
  .dash-row.c3, .dash-row.c2, .dash-row.c21 { grid-template-columns: 1fr; } .dash-tiles { grid-template-columns: repeat(2, 1fr); }
}
.dash-card .tbl-wrap { overflow: hidden; }
.dash-card table { width: 100%; table-layout: auto; }
.dash-name { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.dash-row.c3 .dash-bar, .dash-row.c2 .dash-bar { width: 44px; }
.dash-row.c3 .dash-card table td, .dash-row.c2 .dash-card table td,
.dash-row.c3 .dash-card table th, .dash-row.c2 .dash-card table th { padding: 6px 5px; }
.dash-tiles { grid-template-columns: repeat(3, 1fr); }
.dash-tile small { white-space: normal; line-height: 1.25; }
.dash-row.c3 .dash-card table, .dash-row.c2 .dash-card table { font-size: 12.5px; }
.dash-row.c3 .dash-name { max-width: 118px; } .dash-row.c2 .dash-name { max-width: 140px; }
.dash-row.c3 .dash-card table td, .dash-row.c2 .dash-card table td,
.dash-row.c3 .dash-card table th, .dash-row.c2 .dash-card table th { padding: 6px 4px; }

/* ---- Permissions, person by person (Sachin, 24 Nov 2026): the people on the
   left, the chosen person's screens on the right, one pill per action. */
.pm-page { display:grid; grid-template-columns:270px minmax(0,1fr); gap:14px; align-items:start; }
.pm-people { padding:10px; position:sticky; top:12px; max-height:calc(100vh - 24px); overflow:auto; }
.pm-people input { width:100%; box-sizing:border-box; padding:8px 10px; border:1px solid var(--line); border-radius:8px; font:inherit; margin-bottom:8px; }
.pm-p { display:flex; align-items:center; gap:9px; padding:8px 10px; border-radius:9px; cursor:pointer; }
.pm-p:hover { background:var(--subtle); }
.pm-p.on { background:var(--navy-50); }
.pm-av { width:30px; height:30px; border-radius:50%; background:var(--navy); color:#fff; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; flex:none; }
.pm-p b { display:block; font-size:13px; }
.pm-p small { color:var(--muted); font-size:11.5px; }
.pm-p .pm-n { margin-left:auto; font-size:10.5px; font-weight:700; color:#0B7A4B; background:#E3F4EA; padding:1px 7px; border-radius:999px; white-space:nowrap; }
.pm-main { padding:16px 18px; }
.pm-head { display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding-bottom:14px; border-bottom:1px solid var(--line); margin-bottom:6px; }
.pm-who b { font-size:16px; } .pm-who small { display:block; color:var(--muted); }
.pm-def { display:flex; align-items:center; gap:8px; margin-left:auto; flex-wrap:wrap; }
.pm-def label { display:inline; margin:0; font-size:11.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.pm-def select { width:auto; max-width:240px; font:inherit; padding:6px 10px; border:1px solid var(--line-strong); border-radius:8px; background:var(--surface); color:var(--text); }
.pm-legend { display:flex; flex-wrap:wrap; gap:16px; font-size:12px; color:var(--muted); margin:12px 0 0; }
.pm-legend span:not(.muted)::before { content:''; display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:5px; vertical-align:-1px; }
.pm-legend .a::before { background:var(--navy); } .pm-legend .b::before { background:#0B7A4B; } .pm-legend .c::before { background:#F2B8B5; }
.pm-sec { font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin:16px 0 6px; display:flex; align-items:center; gap:8px; }
.pm-sec::before { content:''; width:3px; height:12px; border-radius:2px; background:var(--teal); }
.pm-row { display:grid; grid-template-columns:230px minmax(0,1fr); gap:12px; align-items:center; padding:9px 10px; border:1px solid var(--line); border-radius:10px; margin-bottom:6px; }
.pm-row.changed { border-color:var(--teal); background:#F3FBFD; }
.pm-nm b { display:block; font-size:13px; } .pm-nm small { color:var(--muted); font-size:11.5px; }
.pm-acts { display:flex; flex-wrap:wrap; gap:6px; }
.pm-t { font:inherit; display:inline-flex; align-items:center; padding:4px 10px; border-radius:999px; border:1px solid var(--line-strong); font-size:12.5px; cursor:pointer; background:var(--surface); color:#4B5A70; }
.pm-t:disabled { cursor:default; opacity:.85; }
.pm-t.on { background:var(--navy); border-color:var(--navy); color:#fff; }
.pm-t.on.plus { background:#0B7A4B; border-color:#0B7A4B; }
.pm-t.minus { background:#FBE9E7; border-color:#F2B8B5; color:#B3261E; text-decoration:line-through; }
.pm-note { font-size:12.5px; color:var(--muted); margin:12px 0 0; }
.pm-back { display:flex; align-items:center; gap:12px; margin-bottom:12px; font-size:12.5px; }
@media (max-width: 860px) { .pm-page { grid-template-columns:1fr; } .pm-people { position:static; max-height:260px; } .pm-row { grid-template-columns:1fr; gap:6px; } }
