/* MS BEAU AVE — the house style.
   Dusty rose on warm white: soft edges, hairline rose borders rather than
   heavy shadow, serif for the name and nothing else. The shell is a Bitrix-
   style workspace — a tinted bar across the top, a standing column of tabs
   down the left, and the work itself in the remaining space. */
:root {
  --rose-primary: #C98DA4;   /* buttons, the thing you are meant to press */
  --rose-deep:    #A2647E;   /* headings, active tab, figures that matter */
  --rose-soft:    #EFCCDA;   /* hairline borders */
  --rose-blush:   #F9E9F0;   /* tinted surfaces: the top bar, active tabs */
  --rose-dust:    #DDAEC2;   /* input borders, heavier rules */
  --ink:          #45303C;
  --bg:           #FBF6F8;
  --card:         #FFFFFF;
  --muted:        #92707F;
  --success:      #5F8D6B;
  --warning:      #C9963F;
  --danger:       #B04A4A;

  /* Older names still used across the screens, kept pointing at the palette
     above so a rename never has to touch every rule that mentions a colour. */
  --pink: var(--rose-primary);
  --rose: var(--rose-deep);
  --blush: var(--rose-blush);
  --sage: #A8B8A0;
  --sage-deep: var(--success);
  --amber: var(--warning);
  --red: var(--danger);
  --shade: 0 10px 30px rgba(158, 91, 123, .10);
  --round: 12px;
  /* A hairline rule. Eleven rules were already asking for this by name and
     nothing had ever defined it, so every one of them was an invalid border
     the browser threw away — including every line on a payslip, which is why
     that sheet read as a wall of figures with nothing separating them. */
  --line: var(--rose-soft);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 15px/1.55 Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 600; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; color: var(--rose-deep); }
h3 { font-size: 1rem; color: var(--rose-deep); }
a { color: var(--rose-primary); }
.wordmark { font-family: Georgia, "Times New Roman", serif; }

/* The logo, wherever it appears: always circular, always cropped to fill. */
.logo-mark {
  border-radius: 50%; overflow: hidden; flex: none; background: #fff;
  border: 2px solid var(--rose-dust); display: inline-block;
}
.logo-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- signing in ---------- */
.signin-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--rose-blush), var(--bg) 62%); padding: 1rem;
}
.signin {
  background: var(--card); border: 1px solid var(--rose-soft); border-radius: 18px;
  box-shadow: var(--shade); padding: 2.2rem; width: 100%; max-width: 370px;
  text-align: center;
}
.signin .logo-mark { width: 92px; height: 92px; margin: 0 auto .8rem; }
.signin h1 { font-size: 1.3rem; letter-spacing: .12em; color: var(--rose-deep); }
.signin .tag-line { color: var(--muted); font-size: .85rem; }
.signin label { text-align: left; }

/* ---------- the shell ---------- */
.shell { min-height: 100vh; }

/* ---------- added to an iPhone's home screen ----------
 *
 * A standalone web app on iOS owns the whole glass: it draws under the clock
 * and the camera at the top and under the home bar at the bottom. Without
 * these the header sits behind the status bar and the last row of any page is
 * under the swipe strip — which reads as a broken app rather than a missing
 * inset.
 *
 * env() is nothing anywhere else, and the fallback is zero, so this changes
 * nothing on Android or a desktop.
 */
header.app {
  background: var(--rose-blush); border-bottom: 2px solid var(--rose-dust);
  padding: 12px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  padding-left: calc(20px + env(safe-area-inset-left, 0px));
  padding-right: calc(20px + env(safe-area-inset-right, 0px));
}
.page { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
nav.tabs { padding-bottom: env(safe-area-inset-bottom, 0px); }
.veil { padding-top: calc(16px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
#notices { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
header.app .logo-mark { width: 42px; height: 42px; }
header.app h1 { font-size: 1.15rem; color: var(--rose-deep); letter-spacing: .04em; margin: 0; }
header.app .spacer { margin-left: auto; }
header.app .who { font-size: .82rem; color: var(--muted); text-align: right; line-height: 1.35; }
header.app .who b { color: var(--ink); font-weight: 600; }
.badge {
  font-size: .72rem; background: var(--rose-soft); color: var(--rose-deep);
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
#navToggle {
  display: none; border: 1px solid var(--rose-dust); background: #fff;
  color: var(--rose-deep); border-radius: 9px; padding: 5px 11px; cursor: pointer;
}
#navBackdrop { position: fixed; inset: 0; background: rgba(60, 30, 35, .4); z-index: 44; display: none; }
#navBackdrop.show { display: block; }

nav.tabs { display: flex; gap: 4px; padding: 10px 20px 0; background: var(--rose-blush); flex-wrap: wrap; }
nav.tabs button {
  border: none; background: transparent; padding: 10px 16px; font: inherit;
  font-size: .9rem; color: var(--ink); cursor: pointer; border-radius: 10px 10px 0 0;
}
nav.tabs button.on { background: var(--bg); color: var(--rose-deep); font-weight: 600; }
nav.tabs button:focus-visible, .btn:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: 2px; }

.page { padding: 22px 24px 56px; max-width: 1180px; margin: 0 auto; }

/* Panels within one screen: the four documents of a customer order.
   A second row of tabs, plainly subordinate to the column on the left — no
   tinted bar of its own, an underline for the one that is open, and the type
   a size down from the menu so the eye reads the column first. */
.subtabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid var(--rose-soft); margin-bottom: 18px;
  /* Held to the top of the scroll, so the tab line does not slide away when
     the page is scrolled. */
  position: sticky; top: 0; z-index: 5; background: var(--bg);
}
/* The account being ordered for — a tight bar rather than a full panel, so the
   products are not pushed down the screen. */
.picked-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 0 12px; margin-bottom: 4px; border-bottom: 1px solid var(--rose-soft);
}
.picked-bar b { color: var(--rose-deep); }
.subtabs button {
  border: none; background: transparent; font: inherit; font-size: .87rem;
  color: var(--muted); cursor: pointer; padding: 9px 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subtabs button:hover { color: var(--ink); }
.subtabs button.on {
  color: var(--rose-deep); font-weight: 600; border-bottom-color: var(--rose-deep);
}
/* A screen inside a panel has already been announced by the tab above it, so
   its own heading sits closer to the tabs than a page heading would. */
.subtabs + #panel > .head { margin-top: -4px; }
.head { display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap; margin-bottom: 1rem; }
.head .hint { color: var(--muted); font-size: .87rem; }

/* Wide enough for a standing column of tabs: the Bitrix arrangement.
 *
 * Two columns that scroll on their own, rather than one page that scrolls
 * behind both. Twenty-four menu entries are longer than a monitor, and
 * reaching the bottom of them used to drag the screen you were reading up and
 * out of the way — you looked away to find a menu entry and came back to a
 * page somewhere else.
 *
 * So the shell is exactly the height of the glass and never scrolls itself.
 * The menu keeps its own scrollbar and the page keeps its own, and neither
 * knows the other is moving. overscroll-behavior stops the menu handing its
 * last few pixels of momentum to whatever is behind it. */
@media (min-width: 1000px) {
  .shell {
    display: grid; grid-template-columns: 236px 1fr; grid-template-rows: auto 1fr;
    height: 100vh; height: 100dvh; overflow: hidden;
  }
  header.app { grid-column: 1 / 3; grid-row: 1; z-index: 40; }
  nav.tabs {
    grid-column: 1; grid-row: 2; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 16px 10px; background: #fff; border-right: 1px solid var(--rose-soft);
    align-self: stretch;
    overflow-y: auto; overscroll-behavior: contain;
    /* Both of these matter now that the column has a fixed height. The base
     * rule wraps — which for a row of tabs is right, and for a standing column
     * means the menu silently folds into a second column half the width. And a
     * flex item shrinks by default, so without the second line the entries
     * squeeze themselves thinner and thinner rather than letting the column
     * scroll. Neither showed up until the height stopped being whatever the
     * content wanted. */
    flex-wrap: nowrap;
  }
  nav.tabs button { flex: 0 0 auto; }
  nav.tabs button {
    border-radius: 10px; text-align: left; padding: 11px 14px;
    display: flex; align-items: center; gap: 9px;
  }
  nav.tabs button:hover { background: var(--rose-blush); }
  nav.tabs button.on { background: var(--rose-blush); color: var(--rose-deep); font-weight: 700; }
  .pagearea {
    grid-column: 2; grid-row: 2; min-width: 0;
    overflow-y: auto; overscroll-behavior: contain;
  }
  .page { max-width: none; }
}

/* Narrow: the tabs slide in over the page instead of taking a column of it. */
@media (max-width: 999px) {
  nav.tabs {
    position: fixed; top: 0; left: 0; bottom: 0; width: 250px; z-index: 45; background: #fff;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 18px 10px; overflow-y: auto;
    transform: translateX(-105%); transition: transform .22s ease;
    box-shadow: 6px 0 30px rgba(90, 50, 55, .25);
  }
  nav.tabs.open { transform: translateX(0); }
  nav.tabs button {
    border-radius: 10px; text-align: left; padding: 12px 14px;
    display: flex; align-items: center; gap: 9px;
  }
  nav.tabs button.on { background: var(--rose-blush); color: var(--rose-deep); font-weight: 700; }
  #navToggle { display: inline-block; }
  .page { padding: 16px 14px 48px; }
}
@media (prefers-reduced-motion: reduce) { nav.tabs { transition: none; } }

/* ---------- surfaces ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px; margin-bottom: 16px; }
/* A summary that sits on one half of the width, not the whole span. */
.tiles.half { max-width: 620px; }
@media (max-width: 720px) { .tiles.half { max-width: none; } }
.tile, .panel {
  background: var(--card); border: 1px solid var(--rose-soft); border-radius: var(--round);
}
.tile { padding: 16px 18px; }
.tile .big { font-size: 1.6rem; font-weight: 700; color: var(--rose-deep); font-variant-numeric: tabular-nums; }
.tile .label { color: var(--muted); font-size: .78rem; }
.tile.warn { border-left: 4px solid var(--warning); }
.tile.bad  { border-left: 4px solid var(--danger); }
.tile.good { border-left: 4px solid var(--success); }
.panel { padding: 18px; margin-bottom: 16px; }
/* Bank report's own Cash position panel — a grid of Books' named cash
   accounts, read-only, plus the total they add up to. */
.br-cash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.br-cash-acct { padding: 10px 14px; border: 1px solid var(--rose-soft); border-radius: var(--round); }
.br-cash-acct .label { text-transform: uppercase; letter-spacing: .02em; }
.br-cash-acct .big { font-size: 1.15rem; font-weight: 700; color: var(--rose-deep); }
.br-cash-total { display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding: 12px 14px; background: var(--rose-blush);
  border-radius: var(--round); font-size: 1.05rem; }
/* The product list is a column per tier wide, so it can end up wider than the
   screen. It scrolls sideways inside its own panel rather than dragging the
   whole page along with it, and the headings stay put while it does: Tier 4
   means nothing once the row naming it has scrolled off the top. */
/* The heading has to stick to the box that actually scrolls. table() already
   wraps every table in its own .scroll, and a box with overflow set is where a
   sticky child anchors — so pinning the heading to the panel outside it did
   nothing but let the whole table, heading and all, slide up inside. The
   scroller is given the height instead, and the heading sticks to that.

   Both axes on the one box: the list is a column per tier wide as well as long,
   and two nested scrollers is one scrollbar too many to explain. */
#brand_list .scroll,
#pr_list .scroll,
#pl_table .scroll { max-height: calc(100vh - 270px); overflow: auto; }
#brand_list thead th,
#pr_list thead th,
#pl_table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--card); background-clip: padding-box;
  /* A sticky cell keeps no border of its own once it lifts off the rows, so the
     rule under the heading is drawn as a shadow that travels with it. */
  box-shadow: inset 0 -2px 0 var(--rose-dust);
}
/* A second line under a column heading: what the heading is, in small. */
.thsub { font-size: .68rem; font-weight: 500; letter-spacing: .02em;
  color: var(--muted); text-transform: none;
  /* A rule you can actually see. The hairline used everywhere else is a pale
     pink meant for separating rows; between Tier 4 and the name of the price
     filed there it read as a smudge. */
  margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--rose-dust); }
/* What a figure is, said over the figure. Tier 4 means nothing on its own and
   is not the same price for two products, so the name travels in the cell.
   The column reads Tier 4, the heading's own rule, the name, the money — one
   line down the whole table, not one under every name. */
.cellsub { font-size: .66rem; color: var(--muted); font-weight: 500;
  margin-bottom: 1px; }
.panel > h2, .panel > h3 { margin-bottom: 12px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
/* A grid track is min-content wide by default, so anything inside that is
   wider than its share drags the column out with it — which a document
   laid out at page width and then scaled down would do. */
.split > * { min-width: 0; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; font-variant-numeric: tabular-nums; }
th {
  text-align: left; color: var(--rose-deep); font-weight: 600; padding: 6px 8px;
  border-bottom: 2px solid var(--rose-dust); white-space: nowrap;
  vertical-align: bottom;
}
td { padding: 6px 8px; border-bottom: 1px solid var(--rose-blush); }
tbody tr:hover td { background: var(--rose-blush); }
td.n, th.n { text-align: right; }
/* A column of tags rather than words or figures: neither edge is the right one
   to hang them off, so they sit in the middle of it. */
td.mid, th.mid { text-align: center; }
.none { color: var(--muted); padding: 20px; text-align: center; font-size: .88rem; }
.none.bad {
  color: var(--danger); background: #f3dddd; border-radius: 8px;
  text-align: left; line-height: 1.7;
}

/* A pasted price list: columns only line up if the digits are all one width. */
textarea.sheet {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .78rem; line-height: 1.55; white-space: pre; overflow-wrap: normal;
  overflow-x: auto;
}

/* A price list is seven columns wide before it is anything else. */
.dialog.wide { max-width: 1000px; }
.dialog.wide td:first-child, .dialog.wide th:first-child { white-space: nowrap; }
/* The supplier invoice keeps a blank left panel beside the ledger — the
   standard wide dialog is not wide enough to hold an empty column and the
   full ledger without the ledger's last column running off the edge. */
.dialog.wide.invoice-wide { max-width: 1150px; }
/* The receiving form's own green preview sits beside the fields that build
   it — the standard wide dialog leaves it too narrow to hold both without
   the doc's own table running off its edge. */
.dialog.wide.rf-open { max-width: 1150px; }
/* Opening a pending order: the customer order form on the left at its full
   printed width (so it stays crisp), the working order on the right, both in
   one popup. Stacks to one column when the screen is too narrow to hold them. */
.dialog.co-open { max-width: 96vw; width: min(1780px, 96vw); }
.order-split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
/* The form scrolls on its own within the left column, so a tall order does not
   push the working order on the right down the page. The chat link, Download
   and Print sit all the way below the sheet. co-side shrinks below its native
   900px (the sheet itself scales down to match, see scaleCoForm) so the two
   columns keep sitting side by side on an ordinary laptop screen — Windows
   display scaling shrinks the effective CSS width well below the 1920 the
   screen is actually reporting. Only once neither column can shrink to its
   floor does flex-wrap drop the working order to its own row below. */
.order-split .co-side { flex: 1 1 480px; max-width: 900px; min-width: 380px;
  display: flex; flex-direction: column; max-height: 78vh; overflow-y: auto; }
.order-split .co-actions { display: flex; gap: 8px; align-items: center;
  justify-content: flex-end; flex-wrap: wrap; padding-top: 10px; }
/* The chat bar rides at the top, right after the order title. */
.chatbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.chatbar #co_chat { flex: 1 1 260px; max-width: 460px; }
/* The running total on Record a payment — the figure checked against the bank,
   so big and in the house dark pink. */
.paytot { font-size: 1.35rem; color: var(--rose-deep); }
.order-split .edit-side { flex: 1 1 380px; min-width: 380px; }
.order-split .co-scale { overflow: hidden; }
/* Pending customer order only: co-scale's height is set in JS to match the
   scaled sheet (see scaleCoForm in openPendingOrder), but as a flex item
   with overflow set, its automatic minimum height is zero — so once an
   order carries enough lines to run past co-side's own 78vh ceiling, flex
   quietly squeezed co-scale shorter than that JS height instead of letting
   co-side's own scrollbar take the overflow, and the sheet's bottom rows
   were clipped off, unscrollable, never reflected on screen. Holding
   co-scale to its full height here is what lets co-side scroll to them. */
.dialog.pco-open .order-split .co-scale { flex-shrink: 0; }
@media (max-width: 900px) {
  .dialog.co-open { width: 96vw; }
  .order-split .co-side, .order-split .edit-side { flex: 1 1 auto; width: 100%; max-width: 100%; min-width: 0; }
}
/* A line struck off an order with the ✕ — greyed and ruled through while it
   stays on screen to bring back, until the order is saved. */
tr.struck td { opacity: .5; text-decoration: line-through; }
tr.struck td:last-child { opacity: 1; text-decoration: none; }

/* Things that cannot be undone, kept apart from the things that can. */
.danger {
  border: 1px solid #e2bcbc; background: #fdf4f4; border-radius: 12px;
  padding: 16px 18px; margin-top: 18px;
}
.danger h3 { color: var(--danger); font-size: .95rem; margin-bottom: 4px; }
/* Anything that cannot be undone, wherever it appears. */
.btn.warn { background: var(--danger); color: #fff; border: none; }

/* ---------- controls ---------- */
input[type=text], input[type=number], input[type=password], input[type=date],
input[type=search], select, textarea {
  font-size: .85rem; padding: 8px 10px; border: 1px solid var(--rose-dust);
  border-radius: 8px; background: #fff; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--rose-deep); }
label { display: block; font-size: .76rem; color: var(--muted); margin: 10px 0 3px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 128px; }
label.check { display: flex; align-items: center; gap: 7px; font-size: .9rem;
  color: var(--ink); margin: 10px 0 3px; cursor: pointer; }
label.check input { width: auto; margin: 0; }
.btn {
  background: var(--rose-primary); color: #fff; border: none; padding: 8px 14px;
  border-radius: 9px; font: inherit; font-size: .83rem; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--rose-deep); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.quiet { background: var(--rose-blush); color: var(--rose-deep); }
.btn.line { background: none; color: var(--rose-deep); border: 1px solid var(--rose-dust); }
.btn.go { background: var(--success); }
.btn.stop { background: var(--danger); }
.btn.sm { padding: 4px 10px; font-size: .75rem; }
.tools { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.tools input, .tools select { max-width: 290px; }
/* A spacer the width of the left column, so the name filter and Drafts sit
   above the List of orders panel — the right half of the split below. It folds
   away when the split stacks to one column on a narrow screen. */
.tools .tools-gap, .picked-bar .tools-gap { flex: 0 0 calc(50% - 3px); }
@media (max-width: 1100px) { .tools .tools-gap, .picked-bar .tools-gap { display: none; } }

/* ---------- tags ---------- */
.tag {
  display: inline-block; border-radius: 999px; padding: 2px 9px;
  font-size: .72rem; font-weight: 600; white-space: nowrap;
  background: var(--rose-soft); color: var(--rose-deep);
}
.tag.pink  { background: var(--rose-soft); color: var(--rose-deep); }
.tag.green { background: #e3efe6; color: var(--success); }
.tag.amber { background: #f6ecd8; color: var(--warning); }
.tag.red   { background: #f3dddd; color: var(--danger); }
.tag.grey  { background: #eee9ea; color: var(--muted); }

/* ---------- the till ---------- */
.till { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 950px) { .till { grid-template-columns: 1fr; } }
.goods { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.good {
  background: var(--card); border: 1px solid var(--rose-soft); border-radius: 10px;
  padding: 10px; cursor: pointer; text-align: left; display: flex;
  flex-direction: column; gap: 3px; min-height: 92px;
}
.good:hover { border-color: var(--rose-deep); }
.good:active { transform: scale(.98); }
.good .nm { font-weight: 600; font-size: .84rem; line-height: 1.25; }
.good .pr { color: var(--rose-deep); font-weight: 700; }
.good .st { font-size: .72rem; color: var(--muted); }
.good.empty { opacity: .45; cursor: not-allowed; }
.pick { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 3px solid var(--rose-dust); }
.pick .linetot { min-width: 84px; text-align: right; color: var(--rose-deep); font-size: .95rem; }
.basket-sum { margin: 10px 0; }
.sumrow { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; font-size: .95rem; }
.sumrow > span:first-child { color: var(--muted); }
.sumrow.grand { border-top: 3px solid var(--rose-dust); margin-top: 4px; padding-top: 8px;
  font-size: 1.5rem; font-weight: 700; color: var(--rose-deep); }
.sumrow.grand > span:first-child { color: var(--rose-deep); font-size: 1rem; align-self: center; }
.pick .nm { flex: 1; font-size: .85rem; }
.pick input { width: 56px; text-align: center; padding: 4px; }
.total { font-size: 1.6rem; font-weight: 700; text-align: right; margin: 10px 0; color: var(--rose-deep); }
.pay { display: flex; gap: 8px; }
.pay .btn { flex: 1; }
.receipt {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem;
  background: #fff; border: 1px dashed var(--rose-dust); border-radius: 8px;
  padding: 16px; white-space: pre-wrap;
}

/* ---------- dialogs and notices ---------- */
.veil {
  position: fixed; inset: 0; background: rgba(62, 44, 45, .45); display: flex;
  align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.dialog {
  background: var(--bg); border: 1px solid var(--rose-dust); border-radius: 14px;
  padding: 22px; width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto;
}
/* ---------- one person, opened ----------
 *
 * A face is a thing you click, wherever a face appears. It has to look like
 * one: a name that opens a record and a name that does nothing are otherwise
 * the same name, and people only find the first by accident.
 */
[data-person] { cursor: pointer; }
tr:hover [data-person] b, [data-person]:hover b { color: var(--rose-deep); text-decoration: underline; }

.person-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.person-head code { font-size: .8rem; }
.dialog .panel { margin-top: 14px; }

#notices {
  position: fixed; bottom: 20px; right: 20px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.notice {
  background: var(--ink); color: #FBF6F8; padding: 12px 18px; border-radius: 10px;
  font-size: .85rem; max-width: 380px; box-shadow: 0 10px 30px rgba(90, 50, 55, .3);
  animation: rise .2s;
}
.notice.bad { background: var(--danger); }
.notice.good { background: var(--success); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.banner { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: .87rem; }
.banner.bad  { background: #f3dddd; color: var(--danger); }
.banner.warn { background: #f6ecd8; color: var(--warning); }
.banner.good { background: #e3efe6; color: var(--success); }

.dim { color: var(--muted); font-size: .8rem; }
.mt { margin-top: 14px; }
.right { text-align: right; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

@media print {
  header.app, nav.tabs, .tools, .btn, .pay, #navBackdrop { display: none !important; }
  .page { padding: 0; max-width: none; }
  .shell { display: block; }
  body { background: #fff; }
  body:has(#dialog) .shell { display: none !important; }
  /* A document opened over something else — the invoice over the account it
     belongs to — leaves the one underneath in the page as a veil with no id,
     fixed to the whole viewport with a dark ground behind it. On screen it is
     covered; on paper it would be printed over the sheet. Only the one on top
     is the thing being printed. */
  .veil:not(#dialog) { display: none !important; }
  /* The toast that says the order was placed lives outside the shell, so
     hiding the shell does not hide it. Printing straight after saving — which
     is exactly when anybody prints — put "Order placed 🌸" on the invoice. */
  #notices { display: none !important; }
  #dialog { position: static; background: none; padding: 0; display: block; }
  /* One sheet, one page. printOneSheet() shrinks a long document to fit; this
     stops the browser breaking a form across the fold on its way there — a
     signature block on a page of its own is not a signed form. */
  /* The row of buttons under every document. The buttons themselves are
     hidden above, but the row still holds its top margin, and a sheet that
     fills the page exactly plus twelve pixels of nothing is a second page
     carrying no ink at all. */
  #dialog .dialog > .mt.right { display: none !important; }
  .doc, .packing, .receipt { break-inside: avoid; page-break-inside: avoid; }
  .doc table, .packing table { break-inside: avoid; page-break-inside: avoid; }
  .doc tr, .packing tr { break-inside: avoid; page-break-inside: avoid; }
  /* The white border round the sheet, which @page no longer provides. Same
     10mm, so what printOneSheet() measures against is what comes out. */
  /* White, because bond paper is white. The screen paints this panel in the
     house rose, which nobody saw on paper while backgrounds were being dropped
     — now that they are kept, that tint would be laid over the whole sheet in
     ink, on every page, which is neither the document nor a good use of a
     cartridge. The bands on the sheet are colour; the sheet is not. */
  #dialog, #dialog .dialog, .doc, .packing, .receipt { background: #fff; }
  #dialog .dialog { border: 0; max-width: none; max-height: none; padding: 10mm; overflow: visible; }
  /* A form's headings and column bands are the form. A printer dropping them
     to save ink hands the reseller a different document from the one that was
     read on screen and approved, so it is told not to. */
  .doc, .packing, .receipt, .doc *, .packing *, .receipt * {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .receipt { border: 0; padding: 0; }
  /* The order dialog is an editor beside a preview: the invoice on the left,
     the picking table and the number boxes on the right. Only the invoice is
     the document. On paper the editor is the phantom second sheet, so it — and
     the order's own on-screen title, tags and chat bar — drop away, and the
     invoice is given the whole width. */
  #dialog .edit-side, #dialog .co-actions, #dialog .chatbar,
  #dialog .dialog > h3, #dialog .dialog > .tags { display: none !important; }
  .order-split { display: block; }
  .order-split .co-side { flex: 1 1 auto; max-width: none; }
  /* On screen the preview is fitted to its column with a transform, inside a
     wrapper pinned to that shrunk height and clipped. Both are for the screen;
     on paper they would shrink the sheet again and then crop it. printOneSheet
     lifts them by hand, but a plain Ctrl-P does not, so they are lifted here
     too. */
  .co-scale { height: auto !important; overflow: visible !important; }
  .co-scale .doc.cof { transform: none !important; }
}

/* ---------- the workspace ---------- */
.post { padding: 10px 0; border-bottom: 1px solid var(--rose-blush); font-size: .87rem; }
.post:last-child { border-bottom: none; }
.post-by { font-weight: 600; color: var(--rose-deep); font-size: .82rem; margin-bottom: 2px; }
.post-by .dim { font-weight: 400; margin-left: 6px; }

/* Three lanes side by side, scrolling sideways on a phone rather than
   stacking — a board that stacks is a list, and loses the point of a board. */
.kanban { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.klane { min-width: 172px; flex: 1; background: var(--rose-blush); border-radius: 12px; padding: 8px; }
.klane h5 {
  margin: 0 0 8px; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--rose-deep); display: flex; justify-content: space-between;
}
.kcard {
  background: #fff; border: 1px solid var(--rose-soft); border-radius: 10px;
  padding: 8px; margin-bottom: 8px; font-size: .78rem;
}
.kcard b { font-size: .8rem; display: block; }
.kcard .dim { font-size: .72rem; }
.kmove { display: flex; gap: 4px; justify-content: flex-end; margin-top: 6px; }

/* ---------- product photographs ---------- */
.thumb {
  border-radius: 8px; object-fit: cover; display: inline-block; vertical-align: middle;
  background: var(--rose-blush); border: 1px solid var(--rose-soft);
}
.none-photo {
  display: inline-grid; place-items: center; font-size: 1rem;
  color: var(--rose-deep); opacity: .55;
}
.good .goodpic {
  width: 100%; height: 84px; border-radius: 8px; object-fit: cover;
  background: var(--rose-blush); margin-bottom: 2px;
}
.good span.goodpic { display: grid; place-items: center; font-size: 1.8rem; }

/* ---------- everybody's photograph, in one go ----------
   A wall of faces with a name under each. The two states that matter are the
   wrong ones: nothing matched, or two files claiming the same person. Both get
   a colour rather than a line of text further down the page, because the point
   of a grid is that a mistake is visible without being read. */
.photogrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px; max-height: 58vh; overflow-y: auto; padding: 2px;
}
.photopick {
  background: var(--card); border: 1px solid var(--rose-soft);
  border-radius: 11px; padding: 8px;
}
.photopick.unsure { border-color: var(--warning); background: #fdfaf3; }
.photopick.clash  { border-color: var(--danger);  background: #fdf4f4; }
.photopick img {
  display: block; width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 8px; background: var(--rose-blush);
}
.photopick .fn {
  font-size: .7rem; color: var(--muted); margin: 6px 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photopick select { width: 100%; font-size: .78rem; padding: 5px 6px; }
.photopick .why { font-size: .68rem; color: var(--muted); margin-top: 4px; }
.photopick .why.bad { color: var(--danger); }
.warn { color: var(--warning); }

/* ---------- loyalty at the till ---------- */
.loyalty {
  margin-top: 14px; padding: 12px; border-radius: 10px;
  background: var(--rose-blush); border: 1px solid var(--rose-soft);
}
.loyalty label { margin-top: 0; }
.loyalty .hit { display: block; width: 100%; text-align: left; margin-top: 6px; }

label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .8rem; }
label.inline input { width: auto; }

/* ---------- the time clock ----------
   A shared device by the door, often held at arm's length by somebody still
   holding a bag. Big targets, faces before names. */
.clock-grid {
  display: grid; gap: 12px; margin-top: 4px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.clock-card {
  background: #fff; border: 1px solid var(--rose-soft); border-radius: 14px;
  padding: 14px 10px 12px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font: inherit; color: var(--ink);
}
.clock-card:disabled { opacity: .45; cursor: not-allowed; }
.clock-card.on { border-color: var(--success); background: #f2f8f3; }
.clock-card img, .clock-card .clock-face {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  background: var(--rose-blush); display: grid; place-items: center; font-size: 1.9rem;
}
.clock-card b { font-size: .9rem; line-height: 1.25; }
.clock-card span { font-size: .74rem; color: var(--muted); }

.pin-dots {
  text-align: center; font-size: 1.5rem; letter-spacing: .18em;
  color: var(--rose-deep); margin: 14px 0 10px; min-height: 30px;
}
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-pad button {
  padding: 16px 0; font-size: 1.3rem; font-weight: 600; font-family: inherit;
  border: 1px solid var(--rose-dust); border-radius: 12px;
  background: #fff; color: var(--ink); cursor: pointer;
}
.pin-pad button.quiet { font-size: .82rem; color: var(--muted); }
.pin-pad button.go { background: var(--rose-primary); color: #fff; border: none; }

/* ---------- PIN slips ----------
   Cut-up cards on screen, and the only thing on the page when printed. */
.slips {
  display: grid; gap: 10px; margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.slip {
  border: 1px dashed var(--rose-dust); border-radius: 10px;
  padding: 12px 14px; background: #fff; text-align: center;
}
.slip-shop {
  font-family: Georgia, "Times New Roman", serif; letter-spacing: .1em;
  font-size: .7rem; color: var(--rose-deep);
}
.slip-who { font-weight: 700; margin-top: 6px; }
.slip-job { font-size: .74rem; color: var(--muted); }
.slip-pin {
  font-size: 1.9rem; font-weight: 700; letter-spacing: .28em;
  color: var(--rose-deep); margin: 8px 0 6px; font-variant-numeric: tabular-nums;
}
.slip-note { font-size: .66rem; color: var(--muted); line-height: 1.4; }

@media print {
  /* When there are slips, they are the page — nothing else goes on the paper. */
  body:has(.slips) .banner,
  body:has(.slips) .dim,
  body:has(.slips) h3,
  body:has(.slips) .row { display: none !important; }
  .slips { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .slip { break-inside: avoid; border-style: solid; border-color: #bbb; }
  .slip-pin { color: #000; }
}

.mb { margin-bottom: 12px; }

/* Said once, at the top of every screen a view-only sign-in opens, rather than
 * discovered by pressing something and being refused. */
.viewonly-note {
  background: var(--rose-blush); border: 1px solid var(--rose-soft);
  border-radius: 10px; padding: 10px 14px; margin: 14px 18px -4px;
  font-size: .85rem; color: var(--ink);
}
.viewonly-note b { color: var(--rose-deep); }

/* ---------------------------------------------------------------------------
 * A wide wordmark instead of a round badge
 *
 * The house mark is a circle and every rule for it assumes that. Beauty
 * Obsession Avenue's is a wide lockup that spells the name in its own
 * lettering — cropped to a circle it loses the word, and set beside a Georgia
 * heading it is two typefaces saying one thing, with the wrong one larger.
 *
 * So the mark carries the name, and the heading is hidden rather than removed,
 * because a screen reader still has to be able to say where it is.
 *
 * Shape only. The palette is not touched here and cannot be: the rose is
 * defined once, on :root, with no brand able to reach it — which the test in
 * tests/ios.test.js holds to. The door screen is the one place a shop's own
 * colours belong, and that is its own stylesheet.
 * ------------------------------------------------------------------------- */
:root[data-brand] .logo-mark {
  border-radius: 0; width: auto; background: none; border: none; padding: 0;
}
:root[data-brand] .logo-mark img { object-fit: contain; }
:root[data-brand] .signin .logo-mark { height: 76px; margin-bottom: 1.2rem; }
:root[data-brand] .signin .logo-mark img { height: 100%; width: auto; }
:root[data-brand] header.app .logo-mark { height: 38px; }
:root[data-brand] header.app .logo-mark img { height: 100%; width: auto; }

/* Beauty Obsession Avenue's own colours, for the app its own people open.
 *
 * Measured out of the logo rather than guessed at: the hot pink of BEAUTY, the
 * cyan of Avenue, the pale blue the mark sits on. Only the pink is darkened,
 * and only where it carries words — the logo's #F52188 is 3.85:1 on white,
 * which is right for a mark and wrong for a name read off a phone. Every pair
 * here was measured and the lowest is 4.98:1.
 *
 * MS BEAU AVE is the bare :root above and is not touched by any of this. That
 * is the whole arrangement: a brand may dress itself and may not undress
 * anybody else.
 */
:root[data-brand="boa"] {
  --rose-primary: #C4126C;
  --rose-deep:    #A80E5C;
  --rose-soft:    #CDEAF8;
  --rose-blush:   #DFF3FE;
  --rose-dust:    #9FD8F0;
  --ink:          #26364B;
  --bg:           #F5FBFF;
  --muted:        #4F6A7E;
  --success:      #0C7A5C;
  --warning:      #C97A05;
  --danger:       #C9304A;

  --pink: var(--rose-primary);
  --rose: var(--rose-deep);
  --blush: var(--rose-blush);
  --sage-deep: var(--success);
  --amber: var(--warning);
  --red: var(--danger);
  --shade: 0 10px 30px rgba(38, 54, 75, .12);
}
:root[data-brand="boa"] .signin-page {
  background: linear-gradient(160deg, #DFF3FE, #F5FBFF 62%);
}
:root[data-brand="boa"] header.app {
  background: linear-gradient(180deg, #DFF3FE, #EEF8FF);
}

/* ---------- the packing list ----------
   The warehouse's copy of an order: what to pick and a box to tick beside it.
   Deliberately without money — the person packing a box has no business
   knowing what the account pays, and a price on a sheet that travels with the
   goods is a price the customer's customer can read. */
.packing { color: #000; font-size: .8rem; }
/* The letterhead all three documents share: the logo at the left and the
   company centred on the sheet, because the name is the heading of the
   document and not a note in its corner. The empty third column is the
   logo's width, so centre means centre of the page rather than centre of
   whatever is left over beside the logo. */
.packing .rule, .doc .rule { border-top: 3px solid var(--rose-deep); margin-bottom: 8px; }
.packing .head-row, .doc .head-row {
  display: grid; grid-template-columns: 88px 1fr 88px; gap: 10px; align-items: center;
}
.packing .head-row img, .doc .head-row img { height: 44px; }
.packing .who, .doc .who { text-align: center; }
.packing .who b, .doc .who b { color: var(--rose-deep); font-size: 1.02rem; letter-spacing: .01em; }
.packing .who div, .doc .who div { font-size: .62rem; color: #444; line-height: 1.3; }
.packing .title {
  background: #ececec; text-align: center; font-weight: 700; font-size: 1.1rem;
  letter-spacing: .04em; padding: 5px; margin: 8px 0 8px;
}
.packing .party { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.packing .party .lbl { font-weight: 700; font-size: .72rem; }
.packing .party .val { font-size: .72rem; }
.packing table { width: 100%; border-collapse: collapse; font-size: .74rem; }
.packing th {
  background: #fce7ef; border: 1px solid #d9d9d9; padding: 5px 6px;
  font-size: .66rem; letter-spacing: .04em; text-align: center; color: #000;
}
.packing td { border: 1px solid #d9d9d9; padding: 3px 6px; height: 18px; }
.packing td.tick { width: 34px; text-align: center; }
.packing td.qty, .packing td.unit { text-align: center; }
.packing .box {
  display: inline-block; width: 11px; height: 11px; border: 1px solid #555;
}
/* Blank rows so the sheet looks like the pad it replaces, and so anything
   added by hand at the bench has somewhere to go. */
/* Somewhere to actually sign.
   
   The rule used to sit under the typed name, which left the only blank space
   above it occupied by the name itself — a signature line with the name
   already written on it. It is the other way round on every form anybody has
   ever signed: a clear space, the rule, and the printed name beneath it saying
   who the signature above should belong to. The space is 13mm, which is what a
   hand needs. */
.packing .sign { display: flex; justify-content: space-around; margin-top: 20px; text-align: center; }
.packing .sign .who-line { font-size: .68rem; }
.packing .sign .nm {
  font-weight: 700; border-top: 1px solid #000; padding: 2px 26px 0; margin-top: 13mm;
}
.packing .sign .role { color: #444; font-size: .62rem; margin-top: 2px; }
.packing .sign .cap { font-weight: 700; font-size: .64rem; margin-top: 4px; }

/* ---------- the invoice and the order form ----------
   Two documents off one layout: the order form is what a reseller is sent to
   agree to, the invoice is what follows it and carries the money already
   received. Both keep the shape of the paper they replace. */
.doc { color: #000; font-size: .78rem; }
.doc .title { text-align: center; font-weight: 700; font-size: 1.1rem; padding: 5px; margin: 8px 0; }
.doc .title.inv { background: #dbe6f7; color: #2f5fa8; }
.doc .title.cof { background: #fbe2ee; color: var(--rose-deep); }
.doc table.lines { width: 100%; border-collapse: collapse; font-size: .72rem; }
.doc table.lines th {
  background: #dbe6f7; border: 1px solid #d9d9d9; padding: 4px 6px;
  font-size: .62rem; letter-spacing: .03em; text-align: center;
}
.doc.cof table.lines th { background: #fbe2ee; }
.doc table.lines td { border: 1px solid #e4e4e4; padding: 3px 6px; height: 16px; }
.doc table.lines td.n { text-align: right; }
.doc table.lines td.c { text-align: center; }
/* A code wrapped over two lines makes every row on the sheet taller. */
.doc table.lines td.c:first-child { white-space: nowrap; }
.doc table.lines td.refno {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.doc table.lines th.refnoh { width: 150px; }
.doc table.lines th.moneyh { width: 104px; }
/* The supplier invoice sets a blank panel beside the ledger rather than
   handing the ledger the full sheet — sized the same way the portrait
   sheet's columns already are, a width hint on each th with auto layout
   doing the actual arithmetic, rather than table-layout: fixed, which
   measured fine on screen but rendered inconsistently through the real
   print-to-PDF path (columns bleeding into each other) in a way this
   project has never hit with plain auto layout. */
/* On paper the two panels stop at the ledger's own rows and leave the rest
   of the sheet blank underneath — printOneSheet stretches .doc down to the
   full page height, but that height has nowhere to go unless something
   inside is told to grow into it. */
.doc.po.invoice-doc { display: flex; flex-direction: column; }
.doc.po.invoice-doc .invoice-split { flex: 1 1 auto; }
/* On the printed portrait sheet the two panels stack top over bottom rather
   than sitting side by side — a portrait page is narrow, not wide, and a
   photo plus a six-column ledger both want the full width more than they
   want each other's company. The dialog on screen keeps the side-by-side
   split; only the print output stacks. */
@media print {
  .doc.po.invoice-doc .invoice-split { flex-direction: column; }
  /* Stacked, the ledger has the whole sheet's width to itself again, so it
     wears the same column widths as every other printed ledger rather than
     the narrow ones sized for sitting beside a photo on screen. */
  .doc.po.invoice-doc table.lines.ledger-split { font-size: .72rem; }
  .doc.po.invoice-doc table.lines.ledger-split th:nth-child(1),
  .doc.po.invoice-doc table.lines.ledger-split th:nth-child(2) { width: auto; }
  .doc.po.invoice-doc table.lines.ledger-split th.refnoh { width: 150px; }
  .doc.po.invoice-doc table.lines.ledger-split th.moneyh { width: 104px; }
}
.doc.po .invoice-split { display: flex; gap: 16px; align-items: stretch; }
.doc.po .invoice-split-blank {
  flex: 1 1 0; min-width: 0; overflow: hidden; border-radius: 4px;
}
.doc.po .invoice-split-blank .po-billing-photos {
  display: flex; flex-direction: column; gap: 8px; height: 100%;
}
.doc.po .invoice-split-blank .po-billing-photos img {
  width: 100%; height: 100%; object-fit: cover; flex: 1 1 0; display: block;
  border-radius: 4px;
}
.doc.po .invoice-split-ledger { flex: 1 1 0; min-width: 0; }
.doc.po table.lines.ledger-split { font-size: .68rem; }
.doc.po table.lines.ledger-split th:nth-child(1) { width: 60px; }
.doc.po table.lines.ledger-split th:nth-child(2) { width: 110px; }
.doc.po table.lines.ledger-split th.refnoh { width: 65px; }
.doc.po table.lines.ledger-split th.moneyh { width: 60px; }
/* A width hint only holds if the content agrees to it — a date, a
   description or a reference number that runs long still has to be told
   not to spill into the next cell rather than wrap and make every blank
   row on the sheet as tall as its tallest neighbour. */
.doc.po table.lines.ledger-split td:nth-child(1),
.doc.po table.lines.ledger-split td:nth-child(2) {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc.po table.lines.ledger-split td.refno { max-width: 65px; }
.doc.po table.lines.ledger-split td.c { white-space: nowrap; }
.doc .duebox {
  float: right; border: 1px solid #ccc; background: #f4f4f4; padding: 4px 10px;
  font-size: .62rem; text-align: right; margin-bottom: 4px;
}
.doc .duebox b { display: block; font-size: .82rem; }
.doc .foot { display: flex; gap: 16px; margin-top: 10px; align-items: flex-start; }
.doc .foot > * { flex: 1; }
.doc .totals { margin-left: auto; font-size: .72rem; }
.doc .totals div { display: flex; justify-content: space-between; gap: 24px; padding: 2px 6px; }
.doc .totals .grand {
  background: #dbe6f7; font-weight: 700; font-size: .95rem; padding: 5px 6px; margin-top: 2px;
}
.doc.cof .totals .grand { background: #fbe2ee; }
.doc .totals .bal { background: #fde8ee; font-weight: 700; color: #c0392b; padding: 4px 6px; }
.doc .bank { border: 1px solid #c0392b; padding: 6px 10px; font-size: .64rem; margin-top: 8px; line-height: 1.35; }
.doc .bank h5 { font-size: .68rem; margin-bottom: 5px; letter-spacing: .03em; }
.doc .bank .b { font-weight: 700; margin-top: 3px; }
.doc .mop { border: 1px solid #e8b9cc; font-size: .66rem; }
/* Filled, like every other band on the sheet. A heading that is only bold
   reads as the first line of the box on paper; a heading with a wash behind it
   reads as a heading, which is what the pad it replaces does and what somebody
   comparing the two notices straight away. */
.doc .mop .hd {
  text-align: center; font-weight: 700; padding: 4px;
  border-bottom: 1px solid #e8b9cc; background: #dbe6f7;
}
.doc.cof .mop .hd { background: #fbe2ee; }
.doc .mop .slot { border-bottom: 1px solid #f0d3de; padding: 2px 8px; line-height: 1.2; }
/* Five slots, because the paper has five and a reseller settles in
   instalments. They are the tallest thing on the sheet, so they are also
   where the room for a longer order has to come from. */
.doc .mop .slot b { display: block; }
/* The same room to sign on the order form, the invoice and the receipt. The
   rule is drawn here rather than left to the name's own underline, so a sheet
   with a long name and one with a short name are signed on the same width. */
.doc .sign1 { text-align: center; margin-top: 14px; font-size: .68rem; }
.doc .sign1 .nm {
  font-weight: 700; border-top: 1px solid #000; margin: 13mm auto 0; padding-top: 2px;
  width: 62mm;
}
.doc .sign1 .cap { font-weight: 700; margin-top: 3px; }

/* ---------- picking a reseller the way you pick a face on the clock ----------
   The person taking the order is reading a name off a chat window. Typing it
   into a box to summon a list is two actions where there should be one, so
   every account is on screen from the start and typing only narrows what is
   already there.

   The card is an inch by an inch and a third — a fixed size, not a share of
   the row, because two hundred and forty of them want to be the same card
   however wide the window is. The picture inside it is round, the way every
   face in this company is shown: the same shape on the clock, on the team
   board and here, so a reseller reads as somebody the company knows rather
   than as a record. An account with no picture shows its initials in the same
   circle. */
.face-grid {
  display: grid; gap: 10px; margin-top: 4px;
  grid-template-columns: repeat(auto-fill, 96px);
  justify-content: start;
}
.face-card {
  width: 96px; height: 128px;          /* 1in x 1.33in */
  padding: 8px 5px 6px; border: 1px solid var(--rose-soft); border-radius: 12px;
  cursor: pointer; background: #fff; font: inherit; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-align: center; overflow: hidden;
}
.face-card:hover { border-color: var(--rose-deep); background: var(--rose-blush); }
.face-card .face,
.face-card img.face {
  flex: 0 0 auto; width: 62px; height: 62px; border-radius: 50%;
  object-fit: cover; background: var(--rose-blush); color: var(--rose-deep);
  display: grid; place-items: center;
  font-size: 1.35rem; font-weight: 600; letter-spacing: .03em;
}
.face-card .strip { display: block; min-width: 0; }
.face-card .strip b {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: .58rem; line-height: 1.15; letter-spacing: .01em;
}
.face-card .strip .under { display: block; font-size: .55rem; color: var(--muted); }
/* Birthday cards: a little taller than the door-clock face, to carry the date
   above the picture and the tier below the name. */
/* Birthday faces sit bigger than the door-clock's, and the block is held to a
   width that lets about four to a row, so five or more spill onto the next. */
.face-grid.bdays { grid-template-columns: repeat(auto-fill, 132px); }
.face-grid.bdays .face-card {
  width: 132px; height: auto; min-height: 158px; justify-content: flex-start; gap: 6px;
}
.face-grid.bdays .face-card .face,
.face-grid.bdays .face-card img.face { width: 68px; height: 68px; font-size: 1.5rem; }
.face-grid.bdays .face-card .strip b { font-size: .7rem; }
/* The New-order supplier picker: ten across whatever the screen is, so a
   card is wide enough to carry a brand name above the supplier's own name
   instead of neither fitting. */
.face-grid.pf-pick { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.face-grid.pf-pick .face-card {
  width: auto; height: auto; min-height: 170px; justify-content: flex-start; gap: 7px;
}
.face-grid.pf-pick .face-card .face,
.face-grid.pf-pick .face-card img.face { width: 60px; height: 60px; font-size: 1.2rem; }
.face-grid.pf-pick .face-card .strip b { font-size: .8rem; }
.face-grid.pf-pick .face-card .strip .supname {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: .72rem; line-height: 1.2; color: var(--muted); font-weight: 400;
}
@media (max-width: 900px) {
  .face-grid.pf-pick { grid-template-columns: repeat(auto-fill, 96px); }
}
/* The pair pulled to the middle: labelled, and set off from the grid below. */
.qlabel {
  font-size: .78rem; font-weight: 700; color: var(--rose-deep);
  text-transform: uppercase; letter-spacing: .05em; margin: 4px 2px 2px;
}
.face-grid.qrow { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--rose-soft); }
.face-grid.qrow .face-card { border-color: var(--rose-deep); }
/* One dated section under the next, parted by a hairline, all the way down. */
.bday-day { padding: 4px 0 14px; border-bottom: 1px solid var(--rose-soft); }
.bday-day:last-child { border-bottom: 0; }
.face-card .bdate {
  font-size: 1.2rem; font-weight: 800; letter-spacing: .01em;
  color: var(--rose-deep); line-height: 1;
}
.face-card.today .bdate { color: var(--success); }
.face-card .strip .tier {
  display: block; font-size: .5rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; margin-top: 1px;
}
.face-card .strip .tier1 { color: var(--muted); }
.face-card .strip .tier2 { color: var(--rose-deep); }
.face-card .strip .tier3 { color: var(--success); }
/* Today's birthday, lit up in the house green so it is the one the eye lands on. */
.face-card.today { border-color: var(--success); background: #f2f8f3; }
.face-card.today .strip .under { color: var(--success); font-weight: 600; }
.face-card.stopped { opacity: .55; cursor: not-allowed; }
/* The two month tiles are buttons: one picks this month, the other next, and
   the chosen one is ringed. */
.tile.pick {
  cursor: pointer; text-align: left; font: inherit; color: inherit;
  background: var(--card); display: block; width: 100%;
}
.tile.pick.sel { border-color: var(--rose-deep); box-shadow: inset 0 0 0 2px var(--rose-blush); }

/* The birthday card — a celebrant, not the account editor. The picture large,
   the day larger still under it, and a greeting to read before one is sent. */
.dialog.birthday { max-width: 380px; }
.bcard { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 4px 6px 8px; }
.bcard .bface {
  width: 150px; height: 150px; border-radius: 50%; object-fit: cover;
  background: var(--rose-blush); color: var(--rose-deep);
  display: grid; place-items: center; font-size: 3rem; font-weight: 700; letter-spacing: .03em;
}
.bcard.today .bface { box-shadow: 0 0 0 4px #f2f8f3, 0 0 0 6px var(--success); }
.bcard .bname { margin: 4px 0 0; font-size: 1.35rem; line-height: 1.15; }
.bcard .btier { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.bcard .btier.tier1 { color: var(--muted); }
.bcard .btier.tier2 { color: var(--rose-deep); }
.bcard .btier.tier3 { color: var(--success); }
.bcard .bbig { font-size: 2.1rem; font-weight: 800; color: var(--rose-deep); margin-top: 4px; }
.bcard.today .bbig { color: var(--success); }
.bcard .bwhen { color: var(--muted); font-size: .92rem; margin-top: -4px; }
.bcard .bgreet { margin-top: 8px; font-size: 1.02rem; line-height: 1.45; }
.mt.center { text-align: center; }
.face-card.stopped .face { background: #f3dddd; color: var(--danger); }
.face-card.stopped .strip .under { color: var(--danger); }
.face-card .strip .owing { color: var(--warning); }

/* The price a line is given, tapped rather than chosen out of a list — the
   figure it decides is the one being read into the chat, and a list that has
   to be opened first hides it. */
/* A price code is one of thirteen, so it is a list rather than a row of
   buttons. As buttons they wrapped onto three lines and made every basket line
   tall enough to push the running total off the bottom of the panel.

   The unit price sits beside it and is typed into directly, for the price a
   reseller talked somebody into over Messenger that no code covers. It is
   wider than the quantity box because it holds pesos, centavos and a comma. */
.pick .pcode {
  font: inherit; font-size: .72rem; padding: 4px 6px; max-width: 176px;
  border: 1px solid var(--rose-soft); border-radius: 8px;
  background: #fff; color: var(--ink);
}
.pick input.unit { width: 92px; text-align: right; }

/* A basket line is two rows, because the panel it sits in is half a page wide
   and a product name is not short. The name takes the first row whole rather
   than being squeezed into a column narrow enough to break it over three
   lines; the controls take the second, left to right in the order somebody
   reads them — which price, what price, how many, and take it off again. */
.pick { flex-wrap: wrap; }
.pick .nm { flex: 1 1 100%; order: 1; }
.pick .pcode { order: 2; }
.pick input[data-qty] { order: 3; }
.pick input.unit { order: 4; }
.pick .linetot { order: 5; margin-left: auto; }
.pick .btn.stop { order: 6; }

/* The same round frame on the profile, so what is being set is plainly the
   thing that will appear on the card. */
.row .face, .row img.face {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  background: var(--rose-blush); color: var(--rose-deep);
  display: grid; place-items: center; font-size: 1.5rem; font-weight: 600;
}
.face-card img.face { object-fit: cover; }

/* The order form, live, beside the basket that is filling it.
   Laid out at the width the page is and then scaled down to the panel, so it
   is a true miniature of the document rather than the same markup squeezed
   into half the room and wrapping somewhere else. A scaled element still
   claims its unscaled height, which the script corrects. */
.preview {
  overflow: hidden; background: #fff; border: 1px solid var(--rose-soft);
  border-radius: 10px;
}
.preview .doc { padding: 14px; }

/* ---------- a reseller's name is the way into their account ----------
   A row with a button at the far end asks somebody to cross the whole row to
   act on the thing they are already pointing at. The name does it. */
.nameopen {
  font: inherit; color: var(--ink); background: none; border: 0; padding: 0;
  cursor: pointer; text-align: left; display: inline-flex; align-items: center;
  gap: 7px;
}
.nameopen:hover b, .nameopen:focus-visible b {
  color: var(--rose-deep); text-decoration: underline;
}

/* An account with an invoice still open. Amber while it is merely unpaid, red
   once it is past due — the same two states the standing column uses, so the
   dot never says something the row contradicts. */
.blip {
  flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%;
  background: var(--warning); box-shadow: 0 0 0 0 rgba(201, 150, 63, .55);
  animation: blip 1.6s ease-out infinite;
}
.blip.late {
  background: var(--danger); box-shadow: 0 0 0 0 rgba(176, 74, 74, .55);
  animation-name: blip-late;
}
/* Standing, not money: a steady dot — green for active, red for inactive — that
   does not pulse, since it is on every row. */
/* The ✕ at the end of an account row — quiet until pointed at, then the red of
   the thing it leads to. */
/* The price rows on a product: a name and the figure it is sold at, side by
   side. Full width each, stacked, they read as fourteen unrelated boxes down a
   dialog — the name belongs beside its own figure, not above it.

   Seven pairs is a long column, so on a wide dialog they sit two pairs across.
   That is a layout for this form only: the same class carries the rename list,
   where a row is a name and its buttons. */
.pricerow { display: grid; grid-template-columns: 1fr 36%; gap: 8px;
  align-items: center; }
.pricerow select, .pricerow input { margin: 0; }
/* Cost price is settled, so it is a label over its box rather than a dropdown
   beside it — the same shape as every other named field on the form. */
.pricerow.costrow { display: block; }
.pricerow.costrow label { display: block; margin-bottom: 3px; }
.pricerow.costrow input { width: 100%; }
/* Single file: seven pairs down one column, in the order they are typed in,
   because that order is what decides which price is Tier 1. Two across put
   Tier 2 to the right of Tier 1 and read as though the boxes were unrelated. */
#f_prices { display: grid; gap: 10px; }
/* One new product per row: its unit, what makes it different from the one it
   is based on, the category it falls under, and a file if it needs one filed
   with it. A row that is just the name repeated needs nothing typed at all. */
.variation-rows { display: grid; gap: 8px; }
.variation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 8px; align-items: center; background: var(--rose-blush); padding: 8px; border-radius: 8px;
}
.variation-row input, .variation-row select { margin: 0; }
.variation-head {
  background: none; padding: 0 8px; font-size: .82rem; font-weight: 600; color: var(--muted);
}
.rowx {
  border: 0; background: none; cursor: pointer; padding: 2px 6px;
  font-size: 1rem; line-height: 1; color: var(--muted); border-radius: 6px;
}
.rowx:hover { color: #fff; background: var(--danger); }
/* A channel's mark — one small coloured badge per link, its letter in white. */
.silink {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 7px; color: #fff; font-weight: 800; font-size: .95rem;
  line-height: 1; text-decoration: none;
}
.silink:hover { filter: brightness(1.1); }
.silink.off { background: var(--rose-soft); color: var(--muted); opacity: .6; cursor: default; }
/* A scrollable list of suppliers, the chosen one lit. */
.suplist { max-height: 340px; overflow-y: auto; border: 1px solid var(--rose-soft); border-radius: 10px; }
.suprow {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0;
  border-bottom: 1px solid var(--rose-blush); background: var(--card); cursor: pointer;
  font: inherit; color: var(--ink);
}
.suprow:last-child { border-bottom: 0; }
.suprow:hover { background: var(--rose-blush); }
.suprow.on { background: var(--rose-blush); box-shadow: inset 3px 0 0 var(--rose-deep); }
/* Purchase order page: supplier information beside the orders. */
.po-split { display: flex; gap: 20px; align-items: flex-start; }
.po-split .po-sup { flex: 0 0 340px; }
.po-split .po-orders { flex: 1 1 auto; min-width: 0; }
@media (max-width: 900px) {
  .po-split { flex-direction: column; }
  .po-split .po-sup, .po-split .po-orders { flex: 1 1 auto; width: 100%; }
}
/* A link field with a Copy beside it. */
.linkfield { display: flex; gap: 6px; align-items: center; }
.linkfield input { flex: 1; min-width: 0; }
.linkfield .btn { flex: 0 0 auto; }
.blip.on  { background: var(--success); box-shadow: none; animation: none; }
.blip.off { background: var(--danger);  box-shadow: none; animation: none; }
@keyframes blip {
  0%   { box-shadow: 0 0 0 0   rgba(201, 150, 63, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(201, 150, 63, 0); }
  100% { box-shadow: 0 0 0 0   rgba(201, 150, 63, 0); }
}
@keyframes blip-late {
  0%   { box-shadow: 0 0 0 0   rgba(176, 74, 74, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(176, 74, 74, 0); }
  100% { box-shadow: 0 0 0 0   rgba(176, 74, 74, 0); }
}
/* A pulse that will not stop is a poor thing to sit beside all day, and for
   some people it is worse than that. The dot stays; the pulsing goes. */
@media (prefers-reduced-motion: reduce) {
  .blip, .blip.late { animation: none; }
}

/* What the dot beside a reseller's name means, under the buttons at the top
   right where the eye already is. Only on the screen that uses it: a key to a
   mark that is not on the page is a thing to work out the absence of. */
.dotkey {
  display: flex; gap: 18px; margin-left: auto; align-items: center;
  font-size: .72rem; color: var(--muted);
}
.dotkey span { display: inline-flex; align-items: center; gap: 6px; }
.dotkey .blip { width: 8px; height: 8px; }
@media (max-width: 700px) { .dotkey { justify-content: flex-start; } }

/* ---------- the official receipt ----------
   The third sheet, and the last one in the conversation. Same letterhead,
   same party block, same shape as the order form and the invoice — maroon
   rather than pink or blue, which is the whole difference and is enough:
   somebody scrolling a chat can tell which of the three they are looking at
   without reading a word. */
.doc .title.or { background: #f0dcdf; color: #7a2233; }
.doc.or table.lines th { background: #f0dcdf; color: #5e1a27; }
.doc .duebox.or { background: #fcf4f5; border-color: #ddb9c0; }
.doc.or .totals .grand { background: #f0dcdf; }
.doc.or .mop { border-color: #ddb9c0; }
.doc.or .mop .hd { border-bottom-color: #ddb9c0; }
.doc.or .mop .slot { border-bottom-color: #eddade; }
/* Nothing is owed on this sheet in the ordinary case, so the red the invoice
   uses would be shouting at somebody who has just paid. */
.doc.or .totals .bal { background: #fcf4f5; color: #7a2233; }
.doc.or .thanks {
  text-align: right; margin-top: 10px; font-size: .78rem;
  color: #7a2233; font-weight: 600;
}

/* Five payment rows, one per instalment. The labels are written once and
   hidden on the rows below, because four repetitions of "Amount received" is
   four things to read past — but they are hidden from the eye, not from a
   screen reader, which has no column heading to fall back on. */
.payrow + .payrow { margin-top: -2px; }
label.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* The way out of a dialog. Sticky rather than absolute, because the dialog
   scrolls and a way out that scrolls off the top is not one. Floated so the
   content beside it does not shift to make room. */
.dialog { position: relative; }
.dialog-x {
  position: sticky; top: -4px; float: right; z-index: 2;
  margin: -8px -6px 0 10px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--rose-soft); background: #fff; color: var(--muted);
  font: inherit; font-size: .9rem; line-height: 1; cursor: pointer;
}
.dialog-x:hover, .dialog-x:focus-visible {
  border-color: var(--rose-deep); color: var(--rose-deep); background: var(--rose-blush);
}
/* The documents print and download; the button that closes them does not. */
/* A figure on a document that can be corrected.
   Styled as the number it replaces rather than as a form field: the sheet is
   printed and saved as a picture, and a page of boxes does not read as an
   invoice. The rule under it is the only hint that it can be typed in, and it
   goes away entirely on paper. */
.doc .figure, .packing .figure {
  font: inherit; text-align: right; width: 100%; max-width: 84px;
  padding: 0; margin: 0; color: inherit; background: transparent;
  border: none; border-bottom: 1px dashed var(--rose-dust); border-radius: 0;
}
.doc .figure:focus, .packing .figure:focus {
  outline: none; border-bottom-color: var(--rose-deep); background: var(--rose-blush);
}
.doc .totals .figure { max-width: 96px; }
/* A quantity sits under its heading; a name and a tax line run along the row.
   Same box either way — what changes is which way the writing goes. */
/* A quantity sits under its heading; a name and a tax line run along the row.
   Same box either way — what changes is which way the writing goes. */
.figure.mid { text-align: center; max-width: 60px; }
.figure.wide { max-width: none; text-align: left; }
/* A tax line reads label-then-answer along one line, the way it is written on
   the pad. Left at full width the box claims the whole block and drops the
   answer onto a line of its own, which turns a five-line block into ten. */
.figure.wide.party, .packing .party .figure { display: inline-block; width: 190px; }
/* The document's own number, which is as wide as a number and no wider — left
   at full width it would take the whole right-hand block and push the date
   off it. */
.figure.wide.docno { display: inline-block; width: 132px; }
/* Once a blank row has a real product in it, it reads as a line rather than
   as something half typed. */
.figure.named { font-weight: 700; }
.figure.wide::placeholder { color: #b9b9b9; font-style: italic; }
.figure:disabled { border-bottom-style: none; background: transparent; }
/* No margin on the page, and the margin put on the sheet instead.
   
   Not a preference: a page margin is where the browser prints its own header
   and footer — the date, the tab's title, the URL, "1/1" — across the top and
   bottom of a document that goes to a reseller. Chrome leaves them off when
   the page has no margin of its own, so the white border round the form is
   given by the dialog below rather than by the printer. */
@page { margin: 0; }

@media print {
  .doc .figure, .packing .figure { border-bottom: none; background: none; }
  .figure.wide::placeholder { color: transparent; }

  /* The sheet is as tall as the paper — printOneSheet gives it the height — so
     the space left over after the table goes above the signatures rather than
     below them, and they sit at the foot where a signature sits.
     
     Down here rather than with the other print rules on purpose: this has the
     same specificity as the .packing .sign margin it is overriding, and that
     one is declared further up the file. Equal weight, so the last one wins. */
  .doc, .packing { display: flex; flex-direction: column; }
  .packing .sign, .doc .sign1 { margin-top: auto; }
  /* A row goes pink under the pointer, which is a screen affordance and not
     ink. Whichever row the cursor happened to be resting on when somebody
     reached for Print was coming out with a band across it. */
  tbody tr:hover td { background: none !important; }
}

/* A cell you type into, in a table you read down.
   Borderless until it is hovered or focused, so eight hundred rows read as a
   price list rather than as a form; the box only announces itself when the
   hand is on it. A price that is not set shows its dash placeholder in the
   danger colour, because a missing price is the thing to spot. */
.cellbox {
  font: inherit; color: inherit; background: transparent;
  border: 1px solid transparent; border-radius: 6px; padding: 3px 6px;
  width: 100%; min-width: 74px;
}
.cellbox.money, .cellbox.n { text-align: right; }
/* A money field in a form reads right-aligned, the way it does on the sheet
   the form is filling in. */
input.n { text-align: right; }
/* The box's own right padding sat the figure a few pixels inside its cell,
   short of where the header above it stops — a price list's whole point is
   the column reading straight down, and an input box a few pixels off is
   still off. */
.cellbox.money { padding-right: 0; }
/* A quantity or a price in a column that is already narrow. The default
   minimum is set for a price list eight hundred rows deep; a dialog's table
   has six columns to fit and no room to spare. */
.cellbox.n { min-width: 56px; max-width: 84px; }
.cellbox.code { font-size: .82rem; color: var(--muted); min-width: 108px; }
.cellbox:hover { border-color: var(--rose-soft); }
/* Borderless is right for a price list eight hundred rows deep, where the
   boxes are the whole page and nobody has to be told. It is wrong for three
   rows inside a dialog: there the box has to say it is a box before somebody
   reads the screen as a report and walks off to another one. */
.cellbox.open {
  border-color: var(--rose-soft); background: var(--card);
  min-width: 0;
}
.cellbox.open:hover { border-color: var(--rose-dust); }
/* A product name is the longest thing in the row and the one somebody has to
   read to know what they are changing. The column has to claim the width for
   it rather than cutting it off at the eighth word. */
.cellbox.open[data-swap], .cellbox.open[data-add] { min-width: 300px; }
.cellbox:focus {
  outline: none; border-color: var(--rose-deep); background: #fff;
  color: var(--ink);
}
.cellbox.saving { opacity: .45; pointer-events: none; }

/* A table wider than the page. Nine price codes across is more than a laptop
   has, and the answer is to let the table scroll inside its own box rather
   than let the whole page scroll sideways under the menu. */
.scrollx { overflow-x: auto; overscroll-behavior-x: contain; }
.scrollx table { min-width: 100%; }
.scrollx td, .scrollx th { white-space: nowrap; }
.scrollx td:nth-child(2) { white-space: normal; min-width: 240px; }

/* The payroll cutoff table: two dozen figures wide. Scrolling for them
   sideways was tried and asked back out of — the owner wants the whole
   table in view at once, so every column gives up its own width instead
   and takes a fixed, even share of the screen, however tight. Fixed table
   layout is what makes that a guarantee rather than a hope: it sizes
   columns from the CSS alone, never from what a figure needs to fit. */
#pr_list table { table-layout: fixed; min-width: 0; font-size: .72rem; }
#pr_list th, #pr_list td {
  white-space: normal; padding: 4px 3px;
  overflow-wrap: break-word; hyphens: auto;
}
#pr_list td:first-child, #pr_list th:first-child { white-space: normal; width: 12%; min-width: 0; }
#pr_list .cellbox.n { min-width: 0; max-width: none; padding: 2px 2px; font-size: .72rem; }

@media print { .dialog-x { display: none !important; } }

/* ---------- the purchase billing sheet ----------
   The one sheet in this system that goes out rather than back: the company
   buying rather than selling, read by a supplier rather than a reseller. So
   it is the one that does not wear the house rose — orange, and laid out as
   the paper it replaces is, with two parties across the top instead of one. */
.doc.po { color: #000; }
.doc.po .rule { border-top: 6px solid #f5a623; margin-bottom: 12px; }
.doc.po .po-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.doc.po .po-head img { height: 86px; }
.doc.po .po-title { text-align: left; min-width: 300px; }
.doc.po .po-title h2 {
  color: #f5a623; font-size: 1.7rem; letter-spacing: .01em; text-align: right;
  margin: 6px 0 16px;
}
/* The supplier invoice alone carries its logo on the right, title and
   numbers on the left — the title's text still has to hug the edge it is
   now next to, not the one it left. */
.doc.po .invoice-split-ledger .po-title { min-width: 0; }
.doc.po .invoice-split-ledger .po-title h2 { text-align: left; }
.doc.po .fld { display: flex; gap: 8px; font-size: .68rem; line-height: 1.5; }
.doc.po .fld span { color: #333; min-width: 118px; }
.doc.po .fld b { font-weight: 700; }
.doc.po .barhd {
  background: #f5a623; color: #fff; font-weight: 700; font-size: .68rem;
  padding: 2px 8px; display: inline-block; margin-bottom: 3px;
}
.doc.po .po-parties {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 6px 0 12px;
}
.doc.po .po-parties.one { grid-template-columns: 1fr; }
.doc.po table.lines th {
  background: #f5a623; color: #fff; border-color: #f5a623;
  font-size: .66rem; letter-spacing: .03em;
}
.doc.po table.lines td { border-color: #f6dfba; height: 17px; }
.doc.po table.lines tfoot td {
  background: #fdecd2; border-color: #f5a623; font-weight: 700;
}
.doc.po .notes { width: 260px; border: 1px solid #f6dfba; }
.doc.po .notes .barhd { display: block; margin: 0; }
.doc.po .notes .wrote {
  min-height: 34px; padding: 5px 8px; font-size: .68rem;
  border-bottom: 1px solid #f6dfba;
}
/* Record payment on top, its own row with the remove button; the bill's own
   papers stacked underneath, one per line — not a row of pills fighting for
   space. */
.bill-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.bill-actions-top { display: flex; align-items: center; gap: 6px; }
/* The Invoice tab's own row of buttons — a separate rule from .bill-actions
   above so a change to one cannot shift the other. */
.inv-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

.doc.po .sign3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px;
  margin-top: 30px; text-align: center;
}
.doc.po .sign3 .nm {
  font-weight: 700; font-size: .7rem; border-bottom: 1px solid #000;
  padding-bottom: 2px; min-height: 18px;
}
.doc.po .sign3 .role { font-size: .6rem; color: #444; margin-top: 2px; }
.doc.po .sign3 .cap { font-weight: 700; font-size: .64rem; margin-top: 3px; }

/* The receiving form wears the same bones as the purchase order and a
   different colour, because they are two halves of one transaction and the
   only question anybody asks across a stockroom is which one they are holding.
   Orange went out; green came back. */
.doc.po.rf .rule { border-top-color: #2e7d4f; }
.doc.po.rf .po-title h2 { color: #2e7d4f; }
.doc.po.rf .barhd { background: #2e7d4f; }
.doc.po.rf table.lines th { background: #2e7d4f; border-color: #2e7d4f; }
.doc.po.rf table.lines td { border-color: #cfe4d7; }
.doc.po.rf table.lines td i { font-style: normal; color: #2e7d4f; font-weight: 700; }
.doc.po.rf .notes { border-color: #cfe4d7; width: auto; }

/* The Invoice tab's own billing statement wears the same bones again, the
   same blue as the INVOICE document it sits beside on that screen — a
   supplier's bill to MS Beau Ave is orange; a reseller's own account is
   this blue, the same colour that names it everywhere else on this tab. */
.doc.po.civbill .rule { border-top-color: #2f5fa8; }
.doc.po.civbill .po-title h2 { color: #2f5fa8; }
.doc.po.civbill .barhd { background: #2f5fa8; }
.doc.po.civbill table.lines th { background: #2f5fa8; border-color: #2f5fa8; }
.doc.po.civbill table.lines td { border-color: #c3d6ef; }
.doc.po.civbill table.lines tfoot td { background: #dbe6f7; border-color: #2f5fa8; }
.doc.po.civbill .notes { border-color: #c3d6ef; }
.doc.po.civbill .notes .wrote { border-bottom-color: #c3d6ef; }
.doc.po.rf .notes .wrote { border-bottom-color: #cfe4d7; }
.doc.po .po-parties.four {
  grid-template-rows: auto auto; row-gap: 10px;
}
/* The footer is the one place the two papers differ in shape: the order has a
   comments box beside nothing, this has the gate's own record — boxes, guard,
   time — beside the three people who sign for it. */
.doc.po.rf .rf-foot {
  display: grid; grid-template-columns: 320px 1fr; gap: 28px;
  align-items: start; margin-top: 14px;
}
.doc.po.rf .rf-foot .tally { padding: 6px 8px; }
.doc.po.rf .rf-foot .tally .fld span { min-width: 108px; }
.doc.po.rf .rf-foot .sign3 { margin-top: 22px; gap: 18px; }

/* Entering a delivery. Each product is a small block of its own with its
   packings stacked under it, because that is the shape of the question being
   asked: what is it, then how did it come. */
.rfitem {
  border: 1px solid var(--line, #e6d8dc); border-radius: 10px;
  padding: 10px 12px 6px; margin-bottom: 10px;
}
.rfitem .fixed {
  padding: 7px 0; line-height: 1.25; font-size: .84rem;
}
.rfitem .fixed .dim { display: block; font-size: .72rem; }
.rfitem .packrow { padding-left: 22px; border-left: 3px solid #e9dfe2; margin-left: 4px; }
.rfitem .packfoot {
  display: flex; align-items: center; gap: 12px; padding: 2px 0 4px 26px;
}
.rfitem .packfoot .i-total { font-weight: 700; color: var(--ink, #3b2b30); }
/* A button next to a labelled input sits at the label's height without this,
   which reads as a misalignment even when nothing is wrong. */
.pushdown { align-self: flex-end; padding-bottom: 2px; }

/* A dialog opened from inside another one stacks on top of it. Only the top
   veil dims — three of them layered would turn the page to mud, and the one
   underneath is meant to stay readable, so you can see what you are coming
   back to. */
.veil:not(#dialog) { background: transparent; }

/* Typing more than the invoice owes into five boxes of pesos: said in the
   running total, in the colour everything else here says "no" in, before the
   Record button is reached rather than after it. */
.dim .over { color: var(--danger); }

/* The same again for the two stockroom sheets, which are laid out further down
   this file than the print block above and so were overriding it. A purchase
   order is signed three times and a receiving form four; on both, the room
   left over by a short delivery belongs above the signatures, not below them.

   Down here for the same reason as the block it completes: equal specificity
   to the margins it replaces, so it has to come last to win. */
@media print {
  .doc.po .sign3 { margin-top: auto; }
  .doc.po.rf .rf-foot { margin-top: auto; }
  .doc.po.rf .rf-foot .sign3 { margin-top: 22px; }
}

/* ---------- Books: the accounting app on /books ----------
   A standalone app sharing this stylesheet. Most of it reuses .panel, .btn,
   .tag, .lines and .notice; these are the few pieces its own shell needs. */
.books-top {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--rose-blush); border-bottom: 1px solid var(--rose-soft);
}
.books-top .brand { display: flex; flex-direction: column; line-height: 1.1; }
.books-top .brand b { color: var(--rose-deep); letter-spacing: .02em; }
.books-top .brand span { font-size: .72rem; color: var(--muted); }
.books-top nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.books-top nav button {
  border: none; background: transparent; font: inherit; padding: 8px 14px;
  border-radius: 8px; cursor: pointer; color: var(--ink);
}
.books-top nav button.on { background: var(--bg); color: var(--rose-deep); font-weight: 600; }
.books-top nav button:hover { background: var(--bg); }
.books-top .who { display: flex; align-items: center; gap: 10px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--rose-blush), var(--bg) 62%); }
.login-card {
  width: min(360px, 92vw); background: var(--card); border: 1px solid var(--rose-soft);
  border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 6px;
}
.login-card .brand { text-align: center; margin-bottom: 12px; }
.login-card .brand b { display: block; color: var(--rose-deep); font-size: 1.2rem; letter-spacing: .04em; }
.login-card .brand span { color: var(--muted); font-size: .8rem; }
.login-card label { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.login-card input {
  border: 1px solid var(--rose-dust); border-radius: 8px; padding: 9px 10px; font: inherit; outline: none;
}
.btn.wide { width: 100%; margin-top: 14px; padding: 10px; }

.books-top ~ #page .two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .books-top ~ #page .two-up { grid-template-columns: 1fr; } }
#page table.lines tr.sub td { background: var(--rose-blush); font-weight: 600; font-size: .72rem;
  letter-spacing: .03em; text-transform: uppercase; color: var(--rose-deep); }
#page table.lines tr.grand td { border-top: 2px solid var(--rose-dust); font-size: .95rem; }
#page .right { text-align: right; }
#page .due { color: var(--danger); }
#page table.lines tfoot .gmore, #page table.lines .l_del { padding: 2px 8px; }

/* Auto-posting panel on the Journal tab. */
#page .panel.autopost { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; background: var(--rose-blush); border: 1px solid var(--rose-soft); }

/* Reports — a sub-nav and a date bar. */
#page .subnav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
#page .subnav button {
  border: 1px solid var(--rose-soft); background: var(--card); font: inherit; padding: 6px 14px;
  border-radius: 999px; cursor: pointer; color: var(--ink);
}
#page .subnav button.on { background: var(--rose-deep); color: #fff; border-color: var(--rose-deep); }
#page .daterow { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
#page .daterow label { margin: 0 0 4px; }
#page .daterow input { padding: 6px 8px; }

/* Cash position cards. */
#page .cashcard {
  flex: 1; min-width: 150px; padding: 12px 16px; border: 1px solid var(--rose-soft);
  border-radius: 12px; background: var(--card);
}
#page .cashcard.total { background: var(--rose-blush); border-color: var(--rose-dust); }

/* A disbursement voucher, on screen and on paper. */
.voucher {
  background: #fff; color: #2a2a2a; padding: 22px 26px; border: 1px solid var(--rose-dust);
  border-radius: 10px; width: min(560px, 92vw);
}
.voucher .v-head { display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid var(--rose-dust); padding-bottom: 10px; margin-bottom: 12px; }
.voucher .v-head b { color: var(--rose-deep); letter-spacing: .03em; }
.voucher table.v-body { width: 100%; border-collapse: collapse; }
.voucher table.v-body td { padding: 7px 6px; border-bottom: 1px solid #eee; vertical-align: top; }
.voucher table.v-body td:first-child { width: 120px; }
.voucher tr.v-amt td { font-size: 1.15rem; border-bottom: none; padding-top: 12px; }
.voucher .v-sign { display: flex; gap: 20px; margin-top: 34px; }
.voucher .v-sign > div { flex: 1; font-size: .72rem; color: var(--muted); text-align: center; }
.voucher .v-line { border-top: 1px solid #333; margin-bottom: 4px; }

@media print {
  body.voucher-open .books-top,
  body.voucher-open #page,
  body.voucher-open .no-print { display: none !important; }
  body.voucher-open #dialog .dialog { box-shadow: none; border: none; padding: 0; }
  body.voucher-open .voucher { border: none; width: auto; }
}

/* Papers and proofs on an account — a small grid of thumbnails. */
/* A section folded away until it is wanted, so it does not eat the dialog.
   The heading stays the summary, with a chevron that turns when it opens. */
.fold { margin-top: 14px; }
.fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before {
  content: '›'; color: var(--rose-deep); font-size: 1.2rem; line-height: 1;
  transition: transform .15s; display: inline-block;
}
.fold[open] > summary::before { transform: rotate(90deg); }
.fold > summary h3.mt { margin-top: 0; }

.filegrid { display: flex; flex-wrap: wrap; gap: 12px; }
.filecard { margin: 0; width: 132px; }
.filecard img {
  width: 132px; height: 96px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--rose-soft); background: var(--card); display: block;
}
.filethumb { cursor: zoom-in; }

/* Tap a thumbnail and it fills the screen; tap anywhere to close. */
.lightbox {
  position: fixed; inset: 0; z-index: 1000; cursor: zoom-out;
  background: rgba(20, 8, 14, .82); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 24px;
}
.lightbox img {
  max-width: 96vw; max-height: 88vh; object-fit: contain;
  border-radius: 10px; box-shadow: 0 12px 48px rgba(0, 0, 0, .5);
}
.lightbox .lightbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
}
.lightbox .cap { color: #fff; font-size: .9rem; text-align: center; }
.lightbox .btn { text-decoration: none; }
.filecard figcaption { font-size: .72rem; margin-top: 4px; line-height: 1.3; word-break: break-word; }
.linkbtn {
  border: none; background: none; color: var(--danger); font: inherit; font-size: .72rem;
  padding: 0; margin-left: 6px; cursor: pointer; text-decoration: underline;
}

/* The product picker's rows read too faint; a clearer, thicker divider. */
#ch_goods td { border-bottom: 2px solid var(--rose-dust); }

/* Saved chat-order drafts. */
.draft-group { margin-top: 12px; }
.draft-group:first-of-type { margin-top: 4px; }
.draft-head { color: var(--rose-deep); font-size: .82rem; padding-bottom: 2px;
  border-bottom: 2px solid var(--rose-soft); }
.draft-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.draft-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border: 1px solid var(--rose-soft); border-radius: 10px;
}

.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* Payslips
   Their own classes, because the Team's PIN slips already own .slip and .slips
   and their print rules were quietly setting a payslip three to a row.

   The shape the shop's own bookkeeper issues: a title band, CONFIDENTIAL under
   it, who is paid and for which cutoff, then earnings and deductions ruled line
   by line with the hours or days beside each figure, and the net at the foot. */
.payslips { display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); }
.payslip {
  border: 1px solid var(--line); border-radius: 3px; background: var(--card, #fff);
  overflow: hidden; break-inside: avoid; font-size: 12px; line-height: 1.4;
  box-shadow: 0 1px 3px rgba(70, 83, 107, .07);
}
.payslip .band {
  background: #46536b; color: #fff; text-align: center; font-weight: 700;
  letter-spacing: .24em; padding: 8px; font-size: 12px;
}
.payslip .conf {
  background: #eef0f4; color: #46536b; text-align: center; font-weight: 600;
  letter-spacing: .2em; padding: 3px; font-size: 9px;
}
.payslip .top { display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px 8px; }
.payslip .firm { display: flex; align-items: center; gap: 10px; flex: 1;
  font-weight: 700; font-style: italic; color: #46536b; line-height: 1.2;
  font-size: 10.5px; }
/* The mark carries the letterhead, the words underneath it only say who that
   is — so the logo is the larger of the two. */
.payslip .mark { width: 58px; height: 58px; object-fit: contain; flex: 0 0 auto; }
.payslip .firm span { font-size: 9px; color: var(--dim); letter-spacing: .1em;
  text-transform: uppercase; font-style: normal; font-weight: 500; }
.payslip .dates { border-collapse: collapse; font-size: 11px; }
.payslip .dates td { padding: 2px 0 2px 10px; white-space: nowrap; }
.payslip .dates td:first-child { color: var(--dim); }
.payslip .dates td.n { text-align: right; border-bottom: 1px solid var(--line);
  font-weight: 600; }
.payslip .title { margin-left: auto; text-align: right; font-weight: 800;
  letter-spacing: .2em; font-size: 12px; display: flex; flex-direction: column; }
.payslip .title span { font-weight: 500; letter-spacing: .02em; font-size: 10px;
  color: var(--dim); }

.payslip .who { width: calc(100% - 32px); margin: 4px 16px 12px;
  border-collapse: collapse; font-size: 11px; }
.payslip .who td { padding: 3px 0; }
.payslip .who td:nth-child(odd) { color: var(--dim); white-space: nowrap;
  padding-right: 8px; width: 1%; }
.payslip .who td:nth-child(even) { border-bottom: 1px solid var(--line); }
.payslip .who td.n { text-align: right; }

.payslip .rows { width: calc(100% - 32px); margin: 0 16px 10px;
  border-collapse: collapse; }
.payslip .rows th { text-align: left; font-size: 10px; letter-spacing: .04em;
  padding: 5px 0; border-top: 1.5px solid #46536b;
  border-bottom: 1.5px solid #46536b; }
.payslip .rows th.c, .payslip .rows td.c { width: 22%; text-align: center;
  color: var(--dim); white-space: nowrap; }
.payslip .rows th.n, .payslip .rows td.n { width: 26%; text-align: center;
  white-space: nowrap; }
.payslip .rows td.n, .payslip .rows td.c, .payslip .net td.n {
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.payslip .rows td { padding: 2.5px 0;
  border-bottom: 1px solid rgba(70, 83, 107, .07); }
.payslip .rows tbody tr:last-child td { border-bottom: none; }
.payslip .rows tfoot td { font-weight: 700; border-bottom: none;
  border-top: 1.5px solid #46536b; padding-top: 5px; }

.payslip .rate { margin: -4px 16px 14px; font-size: 9.5px; color: var(--dim); }

.payslip .net { width: calc(100% - 32px); margin: 0 16px 4px;
  border-collapse: collapse; }
.payslip .net td { padding: 8px 0; font-weight: 800; font-size: 15px;
  border-top: 2px solid #46536b; }
.payslip .net td.n { text-align: right; }

.payslip .sign { display: flex; gap: 20px; padding: 22px 16px 0; }
.payslip .sign > div { flex: 1; font-size: 9.5px; color: var(--dim);
  text-align: center; }
.payslip .sign .rule { display: block; border-bottom: 1px solid var(--ink, #333);
  height: 18px; margin-bottom: 3px; }
.payslip .note { padding: 10px 16px 0; font-size: 9.5px; color: var(--dim);
  line-height: 1.5; }
.payslip .keep { padding: 10px 16px 14px; display: flex; flex-wrap: wrap;
  gap: 8px; align-items: center; justify-content: flex-end; }
/* Already gone out, and when. Quiet — it is a fact about the slip, not a
   thing to press. */
.payslip .sent { font-size: 10px; font-weight: 700; color: var(--good, #1b7a4b);
  background: color-mix(in srgb, var(--good, #1b7a4b) 12%, transparent);
  border-radius: 999px; padding: 3px 9px; }

/* On paper: US Letter, one person to a page, set at 11 — a payslip is a form,
   not a letter, and at the screen's own size it ran to a second sheet. */
@media print {
  /* The screen's own furniture does not belong on somebody's payslip: the page
     heading, the four tabs, the hint under them. */
  body:has(.payslips) .head,
  body:has(.payslips) .subtabs,
  body:has(.payslips) #pr_mailbox,
  body:has(.payslips) .hint { display: none !important; }
  .payslips { display: block; }
  .payslip {
    font-size: 11px; line-height: 1.3; border: 1px solid #999;
    box-shadow: none; border-radius: 0; padding-bottom: 6px;
    break-after: page; page-break-after: always;
    break-inside: avoid; page-break-inside: avoid;
  }
  .payslip:last-child { break-after: auto; page-break-after: auto; }
  .payslip .band { font-size: 11px; padding: 6px;
    background: #46536b !important; -webkit-print-color-adjust: exact;
    print-color-adjust: exact; }
  .payslip .conf { font-size: 9px; padding: 3px;
    background: #eef0f4 !important; -webkit-print-color-adjust: exact;
    print-color-adjust: exact; }
  .payslip .top { padding: 8px 12px 5px; }
  .payslip .mark { width: 50px; height: 50px; }
  .payslip .who { margin: 2px 12px 7px; width: calc(100% - 24px); font-size: 10px; }
  .payslip .rows { margin: 0 12px 7px; width: calc(100% - 24px); font-size: 11px; }
  .payslip .rows th { font-size: 10px; padding: 3px 0; }
  .payslip .rows td { padding: 1.5px 0; }
  .payslip .rate { margin: -3px 12px 8px; font-size: 9px; }
  .payslip .net { margin: 0 12px 2px; width: calc(100% - 24px); }
  .payslip .net td { padding: 5px 0; font-size: 13px; }
  .payslip .sign { padding: 16px 12px 0; }
  .payslip .note { padding: 7px 12px 0; font-size: 9px; }
  .payslip .keep { display: none !important; }
}

.po-split { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
.po-split-left { min-width: 0; padding-right: 22px; }
.po-split-left #po_list table { table-layout: fixed; }
.po-split-left #po_list th, .po-split-left #po_list td {
  padding: 6px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.po-split-left #po_list th:nth-child(1), .po-split-left #po_list td:nth-child(1) { width: 16%; }
.po-split-left #po_list th:nth-child(2), .po-split-left #po_list td:nth-child(2) { width: 14%; }
.po-split-left #po_list th:nth-child(3), .po-split-left #po_list td:nth-child(3) { width: 15%; }
.po-split-left #po_list th:nth-child(4), .po-split-left #po_list td:nth-child(4) { width: 20%; }
.po-split-left #po_list th:nth-child(5), .po-split-left #po_list td:nth-child(5) {
  width: 21%; white-space: normal; text-overflow: clip; overflow: visible;
}
.po-split-left #po_list th:nth-child(6), .po-split-left #po_list td:nth-child(6) { width: 14%; overflow: visible; }
.po-split-left #po_list td:nth-child(4) .nameopen { max-width: 100%; }
.po-split-left #po_list td:nth-child(4) b,
.po-split-left #po_list td:nth-child(4) .dim { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.po-split-right { min-width: 0; border-left: 3px solid var(--rose-dust); padding-left: 22px; }

/* The order's Received/Price columns crowded against the printed sheet's
   fixed 900px column — give the sheet less room so the working table gets
   enough to lay out its columns without a horizontal scrollbar. */
.dialog.po-open .order-split .co-side { max-width: 740px; }
/* Product, Quantity, Unit, Status, Received (input + Save) and sometimes
   Branch, plus the delete button — this table has more columns than the
   generic edit-side floor (380px) was ever sized for, so below full HD the
   two sides were staying side by side per the general rule and squeezing
   the table into ellipsized fragments instead. Give it a floor wide enough
   to lay out on its own, so flex-wrap drops it to its own full-width row
   once the screen genuinely can't fit both comfortably. */
.dialog.po-open .order-split .edit-side { flex-basis: 620px; min-width: 620px; }
@media (max-width: 680px) {
  .dialog.po-open .order-split .edit-side { min-width: 0; }
}
.dialog.po-open .order-split .edit-side .po-lines-table { table-layout: fixed; }
.dialog.po-open .order-split .edit-side .po-lines-table th,
.dialog.po-open .order-split .edit-side .po-lines-table td {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Price/Total are left out of the markup entirely on this table when a
   caller doesn't want them (see openPO's H), rather than rendered and
   hidden — a hidden cell still claimed a column's width under
   table-layout:fixed, which was the dead gap this table used to have
   between the last real column and the delete button. So column 6 (or 7,
   with Branch) is always the delete button now, never a phantom column. */
.dialog.po-open .order-split .edit-side .po-lines-table th:nth-child(1),
.dialog.po-open .order-split .edit-side .po-lines-table td:nth-child(1) { width: 26%; }
.dialog.po-open .order-split .edit-side .po-lines-table th:nth-child(2),
.dialog.po-open .order-split .edit-side .po-lines-table td:nth-child(2) { width: 8%; }
.dialog.po-open .order-split .edit-side .po-lines-table th:nth-child(3),
.dialog.po-open .order-split .edit-side .po-lines-table td:nth-child(3) { width: 7%; }
.dialog.po-open .order-split .edit-side .po-lines-table th:nth-child(4),
.dialog.po-open .order-split .edit-side .po-lines-table td:nth-child(4) {
  width: 13%; overflow: visible; white-space: normal; text-overflow: clip;
}
.dialog.po-open .order-split .edit-side .po-lines-table th:nth-child(5),
.dialog.po-open .order-split .edit-side .po-lines-table td:nth-child(5) { width: 32%; overflow: visible; }
.dialog.po-open .order-split .edit-side .po-lines-table th:nth-child(6),
.dialog.po-open .order-split .edit-side .po-lines-table td:nth-child(6) { width: 8%; }
/* The Received box itself is capped at 84px by the generic .cellbox.n rule
   everywhere else it's used (Quantity, Price); this is the one place that
   box needs real room for the Save button beside it. */
.dialog.po-open .order-split .edit-side .po-lines-table [data-received] {
  max-width: none; width: 100%;
}

/* Only when a second branch makes the Branch column real — otherwise the
   columns above already add up to a whole table and this would just steal
   room nobody asked to give up. */
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col th:nth-child(1),
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col td:nth-child(1) { width: 20%; }
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col th:nth-child(2),
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col td:nth-child(2) { width: 7%; }
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col th:nth-child(3),
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col td:nth-child(3) { width: 6%; }
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col th:nth-child(4),
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col td:nth-child(4) { width: 11%; }
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col th:nth-child(5),
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col td:nth-child(5) { width: 27%; overflow: visible; }
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col th:nth-child(6),
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col td:nth-child(6) {
  width: 15%; overflow: visible;
}
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col th:nth-child(7),
.dialog.po-open .order-split .edit-side .po-lines-table.has-branch-col td:nth-child(7) { width: 8%; }
.dialog.po-open .order-split .edit-side .po-lines-table td:nth-child(1) b,
.dialog.po-open .order-split .edit-side .po-lines-table td:nth-child(1) .dim {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}

/* A 201 file's facts: label over value, as many across as fit. */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 20px; }
.facts > div { min-width: 0; overflow-wrap: anywhere; }

/* IT support — your theme, laid out like the owner's reference: a switch
   between the dashboard and the form, three counts, a two-column form. */
.ithead { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px; }
.itswitch { display: inline-flex; background: var(--rose-blush); border-radius: 999px; padding: 4px; }
.itswitch button { border: 0; background: transparent; padding: 8px 18px; border-radius: 999px;
  font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.itswitch button.on { background: var(--rose-deep); color: #fff; }
.itstats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 8px; }
.itstats span { display: block; color: var(--muted); font-size: .82rem; }
.itstats b { font-size: 1.5rem; color: var(--ink, inherit); }
.itstats b.amber { color: var(--warning); }
.itstats b.red { color: var(--danger); }
.itgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.itgrid .wide { grid-column: 1 / -1; }
.itgrid input, .itgrid select, .itgrid textarea { width: 100%; }
.itsendbig { width: 100%; padding: 12px; }
.itthread { margin-top: 10px; display: grid; gap: 8px; }
.itmsg { background: var(--rose-blush); border-radius: 10px; padding: 8px 12px; font-size: .9rem;
  max-width: 80%; }
.itmsg.it { background: #e8eef8; justify-self: end; }
.itreply input { flex: 1; }
.itreply .btn { flex: 0 0 auto; align-self: end; }
.itstatus .btn { flex: 0 0 auto; }
#itBadge { margin-left: 4px; font-size: .7rem; padding: 0 6px; }
@media (max-width: 640px) { .itgrid { grid-template-columns: 1fr; } }

/* The dashboard: five figures, a chart beside the latest invoices, the
   stock list, and what needs attention underneath. */
.dashkpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.dashkpi { background: #fff; border: 1px solid var(--rose-soft); border-radius: 14px; padding: 16px 18px; }
.dashkpi span { display: block; color: var(--muted); font-size: .8rem; }
.dashkpi b { display: block; font-size: 1.55rem; margin-top: 4px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.dashkpi small { display: block; color: var(--muted); font-size: .76rem; margin-top: 2px; }
.dashkpi.ar b { color: var(--danger); }
.dashup { color: var(--success); font-weight: 600; }
.dashdown { color: var(--danger); font-weight: 600; }
.dashgrid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
/* A grid cell will not shrink below its widest table without this, which
   pushed the page sideways on a phone. */
.dashgrid > *, .dashkpis > * { min-width: 0; }
.dashhd { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.dashhd h3 { margin: 0; }
.dashchips { display: flex; gap: 6px; flex-wrap: wrap; }
.dashchips button { border: 1px solid var(--rose-soft); background: #fff; border-radius: 999px; padding: 3px 12px;
  font: inherit; font-size: .78rem; color: var(--muted); cursor: pointer; }
.dashchips button.on { background: var(--rose-deep); border-color: var(--rose-deep); color: #fff; }
.dashbar:hover path { opacity: 1; }
.dashattn { color: var(--rose-deep); margin: 8px 0 10px; display: flex; gap: 10px; align-items: baseline; }
@media (max-width: 1200px) { .dashkpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .dashkpis { grid-template-columns: repeat(2, 1fr); } .dashgrid { grid-template-columns: 1fr; } }

/* Running stocks' own counter (Internal Inventory Report) — a copy of the
   dashboard's chips, kept separate so neither screen moves the other. */
.rshd { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rshd h3 { margin: 0; }
.rschips { display: flex; gap: 6px; flex-wrap: wrap; }
.rschips button { border: 1px solid var(--rose-soft); background: #fff; border-radius: 999px; padding: 3px 12px;
  font: inherit; font-size: .78rem; color: var(--muted); cursor: pointer; }
.rschips button.on { background: var(--rose-deep); border-color: var(--rose-deep); color: #fff; }

/* Bank report's tile menu — this screen's own. */
.brgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 980px; }
.brtile { display: flex; align-items: center; gap: 12px; padding: 18px 20px; background: #fff;
  border: 1px solid var(--rose-soft); border-radius: 12px; font: inherit; font-weight: 600; font-size: .95rem;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink); cursor: pointer; text-align: left; }
.brtile:hover { border-color: var(--rose-deep); box-shadow: 0 2px 10px rgba(160, 80, 110, .12); }
.brtile svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--rose-deep); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 600px) { .brgrid { grid-template-columns: 1fr; } }
.brhd { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.brhd h3 { margin: 0; }
/* Bank report's Dashboard header — a heading, not a button. */
.brheader { display: flex; align-items: center; gap: 12px; padding: 18px 20px; margin-bottom: 12px; max-width: 980px;
  box-sizing: border-box; background: var(--rose-soft); border-radius: 12px; font-weight: 700; font-size: 1rem;
  letter-spacing: .04em; text-transform: uppercase; color: var(--rose-deep); cursor: default; }
.brheader svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
/* Bank report → Sales: the four boxes are buttons. */
.tile.brsf { font: inherit; text-align: left; cursor: pointer; width: 100%; display: flex; flex-direction: column; justify-content: flex-start; }
.tile.brsf:hover { border-color: var(--rose-deep); }
.tile.brsf.on { outline: 2px solid var(--rose-deep); outline-offset: -2px; background: #fff7fa; }
/* Inventory stock value report's own footer: Download, then the total value. */
.svfoot { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 12px;
  padding-top: 10px; border-top: 2px solid var(--rose-soft); color: var(--muted); }
.svfoot b { color: var(--rose-deep); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
/* Bank report's Dashboard: Daily/Monthly, the date bar and six figures. */
.brdash { max-width: 980px; margin-bottom: 16px; }
.brdate { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 14px;
  padding: 10px 14px; background: #fff; border: 1px solid var(--rose-soft); border-radius: 12px; }
.brdate b { font-size: 1.05rem; letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.brfigs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brfigs .tile .label { font-size: .85rem; margin-bottom: 4px; }
@media (max-width: 600px) { .brfigs { grid-template-columns: 1fr; } }

/* IT's hardware masterlist: the four intake steps, a three-across form,
   and the drawer that says who has a unit now. */
.itsteps { display: flex; flex-wrap: wrap; gap: 8px; }
.itsteps span { background: var(--rose-blush); border-radius: 999px; padding: 6px 14px;
  font-weight: 600; font-size: .85rem; }
.itsteps span + span::before { content: '→ '; color: var(--muted); }
.asgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 16px; }
.asgrid .wide { grid-column: 1 / -1; }
.asgrid input:not([type=checkbox]), .asgrid select { width: 100%; }
.ascheck { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 4px; }
.ascheck label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500;
  white-space: nowrap; margin: 0; width: auto; }
.ascheck input { width: auto; margin: 0; }
.asveil { position: fixed; inset: 0; background: rgba(40, 20, 30, .35); z-index: 50;
  display: flex; justify-content: flex-end; }
.asdrawer { background: #fff; width: min(420px, 100vw); height: 100%; overflow-y: auto;
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom, 0px)); box-shadow: -8px 0 30px rgba(0,0,0,.15); }
.asdrawer select, .asdrawer input, .asdrawer textarea { width: 100%; }
.asdrawer .row { justify-content: space-between; }
.asdrawer .dialog-x { position: static; }
@media (max-width: 900px) { .asgrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .asgrid { grid-template-columns: 1fr; } }

/* Hardware assets: attachment thumbnails, and its own zoomable viewer. */
.asthumbs { display: flex; flex-wrap: wrap; gap: 8px; min-height: 42px; align-items: center; }
.asthumbs img { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; cursor: zoom-in;
  border: 1px solid var(--rose-soft); }
.asthumbs.big figure { margin: 0; text-align: center; font-size: .75rem; }
.asthumbs.big img { width: 84px; height: 84px; display: block; }
.asthumbs.big figcaption { color: var(--muted); margin-top: 2px; }
.itzoom { position: fixed; inset: 0; z-index: 100; background: rgba(15, 10, 14, .92);
  display: flex; flex-direction: column; }
.itzoom-stage { flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center;
  touch-action: none; }
.itzoom-stage img { max-width: 92vw; max-height: 82vh; transform-origin: center center;
  transition: transform .08s ease-out; user-select: none; }
.itzoom-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(0, 0, 0, .4); }
.itzoom-bar .cap { color: #fff; margin-right: 8px; }
.itzoom-pct { color: #fff; min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.asspecs { white-space: pre-line; font-size: .8rem; max-width: 46ch; }
.asgrid textarea { width: 100%; min-height: 7.5em; resize: vertical; }

/* Bank report: the date opens a calendar under it (Dashboard and Sales). */
.brpickwrap { position: relative; display: inline-block; }
.brpick { border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 4px 12px;
  font: inherit; color: inherit; cursor: pointer; }
.brpick:hover, .brpick:focus-visible { border-color: var(--rose-soft); background: var(--rose-blush); }
.brdate .brpick b { font-size: 1.05rem; letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.brcal { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 40;
  background: #fff; border: 1px solid var(--rose-soft); border-radius: 14px; padding: 12px;
  box-shadow: 0 12px 30px rgba(60, 20, 40, .16); width: 290px; }
.brcal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.brcal-head button, .brcal-days button, .brcal-months button { border: 0; background: transparent;
  font: inherit; cursor: pointer; border-radius: 8px; color: var(--ink, inherit); }
.brcal-head button { padding: 4px 10px; font-size: 1.1rem; }
.brcal-head button:disabled, .brcal-days button:disabled, .brcal-months button:disabled { opacity: .3; cursor: default; }
.brcal-week, .brcal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.brcal-week span { font-size: .72rem; color: var(--muted); padding: 4px 0; }
.brcal-days button { padding: 7px 0; font-variant-numeric: tabular-nums; }
.brcal-days button:hover:not(:disabled), .brcal-months button:hover:not(:disabled) { background: var(--rose-blush); }
.brcal-days button.today { box-shadow: inset 0 0 0 1px var(--rose-deep); }
.brcal-days button.on, .brcal-months button.on { background: var(--rose-deep); color: #fff; }
.brcal-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.brcal-months button { padding: 10px 0; }
.brcal-foot { display: flex; justify-content: center; margin-top: 8px; }

/* Bank report → Bank: the Bank Transactions section, as the owner drew it. */
.btpanel { padding: 18px 20px; }
.bthead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.bthead .bttitle { flex: 1; min-width: 220px; }
.bthead h3 { margin: 0; font-size: 1.25rem; }
.bticon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--rose-blush); flex: 0 0 auto; }
.bticon svg { width: 24px; height: 24px; fill: none; stroke: var(--ink, #3d2a33); stroke-width: 1.8;
  stroke-linecap: round; }
.bticon circle { fill: var(--ink, #3d2a33); stroke: none; }
.bticon.big { width: 56px; height: 56px; }
.btfilters { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; background: #fbf5f8;
  border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.btfilters select { min-width: 200px; flex: 1; }
.btsearch { position: relative; flex: 1.5; min-width: 240px; display: flex; align-items: center; margin: 0; }
.btsearch span { position: absolute; left: 10px; font-size: .85rem; opacity: .6; }
.btsearch input { width: 100%; padding-left: 32px; }
.btrange-wrap { position: relative; flex: 1; min-width: 200px; }
.btrange { width: 100%; text-align: left; display: flex; gap: 8px; align-items: center; background: #fff;
  border: 1px solid var(--rose-soft); border-radius: 10px; padding: 9px 12px; font: inherit; color: var(--muted);
  cursor: pointer; }
.btrange #bt_range_label { flex: 1; }
.btrange.on { color: var(--ink, inherit); border-color: var(--rose-deep); }
.btrangepop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; background: #fff;
  border: 1px solid var(--rose-soft); border-radius: 12px; padding: 12px; width: 260px;
  box-shadow: 0 12px 30px rgba(60, 20, 40, .16); display: grid; gap: 8px; }
.btrangepop input { width: 100%; }
.btrangepop .row { justify-content: flex-end; gap: 8px; }
.bttable { width: 100%; border-collapse: collapse; }
.bttable thead th { background: #fbf0f4; text-transform: uppercase; font-size: .74rem; letter-spacing: .06em;
  color: var(--muted); font-weight: 600; text-align: left; padding: 10px 12px; white-space: nowrap; }
.bttable thead th:first-child { border-radius: 10px 0 0 10px; }
.bttable thead th:last-child { border-radius: 0 10px 10px 0; }
.bttable td { padding: 10px 12px; border-bottom: 1px solid var(--rose-soft); vertical-align: middle; }
.bttable .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bttable .c { text-align: center; }
.btin { color: #3f7d4e; } .btout { color: #b4475a; }
.btempty { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 28px 0; }
.btempty .dim { font-size: .82rem; margin-top: 2px; }
.bttable td { font-size: .9rem; }
.bttable th, .bttable td { padding-left: 9px; padding-right: 9px; }
.bttable td:nth-child(3), .bttable td:nth-child(10) { min-width: 130px; max-width: 220px; overflow-wrap: anywhere; }
.btscroll { overflow-x: auto; }
.bttable td:nth-child(2) { overflow-wrap: anywhere; max-width: 150px; }
.btrange #bt_range_label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bttable td:first-child { white-space: nowrap; }

/* Bank report → Bank: Cash position as two columns, BANK and CASH. */
.br-cash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.br-cash-col { display: grid; gap: 12px; }
.br-cash-colhd { display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rose-deep);
  border-bottom: 2px solid var(--rose-soft); padding-bottom: 6px; }
.br-cash-colhd .dim { letter-spacing: 0; font-weight: 600; }
.br-cash-rest { margin-top: 12px; font-size: .85rem; }
@media (max-width: 640px) { .br-cash-cols { grid-template-columns: 1fr; } }

/* Bank report → Bank: a Cash position box opens its own transactions. */
.br-cash-pick { display: block; width: 100%; text-align: left; background: #fff; font: inherit;
  color: inherit; cursor: pointer; transition: border-color .12s, background .12s; }
.br-cash-pick:hover, .br-cash-pick:focus-visible { border-color: var(--rose-deep); background: var(--rose-blush); }
.br-cash-pick.on { border-color: var(--rose-deep); background: var(--rose-blush);
  box-shadow: inset 0 0 0 1px var(--rose-deep); }
/* The BANK and CASH words over the two columns, larger (owner's ask); the
   subtotal beside each keeps its size. */
.br-cash-colhd > span:first-child { font-size: 1.45rem; letter-spacing: .06em; }

/* Customer order → Invoice: the Date range button and its drop-down. */
.coinv-rangewrap { position: relative; display: inline-block; }
.coinv-range { display: flex; gap: 8px; align-items: center; min-width: 230px; background: #fff;
  border: 1px solid var(--rose-soft); border-radius: 10px; padding: 9px 12px; font: inherit;
  color: var(--muted); cursor: pointer; text-align: left; }
.coinv-range #coinv_range_label { flex: 1; white-space: nowrap; }
.coinv-range.on { color: var(--ink, inherit); border-color: var(--rose-deep); }
.coinv-rangepop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; background: #fff;
  border: 1px solid var(--rose-soft); border-radius: 12px; padding: 12px; width: 260px;
  box-shadow: 0 12px 30px rgba(60, 20, 40, .16); display: grid; gap: 8px; }
.coinv-rangepop input { width: 100%; }
.coinv-rangepop .row { justify-content: flex-end; gap: 8px; }

/* Payment Management: the Account pick with Rename and Add bank beside it. */
.btacct-row { display: flex; gap: 6px; align-items: center; }
.btacct-row select { flex: 1; min-width: 0; }
.btacct-row .btn { flex: 0 0 auto; white-space: nowrap; }
.btacct-edit { display: flex; gap: 6px; margin-top: 6px; }
.btacct-edit input { flex: 1; min-width: 0; }
.btacct-edit[hidden] { display: none; }

/* Customer order → Pending: the Date range button and its drop-down. */
.pend-rangewrap { position: relative; display: inline-block; }
.pend-range { display: flex; gap: 8px; align-items: center; min-width: 230px; background: #fff;
  border: 1px solid var(--rose-soft); border-radius: 10px; padding: 9px 12px; font: inherit;
  color: var(--muted); cursor: pointer; text-align: left; }
.pend-range #pending_range_label { flex: 1; white-space: nowrap; }
.pend-range.on { color: var(--ink, inherit); border-color: var(--rose-deep); }
.pend-rangepop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; background: #fff;
  border: 1px solid var(--rose-soft); border-radius: 12px; padding: 12px; width: 260px;
  box-shadow: 0 12px 30px rgba(60, 20, 40, .16); display: grid; gap: 8px; }
.pend-rangepop input { width: 100%; }
.pend-rangepop .row { justify-content: flex-end; gap: 8px; }

/* Payment Management (Bank report → Bank): Account | Account no., Rename and
   Add bank under the number, and the List of mode of payment below. */
.pm-top { align-items: flex-start; }
.pm-acts { display: flex; gap: 6px; margin-top: 8px; }
.pm-acts .btn { white-space: nowrap; }
.pm-list { width: 100%; border-collapse: collapse; margin-top: 6px; }
.pm-list th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted, #8a6f7d); border-bottom: 1px solid var(--line, #ecd5df); padding: 6px 8px; }
.pm-list td { padding: 8px; border-bottom: 1px solid var(--line, #f3e4ea); }
.pm-list td.pm-x { text-align: right; width: 1%; white-space: nowrap; }
.pm-list [data-pmdrop].sure { background: #b5484f; color: #fff; }

/* ---------------------------------------------------------------------------
   Reseller Hub — the reseller's Order stock screen, laid out as the owner's
   reference drew it, in the shop's own rose palette. Its own classes (rs-*).
   --------------------------------------------------------------------------- */
.rs-hub { display: flex; flex-direction: column; gap: 18px; }
.rs-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(90deg, var(--rose-deep), var(--rose-primary));
  border-radius: var(--round); padding: 12px 16px; box-shadow: var(--shade); }
.rs-brandname { color: #fff; font-weight: 700; font-size: 1.1rem; letter-spacing: .02em; margin-right: auto; }
.rs-brandname span { font-weight: 500; opacity: .85; }
.rs-search { flex: 0 1 300px; min-width: 160px; border: none; border-radius: 999px; padding: 9px 16px; }
.rs-track { display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
  background: #fff; color: var(--rose-deep); font-weight: 700; border-radius: 10px; padding: 8px 12px; }
.rs-track b { background: var(--rose-deep); color: #fff; border-radius: 6px; padding: 1px 8px; min-width: 22px; text-align: center; }
.rs-welcome { text-align: center; padding: 18px 12px 6px; }
.rs-welcome h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  color: var(--rose-deep); margin: 0 0 8px; }
.rs-welcome p { color: var(--muted); margin: 0 0 14px; }
.rs-pill { display: inline-block; background: var(--rose-primary); color: #fff; font-weight: 700;
  border-radius: 10px; padding: 8px 18px; box-shadow: var(--shade); }
.rs-filters { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.rs-filters label { color: var(--rose-deep); font-weight: 700; }
.rs-filters select { width: 280px; max-width: 100%; flex: 0 1 280px; }
.rs-add.added { background: var(--success); border-color: var(--success); }
.rs-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1500px) { .rs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .rs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .rs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rs-card { background: var(--card); border: 1px solid var(--rose-soft); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shade); }
.rs-badge { background: var(--rose-primary); color: #fff; text-align: center; font-size: .7rem;
  font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 8px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-photo { position: relative; aspect-ratio: 1 / 1; background: #fff; display: grid; place-items: center;
  border-bottom: 1px solid var(--rose-soft); font-size: 2.4rem; }
.rs-photo img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px);
  object-fit: contain; background: #fff; }
.rs-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; background: var(--rose-blush); }
.rs-name { color: var(--rose-deep); font-weight: 800; text-transform: uppercase; text-align: center;
  line-height: 1.2; min-height: 2.4em; }
.rs-stock { align-self: center; background: var(--success); color: #fff; font-size: .72rem; font-weight: 700;
  border-radius: 999px; padding: 3px 12px; }
.rs-stock.out { background: var(--muted); }
.rs-price { color: var(--rose-deep); font-weight: 700; font-size: .88rem; border-top: 1px solid var(--rose-soft); padding-top: 8px; }
.rs-price b { font-size: 1rem; }
.rs-srp { color: var(--muted); font-size: .78rem; margin-bottom: auto; }
.rs-tierbtn, .rs-add { width: 100%; border-radius: 10px; font-weight: 700; cursor: pointer; padding: 9px; }
.rs-tierbtn { background: transparent; color: var(--rose-deep); border: 2px solid var(--rose-primary); }
.rs-add { background: var(--rose-primary); color: #fff; border: 2px solid var(--rose-primary); }
.rs-add:hover { background: var(--rose-deep); border-color: var(--rose-deep); }
.rs-add:disabled { opacity: .5; cursor: not-allowed; }
.rs-carttotal { display: flex; justify-content: space-between; font-size: 1.2rem; margin: 12px 0;
  color: var(--rose-deep); }
.rs-tiers { width: 100%; border-collapse: collapse; margin-top: 10px; }
.rs-tiers th { text-align: left; font-size: .75rem; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--rose-soft); padding: 6px; }
.rs-tiers td { padding: 7px 6px; border-bottom: 1px solid var(--rose-soft); }
.rs-tax { display: block; text-align: center; background: var(--rose-deep); color: #fff; font-size: .75rem;
  font-weight: 800; letter-spacing: .08em; border-radius: 999px; padding: 4px 10px; }
.taxpick { min-width: 104px; padding: 4px 8px; }

/* Customer order → Invoice tab's own invoice, when the invoice is void:
   STATUS: VOIDED under the number, and a VOID stamp across the sheet. Inside
   the .doc, so the JPEG and the print carry it. Its own co-void* classes. */
.doc.co-voided { position: relative; overflow: hidden; }
.co-voidstatus { width: fit-content; margin: 2px 0 6px auto; padding: 2px 14px;
  border: 2px solid #d32f2f; background: #fff0f0; color: #d32f2f;
  font-weight: 800; font-size: .8rem; letter-spacing: .04em; }
.co-voidstamp { position: absolute; left: 50%; top: 50%; pointer-events: none; z-index: 2;
  transform: translate(-50%, -50%) rotate(-18deg);
  border: 10px solid rgba(211, 47, 47, .78); border-radius: 22px; padding: 0 44px; }
.co-voidstamp span { display: block; font: 900 128px/1.15 Georgia, 'Times New Roman', serif;
  color: rgba(211, 47, 47, .72); letter-spacing: .06em; }

/* Record payment (Invoice tab): a payment on file's reference no., shown in
   its row's Reference no. box, greyed and read-only. */
.ci_ref.ci-ref-onfile { background: #f3edf0; color: var(--muted); cursor: default; }

/* ---------------------------------------------------------------------------
   Bank report → Expenses: the Expenses Overview and the Expense Register, as
   the owner's reference laid them out, in the rose palette. Its own ex-*.
   --------------------------------------------------------------------------- */
.ex-card { background: linear-gradient(135deg, var(--rose-deep), var(--rose-primary)); color: #fff;
  border-radius: 16px; padding: 18px; box-shadow: var(--shade); }
.ex-head { display: flex; align-items: center; gap: 12px; }
.ex-head h3 { margin: 0; color: #fff; font-size: 1.15rem; letter-spacing: .02em; }
.ex-co { font-size: .82rem; opacity: .9; }
.ex-icon { width: 42px; height: 42px; border-radius: 10px; background: rgba(255,255,255,.2);
  display: grid; place-items: center; }
.ex-icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.ex-year { margin-left: auto; background: rgba(255,255,255,.25); border-radius: 999px; padding: 2px 10px;
  font-size: .78rem; font-weight: 700; }
.ex-label { margin: 14px 0 6px; font-size: .88rem; }
.ex-picks { display: flex; gap: 10px; }
.ex-picks select { flex: 1; border-radius: 999px; border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.95); color: var(--ink); padding: 9px 14px; }
.ex-picks select#ex_year { flex: 0 0 120px; }
.ex-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.ex-tile { text-align: left; background: rgba(255,255,255,.95); color: var(--ink); border: none;
  border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.ex-tile span { font-size: .85rem; color: var(--muted); }
.ex-tile b { font-size: 1.35rem; color: var(--rose-deep); }
.ex-tile small { font-size: .74rem; color: var(--rose-primary); font-weight: 600; }
.ex-tile.warn small { color: var(--warning); }
.ex-tile.info small { color: var(--success); }
.ex-tile.bad small { color: var(--danger); }
.ex-tile:hover { box-shadow: 0 0 0 2px #fff inset, 0 0 0 4px var(--rose-soft); }
.ex-reg { background: var(--card); border: 1px solid var(--rose-soft); border-radius: 16px; padding: 16px;
  margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.ex-reghead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ex-reghead h3 { margin: 0; }
.ex-sums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 2px; }
.ex-sums div { display: flex; flex-direction: column; }
.ex-sums b { font-size: 1.1rem; color: var(--rose-deep); }
.ex-form { border: 1px solid var(--rose-soft); border-radius: 12px; padding: 12px 14px; background: var(--rose-blush); }
.ex-form[hidden] { display: none; }
.ex-form h4 { margin: 0 0 6px; color: var(--rose-deep); }
.ex-formacts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.ex-search, .ex-filter { width: 100%; }
.ex-count { font-size: .8rem; margin: 2px 0 6px; }
.ex-rec { border: 1px solid var(--rose-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.ex-rectop { display: flex; justify-content: space-between; font-size: .8rem; }
.ex-rectop b { font-size: .95rem; color: var(--ink); }
.ex-recname { font-weight: 700; margin-top: 2px; }
.ex-rectags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: .8rem; }
.ex-none { color: var(--muted); padding: 10px 2px; }
.ex-copy { width: 100%; }

/* Bank report's menu as two panels on a computer: the Dashboard on the left,
   the six tiles on the right, both bigger and filling the width. The menu's
   own br-split classes; phones keep the single column. */
@media (min-width: 1000px) {
  .br-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
  .br-split .brheader, .br-split .brdash, .br-split .brgrid { max-width: none; }
  .br-split .brdash { margin-bottom: 0; }
  /* The six figures are the size of the six tiles beside them — one box
     size across both panels. */
  .br-split .brfigs { grid-auto-rows: 189px; gap: 16px; }
  .br-split .brfigs .tile { padding: 24px 24px; height: 189px; box-sizing: border-box;
    display: flex; flex-direction: column; justify-content: center; }
  .br-split .brfigs .tile .big { font-size: 1.9rem; }
  .br-split .brfigs .tile .label { font-size: .95rem; }
  .br-split-r { display: flex; }
  .br-split-r .brgrid { flex: 1; gap: 16px; grid-auto-rows: 189px; align-content: start; }
  /* The six tiles are shorter than the figures but sit in the same 189px
     rows, top edge level with the figure beside it. */
  .br-split .brtile { height: 120px; box-sizing: border-box; align-self: start; }
  .br-split .brtile { padding: 20px 24px; font-size: 1.05rem; gap: 14px; }
  .br-split .brtile svg { width: 26px; height: 26px; }
}

/* Bank report menu on a computer: Daily / Monthly and the date bar on one
   line, closer under the Dashboard heading, so the figures sit higher. */
@media (min-width: 1000px) {
  .br-split .brheader { padding: 12px 18px; margin-bottom: 8px; }
  .br-split .brdash { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
  .br-split .brdash #brd_period { margin: 0; }
  .br-split .brdash .brdate { margin: 0; padding: 6px 12px; }
  .br-split .brdash .brfigs { grid-column: 1 / -1; margin-top: 10px; }
}
/* The six tiles start level with the six figures, row for row: the right
   panel drops by the height of the Dashboard heading and the date line. */
@media (min-width: 1000px) {
  .br-split-r { padding-top: 117px; }
}

/* ---------------------------------------------------------------------------
   Bank report → Sales: the Sales Overview, in the Expenses Overview's look.
   Its own so-* (a copy, not shared).
   --------------------------------------------------------------------------- */
.so-card { background: linear-gradient(135deg, var(--rose-deep), var(--rose-primary)); color: #fff;
  border-radius: 16px; padding: 18px; box-shadow: var(--shade); }
.so-head { display: flex; align-items: center; gap: 12px; }
.so-head h3 { margin: 0; color: #fff; font-size: 1.15rem; letter-spacing: .02em; }
.so-co { font-size: .82rem; opacity: .9; }
.so-icon { width: 42px; height: 42px; border-radius: 10px; background: rgba(255,255,255,.2);
  display: grid; place-items: center; }
.so-icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.so-year { margin-left: auto; background: rgba(255,255,255,.25); border-radius: 999px; padding: 2px 10px;
  font-size: .78rem; font-weight: 700; }
.so-label { margin: 14px 0 6px; font-size: .88rem; }
.so-picks { display: flex; gap: 10px; }
.so-picks select { flex: 1; border-radius: 999px; border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.95); color: var(--ink); padding: 9px 14px; }
.so-picks select#ex_year { flex: 0 0 120px; }
.so-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.so-tile { text-align: left; background: rgba(255,255,255,.95); color: var(--ink); border: none;
  border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.so-tile span { font-size: .85rem; color: var(--muted); }
.so-tile b { font-size: 1.35rem; color: var(--rose-deep); }
.so-tile small { font-size: .74rem; color: var(--rose-primary); font-weight: 600; }
.so-tile.warn small { color: var(--warning); }
.so-tile.info small { color: var(--success); }
.so-tile.bad small { color: var(--danger); }
.so-tile:hover { box-shadow: 0 0 0 2px #fff inset, 0 0 0 4px var(--rose-soft); }

/* ---------------------------------------------------------------------------
   Bank report → Purchases: the Purchase Overview, in the Expenses Overview's
   look. Its own pv-* (a copy, not shared).
   --------------------------------------------------------------------------- */
.pv-card { background: linear-gradient(135deg, var(--rose-deep), var(--rose-primary)); color: #fff;
  border-radius: 16px; padding: 18px; box-shadow: var(--shade); }
.pv-head { display: flex; align-items: center; gap: 12px; }
.pv-head h3 { margin: 0; color: #fff; font-size: 1.15rem; letter-spacing: .02em; }
.pv-co { font-size: .82rem; opacity: .9; }
.pv-icon { width: 42px; height: 42px; border-radius: 10px; background: rgba(255,255,255,.2);
  display: grid; place-items: center; }
.pv-icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.pv-year { margin-left: auto; background: rgba(255,255,255,.25); border-radius: 999px; padding: 2px 10px;
  font-size: .78rem; font-weight: 700; }
.pv-label { margin: 14px 0 6px; font-size: .88rem; }
.pv-picks { display: flex; gap: 10px; }
.pv-picks select { flex: 1; border-radius: 999px; border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.95); color: var(--ink); padding: 9px 14px; }
.pv-picks select#ex_year { flex: 0 0 120px; }
.pv-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.pv-tile { text-align: left; background: rgba(255,255,255,.95); color: var(--ink); border: none;
  border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.pv-tile span { font-size: .85rem; color: var(--muted); }
.pv-tile b { font-size: 1.35rem; color: var(--rose-deep); }
.pv-tile small { font-size: .74rem; color: var(--rose-primary); font-weight: 600; }
.pv-tile.warn small { color: var(--warning); }
.pv-tile.info small { color: var(--success); }
.pv-tile.bad small { color: var(--danger); }
.pv-tile:hover { box-shadow: 0 0 0 2px #fff inset, 0 0 0 4px var(--rose-soft); }

/* Bank report → Purchases: the Purchase Register, a copy of the Expense
   Register's look under its own pr-* names. */
.pr-reg { background: var(--card); border: 1px solid var(--rose-soft); border-radius: 16px; padding: 16px;
  margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.pr-reghead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pr-reghead h3 { margin: 0; }
.pr-sums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 2px; }
.pr-sums div { display: flex; flex-direction: column; }
.pr-sums b { font-size: 1.1rem; color: var(--rose-deep); }
.pr-form { border: 1px solid var(--rose-soft); border-radius: 12px; padding: 12px 14px; background: var(--rose-blush); }
.pr-form[hidden] { display: none; }
.pr-form h4 { margin: 0 0 6px; color: var(--rose-deep); }
.pr-formacts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.pr-search, .pr-filter { width: 100%; }
.pr-count { font-size: .8rem; margin: 2px 0 6px; }
.pr-rec { border: 1px solid var(--rose-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.pr-rectop { display: flex; justify-content: space-between; font-size: .8rem; }
.pr-rectop b { font-size: .95rem; color: var(--ink); }
.pr-recname { font-weight: 700; margin-top: 2px; }
.pr-rectags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: .8rem; }
.pr-none { color: var(--muted); padding: 10px 2px; }
.pr-copy { width: 100%; }

/* Sales Overview: three pickers in a row on a light band, and the four boxes
   with their icon, each a button that narrows the list. */
.so-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px;
  background: rgba(255,255,255,.92); border-radius: 12px; padding: 10px 12px; color: var(--ink); }
.so-picks label { font-size: .78rem; color: var(--muted); display: block; margin-bottom: 3px; }
.so-picks select, .so-picks input { width: 100%; }
.so-picks .so-wide { grid-column: span 2; }
.so-tile { display: flex; align-items: center; gap: 14px; border: 1.5px solid transparent; }
.so-tile.on { box-shadow: 0 0 0 3px rgba(255,255,255,.9); }
.so-tile.all { border-color: var(--rose-deep); }
.so-tile.paid { border-color: var(--success); }
.so-tile.unpaid { border-color: var(--danger); }
.so-tile.part { border-color: var(--warning); }
.so-ticon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--rose-blush); }
.so-tile.paid .so-ticon { background: #e8f1ea; }
.so-tile.part .so-ticon { background: #faf0dc; }
.so-ticon svg { width: 22px; height: 22px; fill: none; stroke: var(--rose-deep); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.so-tbody { display: flex; flex-direction: column; gap: 2px; }
.so-tlabel { font-size: .85rem; color: var(--muted); }
.so-tbody b { font-size: 1.35rem; color: var(--rose-deep); }
.so-tbody small { font-size: .74rem; color: var(--muted); }
@media (min-width: 1000px) { .so-tiles { grid-template-columns: repeat(4, 1fr); } }
.so-card + .panel { margin-top: 16px; }
/* Purchase Overview: one wide Reporting period picker. */
.pv-pick { width: 100%; border-radius: 999px; border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.95); color: var(--ink); padding: 9px 14px; }
/* Purchase Register: its own records, with the amount and what was paid. */
.pr-amt { display: flex; flex-direction: column; align-items: flex-end; }
.pr-amt small { color: var(--muted); font-size: .74rem; }
.pr-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.so-tile { flex-direction: row; justify-content: flex-start; text-align: left; }

/* ---------------------------------------------------------------------------
   Bank report → Bank: the Bank Overview on top, a copy of the Expenses
   Overview's look in the rose palette. Its own bo-*.
   --------------------------------------------------------------------------- */
.bo-card { background: linear-gradient(135deg, var(--rose-deep), var(--rose-primary)); color: #fff;
  border-radius: 16px; padding: 18px; box-shadow: var(--shade); }
.bo-head { display: flex; align-items: center; gap: 12px; }
.bo-head h3 { margin: 0; color: #fff; font-size: 1.15rem; letter-spacing: .02em; }
.bo-co { font-size: .82rem; opacity: .9; }
.bo-icon { width: 42px; height: 42px; border-radius: 10px; background: rgba(255,255,255,.2);
  display: grid; place-items: center; }
.bo-icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bo-year { margin-left: auto; background: rgba(255,255,255,.25); border-radius: 999px; padding: 2px 10px;
  font-size: .78rem; font-weight: 700; }
.bo-label { margin: 14px 0 6px; font-size: .88rem; }
.bo-picks { display: flex; gap: 10px; }
.bo-picks select { flex: 1; border-radius: 999px; border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.95); color: var(--ink); padding: 9px 14px; }
.bo-picks select#bo_year { flex: 0 0 120px; }
.bo-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.bo-tile { text-align: left; background: rgba(255,255,255,.95); color: var(--ink);
  border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.bo-tile span { font-size: .85rem; color: var(--muted); }
.bo-tile b { font-size: 1.35rem; color: var(--rose-deep); }
.bo-tile small { font-size: .74rem; color: var(--rose-primary); font-weight: 600; }
.bo-tile.info small, .bo-tile.in small { color: var(--success); }
.bo-tile.bad small { color: var(--danger); }
@media (min-width: 1000px) { .bo-tiles { grid-template-columns: repeat(4, 1fr); } }

/* Bank report menu: the six figures carry their own detail — a line under
   the amount and their top three — as the owner's reference. Taller rows,
   the same on both panels, so the tiles still line up beside them. */
.brf-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.brf-pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; }
.brf-pill.brf-ok { background: #e3f1e6; color: var(--success); }
.brf-pill.brf-low { background: #f8e1e4; color: var(--danger); }
.brf-warn { color: var(--warning); font-weight: 600; }
.brf-bad { color: var(--danger); font-weight: 600; }
.brf-listhd { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--rose-soft);
  margin-top: 10px; padding-top: 8px; font-size: .82rem; font-weight: 600; color: var(--rose-deep); }
.brf-go { background: none; border: none; color: var(--rose-primary); font: inherit; font-size: .8rem; cursor: pointer; padding: 0; }
.brf-go:hover { text-decoration: underline; }
.brf-row { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; padding: 2px 0; }
.brf-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brf-row b { white-space: nowrap; }
.brf-row small { color: var(--muted); font-weight: 400; }
.brf-none { font-size: .8rem; color: var(--muted); padding: 4px 0; }
@media (min-width: 1000px) {
  .br-split .brfigs { grid-auto-rows: 250px; }
  .br-split .brfigs .tile.brf { height: 250px; justify-content: flex-start; padding: 20px 22px; }
  .br-split .brfigs .tile.brf .big { font-size: 1.6rem; }
  .br-split-r .brgrid { grid-auto-rows: 250px; }
}

/* Bank report → Purchases: its overview's Reporting view, month and year in
   one light panel, as on the Sales Overview. Its own pv-vpicks. */
.pv-vpicks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px;
  background: rgba(255,255,255,.92); border-radius: 12px; padding: 10px 12px; color: var(--ink); }
.pv-vpicks label { font-size: .78rem; color: var(--muted); display: block; margin-bottom: 3px; }
.pv-vpicks select, .pv-vpicks input { width: 100%; }
.pv-vpicks .pv-vwide { grid-column: span 2; }
@media (max-width: 600px) { .pv-vpicks { grid-template-columns: 1fr; } .pv-vpicks .pv-vwide { grid-column: auto; } }

/* Bank report → Expenses: its overview's Reporting view, month and year in
   one light panel, as on the Sales Overview. Its own ex-vpicks. */
.ex-vpicks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px;
  background: rgba(255,255,255,.92); border-radius: 12px; padding: 10px 12px; color: var(--ink); }
.ex-vpicks label { font-size: .78rem; color: var(--muted); display: block; margin-bottom: 3px; }
.ex-vpicks select, .ex-vpicks input { width: 100%; }
.ex-vpicks .ex-vwide { grid-column: span 2; }
@media (max-width: 600px) { .ex-vpicks { grid-template-columns: 1fr; } .ex-vpicks .ex-vwide { grid-column: auto; } }

/* Bank report → Bank: its overview's Reporting view, month and year in
   one light panel, as on the Sales Overview. Its own bo-vpicks. */
.bo-vpicks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px;
  background: rgba(255,255,255,.92); border-radius: 12px; padding: 10px 12px; color: var(--ink); }
.bo-vpicks label { font-size: .78rem; color: var(--muted); display: block; margin-bottom: 3px; }
.bo-vpicks select, .bo-vpicks input { width: 100%; }
.bo-vpicks .bo-vwide { grid-column: span 2; }
@media (max-width: 600px) { .bo-vpicks { grid-template-columns: 1fr; } .bo-vpicks .bo-vwide { grid-column: auto; } }

/* ---------------------------------------------------------------------------
   IT support → Hardware assets → Accountability forms (db/195). Its own acc-*.
   --------------------------------------------------------------------------- */
.acc-switch { display: inline-flex; background: var(--rose-blush); border-radius: 999px; padding: 4px; margin-bottom: 12px; }
.acc-switch button { border: none; background: none; font: inherit; font-size: .9rem; padding: 7px 16px;
  border-radius: 999px; cursor: pointer; color: var(--rose-deep); }
.acc-switch button.on { background: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(160, 80, 110, .15); }
.itstats.acc-stats { grid-template-columns: repeat(4, 1fr); }
.acc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.acc-head h3 { margin: 0; }
.acc-scroll { overflow-x: auto; }
.acc-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.acc-table th { text-align: left; font-size: .78rem; color: var(--muted); font-weight: 600; padding: 8px 8px;
  border-bottom: 1px solid var(--rose-soft); white-space: nowrap; }
.acc-table td { padding: 8px; border-bottom: 1px solid var(--rose-blush); vertical-align: top; }
.acc-table.compact td { padding: 5px 8px; }
.acc-acts { white-space: nowrap; text-align: right; }
.acc-chip { display: inline-block; background: var(--rose-blush); color: var(--rose-deep); border-radius: 999px;
  padding: 1px 9px; font-size: .78rem; margin: 1px 0; }
.acc-chip.back { background: #eef0ee; color: var(--muted); text-decoration: line-through; }
.acc-holder { border: 1px solid var(--rose-soft); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.acc-holdhd { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.acc-holdhd .tag { margin-left: auto; }
.dialog.wide.acc-dialog { max-width: 1250px; }
.acc-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.acc-form label, .acc-dialog label { font-size: .8rem; color: var(--muted); display: block; margin-bottom: 3px; }
.acc-form input, .acc-form select { width: 100%; box-sizing: border-box; }
.acc-lines td { padding: 4px; }
.acc-lines input, .acc-lines select { width: 100%; min-width: 110px; box-sizing: border-box; font-size: .85rem; }
.acc-lines select { min-width: 190px; }
.acc-lines input.acc-qty { min-width: 56px; width: 56px; }
.acc-lines [data-acl="equipment"], .acc-lines [data-acl="return_note"] { min-width: 150px; }
.acc-lines [data-acl="specs"] { min-width: 180px; }
.acc-lines [data-acl="serial_no"], .acc-lines [data-acl="model_no"] { min-width: 130px; }
.acc-lines tr.acc-back td { background: #f3f5f3; }
.acc-btns { gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) { .acc-form { grid-template-columns: 1fr; } }

/* IT support → Hardware assets → Company property (db/196). Its own pr-*
   rooms and stats; the table and dialog reuse the accountability forms' acc-*. */
.itstats.pr-stats { grid-template-columns: repeat(5, 1fr); }
.pr-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pr-room { display: flex; flex-direction: column; gap: 2px; text-align: left; background: #fff; font: inherit;
  border: 1px solid var(--rose-soft); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--ink); }
.pr-room:hover { border-color: var(--rose-deep); }
.pr-room.on { border-color: var(--rose-deep); background: var(--rose-blush); }
.pr-roomname { font-size: .84rem; font-weight: 600; color: var(--rose-deep); }
.pr-room b { font-size: 1.4rem; color: var(--rose-deep); }
.pr-room .dim { font-size: .76rem; }
.dialog.wide.pr-dialog { max-width: 900px; }
.pr-dialog label { font-size: .8rem; color: var(--muted); display: block; margin-bottom: 3px; }
.pr-dialog textarea { width: 100%; box-sizing: border-box; }
.pr-hist { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; max-height: 180px; overflow-y: auto;
  border: 1px solid var(--rose-blush); border-radius: 10px; padding: 8px 10px; }
@media (max-width: 700px) { .itstats.pr-stats { grid-template-columns: repeat(2, 1fr); } }

/* Hardware assets: the by-employee cards on the Masterlist and on Company
   property. Their own hold-*. */
.hold-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.hold-grid .acc-holder { margin-top: 0; }
.hold-row { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
  background: none; border: none; border-top: 1px solid var(--rose-blush); padding: 6px 2px; font: inherit;
  font-size: .86rem; color: var(--ink); cursor: pointer; }
.hold-row:hover { background: var(--rose-blush); }
/* A viewer's Company property item opens read-only: locked boxes look locked. */
.it-viewonly .pr-dialog :is(input, select, textarea):disabled { background: var(--rose-blush); color: var(--ink);
  opacity: 1; cursor: default; }
/* A viewer's room items are read, not opened: no hover, no hand. */
.it-viewonly .pr-roomitems div.hold-row:hover { background: none; }
.it-viewonly .pr-roomitems div.hold-row { cursor: default; }
.hold-row .dim { font-size: .78rem; }
.itstats.pr-stats { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 700px) { .itstats.pr-stats { grid-template-columns: repeat(2, 1fr); } }

.hold-branch + .hold-branch { margin-top: 14px; }
.hold-branch h4 { margin: 0 0 8px; color: var(--rose-deep); }

/* IT support: every tab's overview card, in the Financial overview's rose
   look (copied from its ex-card, not shared). Its own itov-*. */
.itov-card { background: linear-gradient(135deg, var(--rose-deep), var(--rose-primary)); color: #fff;
  border-radius: 16px; padding: 18px; box-shadow: var(--shade); margin-bottom: 16px; }
.itov-head { display: flex; align-items: center; gap: 12px; }
.itov-head h3 { margin: 0; color: #fff; font-size: 1.15rem; letter-spacing: .02em; }
.itov-co { font-size: .82rem; opacity: .9; }
.itov-icon { width: 42px; height: 42px; border-radius: 10px; background: rgba(255,255,255,.2);
  display: grid; place-items: center; flex: none; }
.itov-icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.itov-year { margin-left: auto; background: rgba(255,255,255,.25); border-radius: 999px; padding: 2px 10px;
  font-size: .78rem; font-weight: 700; }
.itov-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; margin-top: 14px; }
.itov-tile { background: rgba(255,255,255,.95); color: var(--ink); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px; }
.itov-tile span { font-size: .85rem; color: var(--muted); }
.itov-tile b { font-size: 1.35rem; color: var(--rose-deep); }
.itov-tile small { font-size: .74rem; color: var(--rose-primary); font-weight: 600; }
.itov-tile.warn small { color: var(--warning); }
.itov-tile.info small { color: var(--success); }
.itov-tile.bad small, .itov-tile.bad b { color: var(--danger); }

/* Company property: a room, opened — its items and its zoomable photos. */
.pr-roomitems { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 14px; }
.pr-upload { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 10px; align-items: end;
  background: var(--rose-blush); border-radius: 12px; padding: 10px 12px; }
.pr-upload input[type=text], .pr-upload select { width: 100%; box-sizing: border-box; }
.pr-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pr-gallery figure { margin: 0; border: 1px solid var(--rose-soft); border-radius: 12px; overflow: hidden; background: #fff; }
.pr-gallery img { width: 100%; height: 140px; object-fit: cover; display: block; cursor: zoom-in; }
.pr-gallery figcaption { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; font-size: .78rem; }
.pr-gallery figcaption .linkbtn { align-self: flex-start; font-size: .76rem; }
@media (max-width: 700px) { .pr-upload { grid-template-columns: 1fr; } }

.pr-gallery .pr-photoname { font-size: .88rem; color: var(--rose-deep); }
.pr-photoacts { display: flex; gap: 10px; }
.pr-upload { grid-template-columns: 1.3fr 1fr 1.2fr auto; }

.pr-upload { grid-template-columns: 1.3fr 1fr 1.2fr .9fr auto; }
.pr-gallery .pr-track { align-self: flex-start; margin: 3px 0; }

/* Hardware assets: an employee's card, one compact line per thing held. */
.hold-card .acc-holdhd b { font-size: .9rem; }
.hold-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%;
  background: none; border: none; border-top: 1px solid var(--rose-blush); padding: 4px 2px; font: inherit;
  font-size: .78rem; color: var(--ink); text-align: left; cursor: default; }
.hold-line[data-asopen], .hold-line[data-propen] { cursor: pointer; }
.hold-line[data-asopen]:hover, .hold-line[data-propen]:hover { background: var(--rose-blush); }
.hold-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hold-tag { flex: none; font-size: .7rem; color: var(--muted); }
.acc-head > div:first-child { flex: 1 1 360px; min-width: 0; }
.acc-head > .btn, .acc-head > .row { flex: none; }

/* Masterlist: a unit's row takes the colour of its health at its last
   check (db/200). Masterlist's own rows only. */
#as_list tr:has(.hl-maintenance) td { background: #fdf3df; }
#as_list tr:has(.hl-replace) td { background: #fbe1e3; }
#as_list tr:has(.hl-defective) td { background: #f6cfd3; }
#as_list tr:has(.hl-maintenance) td:first-child { box-shadow: inset 4px 0 0 var(--warning); }
#as_list tr:has(.hl-replace) td:first-child,
#as_list tr:has(.hl-defective) td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
.ascheck-box { border: 1px solid var(--rose-soft); border-radius: 12px; padding: 10px 12px; }
.ascheck-box .row select { flex: 0 0 auto; }
.ascheck-box .row input { flex: 1; min-width: 0; }
.ascheck-hist { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; max-height: 160px; overflow-y: auto; }

/* IT support for a viewer (db/203): everything to look at, nothing that
   writes. The buttons that would change something are hidden here; the
   database refuses them anyway. IT support's own controls only. */
.it-viewbar { background: var(--rose-blush); color: var(--rose-deep); border-radius: 12px; padding: 8px 14px;
  font-size: .88rem; font-weight: 600; margin-bottom: 12px; }
.it-viewonly .panel:has(#as_form),
.it-viewonly #as_assign, .it-viewonly #asd_save, .it-viewonly #asd_check, .it-viewonly [data-asdrop],
.it-viewonly .asdrawer .row:has(#asd_receipt),
.it-viewonly #acc_new, .it-viewonly #acf_save, .it-viewonly #acf_del, .it-viewonly #acf_add, .it-viewonly [data-acldrop],
.it-viewonly #pr_new, .it-viewonly #pr_loc, .it-viewonly #prf_save, .it-viewonly #prf_del,
.it-viewonly .pr-upload, .it-viewonly [data-prdrop], .it-viewonly [data-prname], .it-viewonly [data-prtrack],
.it-viewonly .itstatus { display: none !important; }

/* Company property: a masterlist computer shown under Desktop / Laptop. */
#pr_list tr.pr-mlrow td { background: #fbf4f7; }

/* Company property: a room's own way to place a masterlist unit in it. */
.pr-place { background: var(--rose-blush); border-radius: 12px; padding: 10px 12px; }
.pr-place select { flex: 1; min-width: 0; }
.it-viewonly .pr-place { display: none !important; }

.pr-gallery figure.pr-mlphoto { border-color: var(--rose-primary); }

/* Asset inventory masterlist: a company property row, set apart. */
#as_list tr:has(.hl-prop) td { background: #fbf6f8; }

/* Receiving form's own three tabs and its monitor's figures. */
.rvf-switch { display: inline-flex; flex-wrap: wrap; background: var(--rose-blush); border-radius: 999px; padding: 4px; margin-bottom: 12px; }
.rvf-switch button { border: none; background: none; font: inherit; font-size: .9rem; padding: 7px 16px;
  border-radius: 999px; cursor: pointer; color: var(--rose-deep); }
.rvf-switch button.on { background: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(160, 80, 110, .15); }
.rvf-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rvf-tiles > div { background: var(--rose-blush); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.rvf-tiles span { font-size: .8rem; color: var(--rose-deep); }
.rvf-tiles b { font-size: 1.35rem; }

/* Warehouse receiving management — Expected deliveries monitoring, its own look. */
.ed-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--rose-soft);
  border-radius: 14px; padding: 16px 18px; }
.ed-heroicon { width: 54px; height: 54px; border-radius: 12px; background: var(--rose-blush); color: var(--rose-deep); display: grid;
  place-items: center; font-size: 1.6rem; flex: 0 0 auto; }
.ed-herotext { flex: 1 1 220px; }
.ed-herotext h3 { margin: 0; font-size: 1.3rem; color: var(--rose-deep); }
.ed-herotext div { color: var(--ink); font-size: .9rem; }
.ed-herohint { flex: 1 1 300px; background: var(--rose-blush); border-radius: 10px; padding: 10px 14px; font-size: .82rem; color: var(--ink); }
.btn.ed-create { flex: 0 0 auto; }
.ed-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.ed-tile { display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 14px 16px; }
.ed-tile span { font-size: .85rem; font-weight: 600; color: var(--rose-deep); }
.ed-tile b { display: block; font-size: 1.6rem; color: var(--rose-deep); }
.ed-tile small { color: var(--ink); }
.ed-ticon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; flex: 0 0 auto; background: #fff; }
.ed-t-blue { background: var(--rose-blush); } .ed-t-green { background: #e3efe6; } .ed-t-red { background: #f3dddd; }
.ed-t-red span, .ed-t-red b { color: var(--danger); }
.ed-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ed-tools input[type=search] { flex: 1 1 240px; }
.ed-tools select { flex: 0 0 auto; width: auto; }
.ed-dates { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .85rem; color: var(--ink); }
.ed-dates input { width: auto; }
.ed-scroll { overflow-x: auto; }
.ed-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.ed-table th { text-align: left; background: var(--rose-blush); color: var(--rose-deep); font-weight: 600; padding: 10px 8px; white-space: nowrap; }
.ed-table td { padding: 9px 8px; border-top: 1px solid var(--rose-soft); vertical-align: middle; }
.ed-table .n { text-align: right; }
.ed-empty { text-align: center; padding: 18px; }
.ed-pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: .76rem; white-space: nowrap; }
.ed-blue { background: var(--rose-blush); color: var(--rose-deep); } .ed-red { background: #f3dddd; color: var(--danger); }
.ed-amber { background: #f6ecd8; color: var(--warning); } .ed-green { background: #e3efe6; color: var(--success); }
.ed-acts { position: relative; white-space: nowrap; }
.btn.ed-view { min-width: 54px; }
.ed-menu { position: absolute; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--rose-soft); border-radius: 10px;
  box-shadow: 0 6px 18px rgba(160, 80, 110, .15); display: flex; flex-direction: column; min-width: 230px; padding: 4px; }
.ed-menu button { border: none; background: none; text-align: left; padding: 8px 10px; font: inherit; font-size: .85rem; border-radius: 8px; cursor: pointer; }
.ed-menu button:hover { background: var(--rose-blush); }
.ed-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: .82rem; }
.ed-pages { display: flex; gap: 4px; }
.ed-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ed-form .ed-wide { grid-column: 1 / -1; }
.ed-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ed-facts > div { background: var(--rose-blush); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.ed-facts span { font-size: .78rem; color: var(--ink); }
.ed-table .ed-nw { white-space: nowrap; }
.btn.ed-on { background: var(--rose-primary); border-color: var(--rose-primary); color: #fff; }

/* Warehouse receiving management — Goods receipt & inspection form, in the shop's rose theme. */
.gr-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: linear-gradient(120deg, #fff, var(--rose-blush));
  border: 1px solid var(--rose-soft); border-radius: 14px; padding: 18px 20px; }
.gr-heroicon { width: 64px; height: 64px; border-radius: 14px; background: var(--rose-primary); color: #fff; display: grid;
  place-items: center; font-size: 1.9rem; flex: 0 0 auto; }
.gr-herotext { flex: 1 1 320px; }
.gr-kicker { font-size: .8rem; font-weight: 600; color: var(--rose-deep); }
.gr-herotext h3 { margin: 2px 0; font-size: 1.45rem; color: var(--rose-deep); }
.gr-sub { color: var(--ink); font-size: .92rem; }
.gr-desc { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.gr-badge { background: #fff; border: 1px solid var(--rose-dust); color: var(--rose-deep); border-radius: 999px; padding: 6px 14px;
  font-weight: 600; font-size: .85rem; flex: 0 0 auto; }
.gr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 14px 0; }
.gr-tile { display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 14px 16px; background: var(--rose-blush); }
.gr-tile span { font-size: .85rem; font-weight: 600; color: var(--rose-deep); }
.gr-tile b { display: block; font-size: 1.6rem; color: var(--rose-deep); }
.gr-tile small { color: var(--ink); }
.gr-ticon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; flex: 0 0 auto; background: #fff; }
.gr-t-amber { background: #f6ecd8; } .gr-t-amber span, .gr-t-amber b { color: var(--warning); }
.gr-t-red { background: #f3dddd; } .gr-t-red span, .gr-t-red b { color: var(--danger); }
.gr-t-green { background: #e3efe6; } .gr-t-green span, .gr-t-green b { color: var(--success); }
.gr-t-rose { background: #fff; border: 1px solid var(--rose-soft); }
.gr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .gr-layout { grid-template-columns: 1fr; } }
.gr-mainhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.gr-mainhead h3 { margin: 0; }
.gr-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.gr-tools input[type=search] { flex: 1 1 220px; }
.gr-tools select { flex: 0 0 auto; width: auto; }
.gr-dates { display: flex; align-items: center; gap: 4px; }
.gr-dates input { width: auto; }
.gr-scroll { overflow-x: auto; }
.gr-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.gr-table th { text-align: left; background: var(--rose-blush); color: var(--rose-deep); font-weight: 600; padding: 8px 5px; vertical-align: bottom; }
.gr-table td { padding: 7px 5px; border-top: 1px solid var(--rose-soft); vertical-align: middle; }
.gr-table .n { text-align: right; }
.gr-table .gr-nw { white-space: nowrap; }
.gr-empty { text-align: center; padding: 18px; }
.gr-pill { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: .72rem; white-space: nowrap; }
.gr-amber { background: #f6ecd8; color: var(--warning); } .gr-red { background: #f3dddd; color: var(--danger); }
.gr-green { background: #e3efe6; color: var(--success); } .gr-rose { background: var(--rose-blush); color: var(--rose-deep); }
.gr-acts { position: relative; white-space: nowrap; }
.gr-menu { position: absolute; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--rose-soft); border-radius: 10px;
  box-shadow: 0 6px 18px rgba(160, 80, 110, .15); display: flex; flex-direction: column; min-width: 260px; padding: 4px; }
.gr-menu button { border: none; background: none; text-align: left; padding: 8px 10px; font: inherit; font-size: .85rem; border-radius: 8px; cursor: pointer; }
.gr-menu button:hover { background: var(--rose-blush); }
.gr-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: .82rem; }
.gr-pages { display: flex; gap: 4px; }
.btn.gr-on { background: var(--rose-primary); border-color: var(--rose-primary); color: #fff; }
.gr-side { display: flex; flex-direction: column; gap: 12px; }
.gr-side .panel { margin: 0; }
.gr-side h4 { margin: 0 0 8px; color: var(--rose-deep); }
.gr-lbl { font-size: .78rem; font-weight: 600; }
.gr-qf { display: flex; flex-direction: column; gap: 2px; }
.gr-qf button { display: flex; align-items: center; gap: 8px; border: none; background: none; font: inherit; font-size: .85rem;
  padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--ink); text-align: left; }
.gr-qf button b { margin-left: auto; background: var(--rose-blush); border-radius: 999px; padding: 0 8px; font-size: .78rem; }
.gr-qf button.on, .gr-qf button:hover { background: var(--rose-blush); }
.gr-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.gr-dot.gr-amber { background: var(--warning); } .gr-dot.gr-red { background: var(--danger); }
.gr-dot.gr-green { background: var(--success); } .gr-dot.gr-rose { background: var(--rose-primary); }
.gr-qa { display: flex; flex-direction: column; gap: 8px; }
.gr-recent { display: flex; flex-direction: column; gap: 10px; font-size: .82rem; }
.gr-recent > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gr-recent .dim { width: 100%; padding-left: 16px; font-size: .75rem; }
.gr-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gr-form .gr-wide { grid-column: 1 / -1; }
.gr-note { margin-top: 14px; background: var(--rose-blush); border-radius: 12px; padding: 12px 16px; font-size: .84rem; color: var(--ink); }

/* The masterlist's side drawer for a computer-related property item: a viewer reads it, writes nothing. */
.it-viewonly #phd_save, .it-viewonly #phd_check, .it-viewonly .phd-upload { display: none !important; }
