:root {
  --scrim: rgba(28,25,23,0.4);
  /* Design tokens (1.32). Every color in this file comes from here, so a later reskin is a
     change to this block only. Values are unchanged from before 1.32. */
  --amber: #d97706;          /* accent: primary buttons, active tab/nav, focus */
  --amber-dark: #b45309;     /* accent hover, brand text */
  --accent-hover: #fef3e2;   /* row / option hover */
  --accent-wash: #fffbeb;    /* notices, edited cells */
  --accent-glow: #fff7ed;    /* login backdrop */
  --accent-text: #92400e;    /* amber text on light fills */
  --accent-ink: #78350f;     /* text inside amber notices */
  --on-accent: #fff;         /* text on accent / danger / ok fills */
  /* Two roles (1.32 proposal): ACTION = the one main button on a screen (orange);
     SELECTION = where you are / what's picked: active menu item, tabs, pills, dates, focus (blue). */
  --accent-fill: #C14A09;     /* main action buttons; cream text 4.8:1 (WCAG AA) */
  --accent-fill-hover: #9f3d07;
  --on-accent-fill: #FFFFC5;
  --brand-text: #C14A09;      /* "King's Bakeshop" wordmark */
  --select-fill: #3D79B7;     /* active tab / menu item / picked date; white text 4.5:1 (1.70: lighter) */
  --on-select-fill: #fff;
  --select-text: #3D79B7;     /* blue text on white 4.5:1: active phone tab, hover headers */
  --select-line: #3D79B7;     /* borders and focus rings for the selected / hovered control */
  --select-hover: #EBF1F8;    /* row / option hover */
  --select-wash: #EBF1F8;
  --band-tint: #fef3e2;       /* KCafe Menu tier bands (unchanged) */
  /* Type (1.32 proposal): Roboto for everything (built into Android; loaded for computers),
     Poppins Bold for page and popup headings only. */
  --font: Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: Poppins, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --line-strong: #d6d3d1;
  --line-stronger: #a8a29e;
  --bg: #fafaf9;
  --surface: #fff;
  --surface-alt: #fafaf9;    /* table headers, alternating bands */
  --surface-muted: #f5f5f4;  /* chips, group rows */
  --surface-hover: #efeeec;
  --surface-hover-alt: #f0efed;
  --danger: #dc2626;
  --pos-diz-bg: #fde7d3;   /* the Dizlog tag */
  --pos-diz-ink: #9a4a06;
  --pos-ut-bg: #d3f1ee;    /* the UTAK tag */
  --pos-ut-ink: #0b6b63;
  --danger-text: #991b1b;
  --danger-ink: #7f1d1d;
  --danger-soft: #fee2e2;
  --danger-wash: #fef2f2;
  --warn-wash: #fef3c7;
  --ok: #16a34a;
  --ok-text: #166534;
  --ok-wash: #dcfce7;
  --info-text: #3730a3;
  --info-wash: #e0e7ff;
  /* 1.74: Change Type colors, the same everywhere */
  --ct-price-bg: #fde2e1; --ct-price-ink: #a51d1a;
  --ct-rename-bg: #dde9f7; --ct-rename-ink: #245a91;
  --ct-category-bg: #fdeb9c; --ct-category-ink: #6b5200;
  --ct-redesign-bg: #ece3fb; --ct-redesign-ink: #5b2aa8;
  --ct-grab-bg: #d9f2df; --ct-grab-ink: #17672f;
  --ct-new-bg: #d5efec; --ct-new-ink: #0f5f58;
  --ct-grey-bg: #ececea; --ct-grey-ink: #57534e;
  --ct-dark-bg: #57534e; --ct-dark-ink: #ffffff;
  /* 1.78 Product Menu: each category's colours, from her MENU.xlsx (Promo picked; KCafe tiers: lightest = cheapest) */
  --menu-breads-band: #fce5cd; --menu-breads-band-ink: #1c1917; --menu-breads-sub: #f6b26b; --menu-breads-sub-ink: #1c1917; --menu-breads-head: #fce5cd; --menu-breads-head-ink: #1c1917; --menu-breads-wash: #fef4ea;
  --menu-pastries-band: #d9d2e9; --menu-pastries-band-ink: #1c1917; --menu-pastries-sub: #b4a7d6; --menu-pastries-sub-ink: #1c1917; --menu-pastries-head: #d9d2e9; --menu-pastries-head-ink: #1c1917; --menu-pastries-wash: #f1eef7;
  --menu-cakes-band: #cfe2f3; --menu-cakes-band-ink: #1c1917; --menu-cakes-sub: #9fc5e8; --menu-cakes-sub-ink: #1c1917; --menu-cakes-head: #cfe2f3; --menu-cakes-head-ink: #1c1917; --menu-cakes-wash: #edf4fb;
  --menu-bundle-band: #073763; --menu-bundle-band-ink: #ffffff; --menu-bundle-sub: #6fa8dc; --menu-bundle-sub-ink: #1c1917; --menu-bundle-head: #073763; --menu-bundle-head-ink: #ffffff; --menu-bundle-wash: #e6eef7;
  --menu-others-band: #ead1dc; --menu-others-band-ink: #1c1917; --menu-others-sub: #d5a6bd; --menu-others-sub-ink: #1c1917; --menu-others-head: #ead1dc; --menu-others-head-ink: #1c1917; --menu-others-wash: #f8eef3;
  --menu-packaging-band: #d9d9d9; --menu-packaging-band-ink: #1c1917; --menu-packaging-sub: #b7b7b7; --menu-packaging-sub-ink: #1c1917; --menu-packaging-head: #efefef; --menu-packaging-head-ink: #1c1917; --menu-packaging-wash: #f5f5f5;
  --menu-promo-band: #fff2cc; --menu-promo-band-ink: #1c1917; --menu-promo-sub: #ffd966; --menu-promo-sub-ink: #1c1917; --menu-promo-head: #fff2cc; --menu-promo-head-ink: #1c1917; --menu-promo-wash: #fffaeb;
  --menu-rawmats-band: #f3f3f3; --menu-rawmats-band-ink: #1c1917; --menu-rawmats-sub: #b7b7b7; --menu-rawmats-sub-ink: #1c1917; --menu-rawmats-head: #efefef; --menu-rawmats-head-ink: #1c1917; --menu-rawmats-wash: #fafafa;
  --menu-nonfood-band: #e3e3e3; --menu-nonfood-band-ink: #1c1917; --menu-nonfood-sub: #b7b7b7; --menu-nonfood-sub-ink: #1c1917; --menu-nonfood-head: #efefef; --menu-nonfood-head-ink: #1c1917; --menu-nonfood-wash: #f6f6f6;
  --menu-other-band: #e7e5e4; --menu-other-band-ink: #1c1917; --menu-other-sub: #d6d3d1; --menu-other-sub-ink: #1c1917; --menu-other-head: #f0efee; --menu-other-head-ink: #1c1917; --menu-other-wash: #f7f6f5;
  --menu-k1-band: #e8d5bf; --menu-k1-band-ink: #1c1917; --menu-k1-sub: #e8d5bf; --menu-k1-sub-ink: #1c1917; --menu-k1-head: #f4eadf; --menu-k1-head-ink: #1c1917; --menu-k1-wash: #faf5ef;
  --menu-k2-band: #c9a27e; --menu-k2-band-ink: #1c1917; --menu-k2-sub: #c9a27e; --menu-k2-sub-ink: #1c1917; --menu-k2-head: #eadbcb; --menu-k2-head-ink: #1c1917; --menu-k2-wash: #f6efe8;
  --menu-k3-band: #8b5e3c; --menu-k3-band-ink: #ffffff; --menu-k3-sub: #8b5e3c; --menu-k3-sub-ink: #ffffff; --menu-k3-head: #dcc7b5; --menu-k3-head-ink: #1c1917; --menu-k3-wash: #f3ebe4;
  --menu-k4-band: #4a2c17; --menu-k4-band-ink: #ffffff; --menu-k4-sub: #4a2c17; --menu-k4-sub-ink: #ffffff; --menu-k4-head: #cdb8a6; --menu-k4-head-ink: #1c1917; --menu-k4-wash: #f0e8e2;
  /* Sizes */
  --tap: 44px;               /* smallest touch target on a phone (Apple HIG) */
  --tabbar-h: 58px;          /* phone bottom tab bar, not counting the safe area */
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-glow), var(--surface-alt));
  padding: 16px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.login-card h1 { margin: 0 0 2px; font-size: 22px; color: var(--brand-text); font-family: var(--font-heading); font-weight: 700; }
.login-sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px;
}
.login-card button {
  width: 100%; margin-top: 20px; padding: 11px; border: none; border-radius: 8px;
  background: var(--accent-fill); color: var(--on-accent-fill); font-weight: 700; font-size: 15px; cursor: pointer;
}
.login-card button:disabled { opacity: 0.6; cursor: default; }
.login-card button.login-secondary { margin-top: 8px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); font-weight: 600; }
.temp-password { font-family: "Courier New", monospace; font-size: 24px; font-weight: 700; letter-spacing: 0.06em; padding: 12px 16px; margin: 12px 0; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 8px; text-align: center; user-select: all; }
.error-text { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 16px; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 0;
  /* Stays in view while the page scrolls, so Log Out is always reachable. */
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}
.sidebar-brand { font-weight: 700; color: var(--brand-text); padding: 0 18px 14px; font-size: 16px; font-family: var(--font-heading); }
.sidebar-user { padding: 0 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.sidebar-user-name { font-weight: 700; font-size: 14px; }
.sidebar-user-roles { color: var(--muted); font-size: 12px; margin-top: 2px; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 4px 8px; }
.nav-item {
  display: block; padding: 9px 14px; border-radius: 8px; color: var(--ink);
  text-decoration: none; font-size: 14px; font-weight: 600; cursor: pointer; border: none;
  background: transparent; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--select-hover); }
.nav-item.active { background: var(--select-fill); color: var(--on-select-fill); }
.sidebar-logout {
  margin: 12px 16px 0; padding: 9px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted);
}
.main-area { flex: 1; min-width: 0; }
/* 1.40: list pages use the whole width; a page that is a form or text (.narrow, set per page in
   app.js) keeps the 1,100px reading width. */
.page-content { padding: 28px 32px; }
.page-content.narrow { max-width: 1100px; }

h2.page-title { margin: 0 0 4px; font-size: 20px; font-family: var(--font-heading); font-weight: 700; }
p.page-sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.btn {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink); white-space: nowrap;
}
.btn.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent-fill); }
.btn.primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); }
.btn.danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* 1.74: clip, not hidden: it keeps the rounded corners and lets a header row stay on screen. */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; overflow: clip; }
/* Tables with dropdowns inside (e.g. a tier's Branches picker) let the panel spill out
   instead of clipping it; the header corners are rounded by hand instead. */
table.has-dropdowns { overflow: visible; }
table.has-dropdowns thead th:first-child { border-top-left-radius: 10px; }
table.has-dropdowns thead th:last-child { border-top-right-radius: 10px; }
th, td { text-align: left; padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--line); }
th { background: var(--surface-alt); color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--select-hover); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.open, .badge.active { background: var(--ok-wash); color: var(--ok-text); }
.badge.closed, .badge.terminated, .badge.resigned, .badge.awol { background: var(--danger-soft); color: var(--danger-text); }
.badge.on_leave { background: var(--warn-wash); color: var(--accent-text); }
.badge.system { background: var(--info-wash); color: var(--info-text); }

/* ---------- Modal ---------- */
.modal-host { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(28,25,23,0.4); }
.modal-box {
  position: relative; background: var(--surface); border-radius: 12px; padding: 24px;
  width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-box h3 { margin: 0 0 16px; font-family: var(--font-heading); font-weight: 700; }
.modal-box.wide { max-width: 900px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px;
}
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; margin-top: 18px; }

.perm-matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; border: none; border-radius: 0; overflow: visible; }
.perm-matrix th, .perm-matrix td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: center; background: var(--surface); }
.perm-matrix th.role-name-col, .perm-matrix td.role-name-col { text-align: left; }
.perm-matrix input[type=checkbox] { width: 16px; height: 16px; }
/* Roles grid: header rows and the Role column stay put while scrolling either way. */
.matrix-scroll { max-height: calc(100vh - 250px); overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.perm-matrix thead th { position: sticky; background: var(--surface-alt); z-index: 2; }
.perm-matrix thead tr.band-row th { top: 0; height: 30px; box-sizing: border-box; }
.perm-matrix thead tr.label-row th { top: 30px; }
.perm-matrix th.band { color: var(--ink); letter-spacing: 0.04em; }
.perm-matrix th.perm-col { min-width: 74px; max-width: 110px; white-space: normal; text-transform: none; font-size: 11px; line-height: 1.25; }
.perm-matrix .role-name-col { position: sticky; left: 0; z-index: 1; min-width: 210px; white-space: nowrap; box-shadow: 1px 0 0 var(--line); }
.perm-matrix thead th.role-name-col { z-index: 3; top: 0; }
.perm-matrix tr.dept-row td { background: var(--surface-muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.perm-matrix tbody tr[data-role]:hover td { background: var(--select-hover); }
.perm-matrix .roleEditBtn { padding: 2px 8px; font-size: 11px; margin-left: 6px; }
.role-perm-list { border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px 10px; max-height: 40vh; overflow-y: auto; }
.role-perm-opt { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; padding: 3px 0; cursor: pointer; }
.role-perm-opt input { margin-top: 2px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--on-accent); padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 100;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--ok); }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.section-title { font-weight: 700; font-size: 13px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface-muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; font-size: 12px;
}
.chip button { border: none; background: none; cursor: pointer; color: var(--danger); font-weight: 700; padding: 0; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-search {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px;
  min-width: 180px; background: var(--surface);
}

/* ---------- Tab bar (order status tabs, order-form category chips) ---------- */
.tab-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.tab-btn {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 13px; cursor: pointer; color: var(--ink);
}
.tab-btn.active { background: var(--select-fill); border-color: var(--select-fill); color: var(--on-select-fill); }

/* ---------- Multiselect ---------- */
.msel { position: relative; display: inline-block; }
.msel-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.msel-btn:hover { border-color: var(--select-line); }
.msel-count {
  background: var(--select-fill); color: var(--on-select-fill); border-radius: 999px; font-size: 11px; font-weight: 700;
  min-width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}
.msel-caret { color: var(--muted); font-size: 10px; }
.msel-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); padding: 8px; min-width: 200px; max-height: 260px;
  overflow-y: auto;
}
.msel-opt {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer;
}
.msel-opt:hover { background: var(--select-hover); }
.msel-opt input { width: 15px; height: 15px; }
/* 6.4: the number beside a filter choice (Employees). Empty on pages that don't use counts. */
.msel-num { margin-left: auto; padding-left: 16px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.msel-num:empty { display: none; }
.list-showing { margin: 0 0 8px; }

.badge-incomplete {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--warn-wash); color: var(--accent-text); margin-left: 6px;
}

/* ---------- Combobox (typeable single-select) ---------- */
.combo { position: relative; }
.combo-input {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px;
}
.combo-panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  max-height: 220px; overflow-y: auto; padding: 4px;
}
.combo-opt { padding: 7px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.combo-opt:hover { background: var(--select-hover); }
.combo-empty { padding: 7px 10px; font-size: 13px; color: var(--muted); }

/* ---------- Date range picker (single pill trigger + a small calendar) ---------- */
.drange { position: relative; display: inline-block; }
.drange-panel { width: 260px; }
.drange-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-weight: 700; font-size: 13px; }
.drange-nav { border: none; background: none; cursor: pointer; font-size: 16px; padding: 2px 8px; color: var(--ink); }
.drange-nav:hover { color: var(--select-text); }
.drange-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.drange-dow { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.drange-day { border: none; background: none; padding: 6px 0; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--ink); }
.drange-day:hover { background: var(--select-hover); }
.drange-day.active { background: var(--select-fill); color: var(--on-select-fill); }

/* ---------- Inline table inputs (counts, times, etc. entered directly in a table cell) ---------- */
.table-input {
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; color: var(--ink);
}
.table-input:disabled { background: var(--bg); color: var(--muted); }
/* KCafe Recipes (1.24): a cell edited but not saved yet. */
.table-input.kr-changed { border-color: var(--amber); background: var(--accent-wash); }

/* ---------- Weekday pill toggle (e.g. a KCafe tier's delivery days) — same look as .tab-btn ---------- */
.weekday-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.weekday-pill {
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.weekday-pill.active { background: var(--select-fill); border-color: var(--select-fill); color: var(--on-select-fill); }
.weekday-pill:disabled { opacity: 0.5; cursor: default; }

/* ---------- Sortable column headers (click a th[data-sort] to sort a list table) ---------- */
.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-th:hover { color: var(--select-text); }
.sortable-th::after { content: ''; display: inline-block; width: 10px; }
.sortable-th.sort-asc::after { content: '\25B2'; font-size: 9px; margin-left: 4px; }
.sortable-th.sort-desc::after { content: '\25BC'; font-size: 9px; margin-left: 4px; }

/* ---------- Required-field indicators (employee profile) ---------- */
.req-star { color: var(--danger); }
label.field-missing { color: var(--danger); }
label.field-missing .req-star { color: var(--danger); }
.field input.input-missing, .field select.input-missing, .field textarea.input-missing {
  border-color: var(--danger); background: var(--danger-wash);
}

/* ---------- Sidebar nav sections + notifications icon/badge ---------- */
.nav-section-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--brand-text); padding: 10px 14px 2px;
}
.nav-icon { margin-right: 6px; display: inline-flex; align-items: center; }
.nav-icon svg { display: block; }
.nav-badge {
  background: var(--danger); color: var(--on-accent); border-radius: 999px; font-size: 11px; font-weight: 700;
  padding: 1px 7px; margin-left: 6px;
}

@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .page-content { padding: 18px; }
}
/* Roles: collapsible groups, holder counts */
.perm-matrix tr.dept-row, .perm-matrix th.band-toggle { cursor: pointer; user-select: none; }
.perm-matrix tr.dept-row:hover td { background: var(--surface-hover); }
.perm-matrix th.band-toggle:hover { background: var(--surface-hover-alt); }
.group-caret { display: inline-block; width: 12px; color: var(--muted); }
.perm-matrix th.role-col { min-width: 96px; }
.holderCountBtn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 1px 8px;
  font-size: 11px; color: var(--muted); cursor: pointer; margin-left: 4px;
}
.holderCountBtn:hover { color: var(--ink); border-color: var(--muted); }
/* Branch Product Mix grid (Batch 1.16): same look as the Roles grid, one header row. */
.perm-matrix.mix-matrix thead tr.label-row th { top: 0; }
.perm-matrix.mix-matrix th.perm-col { min-width: 44px; }
.perm-matrix.mix-matrix tbody tr[data-sub]:hover td { background: var(--select-hover); }
/* Order History (1.17/1.18): keep peso amounts and their +/- sign on one line. */
.regDetailTable td:nth-child(n+6), #regTable td:nth-child(n+6):not(:last-child), #sumTable td:nth-child(n+3) { white-space: nowrap; }

/* ---------- Sidebar: foldable sections, action counts, narrow mode (Batch 1.22) ---------- */
.sidebar-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding-right: 10px; }
.sidebar-toggle {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--ink); border-color: var(--amber); }
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-section-items { display: flex; flex-direction: column; gap: 2px; }
.nav-section.folded .nav-section-items { display: none; }
button.nav-section-label {
  display: flex; align-items: center; gap: 6px; width: 100%; border: none; background: transparent; cursor: pointer;
  text-align: left; border-radius: 6px; font-family: inherit;
}
button.nav-section-label:hover { background: var(--select-hover); }
/* 1.70: lines inside a section start with a small dot (not the phone, where they have icons, nor the narrow strip). */
.nav-section { margin-bottom: 4px; }
.nav-section-items > .nav-item::before { content: "•"; flex: 0 0 14px; font-size: 14px; line-height: 1; color: var(--muted); }
.nav-section-items > .nav-item.active::before { color: inherit; }
/* 1.70: the name area opens My Profile; the My Profile line itself shows only on the narrow strip. */
.nav-item[data-page="my-profile"] { display: none; }
.sidebar-user-btn {
  display: block; width: 100%; padding: 8px 10px; border: none; border-radius: 8px; background: transparent;
  text-align: left; font-family: inherit; color: inherit; cursor: pointer;
}
.sidebar-user-btn:disabled { cursor: default; }
.sidebar-user-btn:not(:disabled):hover, .sidebar-user-btn.on { background: var(--select-hover); }
.sidebar-user-btn .sidebar-user-name, .sidebar-user-btn .sidebar-user-roles { display: block; }
.sidebar-profile-link { display: block; margin-top: 6px; white-space: nowrap; color: var(--select-text); font-size: 12px; font-weight: 700; }
.sidebar-user-btn.on .sidebar-profile-link { color: var(--ink); }
.sidebar-user-btn:disabled .sidebar-profile-link { display: none; }
.nav-section-name { flex: 1; }
.nav-caret { font-size: 10px; transition: transform 0.15s; }
.nav-section.folded .nav-caret { transform: rotate(-90deg); }
.nav-section-label .nav-badge { margin-left: 0; font-size: 10px; letter-spacing: 0; }
.nav-item { display: flex; align-items: center; }
.nav-item .nav-text { flex: 1; }
.nav-badge.hidden { display: none; }
.nav-icon-narrow { display: none; }
.sidebar-logout { display: flex; align-items: center; justify-content: center; gap: 6px; }

/* Narrow strip: icons only, counts as small bubbles; sections always open. */
@media (min-width: 721px) {
  .app-shell.sidebar-narrow .sidebar { width: 64px; }
  .app-shell.sidebar-narrow .sidebar-brand,
  .app-shell.sidebar-narrow .sidebar-user,
  .app-shell.sidebar-narrow .nav-section-label,
  .app-shell.sidebar-narrow .nav-text,
  .app-shell.sidebar-narrow .logout-text { display: none; }
  .app-shell.sidebar-narrow .sidebar-top { justify-content: center; padding: 0 0 12px; }
  .app-shell.sidebar-narrow .nav-item[data-page="my-profile"] { display: flex; }
  .app-shell.sidebar-narrow .nav-section-items > .nav-item::before { display: none; }
  .app-shell.sidebar-narrow .nav-section.folded .nav-section-items { display: flex; }
  .app-shell.sidebar-narrow .nav-section { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 4px; }
  .app-shell.sidebar-narrow .nav-item { justify-content: center; padding: 9px 0; position: relative; }
  .app-shell.sidebar-narrow .nav-icon { margin-right: 0; }
  .app-shell.sidebar-narrow .nav-icon-narrow { display: inline-flex; }
  .app-shell.sidebar-narrow .nav-item .nav-badge { position: absolute; top: 2px; right: 2px; margin-left: 0; font-size: 10px; padding: 0 5px; }
  .app-shell.sidebar-narrow .sidebar-logout { margin: 12px 8px 0; }
}
/* Single-date picker (1.22): dates with something waiting get a dot; today is outlined. */
.drange-day { position: relative; }
.drange-day.today { box-shadow: inset 0 0 0 1px var(--line); }
.drange-day.marked::after, .drange-dot {
  content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--amber);
}
.drange-day.marked::after { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); }
.drange-day.marked.active::after { background: var(--surface); }
.drange-day.marked { font-weight: 700; }

/* Dispatch (1.25): anything that isn't today's delivery is flagged. */
.day-warning { border: 1px solid var(--amber); background: var(--accent-wash); color: var(--accent-ink); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; font-size: 13px; }
.day-warning.late { border-color: var(--danger); background: var(--danger-wash); color: var(--danger-ink); }
.day-warning .btn { margin-left: 8px; padding: 3px 10px; font-size: 12px; }
.day-chips { align-items: center; }
.day-chips .chip-label { margin: 0 2px 0 10px; }
.weekday-pill.pill-future:not(.active) { border-color: var(--amber); color: var(--accent-text); }
.weekday-pill.pill-late:not(.active) { border-color: var(--danger); color: var(--danger-text); }
.weekday-pill.pill-late.active { background: var(--danger); border-color: var(--danger); }
.date-off-day .msel-btn { border-color: var(--amber); background: var(--accent-wash); }
/* KCafe Menu "All Tiers" (1.25): each tier's branches are banded so the tier is always clear. */
.perm-matrix.km-all thead tr.band-row th { top: 0; }
.perm-matrix.km-all thead tr.label-row th { top: 30px; }
.perm-matrix.km-all .tier-start { border-left: 2px solid var(--line-stronger); }
.perm-matrix.km-all th.tier-a, .perm-matrix.km-all td.tier-a { background: var(--surface); }
.perm-matrix.km-all th.tier-b, .perm-matrix.km-all td.tier-b { background: var(--surface-alt); }
.perm-matrix.km-all th.band.tier-a { background: var(--band-tint); }
.perm-matrix.km-all th.band.tier-b { background: var(--surface-muted); }
.perm-matrix.km-all td.not-on-tier { color: var(--line-strong); }

/* Batch 1.28: Baselines grid + the over-baseline box on an order */
.perm-matrix.bl-matrix th.perm-col { min-width: 72px; }
.perm-matrix.bl-matrix td { padding: 3px 4px; }
.perm-matrix.bl-matrix .table-input.blCell { width: 64px; min-width: 64px; text-align: right; padding: 4px 6px; }
.perm-matrix.bl-matrix tbody tr[data-item]:hover td { background: var(--select-hover); }
.perm-matrix.bl-matrix td.not-on-tier { color: var(--line-strong); text-align: center; }
.baseline-table { width: 100%; border-collapse: collapse; margin-top: 4px; background: transparent; }
.baseline-table th, .baseline-table td { padding: 3px 6px; text-align: left; font-size: 12px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.baseline-table th { white-space: normal; font-size: 11px; vertical-align: bottom; }
.baseline-table td.num { text-align: right; white-space: nowrap; }
.baseline-table th.num { text-align: right; }
.baseline-table tr.bl-big td { font-weight: 600; }

/* Batch 6.2: a small hover-note marker next to a short label (the explanation is its tooltip). */
.hint-mark { color: var(--muted); font-size: 12px; cursor: help; margin-left: 2px; }
/* Batch 6.3: the note itself — one bubble for the whole app (lib/hint.js), shown on hover, focus or tap. */
[data-hint] { cursor: help; }
.hint-bubble { position: fixed; z-index: 1000; max-width: min(300px, calc(100vw - 16px)); padding: 8px 10px; border-radius: 8px;
  background: var(--ink); color: var(--surface); font-size: 13px; line-height: 1.35; font-weight: 400; text-align: left;
  text-transform: none; letter-spacing: 0; white-space: normal; pointer-events: none; box-shadow: 0 4px 14px var(--line-stronger); }
.hint-bubble[hidden] { display: none; }

/* ---------- Batch 6.3: HR cases — the notice as shown on screen, and explanations ---------- */
.nte-screen { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); padding: 18px 20px; max-height: 420px; overflow-y: auto; }
.nte-doc { font-size: 13px; line-height: 1.5; }
.nte-doc h4 { margin: 14px 0 4px; font-size: 13px; }
.nte-doc p { margin: 0 0 8px; }
.nte-doc ul, .nte-doc ol { margin: 0 0 8px; padding-left: 20px; }
.nte-head { text-align: center; margin-bottom: 12px; }
.nte-company { font-weight: 700; font-size: 15px; }
.nte-address { font-size: 12px; color: var(--muted); }
.nte-header-img.logo { max-height: 56px; max-width: 180px; margin-bottom: 4px; }
.nte-header-img.full { display: block; width: 100%; max-height: 140px; object-fit: contain; }
.nte-letterhead.full.loaded .nte-company-text { display: none; }
.nte-title { font-weight: 700; letter-spacing: 0.06em; margin-top: 2px; }
.nte-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.nte-to { margin: 10px 0; }
.nte-label { font-weight: 600; }
.nte-pre { white-space: pre-wrap; }
.nte-ground { font-size: 12px; color: var(--muted); }
.nte-act { margin: 2px 0; }
.hd-form { margin-top: 10px; }
.hd-past { background: var(--surface-muted); border-radius: 8px; padding: 10px; margin-bottom: 12px; }
.hd-out { display: grid; gap: 6px; font-size: 13px; }
.hd-out label { display: block; font-weight: 400; margin: 0; }
.hd-sub { margin: 6px 0 0 22px; }
#hdForm[hidden], #hdSuspBox[hidden], #hdDismissBox[hidden], #hdSalaryBox[hidden], #hdAtdBox[hidden], #hdHearingBox[hidden], #hd_open[hidden] { display: none; }
.combo-group { padding: 4px 10px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-muted); }
.sup-more { color: var(--select-text); }
.nte-sign { display: flex; gap: 32px; margin-top: 24px; flex-wrap: wrap; }
.nte-sign > div { flex: 1; min-width: 200px; }
.nte-line { border-bottom: 1px solid var(--ink); min-height: 26px; padding-top: 8px; font-weight: 600; }
.nte-foot { font-size: 12px; color: var(--muted); margin-top: 12px; }
/* 6.5: an earlier version of a notice that an amended one replaced */
.nte-superseded { border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 10px; color: var(--muted); }
.suspended-banner { margin: 0 0 12px; }
.hc-explanation { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--surface-alt); }

/* ---------- Batch 6.12a: 201-file checklist on the employee profile ---------- */
.doc-sum { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; font-size: 13px; }
.doc-bar { height: 8px; width: 220px; max-width: 45%; background: var(--surface-muted); border-radius: 999px; overflow: hidden; }
.doc-bar i { display: block; height: 100%; background: var(--ok); }
.doc-group { font-size: 12px; font-weight: 700; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: 0.02em; }
.doc-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 6px; }
.doc-card.attn { border-left: 4px solid var(--danger); }
.doc-card.soon { border-left: 4px solid var(--amber); }
.doc-ic { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.doc-ic.ok { background: var(--ok-wash); color: var(--ok-text); }
.doc-ic.attn { background: var(--danger-soft); color: var(--danger-text); }
.doc-ic.soon { background: var(--warn-wash); color: var(--accent-text); }
.doc-main { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; font-size: 14px; }
.doc-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.doc-problem { color: var(--ink); }
.doc-link { color: var(--select-text); font-weight: 600; text-decoration: none; }
.doc-link:hover { text-decoration: underline; }
/* 6.12a.1: "not needed" cards, the settings button beside the summary, tick rows */
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.doc-head .doc-sum { margin: 0; }
.doc-card.na { background: var(--surface-alt); }
.doc-card.na .doc-name { color: var(--muted); }
.doc-ic.na { background: var(--surface-muted); color: var(--muted); }
.doc-check { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .doc-check input { width: auto; margin: 0; }
.doc-mass-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.doc-earlier { margin: 4px 0 0; padding-left: 18px; }
.doc-earlier li { margin-bottom: 2px; }

/* ---------- Batch 6.12b: resignation + exit clearance ---------- */
.exit-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.exit-kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; font-size: 13px; }
.exit-kv.two { grid-template-columns: 1fr 1fr; }
.exit-kv b { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 2px; }
.exit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.exit-grid .exit-box { margin-bottom: 0; }
.exit-warn { color: var(--accent-text); font-weight: 600; }
.exit-auto td { background: var(--surface-alt); }
.badge.exit-quiet { background: var(--surface-muted); color: var(--muted); }
.exit-bar { width: 90px; max-width: none; margin-top: 4px; }
#clTable .badge { white-space: nowrap; }
.exit-ticks { max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.exit-ticks .doc-check { font-weight: 400; }

/* ---------- Batch 6.12c: My Profile (cards), Waiting for HR, Corporations ---------- */
.mp-wrap { max-width: 640px; }
.mp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.mp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.mp-title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
.mp-name { font-family: var(--font-heading); font-size: 20px; font-weight: 700; margin: 0; }
.mp-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mp-head + .mp-row { border-top: none; }
.mp-row > span:first-child { color: var(--muted); flex: none; }
.mp-row > span:last-child { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.mp-doc { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mp-head + .mp-doc { border-top: none; }
.mp-lock { font-size: 12px; color: var(--muted); }
.mp-answer { margin-top: 3px; color: var(--ink); }
.mp-wide { width: 100%; }
#mpRequests .mp-doc:first-child { margin-top: 8px; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.link-btn { background: none; border: none; padding: 0; font: inherit; color: var(--select-text); cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }
td.nowrap { white-space: nowrap; }
.doc-preset { background: var(--select-wash); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.corp-image { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 10px 14px; background: var(--surface-alt); }
.corp-image img { max-height: 48px; max-width: 160px; border-radius: 4px; }

/* ---------- Batch 6.12d: HR Dashboard ---------- */
.hd-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0 22px; }
.hd-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.hd-tile:hover, .hd-tile:focus-visible { border-color: var(--select-line); outline: none; }
.hd-tile b { display: block; font-family: var(--font-heading); font-size: 26px; line-height: 1.1; }
.hd-tile > span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; margin-bottom: 4px; }
.hd-tile small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.hd-tile small.bad { color: var(--danger-text); font-weight: 600; }
.hd-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; align-items: start; }
.hd-grid > div { min-width: 0; }
.hd-gap { margin-top: 26px; }
.hd-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.hd-h .section-title { margin: 0 0 8px; }
.hd-tabs { display: flex; gap: 6px; margin: 0 0 8px; }
.hd-tabs .tab-btn { padding: 5px 12px; font-size: 13px; }
.hd-barcell { white-space: nowrap; }
.hd-bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--select-fill); vertical-align: middle; margin-right: 8px; }
th.num, td.num { text-align: right; }
.hd-more { font-size: 13px; margin-top: 6px; display: flex; gap: 14px; }
.hd-listhead { margin: 12px 0 4px; font-size: 13px; }

/* ---------- Batch 6.1: incident reports — attached files and the timeline ---------- */
.incident-files { display: flex; flex-wrap: wrap; gap: 10px; }
.incident-file { width: 150px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--surface); }
.incident-file img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; display: block; }
.incident-file-icon { height: 100px; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 6px; font-weight: 700; color: var(--muted); }
.incident-file .small { overflow-wrap: anywhere; margin-top: 4px; }
.incident-timeline { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
/* 6.15: a report's corrections (added by whoever filed it; the report itself never changes) */
.corr-box { border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; background: var(--surface-alt); }
.corr-item { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.corr-item:last-child { border-bottom: none; }
.incident-timeline li { margin: 0 0 10px; font-size: 13px; }

/* ---------- Batch 1.37: Send Logins (Employees list ticks + the pop-up) ---------- */
.tick-col { width: 34px; text-align: center; }
.emp-code { white-space: nowrap; } /* the list has two more columns now — keep the ID on one line */
.tick-col input { width: 16px; height: 16px; cursor: pointer; }
tr.sl-skip td { background: var(--surface-alt); }
.slRemove { padding: 4px 9px; line-height: 1; }
.sl-password { font-family: "Courier New", monospace; font-weight: 700; font-size: 15px; letter-spacing: 0.04em; user-select: all; }

/* ---------- Batch 0.13: compact filters on a computer too (owner's request) ----------
   Same Filters button as the phone (lib/phone-filters.js): row 1 = search, Filters (with the
   number switched on), then the page's buttons on the right; the filter pills + Reset Filters show
   on the row below only while Filters is open. Phones keep their own rules (the 1.32 block). */
@media (min-width: 721px) {
  .toolbar.m-compact { justify-content: flex-start; }
  .toolbar.m-compact > .filter-bar { display: contents; }
  .toolbar.m-compact .filter-bar > input.filter-search { order: 0; }
  .toolbar.m-compact .m-filter-toggle { display: inline-flex; align-items: center; gap: 6px; order: 1; margin-right: auto; }
  .m-filter-toggle .msel-count { margin-left: 2px; }
  .toolbar.m-compact > div:not(.filter-bar) { order: 2; }
  .toolbar.m-compact:not(.m-collapsed) .filter-bar::before { content: ''; order: 3; flex: 1 0 100%; height: 0; }
  .toolbar.m-compact .filter-bar > :not(input.filter-search):not(.m-filter-toggle) { order: 4; }
  .toolbar.m-compact.m-collapsed .filter-bar > :not(input.filter-search):not(.m-filter-toggle),
  .toolbar.m-compact.m-collapsed [id^="reset"][id$="FiltersBtn"] { display: none !important; }
  .toolbar.m-compact:not(.m-collapsed) .m-filter-toggle { background: var(--select-wash); border-color: var(--select-line); color: var(--select-text); }
}

/* ---------- Batch 3.1: Stock Items, the pack setting, Dispatch Plan + Paste Forecast ---------- */
.perm-matrix.stock-matrix th.perm-col { min-width: 150px; max-width: none; }
.perm-matrix.plan-matrix td.num, .perm-matrix.plan-matrix th.perm-col { text-align: right; font-variant-numeric: tabular-nums; }
.perm-matrix.plan-matrix tbody tr[data-item]:hover td { background: var(--select-hover); }
.plan-date { margin: 0 0 12px; }
.paste-fields { display: grid; grid-template-columns: 220px 1fr; gap: 12px; }
.paste-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; white-space: pre; overflow: auto; tab-size: 8; }
.fc-head { margin: 14px 0 6px; font-size: 15px; }
#fc_names td { vertical-align: middle; }
.pack-box { margin-top: 6px; }
.pack-box .pack-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; }
@media (max-width: 720px) {
  .paste-fields, .pack-box .pack-row { grid-template-columns: 1fr; }
}

/* ---------- Batch 3.5a: Throw-Aways, Throw-Away Pick-ups ---------- */
.ta-branch { max-width: 320px; }
.ta-today { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.ta-today-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ta-today-actions .btn { margin-left: 0; }
.ta-add-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.ta-add-row.pu-who { grid-template-columns: 1fr 1.4fr; }
.ta-lines td { vertical-align: middle; }
.ta-new { color: var(--accent-text); font-weight: 600; }

/* ---------- Batch 3.5c: Throw-Away Summary, recount corrections ---------- */
.ts-tile { cursor: default; }
.ts-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 18px; margin-top: 6px; align-items: start; }
.ts-bar { display: flex; align-items: center; gap: 8px; }
.ts-bar > div { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-muted); overflow: hidden; }
.ts-bar i { display: block; height: 100%; background: var(--select-fill); }
.ts-bar i.over { background: var(--danger); }
.ts-bar span { min-width: 44px; text-align: right; }
.ts-bar span.over { color: var(--danger-text); font-weight: 700; }
.ts-chart { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 6px; }
.ts-chart svg { display: block; max-width: 100%; height: auto; }
.ts-dot.clickable { cursor: pointer; }
.ts-key { display: inline-block; width: 18px; vertical-align: middle; border-top: 2.5px solid var(--select-text); }
.ts-key.prev { border-top: 2px dashed var(--muted); }
#tsBranchRows tr.clickable { cursor: pointer; }
/* 3.4a: Stock Transfers */
.badge.str-kind { margin-right: 4px; }
.ts-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.rc-correction { display: grid; grid-template-columns: 1fr 220px; gap: 16px; align-items: start; }
.rc-photo { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; min-height: 150px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-muted); color: var(--muted); font-size: 13px; text-align: center; text-decoration: none; overflow: hidden; }
.rc-photo img { display: block; width: 100%; max-height: 220px; object-fit: cover; }

/* ---------- Batch 3.2a: Production Count, Goods to Send ---------- */
.table-input.invalid { border-color: var(--danger); background: var(--danger-wash); }
.perm-matrix.count-matrix .pcProduced { width: 84px; text-align: right; }
.perm-matrix.count-matrix th.pc-in { min-width: 110px; text-align: center; }
.perm-matrix.count-matrix th.pc-res { min-width: 130px; text-align: center; }
.perm-matrix.count-matrix th.pc-note, .perm-matrix.count-matrix td.pc-note { min-width: 260px; text-align: left; }
.perm-matrix.count-matrix td.pc-note .table-input { width: 100%; }
.perm-matrix.count-matrix td.pcResult { text-align: center; }
/* Batch 3.6: blind Production Count — Done per product; a Done row's count is locked (dashed box). */
.perm-matrix.count-matrix th.pc-done-col { min-width: 150px; text-align: center; }
.perm-matrix.count-matrix td.pc-done-col { text-align: center; line-height: 1.5; }
.table-input.pc-locked { display: inline-block; min-width: 84px; text-align: right; background: var(--bg); color: var(--muted); border-style: dashed; }
.perm-matrix.count-matrix tr.pc-done td { background: var(--surface-alt); }
.pc-done-tick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.pc-done-tick input { width: 16px; height: 16px; }
.perm-matrix.send-matrix th.gs-stays { min-width: 130px; }
.perm-matrix.send-matrix td.gs-changed { background: var(--accent-wash); }
.perm-matrix.send-matrix th.gs-final, .perm-matrix.send-matrix td.gs-final { background: var(--select-hover); }
.perm-matrix.send-matrix tbody tr[data-item]:hover td.gs-final { background: var(--select-hover); }
.gs-final-tag { font-size: 9px; font-weight: 700; color: var(--select-text); letter-spacing: .04em; }
.gs-was { font-size: 10px; line-height: 1.1; color: var(--muted); }
.perm-matrix.send-matrix .gsCell { width: 58px; min-width: 58px; text-align: right; padding: 4px 6px; }
.branch-ticks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.branch-ticks label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }
/* Batch 3.2b-1: the two runs of a delivery date (tonight / morning) on Goods to Send. */
.plan-date .plan-note { margin: 6px 0 0; color: var(--muted); }
.plan-date .plan-note strong { color: var(--ink); }
.perm-matrix.send-matrix thead tr.band-row th { top: 0; }
.perm-matrix.send-matrix thead tr.label-row th, .perm-matrix.send-matrix thead tr.label-row th.role-name-col { top: 30px; }
.perm-matrix.send-matrix th.gs-run { font-size: 11px; white-space: nowrap; border-left: 2px solid var(--select-fill); }
.perm-matrix.send-matrix th.gs-run-night { background: var(--select-fill); color: var(--on-select-fill); }
.perm-matrix.send-matrix th.gs-run-morning { background: var(--select-hover); color: var(--select-text); }
.perm-matrix.send-matrix th.gs-run-start, .perm-matrix.send-matrix td.gs-run-start { border-left: 2px solid var(--select-fill); }
.gs-moved-tag { font-size: 9px; font-weight: 700; color: var(--brand-text); letter-spacing: .03em; line-height: 1.15; }
#gr_table select.grRun { width: auto; min-width: 150px; }
#gr_table select.grRun.kr-changed { border-color: var(--amber); background: var(--accent-wash); }
/* Batch 3.2b-2: goods on Load a Truck. */
#g_lines tr.g-cat td { background: var(--surface-muted); font-weight: 700; font-size: 12px; }
#g_lines tr.g-diff td { background: var(--accent-wash); }
#g_lines select.g_reason { min-width: 0; }
.dr-nos { white-space: nowrap; }
/* Batch 3.2b-3: Print DR Before Loading. */
.day-warning.info { border-color: var(--line); background: var(--surface-muted); color: inherit; }
.dr-overdue { margin-left: 6px; }
#dPrintedTable td:first-child, #dPrintedTable .badge { white-space: nowrap; }
/* 1.53: the "Nothing is waiting" message is a first cell too — it wraps (it pushed the phone page to 606 px). */
#dPrintedTable td.empty-cell { white-space: normal; }
.night-tag { margin-left: 6px; }
/* Batch 1.38: one button that opens its choices (Export, Add); Day Hires; "ordered in Ns". */
.menu-btn { position: relative; display: inline-block; }
.menu-caret { font-size: 10px; margin-left: 2px; }
.menu-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); padding: 6px; width: max-content; min-width: 240px; max-width: min(320px, calc(100vw - 24px)); overflow-y: auto;
}
.menu-panel.menu-right { left: auto; right: 0; }
.menu-item { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; font: inherit; color: var(--ink); }
.menu-item:hover, .menu-item:focus-visible { background: var(--select-hover); outline: none; }
.menu-item-label { display: block; font-size: 13px; font-weight: 600; }
.menu-item-note { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; line-height: 1.35; white-space: normal; }
.badge.day-hire, .badge.combo-badge { background: var(--info-wash); color: var(--info-text); }
.badge.combo-badge { margin-left: 4px; }
.badge.order-mult { background: var(--warn-wash); color: var(--accent-text); margin-left: 4px; white-space: nowrap; }
.dh-names { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* Batch 1.40: pages kept together as tabs of one sidebar line (Company Setup, …). The group's
   title is above the tabs; the tab's own page title is not repeated under them. */
.group-tabs { margin: 0 0 16px; }
.group-tabs .nav-badge { margin-left: 6px; }
.group-body > h2.page-title { display: none; }

/* Batch 1.39: Dispatched By / Received By are shown, not picked; the Day Hire trips. */
.fixed-actor { border: 1px solid var(--line); background: var(--surface-muted); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.fixed-actor .small { margin-top: 2px; }
tr.dht-detail > td { background: var(--surface-muted); padding: 6px 10px 10px; }
table.dht-trips { margin: 0; font-size: 13px; background: transparent; }
table.dht-trips th, table.dht-trips td { padding: 4px 8px; }

/* ---------- Batch 1.31: installable app — Offline banner + Install button (all screen sizes) ---------- */
.offline-banner {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 8px;
  background: var(--accent-wash); color: var(--accent-ink); border-bottom: 1px solid var(--amber); padding: 0 14px; font-size: 13px;
  height: 35px; box-sizing: border-box; white-space: nowrap; overflow: hidden;
}
.offline-text { overflow: hidden; text-overflow: ellipsis; }
.offline-short { display: none; }
.offline-banner:not(.hidden) ~ .app-shell .sidebar { top: 35px; height: calc(100vh - 35px); }
.offline-banner strong { color: var(--amber-dark); }
.offline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex-shrink: 0; }
.offline-page { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; max-width: 520px; }
.offline-page h2 { margin: 0 0 6px; font-size: 18px; font-family: var(--font-heading); font-weight: 700; }
.modal-x { display: none; }
.sidebar-install {
  margin: 8px 16px 0; padding: 9px; border: 1px solid var(--amber); background: var(--accent-wash); color: var(--amber-dark);
  border-radius: 8px; cursor: pointer; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px;
}
@media (min-width: 721px) {
  .app-shell.sidebar-narrow .sidebar-install { margin: 8px 8px 0; }
  .app-shell.sidebar-narrow .sidebar-install .install-text { display: none; }
}

/* Batch 3.2c: Delivery Receipts — the record pop-up, accounting's totals, Correct / Cancel, the reasons. */
.dr-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 18px; font-size: 13px; margin: 0 0 14px; }
.dr-facts span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; letter-spacing: 0.03em; }
.dr-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; font-size: 13px; }
.dr-totals h4 { margin: 0 0 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.dr-total-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px solid var(--line); }
.dr-total-row.big { font-weight: 700; }
.dr-box { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.dr-box table { margin-top: 6px; }
.dr-box-head { font-weight: 700; }
.dr-box-head .small { font-weight: 400; }
.dr-hist { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
.dr-hist li { margin: 0 0 8px; font-size: 13px; }
.pick-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pick-row label { display: flex; gap: 6px; align-items: center; font-weight: 600; font-size: 13px; cursor: pointer; }
.pick-row input { width: auto; margin: 0; }
#dr_lines tr.g-cat td, #drc_lines tr.g-cat td { background: var(--surface-muted); font-weight: 700; font-size: 12px; }
#dr_lines tr.g-diff td, #drc_lines tr.g-diff td { background: var(--accent-wash); }
.regDrLink { display: block; }
.modal-box .badge { white-space: nowrap; }

/* ---------- Batch 3.2d: the two-person count of a delivery (lib/delivery-count.js) ---------- */
.dc-who { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; margin: 0 0 12px; }
.dc-card { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.dc-card-label { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; letter-spacing: 0.03em; }
.dc-card-name { font-weight: 700; margin: 2px 0; }
.dc-bar { height: 8px; border-radius: 99px; background: var(--surface-muted); overflow: hidden; margin-top: 8px; }
.dc-bar i { display: block; height: 100%; background: var(--select-fill); }
.dc-bar i.ok { background: var(--ok); }
.dc-table td { vertical-align: middle; }
.dc-table tr.dc-section td { background: var(--select-wash); color: var(--select-text); font-weight: 700; font-size: 13px; }
.dc-table tr.g-cat td { background: var(--surface-muted); font-weight: 700; font-size: 12px; }
.dc-table tr.g-diff td { background: var(--accent-wash); }
.dc-table tr.dc-diff td { background: var(--danger-wash); }
.dc-table tr.dc-same td { color: var(--muted); }
.dc-table .dc-num { text-align: right; white-space: nowrap; }
.dc-table th.dc-num { text-align: right; }
.dc-table .dc-state { white-space: nowrap; font-size: 13px; }
.dc-table .table-input { width: 100%; }
.dc-step { display: inline-flex; align-items: center; gap: 6px; }
.dc-step button { width: var(--tap); height: var(--tap); border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 22px; font-weight: 700; color: var(--ink); cursor: pointer; padding: 0; line-height: 1; }
.dc-step button:hover { background: var(--select-hover); border-color: var(--select-line); }
.dc_qty { width: 84px; height: var(--tap); border: 1px solid var(--line-strong); border-radius: 10px; text-align: center; font-weight: 700; font-size: 18px; background: var(--surface); color: var(--ink); }
.dc_qty:focus { outline: 2px solid var(--select-line); outline-offset: 1px; }
.dc_qty.invalid { border-color: var(--danger); background: var(--danger-wash); }
.dc-locked { display: inline-block; min-width: 84px; text-align: center; font-weight: 700; }
.dc-ok { color: var(--ok-text); font-weight: 700; }
.dc-bad { color: var(--danger-text); }
.day-warning.dc-good { border-color: var(--ok); background: var(--ok-wash); color: var(--ok-text); }
#dc_actions #dc_stopBtn { margin-left: auto; }
.dc-picks { border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; margin: 0 0 14px; }
.dc-pick { display: flex; align-items: center; gap: 8px; padding: 8px 0; cursor: pointer; flex-wrap: wrap; }
.dc-pick + .dc-pick { border-top: 1px solid var(--line); }
.dc-pick input { margin: 0; }
.d-counting { display: block; font-size: 12px; color: var(--info-text); }
.dr-week { margin: 0 0 6px; }
.dr-week .link-btn { font-weight: 700; text-decoration: underline; }
.dr-week .link-btn.on { background: var(--select-fill); color: var(--on-select-fill); text-decoration: none; padding: 1px 8px; border-radius: 99px; }
.dr-nos .link-btn { font-size: inherit; text-decoration: underline; }

/* ---------- Batch 3.3: Deliveries to Receive — the count (lib/receiving.js, pages/deliveries-receive.js) ---------- */
.rcv-box { border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px 10px; margin: 0 0 14px; max-width: 640px; }
.rcv-sec { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 12px 0 2px; }
.rcv-hd, .rcv-ln { display: grid; grid-template-columns: minmax(0, 1fr) 56px 96px; gap: 6px 10px; align-items: center; }
.rcv-hd { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.rcv-hd span:nth-child(n+2) { text-align: right; }
.rcv-ln { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rcv-name .link-btn { display: block; font-size: 12px; margin-top: 2px; text-decoration: underline; }
.rcv-q { text-align: right; color: var(--muted); }
.rcv-ln input, .rcv-ln select { height: var(--tap); border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; padding: 0 10px; box-sizing: border-box; min-width: 0; margin: 0; }
.rcv-ln .rv_qty, .rcv-ln .rv_oqty { width: 100%; text-align: right; font-weight: 700; font-size: 16px; }
.rcv-ln .rv_unfit { width: 72px; text-align: right; font-weight: 700; }
.rcv-ln input:focus, .rcv-ln select:focus { outline: 2px solid var(--select-line); outline-offset: 1px; }
.rcv-ln.diff .rv_qty, .rcv-ln.diff .rv_oqty, .rcv-ln input.invalid { border-color: var(--danger); background: var(--danger-wash); }
.rcv-rs { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.rcv-rs[hidden], .rcv-ln [hidden] { display: none; }
.rcv-rs select, .rcv-rs .rv_oreason { flex: 1 1 180px; }
.rcv-rs .rv_note, .rcv-rs .rv_unfitNote { flex: 1 1 100%; }
.rcv-changes { margin: 6px 0 0; padding-left: 18px; }
/* 1.86 (owner 2026-11-11): Refresh Counts after a receive refused because the DR changed while the store was counting */
.rv-stale { border: 1px solid var(--danger); background: var(--danger-wash); color: var(--danger-ink); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rv-stale p { margin: 0; flex: 1 1 260px; }
.rv-stale[hidden] { display: none; }
.rcv-ln.rv-recount { background: var(--accent-wash); box-shadow: inset 3px 0 0 var(--amber); padding-left: 8px; }
#rv_lines tr.g-cat td { background: var(--surface-muted); font-weight: 700; font-size: 12px; }
#rv_lines tr.g-diff td { background: var(--accent-wash); }

/* ---------- Batch 3.3a: the "Included with the order — no charge" box on a delivery receipt ---------- */
.pack-box .pack-row.free-row:has(.free-x) { grid-template-columns: 110px 1fr 28px; }
.pack-box .free-row + .free-row { margin-top: 8px; }
.free-x { padding-top: 22px; }
.free-x .free-remove { font-size: 20px; line-height: 1; text-decoration: none; }
.dr-inc-sub td { font-weight: 600; border-top: 1px solid var(--line); }
.dr-inc-sub.big td { font-weight: 700; }

/* ---------- Batch 1.31: phone pass (<= 720px) ----------
   Store and dispatcher screens (body.phone-page) and every popup show tables as cards: one
   card per row, each cell on its own line with its column name (data-m-label, filled in by
   lib/phone.js). Other pages stay desktop-first; their wide tables scroll inside themselves.
   Nothing here applies on a computer screen. */
@media (max-width: 720px) {
  .offline-long { display: none; }
  .offline-short { display: inline; }
  .page-content { padding: 14px 12px 40px; max-width: none; }
  h2.page-title { font-size: 19px; }

  /* 16px text in fields: iPhones zoom the page in on anything smaller. Bigger tap targets. */
  input, select, textarea, .table-input, .combo-input, .filter-search, .msel-btn { font-size: 16px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
  .btn { padding: 10px 14px; font-size: 14px; }
  .tab-btn { padding: 8px 14px; font-size: 14px; }
  .weekday-pill { padding: 7px 11px; font-size: 13px; }

  /* Filter toolbar: the search box takes a full line; buttons wrap instead of running off. */
  .toolbar { align-items: stretch; }
  .toolbar > div { flex-wrap: wrap; }
  .filter-bar { width: 100%; }
  .filter-bar > .filter-search { flex: 1 1 100%; width: 100% !important; min-width: 0 !important; max-width: none !important; }
  .filter-bar > select.filter-search { flex: 1 1 auto; }

  /* Desktop-first pages: a wide table scrolls sideways inside itself, not the whole page. */
  .page-content table:not(.m-cards):not(.perm-matrix) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  body:not(.phone-page) .page-content table.m-cards { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ---- Phone cards ---- */
  body.phone-page .page-content table.m-cards, .modal-box table.m-cards {
    display: block; border: none; background: transparent; border-radius: 0; overflow: visible; width: 100%;
  }
  body.phone-page .page-content table.m-cards colgroup, .modal-box table.m-cards colgroup,
  body.phone-page .page-content table.m-cards thead, .modal-box table.m-cards thead { display: none; }
  body.phone-page .page-content table.m-cards :is(tbody, tfoot), .modal-box table.m-cards :is(tbody, tfoot) { display: block; }
  body.phone-page .page-content table.m-cards tr, .modal-box table.m-cards tr {
    display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin: 0 0 8px; padding: 4px 0;
  }
  body.phone-page .page-content table.m-cards tr.clickable:active, .modal-box table.m-cards tr.clickable:active { background: var(--select-hover); }
  body.phone-page .page-content table.m-cards td, .modal-box table.m-cards td {
    display: flex; align-items: center; justify-content: flex-end; gap: 6px 12px; flex-wrap: wrap;
    padding: 6px 12px; border: none; text-align: right; width: auto !important; white-space: normal;
  }
  body.phone-page .page-content table.m-cards td::before, .modal-box table.m-cards td::before {
    content: attr(data-m-label); flex: 0 1 auto; max-width: 48%; text-align: left; margin-right: auto;
    color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  }
  body.phone-page .page-content table.m-cards td[data-m-label=""]::before, .modal-box table.m-cards td[data-m-label=""]::before { content: none; }
  body.phone-page .page-content table.m-cards td:empty, .modal-box table.m-cards td:empty { display: none; }
  /* The first cell is the card's title. */
  body.phone-page .page-content table.m-cards tr > td:first-child, .modal-box table.m-cards tr > td:first-child {
    justify-content: flex-start; text-align: left; font-weight: 600; font-size: 14px;
  }
  body.phone-page .page-content table.m-cards tr > td:first-child::before, .modal-box table.m-cards tr > td:first-child::before { content: none; }
  /* A row that spans the whole table (a group heading, "No orders") is a plain line. */
  body.phone-page .page-content table.m-cards tr.m-row-span, .modal-box table.m-cards tr.m-row-span {
    background: transparent; border: none; padding: 0; margin: 12px 0 4px;
  }
  body.phone-page .page-content table.m-cards tr.m-row-span > td, .modal-box table.m-cards tr.m-row-span > td { display: block; padding: 2px; font-weight: 600; }
  /* Totals rows: label and amount on one line. */
  body.phone-page .page-content table.m-cards :is(tfoot tr, tr.m-row-total), .modal-box table.m-cards :is(tfoot tr, tr.m-row-total) { display: flex; justify-content: space-between; align-items: center; }
  body.phone-page .page-content table.m-cards :is(tfoot, tr.m-row-total) td::before, .modal-box table.m-cards :is(tfoot, tr.m-row-total) td::before { content: none; }
  body.phone-page .page-content table.m-cards tr.m-row-total > td, .modal-box table.m-cards tr.m-row-total > td { font-weight: 700; }
  /* Counts typed into a card stay a comfortable size; text fields take the line. */
  .modal-box table.m-cards td .table-input[type=number], body.phone-page .page-content table.m-cards td .table-input[type=number] { width: 96px !important; text-align: right; }
  .modal-box table.m-cards td > input[type=text], .modal-box table.m-cards td > textarea { flex: 1 1 100%; }
  /* A line's "reason for the difference" sits under the count, full width, only when needed. */
  .modal-box table.m-cards td:has(> .line-reason) { display: block; text-align: left; }
  .modal-box table.m-cards td:has(> .line-reason)::before { display: block; margin-bottom: 4px; }
  .modal-box table.m-cards td:has(> .line-reason:not([data-required="1"])) { display: none; }
  .modal-box table.m-cards td .btn { margin: 2px 0 2px 6px; }

  /* ---- Popups fill the screen; their buttons stay at the bottom ---- */
  body.modal-open { overflow: hidden; }
  .modal-x {
    display: flex; align-items: center; justify-content: center; position: fixed; z-index: 55;
    top: calc(8px + env(safe-area-inset-top)); right: 8px; width: 36px; height: 36px; padding: 0;
    border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
  }
  .modal-host { align-items: stretch; }
  .modal-box, .modal-box.wide {
    max-width: none; width: 100%; height: 100%; max-height: none; border-radius: 0;
    padding: 14px 14px 0; box-shadow: none; overscroll-behavior: contain;
  }
  .modal-box h3 { font-size: 17px; margin-bottom: 12px; padding-right: 40px; }
  /* The popup's last row of buttons sticks to the bottom (earlier rows stay where they are,
     so two rows never pile up on top of each other). */
  .modal-box > .modal-actions:last-child {
    position: sticky; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line);
    margin: 16px -14px 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }
  .modal-box::after { content: ''; display: block; height: 14px; }
  .modal-box:has(> .modal-actions:last-child)::after { content: none; }
  .modal-actions .btn { flex: 1 1 auto; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); text-align: center; }
}

/* ---------- Batch 1.32: phone navigation (Apple HIG tab bar) ----------
   Nothing here applies on a computer screen: the tab bar and the sheet chrome are hidden above
   720px, and the sidebar keeps its desktop layout. On a phone:
   - a bottom tab bar holds up to 4 of the person's main pages + "More" (lib/phone-nav.js);
   - "More" slides the whole sidebar up as a sheet (name, every section, Install App, Log Out);
   - every control is at least --tap (44px) tall. */
.phone-tabs, .more-head, .more-backdrop { display: none; }
@media (max-width: 720px) {
  /* ---- Bottom tab bar ---- */
  .phone-tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 0 max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
  }
  .phone-tab {
    flex: 1 1 0; min-width: 0; height: var(--tabbar-h); position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: none; background: transparent; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600;
    cursor: pointer; padding: 0 2px; -webkit-tap-highlight-color: transparent;
  }
  .phone-tab svg { width: 24px; height: 24px; display: block; }
  .phone-tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .phone-tab.active { color: var(--select-text); }
  .phone-tab:active { background: var(--select-hover); }
  .phone-tab:focus-visible { outline: 2px solid var(--select-line); outline-offset: -4px; border-radius: 10px; }
  .phone-tab .nav-badge {
    position: absolute; top: 5px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; padding: 0 5px;
    font-size: 11px; line-height: 18px; text-align: center; border: 2px solid var(--surface); box-sizing: content-box;
  }
  .page-content { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); }
  .toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); }

  /* ---- "More" sheet: the sidebar, slid up from the bottom ---- */
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 46; width: 100%;
    height: auto; max-height: calc(100dvh - 48px - env(safe-area-inset-top));
    flex-direction: column; overflow: hidden; padding: 0 0 calc(12px + env(safe-area-inset-bottom));
    border-right: none; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 32px rgba(28,25,23,0.18);
    transform: translateY(105%); visibility: hidden;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.22s;
  }
  body.more-open .sidebar { transform: none; visibility: visible; transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1); }
  body.more-open { overflow: hidden; }
  .offline-banner:not(.hidden) ~ .app-shell .sidebar { top: auto; height: auto; }
  .more-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(28,25,23,0.4); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  body.more-open .more-backdrop { opacity: 1; pointer-events: auto; }
  .more-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0;
    padding: 6px 8px 6px 18px; border-bottom: 1px solid var(--line);
  }
  .more-head::before { content: ''; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-strong); }
  .more-title { font-weight: 700; font-size: 17px; padding-top: 10px; font-family: var(--font-heading); }
  .more-close {
    width: var(--tap); height: var(--tap); margin-top: 6px; border: none; background: transparent; color: var(--muted);
    font-size: 26px; line-height: 1; cursor: pointer; border-radius: 50%;
  }
  .more-close:active { background: var(--surface-muted); }
  .sidebar-top { display: none; }
  .sidebar-user { padding: 8px; margin: 0; flex-shrink: 0; }
  .sidebar-user-btn { min-height: var(--tap); }
  .nav-section-items > .nav-item::before { display: none; }
  .sidebar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 10px 8px; gap: 0; }
  /* Sections are always open here; their names are plain headings. */
  .nav-section.folded .nav-section-items { display: flex; }
  button.nav-section-label { pointer-events: none; padding: 14px 8px 4px; }
  .nav-section-label .nav-caret, .nav-section-badge { display: none !important; }
  .nav-item { min-height: var(--tap); padding: 0 10px; font-size: 16px; font-weight: 500; border-radius: 10px; }
  .nav-item .nav-icon, .nav-item .nav-icon-narrow { display: inline-flex; width: 22px; margin-right: 12px; color: var(--muted); }
  .nav-item.active .nav-icon { color: inherit; }
  .nav-item .nav-badge { margin-left: 8px; }
  .sidebar-install, .sidebar-logout { min-height: var(--tap); margin: 8px 16px 0; font-size: 16px; flex-shrink: 0; }
  .sidebar-install .install-text { display: inline; }

  /* ---- 44px touch targets everywhere else ---- */
  .btn, .tab-btn, .msel-btn, .weekday-pill, .filter-search, .combo-input, .table-input,
  .field input:not([type=checkbox]):not([type=radio]), .field select, .login-card input, .login-card button { min-height: var(--tap); }
  .tab-btn, .weekday-pill, .msel-btn { display: inline-flex; align-items: center; justify-content: center; }
  .msel-opt, .combo-opt, .role-perm-opt { min-height: var(--tap); padding-top: 0; padding-bottom: 0; align-items: center; }
  .drange-day { min-height: 40px; font-size: 14px; }
  .modal-x { width: var(--tap); height: var(--tap); top: calc(4px + env(safe-area-inset-top)); right: 4px; }
  .modal-box h3 { padding-right: 48px; }
  .drange-nav { min-width: var(--tap); min-height: var(--tap); }
  .day-warning .btn { min-height: 36px; }
  label:has(> input[type=checkbox]), label:has(> input[type=radio]) { min-height: var(--tap); display: inline-flex; align-items: center; gap: 8px; }
}
/* ---- 1.32: compact filter toolbars (lib/phone-filters.js) + one-line tab rows ---- */
.m-filter-toggle { display: none; }
@media (max-width: 720px) {
  .ts-grid, .rc-correction, .ts-fields { grid-template-columns: 1fr; }
  .toolbar.m-compact { flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px; }
  .toolbar.m-compact > .filter-bar { display: contents; }
  .toolbar.m-compact .filter-bar > input.filter-search { order: 0; flex: 1 1 100%; }
  .toolbar.m-compact .m-filter-toggle { display: inline-flex; align-items: center; gap: 6px; order: 1; flex: 0 0 auto; }
  .m-filter-toggle .msel-count { margin-left: 2px; }
  /* Row 2: Filters on the left, the page's main action on the right. Opened: the filters, then
     the Reset / Export / Import buttons, each on the lines below. */
  .toolbar.m-compact > div:not(.filter-bar) { display: contents !important; } /* beats the pages' inline display:flex */
  .toolbar.m-compact > div:not(.filter-bar) > * { order: 2; }
  .toolbar.m-compact .m-filter-toggle { margin-right: auto; }
  .toolbar.m-compact:not(.m-collapsed) .filter-bar::before { content: ''; order: 3; flex: 1 0 100%; height: 0; }
  .toolbar.m-compact .filter-bar > :not(input.filter-search):not(.m-filter-toggle) { order: 3; }
  .toolbar.m-compact :is([id^="reset"][id$="FiltersBtn"], [id^="export"], [id^="import"]) { order: 4; }
  .toolbar.m-compact.m-collapsed .filter-bar > :not(input.filter-search):not(.m-filter-toggle),
  .toolbar.m-compact.m-collapsed :is([id^="reset"][id$="FiltersBtn"], [id^="export"], [id^="import"], #docsNotNeededBtn) { display: none !important; }
  /* 0.19k: the Owner / Admin's employee exports stay on a phone; a File ▾ group with nothing left for a phone goes. */
  .toolbar.m-compact.m-collapsed :is(#exportEmpList, #exportEmpFull, #exportContributions) { display: block !important; }
  .toolbar.m-compact.m-collapsed [id^="exportGrp"] + .menu-sub, .toolbar.m-compact.m-collapsed [id^="exportGrp"] + .menu-sub + .menu-sep { display: none; }
  .doc-mass-grid { grid-template-columns: 1fr; }
  .exit-kv, .exit-kv.two, .exit-grid { grid-template-columns: 1fr; }
  .mp-wrap { max-width: none; }
  .hd-tiles { grid-template-columns: 1fr 1fr; }
  .hd-grid { grid-template-columns: 1fr; }
  .hd-bar { display: none; }
  .hd-tile { min-height: var(--tap); }
  .btn.sm, .mp-wide { min-height: var(--tap); }
  .toolbar.m-compact:not(.m-collapsed) .m-filter-toggle { background: var(--select-wash); border-color: var(--select-line); color: var(--select-text); }
  /* 1.53 (owner): page-level tab rows wrap — every tab and its count in view, no sliding — with smaller tabs
     so they take a few short rows. The page's description is left out on a phone (computers keep it). */
  #pageContent .tab-bar { flex-wrap: wrap; gap: 6px; }
  #pageContent .tab-bar > .tab-btn { flex: 0 0 auto; min-height: 36px; padding: 6px 11px; font-size: 13px; line-height: 1.2; }
  #pageContent p.page-sub { display: none; }
  /* 1.38: menu choices are full-size touch targets; the Day Hire name boxes stack. */
  .menu-item { min-height: var(--tap); }
  .dh-names { grid-template-columns: 1fr; }
  /* 3.2c: the delivery receipt pop-up's facts and totals stack. */
  .dr-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dr-totals { grid-template-columns: 1fr; gap: 8px; }
  /* 3.2d: the count on a phone — one line per product, the number at the right. */
  .dc-card { min-width: 0; flex: 1 1 100%; }
  .dc-table .dc-state { white-space: normal; }
  .dc_qty { width: 72px; }
  #dc_actions #dc_stopBtn { margin-left: 0; }
}
@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .sidebar, body.more-open .sidebar, .more-backdrop { transition: none; }
}
/* Fields that take a paragraph use the app's own font, not the browser's monospace default. */
button, input, select, textarea { font-family: inherit; }

/* ---------- Batch 3.3b ---------- */
/* A menu in a table row is lifted out of the table and opens under its own button. */
.menu-panel.menu-float { position: fixed; top: auto; right: auto; z-index: 70; }
/* The photo box: one look for every "add a photo". */
.photo-box { position: relative; width: 100%; }
.photo-box-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-box-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; text-align: left;
  background: var(--surface-alt); border: 1.5px dashed var(--line-stronger); border-radius: 10px; cursor: pointer; font: inherit; color: var(--ink);
}
.photo-box-btn:hover, .photo-box-btn:focus-visible { border-color: var(--select-line); background: var(--select-wash); outline: none; }
.photo-box-thumb { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.photo-box-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-box-pdf { font-size: 10px; font-weight: 700; color: var(--danger-text); }
.photo-box-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.photo-box-title { font-weight: 600; font-size: 14px; }
.photo-box-title .req { color: var(--danger); }
.photo-box-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-box-error { display: none; font-size: 12px; color: var(--danger-text); font-weight: 600; }
.photo-box-change { flex: 0 0 auto; text-decoration: underline; }
.photo-box.added .photo-box-btn { border-style: solid; border-color: var(--line-strong); background: var(--surface); }
.photo-box.added .photo-box-title { color: var(--ok-text); }
.photo-box.missing .photo-box-btn { border-color: var(--danger); background: var(--danger-wash); }
.photo-box.missing .photo-box-thumb { color: var(--danger); }
.photo-box.missing .photo-box-error { display: block; }
.photo-box-remove { margin-top: 4px; }
.photo-box.compact .photo-box-btn { min-height: 52px; padding: 6px 10px; }
.photo-box.compact .photo-box-thumb { width: 40px; height: 40px; }
/* The phone sheet: Take a Photo / Choose from Gallery / Cancel. */
.action-sheet-host { position: fixed; inset: 0; z-index: 90; }
.action-sheet-backdrop { position: absolute; inset: 0; background: rgba(28,25,23,0.4); }
.action-sheet { position: absolute; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; max-width: 480px; margin: 0 auto; }
.action-sheet-group { background: var(--surface); border-radius: 12px; overflow: hidden; }
.action-sheet-group .action-sheet-item + .action-sheet-item { border-top: 1px solid var(--line); }
.action-sheet-item { display: block; width: 100%; min-height: 52px; border: none; background: var(--surface); font: inherit; font-size: 16px; color: var(--select-text); cursor: pointer; }
.action-sheet-cancel { border-radius: 12px; font-weight: 600; }
/* The upload area (Incident Reports, HR Cases). */
.upload-zone { width: 100%; }
.upload-drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  padding: 18px 14px; border: 1.5px dashed var(--line-stronger); border-radius: 10px; background: var(--surface-alt);
}
.upload-drop.over { border-color: var(--select-line); background: var(--select-wash); }
.upload-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-icon { color: var(--muted); line-height: 0; }
.upload-drag { font-weight: 600; font-size: 14px; }
.upload-or { font-size: 12px; color: var(--muted); }
.upload-hint { display: block; margin-top: 4px; max-width: 420px; }
.upload-zone.busy .upload-drop { opacity: 0.6; }
.upload-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.upload-list:empty { display: none; }
.upload-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.upload-thumb { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 6px; overflow: hidden; background: var(--surface-muted); display: flex; align-items: center; justify-content: center; }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-pdf { font-size: 10px; font-weight: 700; color: var(--danger-text); }
.upload-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upload-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-bar { display: none; height: 4px; border-radius: 2px; background: var(--surface-muted); overflow: hidden; }
.upload-bar > span { display: block; height: 100%; width: 0; background: var(--select-fill); }
.upload-row.up .upload-bar, .upload-row.done .upload-bar, .upload-row.fail .upload-bar { display: block; }
.upload-row.up .upload-bar > span { width: 40%; animation: upload-slide 1.1s ease-in-out infinite; }
.upload-row.done .upload-bar > span { width: 100%; background: var(--ok); }
.upload-row.fail .upload-bar > span { width: 100%; background: var(--danger); }
@keyframes upload-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .upload-row.up .upload-bar > span { animation: none; width: 60%; } }
.upload-actions { flex: 0 0 auto; display: flex; gap: 10px; }
/* Batch 1.47: "Cancel This Order" sits on its own row, after the other buttons. */
.modal-actions .btn.cancel-order-btn { order: 99; flex: 1 1 100%; margin-top: 8px; }
/* 1.48: Confirm Prepared check + Print for Preparing (several) */
#cp_lines tr.cp-diff td { background: var(--warn-wash); color: var(--accent-text); }
#cp_lines tr.cp-zero td { background: var(--danger-soft); color: var(--danger-text); }
.pp-list { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin-bottom: 10px; }
.pp-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pp-row:last-child { border-bottom: 0; }

/* 3.4c: Stock Transfers between branches — the steps line on top of a transfer; rows waiting for me */
.bt-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 12px; }
.bt-step { color: var(--muted); }
.bt-step.done { color: var(--ok-text); }
.bt-step.now { color: var(--accent-text); font-weight: 700; }
tr.bt-mine td:first-child { box-shadow: inset 3px 0 0 var(--amber); }

/* 1.50: field checks — the message under a box, a greyed "your own" note, reason choices */
.row-msg { color: var(--danger); font-size: 12px; margin-top: 4px; line-height: 1.3; }
.row-msg.hidden { display: none; }
.lock-note { background: var(--surface-muted); border-radius: 7px; padding: 8px 10px; font-size: 12.5px; color: var(--muted); margin: 4px 0 12px; }
.req { color: var(--danger); }
.opt-line { display: flex !important; gap: 8px; align-items: center; margin: 6px 0; font-size: 14px; font-weight: 400 !important; }
.opt-line input { width: auto !important; margin: 0; }
.field textarea.hidden { display: none; }
.table-input.kr-changed.invalid { border-color: var(--danger); background: var(--danger-wash); }

/* 1.51: a KCafe drink counted in the milk and beans — no count box; the order picked on Dispatch */
.kc-nocount { white-space: nowrap; font-style: italic; }
.kc-ingr-note { margin-top: 2px; }
tr.row-picked td { background: var(--select-hover); }

/* 0.17: New Hires for Sprout — red = Sprout requires it, amber = only Sprout HR / Payroll */
.sh-scroll { overflow-x: auto; }
.sh-table td { vertical-align: top; }
.badge.sh-bad { background: var(--danger-soft); color: var(--danger-text); white-space: nowrap; }
.badge.sh-warn { background: var(--warn-wash); color: var(--accent-text); white-space: nowrap; }
.sh-note { font-size: 12px; line-height: 1.4; margin-top: 3px; }
.sh-note.sh-req { color: var(--danger-text); }
.sh-note.sh-wrn { color: var(--accent-text); }
.sh-table select.sh-dept { margin-top: 6px; width: auto; min-width: 230px; }
.sh-table select.sh-payroll { width: auto; }
.sh-count { margin-top: 12px; }
.field select.sh-changed { border-color: var(--amber); background: var(--accent-wash); }
/* 1.53: a branch box that hasn't been picked yet (2+ branches), and the "Is this the branch?" question. */
select.branch-pick.unpicked { border: 2px solid var(--amber); background-color: var(--accent-wash); color: var(--ink); font-weight: 600; }
.branch-pick-field > label { font-weight: 700; }
.branch-pick-hint { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--accent-text); }
.branch-confirm { border: 2px solid var(--amber); background: var(--accent-wash); border-radius: 10px; padding: 14px 16px; margin: 6px 0 12px; }
.branch-confirm-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.branch-confirm-name { font-size: 22px; font-weight: 700; line-height: 1.25; color: var(--ink); }
.page-pick-note { margin: 0 0 14px; }
.radio-line { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-weight: 400; }
.radio-line input[type="radio"] { width: auto; margin-top: 3px; flex: 0 0 auto; }
/* 1.54: one device per login — the note on the sign-in screen of a device that was signed out, and the device lines
   in "You're signed in on another device" / Sign Out Other Devices. */
.login-note {
  background: var(--warn-wash); color: var(--accent-text); border: 1px solid var(--amber); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; line-height: 1.4; margin: 0 0 14px; text-align: left;
}
.login-note strong { display: block; margin-bottom: 2px; font-size: 14px; }
.login-card button.login-link { background: none; border: none; color: var(--brand-text); font-weight: 600; text-decoration: underline; padding: 6px 0; margin-top: 4px; width: auto; }
/* 1.84: the password rules, ticked while typing */
.pw-rules { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; text-align: left; }
.pw-rules li { display: flex; gap: 8px; align-items: center; padding: 3px 0; color: var(--muted); }
.pw-rules li .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; box-sizing: border-box; }
.pw-rules li.ok { color: var(--ok-text); }
.pw-rules li.ok .dot { background: var(--ok-wash); border-color: var(--ok-text); }
.pw-rules li.bad { color: var(--danger-text); }
.pw-rules li.bad .dot { background: var(--danger-soft); border-color: var(--danger-text); }
/* 1.84: Send Login Link — where it goes, or why it can't */
.info-box { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 10px 0; }
.red-box { background: var(--danger-soft); color: var(--danger-text); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 10px 0; }
.badge.sent { background: var(--warn-wash); color: var(--accent-text); }
.badge.flag { background: var(--danger-soft); color: var(--danger-text); }
.sl-why, .le-note { display: block; margin-top: 3px; }
.device-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.device-box .dv-kind { font-weight: 700; }
.device-box .dv-when { font-size: 13px; color: var(--muted); }
.si-who-sub { display: block; }
/* 1.57: Notifications — the unread count and Mark All as Read above the list */
.notif-unread { font-weight: 600; }
#notifToolbar[hidden] { display: none; }
/* 1.59: Regularized On later than the day after probation ended (a warning only) */
input.field-warn { border: 2px solid var(--amber); background-color: var(--accent-wash); }
.warn-text { color: var(--accent-text); }
/* 1.59: a line whose product is no longer sold (orders) */
tr.nls-row > td { background: var(--accent-wash); }
.nls-note { display: block; margin-top: 2px; }
.nls-cell { text-align: right; white-space: nowrap; }
/* 1.59: Notifications → Settings ▾ → What I See…, and the morning summary */
#notifBar[hidden] { display: none; }
.notif-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#notifBar .menu-btn { margin-left: auto; }
.wis-line { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-weight: 400; }
.wis-line input[type="checkbox"] { width: auto; margin-top: 3px; flex: 0 0 auto; }
.wis-line .wis-note { display: block; font-size: 13px; color: var(--muted); }
.sum-table td.sum-who { color: var(--muted); font-size: 13px; text-align: right; }
.sum-table tr.clickable { cursor: pointer; }
/* 1.55: KCafe Delivery to Follow + extra milk / beans */
.k-extra, .extra-note { color: var(--muted); font-weight: 400; }
.k-follow-links { display: grid; gap: 6px; }
.k-follow-links .btn { margin-left: 8px; padding: 3px 10px; font-size: 12px; }
.k-tf-row td { color: var(--muted); }
/* 1.56b-1: the On Foot tick on a truck; the Franchise tag; a franchise delivery's signed DR photo */
.truck-foot-box { background: var(--warn-wash); border-radius: 8px; padding: 8px 10px; }
.franchise-tag { margin-left: 4px; white-space: nowrap; }
.signed-dr-box { margin-top: 10px; }
/* 0.18: the crew schedule (week grid, Move Crew, Who Is Where) */
.sch-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.sch-top select.filter-search { min-width: 200px; max-width: 280px; }
.wk-nav { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.wk-nav .btn { padding: 4px 10px; }
.table-scroll { overflow-x: auto; }
.sch-grid td, .sch-grid th { vertical-align: top; }
.sch-grid td.clickable { cursor: pointer; }
.sch-grid td.clickable:hover { background: var(--select-hover); }
.sch-grid tr.sch-band { background: var(--surface-alt); }
.sch-cell { font-size: 12px; line-height: 1.35; white-space: nowrap; }
.sch-cell + .sch-cell { margin-top: 4px; }
.sch-cell .t { font-weight: 600; }
.sch-cell .s { color: var(--muted); }
.sch-cell.rest { color: var(--muted); }
.sch-cell.unset { color: var(--accent-text); }
.sch-cell.moved .t { color: var(--select-text); }
.sch-today { background: var(--select-wash); }
.sch-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.mv-pre { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-alt); font-size: 13px; }
.mv-pre ul { margin: 6px 0 0 18px; padding: 0; }
.time-row { display: flex; gap: 10px; }
.time-row .field { flex: 1; min-width: 0; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 400; }
.chk input { margin-top: 2px; width: auto; }
.wiw-line { display: flex; gap: 8px; align-items: baseline; line-height: 1.7; }
.wiw-n { display: inline-block; min-width: 40px; font-weight: 700; font-size: 12px; color: var(--muted); flex: 0 0 auto; }
#usEdit input.table-input { width: 110px; }
/* 1.60: the swap check pop-up */
.swap-count-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 0 26px; }
/* 0.18c-1: typing a cutoff (Schedule → Cutoff / Month) and the Weekly Patterns */
.sch-grid.cg { border-collapse: separate; border-spacing: 0; }
.sch-grid.cg th, .sch-grid.cg td { padding: 3px 2px; text-align: center; vertical-align: middle; position: relative; }
.sch-grid.cg th:first-child, .sch-grid.cg td:first-child { text-align: left; min-width: 140px; padding-left: 8px; }
.sch-grid.cg th.cg-we { color: var(--muted); }
.sch-grid.cg td.cg-past { background: var(--surface-alt); }
.cg-in.table-input { width: 64px; text-align: center; padding: 4px 2px; font-size: 12px; font-weight: 600; }
.cp-grid .cg-in.table-input, #cpTable .cg-in.table-input { width: 84px; }
.cg-in.table-input.cg-rd, .cg-txt.cg-rd { color: var(--muted); background: var(--surface-muted); font-weight: 500; }
.cg-in.table-input.cg-mv, .cg-txt.cg-mv { color: var(--select-text); }
.cg-txt { font-size: 12px; font-weight: 600; white-space: nowrap; padding: 4px 2px; border-radius: 6px; }
.cg-txt.cg-worked { color: var(--accent-text); }
.cg-plan { font-size: 10.5px; color: var(--muted); text-decoration: line-through; white-space: nowrap; }
.cg-x { font-size: 10.5px; color: var(--select-text); white-space: nowrap; }
.cg-more { position: absolute; top: 0; right: 0; border: none; background: none; color: var(--muted); font-size: 12px; line-height: 1; padding: 2px 3px; cursor: pointer; opacity: 0; }
.sch-grid.cg td:hover .cg-more, .sch-grid.cg td:focus-within .cg-more, .cg-more:focus { opacity: 1; }
.legend-key { display: inline-block; text-align: center; font-weight: 700; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-right: 3px; font-size: 11px; background: var(--surface); }
/* 0.18c-2: rest-day duty (green), suspended (red), the "How to Type a Day" legend */
.cg-in.table-input.cg-rdd, .cg-txt.cg-rdd, .legend-key.cg-rdd { color: var(--ok-text); background: var(--ok-wash); }
.badge.rdd { background: var(--ok-wash); color: var(--ok-text); }
.badge.sus { background: var(--danger-wash); color: var(--danger-text); font-weight: 700; }
.status-sus { margin-top: 3px; }
.type-legend { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 8px 0 12px; font-size: 13px; }
.type-legend dt { margin: 0; } .type-legend dd { margin: 0; }
.rest-ask select, #rcBox select { margin-left: 4px; }
.mv-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.mv-week label { display: flex; flex-direction: column; gap: 2px; font-weight: 600; }
.mv-week .table-input { width: 100%; text-align: center; padding: 4px 2px; font-size: 12px; }
.cp-note { font-size: 12px; text-align: left; white-space: nowrap; }
/* 0.18c-3: OT hours under a day, the "already in a Sprout file" mark (✓; ! = changed after it was sent) */
.cg-ot { font-size: 10.5px; color: var(--accent-text); font-weight: 600; white-space: nowrap; }
.cg-sp { position: absolute; top: 1px; left: 3px; font-size: 10px; line-height: 1; color: var(--ok-text); font-weight: 700; }
.cg-sp.changed { color: var(--danger-text); }
.legend-sp { position: static; margin-right: 3px; }
@media (max-width: 720px) {
  .sh-table select.sh-dept { width: 100%; min-width: 0; min-height: var(--tap); }
}

/* ---------- 0.19a: the employee page in tabs, one Employee ID, In Sprout ---------- */
.emp-tabs { margin: 4px 0 16px; }
.emp-pane[hidden] { display: none; }
.tab-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-left: 6px; vertical-align: middle; }
.tab-dot[hidden] { display: none; }
.emp-id-row { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.emp-id-row > .field { flex: 1 1 260px; min-width: 0; }
.emp-id-row > .menu-btn { margin-top: 21px; }
.emp-sprout-check label { display: flex; gap: 8px; align-items: center; }
.emp-sprout-check input[type=checkbox] { width: auto; }
.badge-not-sprout { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--surface-muted); color: var(--muted); margin-left: 6px; }

/* ---------- Batch 0.19b: Default Schedule (lib/default-schedule.js) ---------- */
.ds-head { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; max-width: 640px; }
.ds-fill { margin: 2px 0 10px; }
.ds-table { margin-bottom: 4px; }
.ds-table .table-input { width: 112px; }
.ds-table td { white-space: nowrap; vertical-align: middle; }
.ds-table tr.ds-msg td, .ds-table tr.ds-copyrow td { white-space: normal; padding-top: 4px; }
.ds-table tr.ds-copyrow td { background: var(--select-wash); }
.ds-table tr.ds-rest td { background: var(--surface-alt); }
.ds-c { text-align: center !important; }
.ds-table input[type=checkbox] { width: 16px; height: 16px; }
.ds-wb { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.ds-pills { display: inline-flex; margin: 0 8px; }
.ds-bad { color: var(--danger-text); }
.table-input.ds-long { border-color: var(--amber); background: var(--accent-wash); }
.ds-phone-only { display: none; }
.ds-lines { margin: 4px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.ds-add-times { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.ds-add-times input { min-width: 0; }
.ds-history summary { cursor: pointer; color: var(--muted); }
/* ---------- Batch 0.19c: Job Level, Positions' levels, Job Grade Matrix ---------- */
.emp-level-row, .pos-level-row { display: flex; gap: 8px; align-items: flex-start; }
.emp-level-row select { flex: 1; }
.pos-level-row .field { flex: 1; }
select.level-out { border-color: var(--amber); background: var(--accent-wash); }
#posRows tr.pos-dept-row td { background: var(--surface-muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
#jlTable tr.jl-none td { background: var(--surface-alt); }
.mx-scroll { overflow-x: auto; }
.mx-table td { vertical-align: top; padding: 8px; }
.mx-table th { padding: 8px; }
.mx-table td.mx-level { white-space: nowrap; }
.mx-pos { display: inline-block; background: var(--select-wash); color: var(--select-text); border-radius: 6px; padding: 2px 6px; font-size: 12px; font-weight: 600; margin: 1px 2px 1px 0; cursor: pointer; }
.mx-pos.mx-off { background: var(--surface-muted); color: var(--muted); }
.mx-n { font-style: normal; font-size: 11px; font-weight: 700; margin-left: 5px; color: var(--ink); cursor: pointer; text-decoration: underline; }
.mx-table tr.mx-none td { background: var(--surface-alt); }
.mx-phone { display: none; }
.mx-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
/* ---------- Batch 0.19d: Sprout Update File (lib/sprout-update-modal.js) ---------- */
.su-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.su-step { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-muted); color: var(--muted); }
.su-step.on { background: var(--select-fill); color: var(--on-select-fill); }
.su-step.done { background: var(--ok-wash); color: var(--ok-text); }
.su-part { display: flex; gap: 8px; flex-wrap: wrap; }
.su-part label { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; flex: 1 1 200px; font-size: 13px; font-weight: 400; cursor: pointer; margin: 0; }
.su-part label.on { border-color: var(--select-line); background: var(--select-wash); }
.su-part input { width: auto; margin-top: 2px; }
.su-file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); margin-top: 8px; font-size: 13px; }
.su-file .su-read { margin-left: auto; }
.su-sum { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.su-sum .chip b { font-variant-numeric: tabular-nums; }
.su-sum .su-chip-bad { border-color: var(--danger); color: var(--danger-text); }
.su-scroll { overflow-x: auto; }
.su-table tr.su-person td { background: var(--surface-muted); font-weight: 700; }
.su-table tr.su-person td .small { font-weight: 400; }
.su-table td.su-old { color: var(--muted); overflow-wrap: anywhere; }
.su-table td.su-old .su-was { text-decoration: line-through; text-decoration-color: var(--line-stronger); }
.su-table td.su-new { font-weight: 600; overflow-wrap: anywhere; }
.su-table tr.su-off td { color: var(--muted); }
.su-table tr.su-off td.su-new { font-weight: 400; }
.su-table tr.su-bad td { background: var(--danger-wash); }
.su-space { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--warn-wash); border-radius: 3px; padding: 0 2px; }
.su-why { font-size: 12px; font-weight: 400; color: var(--danger-text); margin-top: 2px; }
.su-pick { margin-top: 6px; }
.su-pick select { width: auto; min-width: 200px; }
.su-group { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 10px 14px; margin-top: 10px; }
.su-group h4 { margin: 0 0 6px; font-size: 13px; }
.su-group h4 .badge { margin-left: 6px; }
.su-list { margin: 0; padding-left: 18px; font-size: 13px; }
.su-list li + li { margin-top: 4px; }
.su-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn .su-count { margin-left: 2px; }
@media (max-width: 720px) {
  .ds-head, .ds-add-times { grid-template-columns: 1fr 1fr; }
  .ds-table thead { display: none; }
  .ds-table, .ds-table tbody { display: block; border: none; background: transparent; }
  .ds-table tr.ds-day { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
  .ds-table tr.ds-day.ds-rest { background: var(--surface-alt); }
  .ds-table tr.ds-day td { display: block; border: none; padding: 0; background: transparent; }
  .ds-table tr.ds-day td.ds-name { grid-column: 1 / 2; }
  .ds-table tr.ds-day td.ds-c { grid-column: 2 / 3; grid-row: 1; text-align: right !important; }
  .ds-table tr.ds-day td[data-m-label]:not(.ds-name):not(.ds-c)::before { content: attr(data-m-label); display: block; font-size: 11px; color: var(--muted); }
  .ds-table tr.ds-day .table-input { width: 100%; }
  .ds-table tr.ds-day.ds-rest td:not(.ds-name):not(.ds-c) { display: none; }
  .ds-table tr.ds-msg, .ds-table tr.ds-copyrow { display: block; }
  .ds-table tr.ds-msg td:first-child, .ds-table tr.ds-copyrow td:first-child { display: none; }
  .ds-table tr.ds-msg td, .ds-table tr.ds-copyrow td { display: block; border: none; }
  .ds-phone-only { display: inline; }
  .mx-scroll { display: none; }
  .mx-phone { display: block; }
}
@media (max-width: 720px) {
  .upload-drag, .upload-or { display: none; }
  #notifToolbar .btn { flex: 1 1 100%; min-height: var(--tap); }
  #notifBar .notif-group { flex: 1 1 100%; }
  .upload-choose { min-height: var(--tap); }
}
/* Receiving: the photo of the pieces that can't be sold sits under the line, full width. */
.rcv-photo { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; }
.rcv-ln .photo-box-input { width: 1px; height: 1px; padding: 0; border: 0; }
/* A small link (+ Add a Free Item, Change, Remove) matches the small text around it. */
.link-btn.small { font-size: 12px; }
#pm_freeAdd { font-weight: 600; }

/* 3.3c: Charge Slips — the finger signature pad */
.cs-pad { position: relative; height: 160px; border: 1.5px dashed var(--line-stronger); border-radius: 10px; background: var(--surface); touch-action: none; }
.cs-pad.missing { border-color: var(--danger); }
.cs-pad-canvas { position: absolute; inset: 0 0 24px 0; width: 100%; height: calc(100% - 24px); cursor: crosshair; touch-action: none; }
.cs-pad-line { position: absolute; left: 14px; right: 14px; bottom: 24px; border-top: 1px solid var(--line-strong); pointer-events: none; }
.cs-pad-name { position: absolute; left: 14px; bottom: 5px; pointer-events: none; }
.cs-pad-clear { position: absolute; right: 12px; bottom: 3px; }
.cs-shares input.table-input { width: 110px; text-align: right; }

/* 3.4b: Charge Slips — the photo of the person signing on a device (camera only) */
.cs-cam { position: relative; height: 220px; border-radius: 10px; background: var(--ink); overflow: hidden; display: flex; align-items: center; justify-content: center; border: 2px solid transparent; }
.cs-cam.missing { border-color: var(--danger); }
.cs-cam-video, .cs-cam-shot { width: 100%; height: 100%; object-fit: cover; }
.cs-cam-live { position: absolute; right: 10px; top: 8px; color: var(--on-accent); background: var(--danger); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.cs-cam.taken .cs-cam-live { display: none; }
.cs-cam-off { color: var(--on-accent); padding: 0 18px; text-align: center; }
.cs-cam-actions { display: flex; gap: 8px; margin-top: 8px; }

/* 1.63: counting in piles (Count This Delivery) — the total beside the box, the reason under it, each person's piles */
.dc-total { display: inline-block; min-width: 48px; margin-left: 6px; text-align: left; font-weight: 700; font-size: 16px; color: var(--select-text); font-variant-numeric: tabular-nums; }
.dc-total:empty { display: none; }
.dc-step .dc_qty { width: 110px; }
.dc_qty.dc-typing { border-color: var(--amber); }
.dc-rowmsg { font-size: 12px; color: var(--danger-text); margin-top: 3px; white-space: normal; text-align: right; }
.dc-pilenote { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; white-space: normal; }
/* 1.63: Ready for Dispatch — when each order was due */
.badge.d-due-today { background: var(--info-wash); color: var(--info-text); }
.badge.d-due-early { background: var(--warn-wash); color: var(--accent-text); border: 1px solid var(--amber); }
.badge.d-due-late { background: var(--danger-soft); color: var(--danger-text); }
.d-chips { display: flex; flex-wrap: wrap; gap: 4px; }
/* ---------- 1.64: items Dispatch adds on the DR (Create a New DR, the supplier chips) ---------- */
.badge.supplier { background: var(--warn-wash); color: var(--accent-text); }
button.badge.d-supplier-chip { border: 1px solid var(--amber); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
button.badge.d-supplier-chip:hover, button.badge.d-supplier-chip:focus-visible { background: var(--accent-hover); outline: none; }
.sg-how { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.sg-how label { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 400; font-size: 13px; }
.sg-scroll { overflow-x: auto; border-radius: 10px; max-width: 100%; }
.sg-grid { width: auto; min-width: 100%; }
.sg-grid th, .sg-grid td { padding: 6px; }
.sg-grid .sg-prod { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; box-shadow: 1px 0 0 var(--line); }
.sg-grid thead .sg-prod { background: var(--surface-alt); }
.sg-grid .table-input.sg-in { width: 52px; text-align: right; padding: 4px 6px; }
.sg-grid td.sg-off { color: var(--line-stronger); background: var(--surface-muted); }
.sg-grid .sg-sent { font-size: 10.5px; color: var(--muted); white-space: nowrap; margin-top: 2px; }
.sg-grid tr.g-cat td { background: var(--surface-muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sg-grid tr.sg-own td, .sg-grid tr.sg-own td.sg-prod { background: var(--select-wash); border-top: 2px solid var(--line-strong); }
.sg-flag { display: inline-block; min-width: 14px; border-radius: 999px; background: var(--warn-wash); color: var(--accent-text); font-size: 10px; text-align: center; }

/* ---------- 0.19e: Monthly Contributions pop-up; the Hired On / Last Day columns ---------- */
.ct-months { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.ct-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 40px; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.ct-row input { padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; font-family: inherit; min-width: 0; }
.ct-n { font-family: var(--font-heading); font-weight: 700; font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.ct-warn .link-btn { margin-left: 4px; }
.ct-who { margin-top: 8px; max-height: 240px; overflow-y: auto; }
.ct-who th, .ct-who td { padding: 6px 8px; }
td.emp-when { white-space: nowrap; }

/* ---------- 0.19f: Add Employee "Not sure yet", Weekly Patterns fill ---------- */
.ds-later { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 600; padding: 10px 12px; margin: 0 0 12px;
  border: 1px solid var(--select-line); background: var(--select-wash); border-radius: 8px; cursor: pointer; }
.ds-later input { width: 16px; height: 16px; margin-top: 1px; flex-shrink: 0; }
.ds-later .small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
#f_dsLaterBox[hidden], #f_dsFields[hidden] { display: none; }
.pt-tick { width: 30px; text-align: center !important; padding-left: 4px !important; }
.pt-tick input { width: 16px; height: 16px; }
.pt-fill { white-space: nowrap; }
.pt-fill .btn { padding: 4px 9px; font-size: 12px; }
#cpTable tr.pt-on > td { background: var(--select-wash); }
#cpTable tr.pt-copyrow > td { background: var(--select-wash); text-align: left; padding: 8px 10px; }
.pt-src { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pt-src .table-input { width: auto; padding: 4px 8px; font-size: 12px; }
/* 0.19h: Default Schedules typed in a grid */
#dsgTable td.dsg-name { min-width: 190px; white-space: nowrap; }
#dsgTable .cg-in.table-input { width: 76px; }
#dsgTable td.ds-span { text-align: left; padding-left: 10px; }
#dsgTable .cp-note { white-space: nowrap; }

/* 1.65: Create a New DR — the For box and the one-branch list */
.sg-for { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sg-for label { margin: 0; font-weight: 700; }
.sg-for select { width: auto; min-width: 260px; max-width: 100%; }
.sg-for select.sg-picked { border-color: var(--select-fill); box-shadow: 0 0 0 1px var(--select-fill); font-weight: 600; }
.sg-grid.sg-one { width: 100%; min-width: 0; }
.sg-grid.sg-one .table-input.sg-in { width: 72px; }
.sg-grid.sg-one .sg-sub { display: none; }
/* ---------- 1.66: Products tick boxes, grouped File ▾, the Dizlog / UTAK export pop-ups ---------- */
th.tick-col, td.tick-col { width: 34px; padding-right: 0; text-align: center; }
.tick-col input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--select-fill); cursor: pointer; }
#prodTable tr.ticked > td { background: var(--select-wash); }
.tick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; background: var(--select-wash); border: 1px solid var(--select-line);
  border-radius: 8px; padding: 8px 12px; margin: 0 0 8px; font-size: 13px; }
.tick-bar .link-btn { font-weight: 600; }
#prodTickBar[hidden], .tick-bar .link-btn[hidden], .menu-item[hidden], .menu-sub[hidden] { display: none; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-sub { margin: 0 0 4px 8px; padding-left: 8px; border-left: 2px solid var(--select-line); }
.menu-group .menu-item-label { font-size: 13.5px; }
/* 0.19k: Employees → File ▾ labels and the export pop-up's review list. */
.menu-sub-label { font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 2px; }
.ee-opt > span { display: block; }
#eeWarn { margin-top: 12px; }
.ee-head { font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); margin: 10px 0 6px; }
.ee-review { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.ee-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ee-row:last-child { border-bottom: none; }
.ee-hidden { background: var(--warn-wash); color: var(--accent-text); white-space: nowrap; }
.pos-opt { display: grid; grid-template-columns: 20px 1fr; gap: 2px 8px; align-items: start; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px; background: var(--surface); cursor: pointer; }
.pos-opt.on { border-color: var(--select-line); background: var(--select-wash); }
.pos-opt input { margin-top: 3px; width: auto; accent-color: var(--select-fill); }
.pos-opt-title { font-weight: 700; font-size: 14px; }
.pos-opt-sub { grid-column: 2; }
.pos-opt:has(input:disabled) { opacity: 0.6; cursor: default; }
.pos-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.pos-tiles > div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); font-size: 12px; color: var(--muted); }
.pos-tiles b { display: block; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pos-file-ok { color: var(--ok-text); background: var(--ok-wash); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
#posUtSum[hidden], #posDizBranchField[hidden], #posUtFileOk[hidden], #posDizSee[hidden], #posUtSee[hidden], .pos-main[hidden] { display: none; }
.pos-table-wrap { overflow-x: auto; max-height: 55vh; overflow-y: auto; }
.pos-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.pos-seg-btn { border: none; background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 12px; cursor: pointer; }
.pos-seg-btn.on { background: var(--select-fill); color: var(--on-select-fill); }
.pos-chg-table td, .pos-chg-table th, #posPendingTable td, #posPendingTable th { font-size: 13px; }
#posPendingTable td:nth-child(3), #posPendingTable td:nth-child(4) { white-space: nowrap; }

/* 3.8a Discrepancies */
.dc-note { background: var(--surface-alt); border-radius: 8px; padding: 8px 10px; margin: 8px 0; color: var(--muted); }
.dc-notes { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; margin: 8px 0; font-size: 13px; }
.dc-notes > div + div { margin-top: 6px; }
.dc-corr { font-size: 13px; }
.ds-store.table-input { width: 72px; padding: 3px 6px; text-transform: uppercase; }

/* Batch 1.69: the date filter's quick picks and month / year boxes. */
.drange-panel { width: 290px; max-width: calc(100vw - 32px); box-sizing: border-box; max-height: calc(100vh - 16px); overflow-y: auto; }
.drange-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.drange-quick .tab-btn { padding: 4px 10px; font-size: 12px; }
.drange-month, .drange-year { flex: 1; min-width: 0; width: auto; margin: 0 4px; padding: 6px 8px; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
/* Batch 1.69: Previous / Next under a long list, and a loading message that stays until the list is ready. */
.list-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.list-pager[hidden] { display: none; }
.list-pager-btns { display: flex; align-items: center; gap: 10px; }
.list-pager .btn:disabled { opacity: .5; cursor: default; }
.list-loading { display: flex; align-items: center; gap: 10px; padding: 16px 4px; margin: 0; }
.list-spin { width: 16px; height: 16px; flex: none; border: 2px solid var(--line); border-top-color: var(--select-fill); border-radius: 50%; animation: list-spin 1s linear infinite; }
@keyframes list-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .list-spin { animation: none; } }
/* Batch 1.71: Try Again, Saving…, Show All. */
.list-failed { padding: 16px 4px; }
/* Batch 1.72: the update message. */
.update-box { position: fixed; right: 20px; bottom: 20px; width: 420px; max-width: calc(100vw - 24px); box-sizing: border-box; z-index: 40; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--select-fill); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
.update-box .small { margin-top: 3px; }
.update-box .btn { flex: none; }
@media print { .update-box { display: none; } }
.list-pager-all[hidden], .list-pager-prev[hidden], .list-pager-next[hidden] { display: none; }
.btn.is-busy:disabled { opacity: .85; cursor: progress; }
.btn-spin { display: inline-block; width: 12px; height: 12px; margin-right: 7px; vertical-align: -2px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: list-spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .btn-spin { animation: none; } }
@media (max-width: 720px) {
  .dc-step .dc_qty { width: 84px; }
  .dc-total { display: block; margin: 2px 0 0; text-align: right; }
  .dc-total:empty { display: none; }
  .sg-for select { min-width: 0; width: 100%; }
  .sg-grid.sg-one .sg-srp, .sg-grid.sg-one .sg-today { display: none; }
  .sg-grid.sg-one .sg-sub:not(:empty) { display: block; margin-top: 2px; }
  .sg-grid.sg-one .table-input.sg-in { width: 76px; min-height: var(--tap); font-size: 16px; text-align: right; }
}
/* ---------- Batch 1.56b-2: Brand / Quantity / Unit, the made SKU, the size warning ---------- */
.pm-info { display: grid; grid-template-columns: 1.4fr 0.8fr 1.2fr; gap: 0 10px; }
.pm-info > .field { min-width: 0; }
.sku-made { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sku-val { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; font-weight: 600; padding: 8px 10px; border: 1px dashed var(--line-stronger); border-radius: 7px; background: var(--surface-muted); }
.size-warn { background: var(--accent-wash); border: 1px solid var(--amber); color: var(--accent-ink); border-radius: 8px; padding: 8px 12px; font-size: 13px; line-height: 1.45; margin: 0 0 12px; }
.size-warn[hidden] { display: none; }
.field input.warn-box { border-color: var(--amber); background: var(--accent-wash); }
.sku-kv { width: auto; border: none; }
.sku-kv th { background: none; border: none; width: 60px; }
.sku-kv td { border: none; font-family: ui-monospace, Menlo, Consolas, monospace; }
#prodTable td.prod-qty { text-align: right; }

@media (max-width: 720px) {
  .pm-info { grid-template-columns: 1fr 1fr; }
  .pm-info > .field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  /* 1.71: the date picker opens in the middle of the screen, over the bottom tabs, whole. */
  .drange-panel { position: fixed; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); width: auto; max-width: none; max-height: calc(100dvh - 32px); z-index: 70; box-shadow: 0 0 0 100vmax var(--scrim); }
  .drange-month { flex: 1.4; padding: 6px 4px; }
}
@media (max-width: 720px) {
  .update-box { left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; }
}
/* 1.74 Products Changelog + scheduled changes */
.badge.ct-price { background: var(--ct-price-bg); color: var(--ct-price-ink); }
.badge.ct-rename { background: var(--ct-rename-bg); color: var(--ct-rename-ink); }
.badge.ct-category { background: var(--ct-category-bg); color: var(--ct-category-ink); }
.badge.ct-redesign { background: var(--ct-redesign-bg); color: var(--ct-redesign-ink); }
.badge.ct-grab { background: var(--ct-grab-bg); color: var(--ct-grab-ink); }
.badge.ct-new { background: var(--ct-new-bg); color: var(--ct-new-ink); }
.badge.ct-grey { background: var(--ct-grey-bg); color: var(--ct-grey-ink); }
.badge.ct-dark { background: var(--ct-dark-bg); color: var(--ct-dark-ink); }
.badge[class*="ct-"] { white-space: nowrap; }
.pc-val { max-width: 280px; overflow-wrap: anywhere; }
.pc-fields { overflow-x: auto; }
.pc-fields-table .pc-val { max-width: none; white-space: pre-line; }
.pm-wait { color: var(--accent-text); }
/* 1.74a: a table's header row stays on screen while the page or pop-up scrolls. Computers only; phones show cards.
   :where keeps this weaker than a page's own sticky rule (the Roles grid). */
@media screen and (min-width: 721px) {
  :where(.page-content, .modal-box) table:not(.no-freeze) > thead th {
    position: sticky; top: 0; z-index: 3; box-shadow: inset 0 -1px 0 var(--line);
  }
  /* 1.88: in a pop-up the header sticks to the pop-up's very top edge (over its 24px padding), so rows scrolling up don't show
     above it; a table in its own scroll box (no padding) keeps top: 0. */
  :where(.modal-box) table:not(.no-freeze) > thead th { top: -24px; }
  :where(.modal-box) :where(.table-scroll, .sh-scroll, .su-scroll, .mx-scroll, .sg-scroll, .cat-edit-box) table:not(.no-freeze) > thead th { top: 0; }
  /* A table that scrolls sideways scrolls down in its own box too, or its header could not stay. */
  .table-scroll, .sh-scroll, .su-scroll, .mx-scroll, .sg-scroll { overflow: auto; max-height: calc(100vh - 150px); }
}

/* 1.75a: Edit Categories, the import's tags */
.cat-note { background: var(--warn-wash); color: var(--accent-ink); border-radius: 6px; padding: 10px 12px; margin: 0 0 12px; line-height: 1.45; }
.cat-tag { display: inline-block; background: var(--warn-wash); color: var(--accent-text); border-radius: 10px; font-size: 11px; font-weight: 600; padding: 1px 7px; white-space: nowrap; }
.cat-edit-box { max-height: calc(100vh - 300px); overflow: auto; }
.cat-edit td { vertical-align: middle; }
.cat-edit .cat-row-sub td:first-child { padding-left: 24px; }
.cat-edit .cat-row-cat { background: var(--surface-2, transparent); }
.cat-edit .cat-name { min-width: 150px; max-width: 240px; }
.cat-edit .cat-code { width: 90px; text-transform: uppercase; }
.cat-edit .cat-num { text-align: right; font-variant-numeric: tabular-nums; }
.cat-edit .table-input.kr-changed { font-weight: 600; }
.cat-lock { display: inline-block; margin-left: 4px; font-size: 11px; color: var(--muted, inherit); cursor: help; }
.cat-move { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; }

/* 1.75b: POS and Grab Tasks. Dizlog orange, UTAK teal, same soft look in both themes. */
.pos-tag { display: inline-block; border-radius: 10px; font-size: 11px; font-weight: 600; padding: 1px 8px; white-space: nowrap; }
.pos-tag.diz { background: var(--pos-diz-bg); color: var(--pos-diz-ink); }
.pos-tag.ut { background: var(--pos-ut-bg); color: var(--pos-ut-ink); }
.task-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.task-chip { display: inline-block; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 11px; padding: 1px 7px; white-space: nowrap; }
.task-chip.on { background: var(--ct-new-bg); color: var(--ct-new-ink); border-color: transparent; }
.task-chip.late { border-color: var(--danger); color: var(--danger); }
.task-late { color: var(--danger); font-weight: 600; }
.pair-tag { background: var(--ct-grey-bg); color: var(--ct-grey-ink); }
.pm-ticks .field { margin-bottom: 6px; }
.prod-tags { white-space: nowrap; }

@media (max-width: 720px) {
  .list-pager-btns { width: 100%; justify-content: space-between; }
  .list-pager .btn { min-height: 44px; }
}

/* 1.78 Product Menu */
.pm-c-breads { --pm-band: var(--menu-breads-band); --pm-band-ink: var(--menu-breads-band-ink); --pm-sub: var(--menu-breads-sub); --pm-sub-ink: var(--menu-breads-sub-ink); --pm-head: var(--menu-breads-head); --pm-head-ink: var(--menu-breads-head-ink); --pm-wash: var(--menu-breads-wash); }
.pm-c-pastries { --pm-band: var(--menu-pastries-band); --pm-band-ink: var(--menu-pastries-band-ink); --pm-sub: var(--menu-pastries-sub); --pm-sub-ink: var(--menu-pastries-sub-ink); --pm-head: var(--menu-pastries-head); --pm-head-ink: var(--menu-pastries-head-ink); --pm-wash: var(--menu-pastries-wash); }
.pm-c-cakes { --pm-band: var(--menu-cakes-band); --pm-band-ink: var(--menu-cakes-band-ink); --pm-sub: var(--menu-cakes-sub); --pm-sub-ink: var(--menu-cakes-sub-ink); --pm-head: var(--menu-cakes-head); --pm-head-ink: var(--menu-cakes-head-ink); --pm-wash: var(--menu-cakes-wash); }
.pm-c-bundle { --pm-band: var(--menu-bundle-band); --pm-band-ink: var(--menu-bundle-band-ink); --pm-sub: var(--menu-bundle-sub); --pm-sub-ink: var(--menu-bundle-sub-ink); --pm-head: var(--menu-bundle-head); --pm-head-ink: var(--menu-bundle-head-ink); --pm-wash: var(--menu-bundle-wash); }
.pm-c-others { --pm-band: var(--menu-others-band); --pm-band-ink: var(--menu-others-band-ink); --pm-sub: var(--menu-others-sub); --pm-sub-ink: var(--menu-others-sub-ink); --pm-head: var(--menu-others-head); --pm-head-ink: var(--menu-others-head-ink); --pm-wash: var(--menu-others-wash); }
.pm-c-packaging { --pm-band: var(--menu-packaging-band); --pm-band-ink: var(--menu-packaging-band-ink); --pm-sub: var(--menu-packaging-sub); --pm-sub-ink: var(--menu-packaging-sub-ink); --pm-head: var(--menu-packaging-head); --pm-head-ink: var(--menu-packaging-head-ink); --pm-wash: var(--menu-packaging-wash); }
.pm-c-promo { --pm-band: var(--menu-promo-band); --pm-band-ink: var(--menu-promo-band-ink); --pm-sub: var(--menu-promo-sub); --pm-sub-ink: var(--menu-promo-sub-ink); --pm-head: var(--menu-promo-head); --pm-head-ink: var(--menu-promo-head-ink); --pm-wash: var(--menu-promo-wash); }
.pm-c-rawmats { --pm-band: var(--menu-rawmats-band); --pm-band-ink: var(--menu-rawmats-band-ink); --pm-sub: var(--menu-rawmats-sub); --pm-sub-ink: var(--menu-rawmats-sub-ink); --pm-head: var(--menu-rawmats-head); --pm-head-ink: var(--menu-rawmats-head-ink); --pm-wash: var(--menu-rawmats-wash); }
.pm-c-nonfood { --pm-band: var(--menu-nonfood-band); --pm-band-ink: var(--menu-nonfood-band-ink); --pm-sub: var(--menu-nonfood-sub); --pm-sub-ink: var(--menu-nonfood-sub-ink); --pm-head: var(--menu-nonfood-head); --pm-head-ink: var(--menu-nonfood-head-ink); --pm-wash: var(--menu-nonfood-wash); }
.pm-c-other { --pm-band: var(--menu-other-band); --pm-band-ink: var(--menu-other-band-ink); --pm-sub: var(--menu-other-sub); --pm-sub-ink: var(--menu-other-sub-ink); --pm-head: var(--menu-other-head); --pm-head-ink: var(--menu-other-head-ink); --pm-wash: var(--menu-other-wash); }
.pm-c-k1 { --pm-band: var(--menu-k1-band); --pm-band-ink: var(--menu-k1-band-ink); --pm-sub: var(--menu-k1-sub); --pm-sub-ink: var(--menu-k1-sub-ink); --pm-head: var(--menu-k1-head); --pm-head-ink: var(--menu-k1-head-ink); --pm-wash: var(--menu-k1-wash); }
.pm-c-k2 { --pm-band: var(--menu-k2-band); --pm-band-ink: var(--menu-k2-band-ink); --pm-sub: var(--menu-k2-sub); --pm-sub-ink: var(--menu-k2-sub-ink); --pm-head: var(--menu-k2-head); --pm-head-ink: var(--menu-k2-head-ink); --pm-wash: var(--menu-k2-wash); }
.pm-c-k3 { --pm-band: var(--menu-k3-band); --pm-band-ink: var(--menu-k3-band-ink); --pm-sub: var(--menu-k3-sub); --pm-sub-ink: var(--menu-k3-sub-ink); --pm-head: var(--menu-k3-head); --pm-head-ink: var(--menu-k3-head-ink); --pm-wash: var(--menu-k3-wash); }
.pm-c-k4 { --pm-band: var(--menu-k4-band); --pm-band-ink: var(--menu-k4-band-ink); --pm-sub: var(--menu-k4-sub); --pm-sub-ink: var(--menu-k4-sub-ink); --pm-head: var(--menu-k4-head); --pm-head-ink: var(--menu-k4-head-ink); --pm-wash: var(--menu-k4-wash); }
.pm-c-kcafe { --pm-band: var(--menu-k3-band); --pm-band-ink: var(--menu-k3-band-ink); --pm-sub: var(--menu-k3-sub); --pm-sub-ink: var(--menu-k3-sub-ink); --pm-head: var(--menu-k3-head); --pm-head-ink: var(--menu-k3-head-ink); --pm-wash: var(--menu-k3-wash); }
.pm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pm-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pm-cat { margin: 0 0 18px; }
.pm-cat-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 14px; border-radius: 10px 10px 0 0; font-family: var(--font-heading); font-weight: 700; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; background: var(--pm-band); color: var(--pm-band-ink); }
.pm-cat-n { font-family: var(--font); font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; opacity: .8; }
.pm-tiers { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; font-family: var(--font); text-transform: none; letter-spacing: 0; }
.pm-tb { padding: 4px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; min-height: 30px; }
.pm-tb.on { background: var(--select-fill); border-color: var(--select-fill); color: var(--on-select-fill); }
.pm-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; padding: 12px; background: var(--pm-wash); border-radius: 0 0 10px 10px; }
.pm-cols.pm-n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pm-cols.pm-n1 { grid-template-columns: minmax(0, 1fr); }
.pm-cols.pm-wide { display: block; }
.pm-cols.pm-wide .pm-card + .pm-card { margin-top: 14px; }
.pm-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pm-sub { background: var(--pm-sub); color: var(--pm-sub-ink); font-weight: 700; font-size: 13px; padding: 6px 10px; border-radius: 8px 8px 0 0; }
.pm-sub.pm-sub-plain { background: var(--menu-k2-sub); color: var(--menu-k2-sub-ink); }
.pm-n { font-weight: 600; font-size: 11px; opacity: .75; margin-left: 4px; }
table.pm-table { table-layout: fixed; width: 100%; border-radius: 0 0 8px 8px; }
table.pm-table th, table.pm-table td { padding: 5px 10px; font-size: 13px; }
table.pm-table th { font-size: 10.5px; background: var(--pm-head); color: var(--pm-head-ink); }
col.pm-skucol { width: 38%; }
col.pm-pricecol { width: 56px; }
col.pm-pricecol.pm-money { width: 88px; }
td.pm-name { overflow-wrap: anywhere; }
td.pm-sku { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; padding-left: 6px; padding-right: 6px; }
th.pm-skuh { padding-left: 6px; }
td.pm-price { white-space: nowrap; }
tr.pm-chg td { background: var(--accent-wash); }
.pm-was { display: block; font-size: 11px; color: var(--muted); }
.pm-when { font-size: 10.5px; background: var(--warn-wash); color: var(--accent-text); border-radius: 8px; padding: 0 6px; white-space: nowrap; }
s.pm-old { color: var(--muted); font-size: 12px; }
.pm-scroll { overflow-x: auto; }
table.pm-alltab { min-width: 560px; }
table.pm-alltab th.pm-tname { width: 26%; vertical-align: bottom; }
table.pm-alltab th.pm-tg { background: var(--pm-band); color: var(--pm-band-ink); text-align: center; font-size: 11.5px; }
table.pm-alltab th.pm-tsub { font-size: 10px; }
table.pm-alltab td.pm-tl { border-left: 2px solid var(--line); }
td.pm-dash { color: var(--line-stronger); }
.pm-chk { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; font-size: 14px !important; margin: 3px 0; }
.pm-chk input { width: auto !important; margin: 0; }
.pm-chkgrid { display: grid; grid-template-columns: 1fr 1fr; padding-left: 22px; }
.pm-all { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
/* ---------- 1.80: toolbar dropdowns look like the search box beside them (owner, 2026-11-08) ---------- */
.filter-bar > select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; background: var(--surface); color: var(--ink); width: auto; min-width: 140px; }
.tab-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--danger); color: var(--on-accent); font-size: 11px; line-height: 18px; text-align: center; }
.tab-btn.needs { border-color: var(--amber); background: var(--accent-wash); font-weight: 700; }   /* 6.16: a tab with work for you */
.tab-btn.needs.active { background: var(--select-fill); border-color: var(--amber); color: var(--on-select-fill); }
.flash-here { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; transition: outline-color 0.3s; }   /* 6.16: opened at the part to act on */
.signoff-box { border: 2px solid var(--amber); border-radius: 10px; padding: 12px 14px; background: var(--accent-wash); margin: 10px 0; }   /* 6.16: a sign-off waiting on this record */
/* 6.16: employee profile tabs open view-only (lib/view-first.js) */
.vf-head { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 8px; }
.edit-flag { font-size: 12px; font-weight: 700; color: var(--select-text); }
.vf-view input:disabled, .vf-view select:disabled, .vf-view textarea:disabled { border-color: transparent; background: transparent; color: var(--ink); -webkit-text-fill-color: var(--ink); opacity: 1; appearance: none; -webkit-appearance: none; resize: none; padding-left: 0; cursor: default; }
.vf-view input[type=checkbox]:disabled { appearance: auto; -webkit-appearance: checkbox; }
.vf-editing { outline: 2px solid var(--select-line); outline-offset: 6px; border-radius: 8px; }
.vfCancel { margin-right: 8px; }
tr.cf-skip td, tr.cf-off td { color: var(--muted); background: var(--surface-muted); }   /* 0.20: the fill preview */
tr.cf-off td:not(:first-child) { text-decoration: line-through; }
.msel-more { border-top: 1px solid var(--line); margin-top: 4px; padding: 6px 8px 2px; }   /* 6.16: "Show closed branches" */

/* ---------- 1.80: Change Requests (Product Menu) ---------- */
.cr-modal .field { margin-bottom: 10px; }
.cr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cr-two > .cr-full, .cr-two > .field.cr-full { grid-column: 1 / -1; }
.cr-two > [hidden], .cr-mixlist[hidden], .cr-fpanel[hidden], .cr-cal[hidden] { display: none; }
.cr-hint { margin: 3px 0 0; }
.cr-chk { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; line-height: 1.3; cursor: pointer; }
.cr-chk input { width: auto; }
.cr-strong { font-weight: 600; }
.cr-opts { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.cr-off { opacity: 0.5; }
.cr-mixlist { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0 22px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.cr-mixlist .cr-chk { font-size: 13px; }
.cr-selall { flex-basis: 100%; font-size: 12px; }
.cr-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; min-height: var(--tap); }
.cr-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cr-switch .trk { display: block; width: 40px; height: 22px; border-radius: 11px; background: var(--line-strong); position: relative; flex: none; transition: background 0.15s; }
.cr-switch .trk::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: left 0.15s; }
.cr-switch input:checked + .trk { background: var(--ok); }
.cr-switch input:checked + .trk::after { left: 21px; }
.cr-switch input:focus-visible + .trk { outline: 2px solid var(--select-line); outline-offset: 2px; }
.cr-grab-row { display: grid; grid-template-columns: 80px 1fr; gap: 10px; align-items: start; }
.cr-modal input:disabled, .cr-modal select:disabled, .cr-modal textarea:disabled, .cr-modal .table-input:disabled { background: var(--line); color: var(--muted); border-color: var(--line-strong); cursor: not-allowed; }
.cr-sugg { font-style: italic; }
.cr-rows { width: 100%; }
.cr-rows .table-input { width: 100%; min-width: 70px; }
.cr-c { text-align: center; width: 56px; }
.cr-when { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-alt); margin-top: 6px; }
.cr-when-head { font-weight: 700; }
.cr-datebtn { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: var(--tap); border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; background: var(--surface); font: inherit; font-size: 14px; cursor: pointer; text-align: left; margin-top: 6px; }
.cr-cal { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); max-width: 100%; }
.cr-cal table { border-collapse: collapse; width: auto; border: 0; }
.cr-cal th, .cr-cal td { border: 0; background: none; padding: 1px; text-align: center; font-size: 11px; color: var(--muted); text-transform: none; }
.cr-cal caption { font-weight: 700; font-size: 13px; padding-bottom: 4px; color: var(--ink); }
.cr-cal td button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.cr-cal td button:disabled { color: var(--line-stronger); cursor: not-allowed; }
.cr-cal td button.ok { background: var(--accent-wash); font-weight: 700; }
.cr-cal td button.sel { background: var(--select-fill); color: var(--on-select-fill); }
.cr-cal td button.today { outline: 1px solid var(--line-strong); }
.cr-cal-legend { flex-basis: 100%; font-size: 11px; color: var(--muted); }
.cr-lblrow { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.cr-lblrow label { margin: 0; }
.cr-fbtn { font-size: 12px; padding: 3px 10px; min-height: 0; }
.cr-fbtn.on { background: var(--info-wash); color: var(--info-text); border-color: var(--info-text); }
.cr-fpanel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px 0; margin-bottom: 6px; }
.cr-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; margin: 0 0 10px; }
.cr-from { font-weight: 400; font-size: 11px; color: var(--info-text); background: var(--info-wash); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.cr-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 8px; }
.cr-files { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-phs { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 8px; }
.cr-phs[hidden] { display: none; }
.cr-ph { border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface); }
.cr-ph img, .cr-ph-file { display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 8px; object-fit: cover; background: var(--surface-muted); }
.cr-ph-bar { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 4px; }
.cr-ph-rm { color: var(--danger-text); }
.cr-ph-wait { background: var(--surface-muted); }
.cr-ph-new { font-size: 11px; }
.cr-add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 12px; }
.cr-photo-msg { margin: 4px 0 0; }
.cr-history { margin: 8px 0; }
.cr-history ul { margin: 6px 0 0; padding-left: 18px; }
.cr-cards { display: grid; gap: 8px; }
.cr-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); display: grid; gap: 4px; }
.cr-card-top { display: flex; justify-content: space-between; align-items: center; }
.cr-remarks { background: var(--accent-wash); border-radius: 6px; padding: 4px 8px; }
.old-design-tag { margin-left: 4px; }
.old-design-done { margin-top: 4px; }
/* 1.82: Correct Dispatched Counts for the whole DR — a heading per part, the goods' reason row */
.dc-sec { font-weight: 700; font-size: 13px; margin: 16px 0 6px; padding: 6px 10px; background: var(--surface-muted); border-radius: 6px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dc-sec .muted { font-weight: 400; }
.ddc_why[hidden], .ddc_note[hidden] { display: none !important; }
/* ---------- 2.1: Inventory Management (Warehouse Stock, Counts, Suppliers) ---------- */
.ws-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ws-actions [hidden], #wsRecountTickedBtn[hidden], .as-add .combo[hidden], .sc-row [hidden] { display: none; }
.ws-neg { color: var(--danger-text); font-weight: 700; }
.ws-pos { color: var(--ok-text); font-weight: 700; }
.ws-amber { color: var(--accent-text); }
.ws-break { font-weight: 400; color: var(--muted); }
.ws-h-sub { font-family: var(--font); font-weight: 400; }
.ws-nums { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 12px; }
.ws-num-v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ws-moves td { vertical-align: top; }
.su-boxes { display: inline-flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.su-unit { white-space: nowrap; }
.su-box { text-align: right; }
.as-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.as-grid > .as-full { grid-column: 1 / -1; }
.as-grid > [hidden] { display: none; }
.as-ns { margin-top: 12px; gap: 4px 16px; }
.as-cost { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.as-lines td { vertical-align: top; }
.as-rc-row { display: flex; gap: 10px 16px; flex-wrap: wrap; margin-top: 8px; align-items: flex-end; }
.as-rc-row label[hidden] { display: none; }
.as-add { margin-top: 6px; }
.as-add .combo { max-width: 420px; margin-top: 6px; }
.as-opt-name { font-weight: 600; }
.sr-pick { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sr-pick .sr-note[hidden] { display: none; }
.ss-head { font-weight: 700; margin-bottom: 10px; }
.ss-track { margin-bottom: 12px; }
.ss-row { display: flex; gap: 6px; align-items: center; }
.ss-row select, .ss-row input[type=text]:first-child { flex: 1; }
#pm_stockPart .as-grid { grid-template-columns: 1fr; }   /* 2.1: Edit Product is a narrow pop-up — one column */
.cnt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cnt-head .page-title { margin-bottom: 2px; }
.cnt-sub { margin: 0; }
.cnt-progress { margin: 14px 0 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cnt-bar { flex: 1; min-width: 160px; max-width: 420px; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.cnt-bar > div { height: 100%; background: var(--select-fill); border-radius: 4px; }
.cnt-bar.sm { flex: none; width: 140px; min-width: 0; height: 6px; margin-top: 4px; }
tr.cnt-grp td { background: var(--surface-muted); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.cnt-tiles { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.cnt-tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; min-width: 130px; background: var(--surface); }
.cnt-tile-n { font-size: 22px; font-weight: 700; }
.cnt-finish { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.cnt-finish-gap { flex: 1; }
.sc-head { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.sc-row { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: 14px; font-weight: 400; cursor: pointer; }
.sc-row input { width: auto; margin-top: 3px; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 4px 26px; }
.sc-chip { padding: 4px 12px; font-size: 13px; }
.sup-history { margin: 0; padding-left: 18px; }
.sa-actions { flex-wrap: wrap; }

@media (max-width: 720px) {
  .cr-two, .cr-fpanel { grid-template-columns: 1fr; }
  .filter-bar > select { flex: 1 1 auto; font-size: 16px; }   /* iPhones zoom in on smaller text in a field */
}

@media (max-width: 720px) {
  .pm-cat-head { font-size: 14px; padding: 8px 10px; }
  .pm-tiers { margin-left: 0; }
  .pm-cols { padding: 8px; }
  .pm-chkgrid { grid-template-columns: 1fr; }
}

/* 2.1: Inventory Management on a phone */
@media (max-width: 720px) {
  .as-grid, .as-ns { grid-template-columns: 1fr; }
  .as-cost { justify-content: flex-start; }
  .ws-nums { gap: 14px 22px; }
  .cnt-head .ws-actions { width: 100%; }
  .cnt-head .ws-actions .btn { flex: 1 1 auto; }
  .su-box { font-size: 16px; }
  .sc-chips { margin-left: 0; }
}

/* 1.86: the whole DR — every order as a section; the clicked order outlined; "Show counts" swaps in the full counts. */
.do-sec { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.do-sec.hl { border: 2px solid var(--amber); box-shadow: 0 0 0 4px var(--accent-wash); }
.do-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 4px; }
.do-head strong { font-size: 15px; }
.do-meta { font-size: 12px; color: var(--muted); }
.do-tier { font-weight: 700; color: var(--ink); }
.link-btn.do-small { font-size: 12px; color: var(--muted); text-decoration: underline; }
.do-t { table-layout: fixed; width: 100%; }
.do-t td.num { white-space: nowrap; }
.do-nc { white-space: normal; font-size: 12px; line-height: 1.25; display: inline-block; }
.do-sec tr.g-diff td { background: var(--accent-wash); }
.do-sub td { font-size: 12px; color: var(--muted); background: var(--surface-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
#dr_sections .do-t-detail { display: none; }
#dr_sections.do-counts .do-t-detail { display: table; }
#dr_sections.do-counts .do-t-main { display: none; }
.cc-steps { display: flex; flex-direction: column; gap: 6px; }
.cc-steps .menu-item { border: 1px solid var(--line); border-radius: 8px; }
/* 1.88: the two password boxes differ — a red line under the second box (no longer a rule on the list) */
.pw-mismatch { margin-top: 4px; min-height: 0; }
#pwCurrentBox[hidden] { display: none; }

@media (max-width: 720px) {
  #dr_sections.do-counts .do-t-detail { display: block; }
  .do-t td:first-child { overflow-wrap: anywhere; }
  /* the Times box fits a phone too (nothing scrolls sideways on the DR) */
  #modalBox #dr_times table { table-layout: fixed; width: 100%; font-size: 12px; }
  #modalBox #dr_times th, #modalBox #dr_times td { padding: 4px; white-space: normal; overflow-wrap: anywhere; }
}
/* 1.86: receiving one DR — All Arrived as Listed per order section; the last check shown over the count */
.rcv-allhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 4px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rcv-allhead .btn.done { border-color: var(--ok); color: var(--ok-text); }
.rv-under { display: none !important; }
#rv_last .branch-confirm { margin-bottom: 12px; }
/* 1.88: Needs a Count Correction — the asks on a case / a DR, the store's Counts to Check, Not Ready Yet per printed DR */
.count-asks { margin: 0 0 12px; }
.count-asks .count-ask { margin: 8px 0 0; }
.ask-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.count-ask .ask-actions { justify-content: flex-start; }
.rv-asks { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 8px; background: var(--surface); }
.d-onDr { display: inline; }
#rv_absentBox[hidden], .to-why.hidden, .to-whyOther.hidden { display: none !important; }
/* 1.90: numbers on tabs — a bit of room after the word; the picked tab's number keeps the red with a thin white ring */
.tab-btn .nav-badge, .tab-btn .tab-count { margin-left: 7px; }
.tab-btn.active .nav-badge, .tab-btn.active .tab-count { border: 1px solid var(--on-accent); padding-top: 0; padding-bottom: 0; }
.tab-btn.active .tab-count { line-height: 16px; }
/* 1.90: My Deliveries — one card per DR, big buttons (phone first) */
.md-who { background: var(--info-wash); color: var(--info-text); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 0 0 10px; }
.md-h { font-size: 15px; margin: 14px 0 8px; font-family: var(--font-heading); }
.md-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; max-width: 520px; }
.md-card.md-sign { border-color: var(--danger); }
.md-t { font-weight: 700; font-size: 15px; }
.md-s { font-size: 13px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.md-card .btn.md-dropBtn, .md-card .btn.md-signBtn { width: 100%; min-height: 44px; margin-top: 10px; }
.md-done { margin-top: 10px; font-size: 13px; color: var(--ok-text); background: var(--ok-wash); border-radius: 8px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.md-diff { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0 6px; }
.md-diff th, .md-diff td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.md-diff .num { text-align: right; white-space: nowrap; }
.md-diff td.md-bad { color: var(--danger-text); font-weight: 700; }
.md-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rv-dropped { color: var(--ok-text); font-weight: 700; }
.crew-sign { font-size: 12px; margin-top: 2px; }
@media (max-width: 720px) {
  .md-actions { flex-direction: column; align-items: stretch; }
  .md-actions .btn { width: 100%; min-height: 44px; }
  .vf-head .vfEdit, .vf-editing .vfCancel, .vf-editing .btn.primary { width: 100%; min-height: var(--tap); font-size: 15px; margin: 0 0 8px; }   /* 6.16 */
  /* buttons a thumb can hit: full width, 44 px */
  .ask-actions { flex-direction: column; align-items: stretch; }
  .ask-actions .btn, .rv-asks .btn { width: 100%; min-height: 44px; }
}

/* ---------- 6.17: HR / IR batch ---------- */
.pop-host { z-index: 60; }
.pop-ticks { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.pop-ticks label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 400; }
.pop-ticks input { width: auto; margin-top: 2px; }
.pop-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
tr.inc-urgent td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.inc-urgent-box { border: 2px solid var(--danger); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.hc-case-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hc-case-head h3 { margin-bottom: 6px; }
