/* Core One — original design system (see docs/ui-system.md) */
:root {
  /* brand — overridden per tenant at runtime */
  --accent: #4f46e5;
  /* Derived, not fixed: the tenant's brand colour arrives as an inline style on :root,
     so anything hardcoded here stops tracking it. Dark mode already derived this; light
     did not, which gave a red-branded tenant red buttons and lavender focus rings. */
  --accent-soft: color-mix(in srgb, var(--accent) 13%, #fff);

  /* ink scale */
  --ink: #0e1017;
  --ink-2: #363c4a;
  --muted: #737a8a;
  --faint: #9aa1b1;

  /* surfaces */
  --paper: #ffffff;
  --canvas: #f6f7f9;
  --raised: #fbfbfd;
  --line: #e9eaef;
  --line-2: #f1f2f6;

  /* status */
  --success: #0d7a4f;
  --warn: #b45309;
  --danger: #c0392f;

  /* shape */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* elevation — one soft ambient layer plus a tight contact shadow */
  --e1: 0 1px 2px rgba(14, 16, 23, .05), 0 1px 1px rgba(14, 16, 23, .03);
  --e2: 0 4px 10px -2px rgba(14, 16, 23, .07), 0 2px 4px -2px rgba(14, 16, 23, .05);
  --e3: 0 18px 40px -12px rgba(14, 16, 23, .18), 0 4px 10px -4px rgba(14, 16, 23, .08);

  --ease: cubic-bezier(.32, .72, 0, 1);
}

* { box-sizing: border-box; margin: 0; }
/* A component that sets display: flex/grid otherwise beats the hidden attribute, and the
   element stays on screen while the code believes it is hidden. Settle it once, globally. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  /* Apple's system face first: SF on Apple platforms, the platform UI face elsewhere.
     The slight negative tracking is what makes SF read as SF rather than as Helvetica. */
  font: 400 14px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
        "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "kern" 1;
}
/* iOS tightens tracking as type grows; without this large headings look loose. */
h1, h2, h3, .sheet h1, .doc-title h1 { letter-spacing: -0.022em; }
h1 { font-weight: 700; }
h2, h3 { font-weight: 600; }
/* `color` must be inherited too. Without it a button that sets no colour of its own
   keeps the UA's ButtonText — which is black, so smart buttons rendered black-on-dark
   (1.21:1) in dark mode. Buttons that DO set their own colour are unaffected. */
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.boot { padding: 60px; text-align: center; color: var(--muted); }
.ico { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- top bar ---------- */
.topbar {
  height: 54px; display: flex; align-items: center; gap: 2px;
  padding: 0 14px; position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .home-btn {
  background: none; border: 0; color: var(--muted); font-size: 16px;
  width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.topbar .home-btn:hover { background: var(--line-2); color: var(--ink); }
.topbar .brand-name {
  font-weight: 650; font-size: 14.5px; letter-spacing: -.012em;
  margin: 0 14px 0 6px; white-space: nowrap;
}
.topbar .appname {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; padding: 5px 12px 5px 6px; border-radius: 999px;
  background: var(--line-2); margin-right: 6px; white-space: nowrap;
}
.mini-ico {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}
.mini-ico .ico { width: 13px; height: 13px; }
.topbar .menu-item {
  background: none; border: 0; color: var(--muted); padding: 7px 12px;
  border-radius: var(--r-sm); white-space: nowrap; font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.topbar .menu-item:hover { background: var(--line-2); color: var(--ink); }
.topbar .menu-item.active { color: var(--ink); font-weight: 600; background: var(--line-2); }
.topbar .spacer { flex: 1; }
.topbar .menubar { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 0 1 auto;
  overflow-x: auto; scrollbar-width: none; }
.topbar .menubar::-webkit-scrollbar { display: none; }
/* Only when it actually overflows: a soft fade says "there is more this way". */
.topbar .menubar.scrolls { -webkit-mask-image: linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 18px), transparent); }
.topbar .home-btn, .topbar .brand-name, .topbar .appname, .topbar .theme-btn, .topbar .user-chip { flex: none; }
/* On a phone the bar keeps its icons and gives the rest of the width to the menu. */
@media (max-width: 760px) {
  .topbar { padding: 0 8px; gap: 4px; }
  .topbar .brand-name { display: none; }
  .topbar .appname { font-size: 0; gap: 0; padding: 5px; margin-right: 2px; }
  .topbar .user-chip { font-size: 0; gap: 0; padding: 3px; }
}
.topbar .user-chip {
  background: none; border: 1px solid var(--line); color: var(--ink);
  padding: 4px 12px 4px 5px; border-radius: 999px; font-weight: 550;
  display: flex; align-items: center; gap: 8px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.topbar .user-chip:hover { border-color: var(--faint); box-shadow: var(--e1); }
.topbar .user-chip .dot {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700;
}

/* ---------- app grid ---------- */
.appgrid-wrap {
  min-height: calc(100vh - 54px); display: flex; flex-direction: column; align-items: center;
  padding: clamp(40px, 9vh, 96px) 20px 48px;
}
.appgrid-title { font-size: 25px; font-weight: 680; letter-spacing: -.026em; margin-bottom: 5px; }
.appgrid-sub { color: var(--muted); margin-bottom: 24px; }
.appsearch {
  width: 100%; max-width: 420px; height: 42px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px;
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  margin-bottom: 28px; box-shadow: var(--e1); color: var(--faint); cursor: text;
  transition: border-color .15s, box-shadow .15s;
}
.appsearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.appsearch .ico { width: 16px; height: 16px; flex: none; }
.appsearch input { flex: 1; border: 0; outline: 0; background: none; font: inherit; color: var(--ink); min-width: 0; }
.appsearch input::placeholder { color: var(--faint); }
/* auto-fill + minmax so tiles wrap instead of clipping on a narrow viewport */
.appgrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px; width: 100%; max-width: 760px; justify-items: center;
}
.appgrid > * { width: 100%; max-width: 128px; }
.apptile {
  background: none; border: 0; padding: 16px 8px 14px; border-radius: var(--r-lg);
  color: var(--ink);                       /* buttons don't inherit; labels must follow the theme */
  display: flex; flex-direction: column; align-items: center; gap: 11px;
  transition: background .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.apptile:hover { background: var(--paper); transform: translateY(-2px); box-shadow: var(--e2); }
.apptile:active { transform: translateY(0); }
.apptile .icon {
  width: 58px; height: 58px; border-radius: 17px;
  display: grid; place-items: center;
  transition: transform .18s var(--ease);   /* gradient + glow set from the app colour at render */
}
.apptile .icon .ico { width: 28px; height: 28px; }
.apptile:hover .icon { transform: scale(1.05); }
.apptile .label { font-weight: 550; font-size: 12.5px; letter-spacing: -.005em; }

/* ---------- control panel ---------- */
.cpanel {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: var(--paper); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.cpanel .crumbs {
  font-size: 15.5px; font-weight: 640; letter-spacing: -.015em;
  display: flex; align-items: center; gap: 7px;
}
.cpanel .crumbs a { color: var(--muted); font-weight: 500; }
.cpanel .crumbs a:hover { color: var(--ink); }
.cpanel .crumbs .sep { color: var(--faint); font-weight: 400; }

.btn {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  padding: 7px 14px; border-radius: var(--r-sm); font-weight: 550;
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { border-color: var(--faint); background: var(--raised); }
.btn.primary {
  background: var(--accent); border-color: transparent; color: #fff;
  box-shadow: 0 1px 2px rgba(14, 16, 23, .12);
}
.btn.primary:hover { filter: brightness(1.07); box-shadow: var(--e2); }
.btn.danger { color: var(--danger); border-color: #f0cfcc; }
.btn.danger:hover { background: #fdf4f3; border-color: var(--danger); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; }

.searchbox {
  flex: 1; min-width: 200px; max-width: 460px; margin: 0 auto;
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px; background: var(--canvas);
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.searchbox:focus-within { border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbox input { border: 0; outline: 0; flex: 1; background: none; }
.searchbox .chip {
  background: var(--accent-soft); color: var(--accent); border-radius: var(--r-xs); padding: 2px 4px 2px 9px;
  display: inline-flex; gap: 4px; align-items: center; font-weight: 600; font-size: 12px; white-space: nowrap;
}
.searchbox .chip button { border: 0; background: none; color: inherit; padding: 0 4px; border-radius: 4px; }
.searchbox .chip button:hover { background: rgba(0, 0, 0, .07); }

.filter-dd { position: relative; }
.filter-menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e3);
  min-width: 200px; z-index: 40; padding: 6px;
}
.filter-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 10px; border-radius: var(--r-xs); font-weight: 500;
}
.filter-menu button:hover { background: var(--line-2); }

.pager { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; font-size: 12.5px; }
.pager button {
  border: 1px solid var(--line); background: var(--paper); border-radius: var(--r-xs);
  width: 26px; height: 26px; display: grid; place-items: center; color: var(--ink-2);
}
.pager button:hover:not(:disabled) { border-color: var(--faint); }
.pager button:disabled { opacity: .35; cursor: default; }

.viewswitch { display: flex; gap: 2px; background: var(--line-2); border-radius: var(--r-sm); padding: 2px; }
.viewswitch button {
  border: 0; background: none; padding: 5px 10px; color: var(--muted); border-radius: 7px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.viewswitch button.active { background: var(--paper); color: var(--ink); box-shadow: var(--e1); }

/* ---------- list ---------- */
.view-wrap { padding: 18px; }
.listcard {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--e1); overflow: auto;
}
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th {
  text-align: left; font-weight: 550; color: var(--muted); font-size: 11.5px;
  letter-spacing: .03em; text-transform: uppercase;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--paper); white-space: nowrap;
}
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr { transition: background .12s var(--ease); }
table.list tbody tr:hover td { background: var(--raised); cursor: pointer; }
table.list td.num, table.list th.num { text-align: right; }
table.list .checkcol { width: 38px; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: -.005em;
}
.badge.draft { background: #eef0f4; color: #59606f; }
.badge.sale, .badge.posted { background: #e8f0fe; color: #1b4fd8; }
.badge.done, .badge.paid { background: #e2f4ea; color: var(--success); }
.badge.cancel { background: #fdeeec; color: var(--danger); }
.badge.placed { background: #fdf1e3; color: var(--warn); }
.badge.packed { background: #eef0f4; color: #59606f; }
.badge.shipped { background: #e8f0fe; color: #1b4fd8; }
.badge.delivered { background: #e2f4ea; color: var(--success); }
.bool-dot { color: var(--success); font-weight: 700; }

.selbar {
  display: flex; gap: 10px; align-items: center; padding: 9px 14px;
  background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.empty { padding: 76px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 30px; margin-bottom: 12px; opacity: .5; }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 10px; }
.kcol { min-width: 262px; flex: 0 0 262px; }
.kcol h4 {
  font-size: 11.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; font-weight: 600; margin: 2px 4px 10px;
}
.kcards { display: flex; flex-direction: column; gap: 9px; }
.kanban.flat { flex-wrap: wrap; }
.kanban.flat .kcard { width: 262px; }
.kcard {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--e1); padding: 14px; cursor: pointer;
  transition: box-shadow .18s var(--ease), transform .18s var(--ease), border-color .18s var(--ease);
}
.kcard:hover { border-color: var(--faint); box-shadow: var(--e2); transform: translateY(-1px); }
.kcard .t { font-weight: 640; letter-spacing: -.01em; }
.kcard .s { color: var(--muted); margin-top: 2px; font-size: 12.5px; }
.kcard .f { margin-top: 10px; font-weight: 600; }
/* The card corner (Helpdesk): deadline on the left, priority stars and the assignee's initials
   on the right. */
.kcard .kmeta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.kmeta-r { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.kwho { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 700; letter-spacing: .02em; }
.kwho.none { background: transparent; border: 1.5px dashed var(--faint); }
.stars { display: inline-flex; gap: 1px; font-size: 13px; line-height: 1; }
.stars .star { color: var(--line); }
.stars .star.on { color: #e3a008; }
.deadline { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.deadline.late { color: var(--danger); }
.deadline.soon { color: var(--warn); }
.deadline.paused { color: var(--faint); font-style: italic; }
.deadline.done { color: var(--muted); font-weight: 500; }
.deadline.late::before, .deadline.soon::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; margin-right: 5px; vertical-align: 1px; }
.dlg-canned { width: 100%; margin-bottom: 6px; }

/* ---------- form ---------- */
.form-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.statusbar { margin-left: auto; display: flex; gap: 3px; background: var(--line-2); padding: 3px; border-radius: 999px; }
.statusbar .step {
  padding: 5px 15px; border-radius: 999px; color: var(--muted);
  font-weight: 550; font-size: 12px; white-space: nowrap;
}
.statusbar .step.current { background: var(--paper); color: var(--ink); box-shadow: var(--e1); font-weight: 620; }

.sheet-wrap { padding: 22px 18px 64px; display: flex; justify-content: center; }
.sheet-col { width: 100%; max-width: 1140px; }
.sheet {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--e1); padding: 32px 38px; position: relative;
}
.sheet .title-input, .sheet .title-ro {
  font-size: 26px; font-weight: 680; letter-spacing: -.028em; padding: 0 0 18px;
  border: 0; outline: 0; width: 100%; background: none;
}
.sheet .title-input::placeholder { color: var(--faint); }
.groups { display: grid; grid-template-columns: 1fr 1fr; gap: 0 52px; }
/* Each field sits on a light line, the way an iOS grouped list separates its rows.
   It is a pseudo-element rather than a border so it can never disturb the grid, and a
   flat 1px in the app's own --line: every other rule in this UI is 1px, and a half-pixel
   separator here would read lighter than the borders sitting next to it. */
.fieldrow {
  position: relative; display: grid; grid-template-columns: 168px 1fr;
  align-items: center; gap: 10px; min-height: 44px; padding: 3px 0;
}
.fieldrow::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--line);
}
.group > .fieldrow:last-child::after { display: none; }
.fieldrow label { color: var(--muted); font-weight: 400; }
.fieldrow .ctrl input[type="text"], .fieldrow .ctrl input[type="date"], .fieldrow .ctrl input[type="number"],
.fieldrow .ctrl input[type="password"], .fieldrow .ctrl select, .fieldrow .ctrl textarea {
  width: 100%; border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 7px 8px; background: none; outline: 0; margin-left: -8px;
  font-weight: 500;
  transition: background .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.fieldrow .ctrl input:hover:not(:focus), .fieldrow .ctrl select:hover:not(:focus),
.fieldrow .ctrl textarea:hover:not(:focus) { background: var(--canvas); }
.fieldrow .ctrl input:focus, .fieldrow .ctrl select:focus, .fieldrow .ctrl textarea:focus {
  background: var(--paper); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.fieldrow .ctrl .ro { color: var(--ink); padding: 6px 0; }
/* a note under a field: a salesperson kept as a name only, what an address is for */
.fieldrow .ctrl .fb-hint { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.4; }
.fbtext { color: var(--muted); font-style: italic; }
.fieldrow-wide { grid-template-columns: 1fr; }

.ribbon {
  position: absolute; top: 24px; right: -6px; background: var(--success); color: #fff;
  font-weight: 700; padding: 5px 18px; transform: rotate(4deg); letter-spacing: .08em;
  font-size: 11px; border-radius: var(--r-xs); box-shadow: var(--e2);
}
.ribbon.cancel { background: var(--danger); }

/* line grids */
.lines-sec { margin-top: 30px; }
.lines-sec h3 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 600; padding-bottom: 8px; margin-bottom: 0;
  border-bottom: 2px solid var(--ink); display: inline-block;
}
table.lines { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
table.lines th {
  text-align: left; color: var(--muted); font-weight: 550; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .03em; padding: 8px; border-bottom: 1px solid var(--line);
}
table.lines td { padding: 5px 8px; border-bottom: 1px solid var(--line-2); }
table.lines input, table.lines select {
  width: 100%; border: 1px solid transparent; border-radius: var(--r-xs); padding: 6px 7px; background: none; outline: 0;
  transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
table.lines input:hover:not(:focus), table.lines select:hover:not(:focus) { background: var(--canvas); }
table.lines input:focus, table.lines select:focus {
  border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 3px var(--accent-soft);
}
table.lines td.num input { text-align: right; }
table.lines td.col-product { min-width: 180px; }
table.lines td.col-desc { min-width: 220px; }
table.lines td.col-narrow { width: 110px; }
table.lines td.col-pct { width: 64px; }
/* (a line's other links — a cost centre, an account — give the numbers room on a narrow screen) */
table.lines td.col-m2o { min-width: 130px; }
table.lines td.num.col-narrow { min-width: 72px; }
table.lines td.num.col-pct { min-width: 56px; }
.lines-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
table.lines .rm { border: 0; background: none; color: var(--faint); font-size: 15px; padding: 2px 7px; border-radius: var(--r-xs); }
table.lines .rm:hover { color: var(--danger); background: #fdf4f3; }
.addline { margin-top: 10px; display: inline-block; font-weight: 550; font-size: 12.5px; }

.totals { margin-left: auto; margin-top: 18px; width: 310px; }
.totals .trow { display: flex; justify-content: space-between; padding: 6px 4px; color: var(--muted); }
.totals .trow b { color: var(--ink); font-weight: 600; }
.totals .trow.grand {
  border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 12px;
  font-weight: 700; font-size: 16px; color: var(--ink);
}
/* Journal entry balance: green when debits meet credits, red on the difference. */
.totals .trow.grand .tdiff.ok { color: var(--success); }
.totals .trow.grand .tdiff.off { color: var(--danger); }
.notes-sec { margin-top: 26px; }
/* The notes field is rendered inside .fieldrow > .ctrl, so `.notes-sec textarea`
   (0,1,1) lost to `.fieldrow .ctrl textarea` (0,2,1) and the boxed styling below
   never applied. Match the real nesting so it wins. */
.notes-sec .fieldrow::after { display: none; }
.notes-sec textarea, .notes-sec .ctrl textarea, .notes-sec .fieldrow .ctrl textarea {
  width: 100%; min-height: 68px; border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 11px; background: var(--paper);
  margin-left: 0; font-weight: 400;
}
.notes-sec textarea:focus, .notes-sec .fieldrow .ctrl textarea:focus {
  outline: 0; background: var(--paper); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.wide-field { margin-top: 24px; }
.wide-field > label { display: block; color: var(--muted); font-weight: 400; margin-bottom: 8px; }
/* Without this, a control in a wide field inherits the browser's default chrome — an
   inset grey box that matches nothing else on the form. */
.wide-field > input[type="text"], .wide-field > input[type="date"], .wide-field > input[type="number"],
.wide-field > select, .wide-field > textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 9px 11px; background: var(--paper); outline: 0;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.wide-field > input:focus, .wide-field > select:focus, .wide-field > textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

/* chatter */
.chatter { max-width: 1140px; margin: 20px auto 0; width: 100%; }
.chatter .notebox { display: flex; gap: 8px; }
.chatter .notebox input {
  flex: 1; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 13px; background: var(--paper);
}
.chatter .notebox input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.msg { display: flex; gap: 11px; padding: 14px 4px; border-bottom: 1px solid var(--line-2); }
.msg .dot {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 11px;
}
.msg.log .dot { background: var(--line); color: var(--muted); }
.msg .who { font-weight: 620; }
.msg .when { color: var(--faint); font-size: 11.5px; margin-left: 8px; }
.msg .body { margin-top: 2px; }
.msg.log .body { color: var(--muted); }

/* ---------- helpdesk: a ticket's conversation ---------- */
.hd-conv { display: flex; flex-direction: column; gap: 14px; }
.hdc { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); box-shadow: var(--e1); overflow: hidden; }
.hdc-tabs { display: flex; gap: 2px; padding: 8px 8px 0; background: var(--raised); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.hdc-tab { flex: none; border: 0; background: none; font: inherit; font-weight: 560; color: var(--muted); padding: 8px 14px; border-radius: var(--r-sm) var(--r-sm) 0 0; cursor: pointer; border-bottom: 2px solid transparent; }
.hdc-tab:hover { color: var(--ink); }
.hdc-tab.on { color: var(--accent); border-bottom-color: var(--accent); background: var(--paper); }
.hdc-body { padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.hdc-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.hdc-hint.warn { color: var(--warn); }
.hdc-rows { display: flex; flex-direction: column; gap: 6px; }
.hdc-row { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 8px; font-size: 13px; }
.hdc-row label { color: var(--muted); font-weight: 560; }
.hdc-row input { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px; background: var(--paper); min-width: 0; }
.hdc-row input:focus, .hdc-body textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hdc-body textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--paper); font: inherit; resize: vertical; min-height: 110px; line-height: 1.5; }
.hdc-canned { align-self: flex-start; max-width: 100%; }
.hdc-inserts { display: flex; flex-wrap: wrap; gap: 8px; }
.hdc-inserts [hidden] { display: none; }
.hdc-files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.hdc-fl { color: var(--muted); }
.hdc-chip { border: 1px solid var(--line); background: var(--raised); color: var(--ink-2); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.hdc-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 560; }
.hdc-chip small, .hdm-file small { color: var(--faint); font-size: 11px; }
.hdc-actions { display: flex; align-items: center; gap: 8px; }
.hdc-spacer { flex: 1; }
.hdc-attach { cursor: pointer; }
.hdc-headline { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 0; }
.hdc-headline h3 { font-size: 15px; font-weight: 650; }
.hdc-filter { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
#hdthread { display: flex; flex-direction: column; gap: 10px; }
.hdm { display: flex; gap: 11px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
.hdm.out { background: color-mix(in srgb, var(--accent) 6%, var(--paper)); border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.hdm.note { background: color-mix(in srgb, var(--warn) 9%, var(--paper)); border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.hdm.auto, .hdm.log { border: 0; background: none; padding: 3px 6px; gap: 9px; align-items: flex-start; }
.hdm-av { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: var(--ink-2); color: var(--paper); display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 11px; }
.hdm.out .hdm-av { background: var(--accent); color: #fff; }
.hdm.note .hdm-av { background: var(--warn); color: #fff; }
.hdm-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--line); margin-top: 7px; margin-left: 11px; margin-right: 8px; }
.hdm-main { min-width: 0; flex: 1; }
.hdm-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.hdm-head b { font-weight: 620; }
.hdm-meta { color: var(--muted); font-size: 12.5px; }
.hdm-when { color: var(--faint); font-size: 11.5px; }
.hdm-sub { color: var(--muted); font-size: 12px; margin-top: 1px; overflow-wrap: anywhere; }
.hdm-subj { font-weight: 600; margin-top: 4px; }
.hdm-body { margin-top: 5px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.hdm-logline { color: var(--muted); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.hdm.auto .hdm-logline b { font-weight: 600; color: var(--ink-2); }
.hdm-sep { margin: 0 5px; color: var(--faint); }
.hdm-more { border: 0; background: none; color: var(--accent); font: inherit; font-size: 12.5px; padding: 4px 0 0; cursor: pointer; }
.hdm-more:hover { text-decoration: underline; }
.hdm-quote { margin-top: 6px; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--muted); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; }
.hdm-html { margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised); overflow: auto; max-height: 420px; overflow-wrap: anywhere; line-height: 1.5; }
.hdm-html blockquote { border-left: 3px solid var(--line); margin: 6px 0; padding-left: 10px; color: var(--muted); }
.hdm-html table { border-collapse: collapse; }
.hdm-html td, .hdm-html th { border: 1px solid var(--line); padding: 2px 6px; }
.hdm-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hdm-file { border: 1px solid var(--line); background: var(--paper); border-radius: var(--r-sm); padding: 3px 10px; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
a.hdm-file { color: var(--accent); }
.hdm-file.off { color: var(--faint); border-style: dashed; }
.hdm-chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--line-2); color: var(--muted); }
.hdm-chip.ok { background: color-mix(in srgb, var(--success) 14%, var(--paper)); color: var(--success); }
.hdm-chip.bad { background: color-mix(in srgb, var(--danger) 14%, var(--paper)); color: var(--danger); }
.hdm-chip.note { background: color-mix(in srgb, var(--warn) 18%, var(--paper)); color: var(--warn); }
.hdm-err { margin-top: 6px; color: var(--danger); font-size: 12.5px; overflow-wrap: anywhere; }
.hdm .btn.sm { margin-top: 6px; }
.hdm-all { align-self: center; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(1000px 620px at 12% -10%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 60%),
    radial-gradient(760px 540px at 108% 108%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 62%),
    #0d0f16;
}
.login-card {
  background: var(--paper); border-radius: var(--r-xl); box-shadow: var(--e3);
  width: 372px; max-width: 100%; padding: 40px 38px;
}
.login-card .logo { font-size: 22px; font-weight: 690; letter-spacing: -.026em; text-align: center; margin-bottom: 5px; }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 28px; }
.login-card label { display: block; font-weight: 550; margin: 15px 0 6px; font-size: 12.5px; }
.login-card input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 13px; background: var(--canvas);
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.login-card input:focus { outline: 0; border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card .btn { width: 100%; margin-top: 24px; padding: 12px; font-size: 14px; }
.login-err { color: var(--danger); text-align: center; margin-top: 14px; min-height: 18px; font-weight: 550; font-size: 12.5px; }

/* ---------- dialog / toasts / widgets ---------- */
.dlg-back {
  position: fixed; inset: 0; background: rgba(14, 16, 23, .42);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  animation: fade .16s var(--ease);
}
.dlg {
  background: var(--paper); border-radius: var(--r-lg); width: 432px; max-width: 94vw;
  padding: 28px; box-shadow: var(--e3); animation: rise .2s var(--ease);
}
.dlg h3 { margin-bottom: 20px; font-size: 17px; font-weight: 650; letter-spacing: -.018em; }
.dlg .fieldrow { grid-template-columns: 132px 1fr; }
.dlg .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 26px; }
/* Suggested recipients, indented to sit under their field rather than its label. */
.dlg-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px 132px; }
.dlg-suggest .tagchip { cursor: pointer; border: 0; font-family: inherit; }
.dlg-suggest .tagchip.on { font-weight: 600; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.985); } }

#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: var(--ink); color: #fff; padding: 11px 17px; border-radius: var(--r-sm);
  box-shadow: var(--e3); animation: rise .18s var(--ease); max-width: 380px; font-weight: 500;
}
.toast.error { background: var(--danger); }
.loadbar {
  position: fixed; top: 54px; left: 0; height: 2px; background: var(--accent);
  width: 0; z-index: 60; transition: width .2s var(--ease); border-radius: 0 2px 2px 0;
}

.colorfield { display: inline-flex; align-items: center; gap: 11px; }
.colorfield input[type="color"] {
  width: 42px; height: 30px; padding: 0; border: 1px solid var(--line);
  border-radius: var(--r-xs); background: none; cursor: pointer;
}
.colorhex { color: var(--muted); }

.multiselect { display: flex; flex-wrap: wrap; gap: 8px; }
.msopt {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 15px; background: var(--paper); cursor: pointer;
  font-weight: 500; transition: border-color .15s var(--ease), background .15s var(--ease);
}
.msopt:hover { border-color: var(--faint); }
.msopt:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.msopt.locked { opacity: .7; cursor: default; }
.msopt em { font-style: normal; font-size: 11px; color: var(--muted); }

.imgfield { display: inline-flex; align-items: center; gap: 13px; }
.imgprev {
  width: 78px; height: 78px; border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--canvas); flex: 0 0 78px;
}
.imgprev img { width: 100%; height: 100%; object-fit: cover; }
.imgprev em { color: var(--faint); font-size: 11px; font-style: normal; text-align: center; }
.imgfield label.btn { cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .groups { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 760px) {
  .cpanel { gap: 8px; padding: 10px 14px; }
  .searchbox { order: 10; max-width: none; width: 100%; margin: 0; }
  .sheet { padding: 22px 18px; border-radius: var(--r-md); }
  .sheet .title-input, .sheet .title-ro { font-size: 22px; }
  .fieldrow { grid-template-columns: 1fr; align-items: start; gap: 2px; padding: 7px 0; }
  .fieldrow .ctrl input, .fieldrow .ctrl select, .fieldrow .ctrl textarea { margin-left: 0; }
  .topbar .brand-name { margin: 0 8px 0 2px; }
  .statusbar { margin-left: 0; width: 100%; overflow-x: auto; }
  .totals { width: 100%; }
}

/* ---------- accounting dashboard & reports ---------- */
.period { display: flex; gap: 12px; align-items: center; }
.period label { color: var(--muted); font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
.period input { border: 1px solid var(--line); border-radius: var(--r-xs); padding: 5px 8px; background: var(--paper); }
.period input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.dash { padding: 22px 18px 60px; max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 14px; }
.kpi {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--e1); padding: 20px 22px; display: flex; flex-direction: column; gap: 8px;
}
.kpi.hero { background: var(--ink); border-color: var(--ink); }
.kpi.hero .kl { color: rgba(255, 255, 255, .6); }
.kl { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kv { font-size: 30px; font-weight: 680; letter-spacing: -.03em; }
.kpi.hero .kv { color: #fff; }
.kv.pos { color: var(--success); } .kpi.hero .kv.pos { color: #34d399; }
.kv.neg { color: var(--danger); } .kpi.hero .kv.neg { color: #f87171; }

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mcard {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--e1); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
}
.mcard.link { transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.mcard.link:hover { border-color: var(--faint); box-shadow: var(--e2); }
.mv { font-size: 21px; font-weight: 640; letter-spacing: -.02em; }
.mhint { color: var(--accent); font-size: 12px; font-weight: 550; }

.chartcard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--e1); padding: 22px; }
.charthead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.charthead h3 { font-size: 14px; font-weight: 640; letter-spacing: -.01em; }
.legend { display: flex; gap: 14px; }
.lg { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ''; width: 10px; height: 10px; border-radius: 3px; }
.lg.in::before { background: var(--success); } .lg.out::before { background: var(--danger); }
.chart { display: flex; gap: 12px; align-items: flex-end; height: 180px; padding-top: 10px; }
.barcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.bars { display: flex; gap: 4px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar { width: 22px; border-radius: 5px 5px 0 0; min-height: 2px; transition: height .5s var(--ease); }
.bar.in { background: var(--success); } .bar.out { background: var(--danger); opacity: .82; }
.barlabel { font-size: 11px; color: var(--muted); }

/* Report and chart side by side. The report comes first in the DOM, so on a narrow
   screen the grid collapses and the chart falls BELOW the figures with no order hacks —
   the numbers are the deliverable and should never be pushed down to make room. */
.report-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px; align-items: start; padding: 22px 18px 64px; max-width: 1240px; margin: 0 auto;
}
.report-wrap { padding: 0; display: flex; justify-content: center; min-width: 0; }
/* Sticky, because reports run from six rows to fifty: the chart has to stay with you for
   the whole scroll or it may as well not be there. 54px is the top bar. */
.report-side { position: sticky; top: 70px; min-width: 0; }
.report-side .chartcard { padding: 18px; }
/* A filter change should look like the chart re-drawing, not like a static picture. */
.report-side.repainting { opacity: .45; }
.report-side { transition: opacity .14s var(--ease); }
@keyframes chgrow { from { transform: scaleY(.02); } to { transform: scaleY(1); } }
.svgchart.grow rect { animation: chgrow .34s var(--ease) both; transform-origin: 0 100%; transform-box: fill-box; }
.svgchart.grow rect:nth-of-type(2) { animation-delay: .04s; }
.svgchart.grow rect:nth-of-type(3) { animation-delay: .08s; }
.svgchart.grow rect:nth-of-type(4) { animation-delay: .12s; }

@media (max-width: 1080px) {
  .report-layout { grid-template-columns: minmax(0, 1fr); }
  .report-side { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .svgchart.grow rect { animation: none; }
  .report-side { transition: none; }
}
.report {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--e1); padding: 34px 40px; width: 100%; max-width: 760px;
}
.report h2 { font-size: 22px; font-weight: 680; letter-spacing: -.025em; }
.rperiod { color: var(--muted); margin-bottom: 22px; }
.rtabs { display: flex; gap: 2px; background: var(--line-2); border-radius: var(--r-sm); padding: 2px; flex-wrap: wrap; }
.rtab { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 550; font-size: 12.5px; }
.rtab:hover { color: var(--ink); }
.rtab.active { background: var(--paper); color: var(--ink); box-shadow: var(--e1); }
.rsec { margin-bottom: 20px; }
.rsec h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.rrow { display: flex; justify-content: space-between; padding: 6px 2px; border-bottom: 1px solid var(--line-2); }
.rrow .ra { font-weight: 550; }
.rrow.sum { border-top: 1px solid var(--ink); border-bottom: 0; margin-top: 4px; padding-top: 10px; font-weight: 650; }
.rrow.grand { border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 8px; padding-top: 12px; font-size: 17px; font-weight: 700; }
.rrow.pos .ra { color: var(--success); } .rrow.neg .ra { color: var(--danger); }
.rnone { color: var(--faint); padding: 6px 2px; font-style: italic; }
.rcheck { margin-top: 18px; padding: 10px 14px; border-radius: var(--r-sm); font-weight: 550; font-size: 12.5px; }
.rcheck.ok { background: #e2f4ea; color: var(--success); }
.rcheck.bad { background: #fdeeec; color: var(--danger); }
table.rtable { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
table.rtable th { text-align: left; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.rtable td { padding: 8px 6px; border-bottom: 1px solid var(--line-2); }
table.rtable .n { text-align: right; }
table.rtable tfoot td { font-weight: 700; border-top: 1px solid var(--ink); border-bottom: 0; }
.aged-buckets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 22px; }
.abucket { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; gap: 5px; }
.abucket .mv { font-size: 16px; }

@media (max-width: 760px) {
  .kpis, .cards3, .aged-buckets { grid-template-columns: 1fr 1fr; }
  .report { padding: 22px 18px; }
}

/* ---------- Odoo-style control panel ---------- */
.cpanel.odoo { display: block; padding: 0; }
.cpanel.odoo .cp-top {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; flex-wrap: wrap;
}
.cpanel.odoo .cp-top .spacer { flex: 1; }
.cpanel.odoo .crumbs { font-size: 15.5px; font-weight: 640; letter-spacing: -.015em; }
.cpanel.odoo .crumbs.stacked { display: flex; flex-direction: column; gap: 0; line-height: 1.25; }
.cpanel.odoo .crumbs.stacked a { font-size: 11.5px; color: var(--muted); font-weight: 550; }
.cpanel.odoo .crumbs.stacked a:hover { color: var(--accent); }
.cpanel.odoo .crumbs.stacked .rec { font-size: 15.5px; font-weight: 660; }
.cpanel.odoo .cp-search {
  display: flex; align-items: center; gap: 7px; padding: 7px 16px;
  border-top: 1px solid var(--line-2); background: var(--paper);
}
.cpanel.odoo .cp-search .si { color: var(--faint); font-size: 15px; }
.cpanel.odoo .cp-search input { flex: 1; border: 0; outline: 0; background: none; padding: 3px 0; }
.cpanel.odoo .cp-search .chip {
  background: var(--accent-soft); color: var(--accent); border-radius: var(--r-xs);
  padding: 2px 4px 2px 9px; display: inline-flex; gap: 4px; align-items: center;
  font-weight: 600; font-size: 12px; white-space: nowrap;
}
.cpanel.odoo .cp-search .chip button { border: 0; background: none; color: inherit; padding: 0 4px; border-radius: 4px; }
.cpanel.odoo .cp-search .chip button:hover { background: rgba(0,0,0,.08); }
.cpanel.odoo .caret {
  border: 0; background: none; color: var(--muted); font-size: 13px; padding: 4px 8px; border-radius: var(--r-xs);
}
.cpanel.odoo .caret:hover { background: var(--line-2); color: var(--ink); }
.fm-head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); padding: 6px 10px 4px; font-weight: 650; }

/* ---------- smart buttons (Odoo's stat bar) ---------- */
.smartbar {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px 0;
  max-width: 1176px; margin: 0 auto; width: 100%;
}
.smartbtn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 14px 8px 11px; box-shadow: var(--e1);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.smartbtn:hover:not(:disabled) { border-color: var(--accent); box-shadow: var(--e2); transform: translateY(-1px); }
.smartbtn:disabled { opacity: .45; cursor: default; }
.sb-ico { color: var(--accent); display: flex; }
.sb-ico .ico { width: 18px; height: 18px; }
.sb-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.sb-label { font-size: 11px; color: var(--muted); font-weight: 550; }
.sb-val { font-size: 14.5px; font-weight: 680; letter-spacing: -.015em; }

/* ---------- kanban column header (Odoo progress bar + total) ---------- */
.kcol-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 2px 4px 6px; }
.kcol-head h4 { margin: 0; display: flex; align-items: center; gap: 6px; }
.kcount {
  background: var(--line-2); color: var(--ink-2); border-radius: 999px;
  padding: 1px 7px; font-size: 10.5px; font-weight: 700; letter-spacing: 0; text-transform: none;
}
.kcol-sum { font-size: 12.5px; font-weight: 680; color: var(--ink); letter-spacing: -.01em; }
.kbar { height: 4px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin: 0 4px 10px; }
.kbar-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s var(--ease); }
.kbar-fill.s-draft { background: #9aa1b1; }
.kbar-fill.s-sale, .kbar-fill.s-posted, .kbar-fill.s-shipped { background: #1b4fd8; }
.kbar-fill.s-paid, .kbar-fill.s-done, .kbar-fill.s-delivered { background: var(--success); }
.kbar-fill.s-cancel { background: var(--danger); }
.kbar-fill.s-placed { background: var(--warn); }

/* record pager + scope chip */
.recpager { margin-left: 4px; }
.cpanel.odoo .cp-search .chip.scope { background: #e8f0fe; color: #1b4fd8; }

/* filter/group dropdown, two columns like the reference */
.filter-menu.wide { display: flex; gap: 4px; min-width: 300px; }
.fm-col { flex: 1; min-width: 130px; }
.fm-col + .fm-col { border-left: 1px solid var(--line-2); padding-left: 4px; }
.filter-menu button.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.filter-menu button.clear { color: var(--muted); font-style: italic; }
.cpanel.odoo .cp-search .chip.grp { background: #e2f4ea; color: var(--success); }

/* grouped list */
.groupcard {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--e1); overflow: hidden; margin-bottom: 14px;
}
.grouprow {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: none; padding: 11px 14px; border-bottom: 1px solid var(--line-2);
  transition: background .12s var(--ease);
}
.grouprow:last-child { border-bottom: 0; }
.grouprow:hover { background: var(--raised); }
.gcaret { color: var(--faint); font-size: 11px; }
.glabel { font-weight: 600; flex: 1; }
.gcount {
  background: var(--line-2); color: var(--ink-2); border-radius: 999px;
  padding: 1px 9px; font-size: 11px; font-weight: 700;
}
.gsum { font-weight: 650; font-variant-numeric: tabular-nums; }

/* photo block on the form sheet */
.sheet-head { display: flex; gap: 24px; align-items: flex-start; }
.sheet-headmain { flex: 1; min-width: 0; }
.sheet-photo { flex-direction: column; align-items: flex-start; gap: 8px; }
.sheet-photo .imgprev { width: 104px; height: 104px; flex: 0 0 104px; border-radius: var(--r-md); }
.sheet-photo .imgprev em { line-height: 1.4; }

/* ---------- Odoo-style accounting journal cards ---------- */
.jgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px; padding: 20px 18px 60px; max-width: 1180px; margin: 0 auto;
}
.jcard {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--e1); overflow: hidden; border-top: 3px solid var(--accent);
  transition: box-shadow .18s var(--ease), transform .18s var(--ease);
}
.jcard:hover { box-shadow: var(--e2); transform: translateY(-1px); }
.jcard.j-sale { border-top-color: #2563eb; }
.jcard.j-purchase { border-top-color: #b45309; }
.jcard.j-bank { border-top-color: #0f766e; }
.jcard.j-cash { border-top-color: #0d7a4f; }
.jcard.j-misc { border-top-color: #7c5cbf; }
.jcard-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px 10px;
}
.jcard-head h3 { font-size: 15.5px; font-weight: 660; letter-spacing: -.015em; color: var(--ink); }
.jcard-lines { padding: 2px 8px 10px; }
.jl {
  display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left;
  border: 0; background: none; padding: 7px 8px; border-radius: var(--r-xs);
  transition: background .12s var(--ease);
}
.jl:hover { background: var(--raised); }
.jl-count {
  min-width: 22px; text-align: right; color: var(--accent); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.jl-count.empty { min-width: 22px; }
.jl-label { flex: 1; color: var(--muted); }
.jl-amt { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.jl.danger .jl-count, .jl.danger .jl-amt { color: var(--danger); }
.jl.danger .jl-label { color: var(--danger); }

@media (max-width: 760px) { .jgrid { grid-template-columns: 1fr; } }

/* report comparison columns + collapsible sections */
.cmpsel { border: 1px solid var(--line); border-radius: var(--r-xs); padding: 5px 8px; background: var(--paper); font-size: 12.5px; }
.cmpsel:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rrow.cmp { display: grid; grid-template-columns: 1fr 110px 110px 64px; align-items: baseline; gap: 8px; }
.rrow.cmp .ra, .rrow.cmp .rp { text-align: right; font-variant-numeric: tabular-nums; }
.rrow.cmp .rp { color: var(--muted); }
.rrow.cmp .rv { text-align: right; font-size: 12px; font-weight: 650; color: var(--faint); }
.rrow.cmp .rv.up { color: var(--success); }
.rrow.cmp .rv.down { color: var(--danger); }
.rrow.rhead { border-bottom: 1px solid var(--line); }
.rrow.rhead .ra, .rrow.rhead .rp, .rrow.rhead .rv {
  color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 650;
}
.rsec-head { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.rsec-head .scaret { font-size: 9px; color: var(--faint); transition: transform .15s var(--ease); }
.rsec.collapsed .rsec-head .scaret { transform: rotate(-90deg); }
.rsec.collapsed .rsec-body { display: none; }

/* kanban drag-and-drop */
.kanban.dnd .kcard { cursor: grab; }
.kanban.dnd .kcard.dragging { opacity: .4; cursor: grabbing; }
.kcards { min-height: 40px; border-radius: var(--r-sm); transition: background .12s var(--ease); }
.kcards.drop-hot { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: 2px; }


/* ---------- dark theme ---------- */
:root[data-theme="dark"] {
  --accent-soft: color-mix(in srgb, var(--accent) 26%, #12151c);
  --ink: #e7e9ee;
  --ink-2: #b6bcc8;
  --muted: #8b93a3;
  --faint: #6b7280;
  --paper: #171a21;
  --canvas: #0f1116;
  --raised: #1d212a;
  --line: #2a2f3a;
  --line-2: #21252e;
  --success: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --e1: 0 1px 2px rgba(0,0,0,.4);
  --e2: 0 4px 12px -2px rgba(0,0,0,.5);
  --e3: 0 18px 40px -12px rgba(0,0,0,.7);
}
:root[data-theme="dark"] body { background: var(--canvas); }
:root[data-theme="dark"] .topbar { background: rgba(23,26,33,.82); }
:root[data-theme="dark"] .kpi.hero { background: #05070b; border-color: #05070b; }
:root[data-theme="dark"] .badge.draft { background: #262b35; color: #aab2c0; }
:root[data-theme="dark"] .badge.sale, :root[data-theme="dark"] .badge.posted, :root[data-theme="dark"] .badge.shipped { background: #16233f; color: #7aa5ff; }
:root[data-theme="dark"] .badge.paid, :root[data-theme="dark"] .badge.done, :root[data-theme="dark"] .badge.delivered { background: #123027; color: #4ade80; }
:root[data-theme="dark"] .badge.cancel { background: #3a1d1d; color: #fca5a5; }
:root[data-theme="dark"] .badge.placed { background: #3a2c15; color: #fbbf24; }
:root[data-theme="dark"] .rcheck.ok { background: #123027; color: #4ade80; }
:root[data-theme="dark"] .rcheck.bad { background: #3a1d1d; color: #fca5a5; }
:root[data-theme="dark"] input[type="date"], :root[data-theme="dark"] input[type="color"] { color-scheme: dark; }

.theme-btn {
  background: none; border: 1px solid var(--line); color: var(--muted); width: 32px; height: 32px;
  border-radius: 999px; font-size: 14px; display: grid; place-items: center; margin-right: 8px;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.theme-btn:hover { border-color: var(--faint); color: var(--ink); }

/* favourites + kanban quick-add */
.favrow { display: flex; align-items: center; gap: 2px; }
.favrow .favapply { flex: 1; }
.favdel { border: 0; background: none; color: var(--faint); padding: 4px 6px; border-radius: var(--r-xs); }
.favdel:hover { color: var(--danger); background: #fdf4f3; }
.favnone { color: var(--faint); font-size: 12px; padding: 6px 10px; font-style: italic; }
#savefav { color: var(--accent) !important; font-style: normal !important; font-weight: 600; }
.kcol-head { align-items: center; }
.kcol-right { display: flex; align-items: center; gap: 6px; }
.kadd { border: 0; background: none; color: var(--muted); width: 22px; height: 22px; border-radius: var(--r-xs); font-size: 15px; line-height: 1; }
.kadd:hover { background: var(--accent-soft); color: var(--accent); }
.kquick { background: var(--paper); border: 1px solid var(--accent); border-radius: var(--r-md); padding: 10px; margin-bottom: 9px; box-shadow: var(--e1); }
.kquick input { width: 100%; border: 0; outline: 0; background: none; font-weight: 600; margin-bottom: 8px; }
.kquick-a { display: flex; gap: 6px; }
/* A folded kanban column (Odoo's folded stage): a narrow strip with its name running down
   it; its cards stay hidden until it is unfolded, and a card can still be dropped on it. */
.kfold { border: 0; background: none; color: var(--muted); width: 22px; height: 22px; border-radius: var(--r-xs); font-size: 15px; line-height: 1; }
.kfold:hover { background: var(--accent-soft); color: var(--accent); }
.kcol.folded { min-width: 46px; flex: 0 0 46px; }
.kcol.folded .kcol-head { flex-direction: column-reverse; align-items: center; gap: 10px; margin-inline: 0; }
.kcol.folded .kcol-head h4 { writing-mode: vertical-rl; margin: 0; white-space: nowrap; }
.kcol.folded .kcards { min-height: 160px; }
.kbar-fill.s-stage { background: var(--accent); }

/* a notebook tab's own grid (an event's questions) */
.tabgrid { margin-top: 6px; }
.tabgrid-none { color: var(--faint); font-size: 12.5px; font-style: italic; margin: 10px 4px 0; }
.tabgrid-hint { color: var(--muted); font-size: 12.5px; margin: 0 4px 10px; max-width: 70ch; }
/* a saved row's own buttons (an event email's "Send Now") and its ↗ to open it */
.tabgrid td.row-acts { white-space: nowrap; text-align: end; width: 1%; }
.tabgrid td.row-acts .btn.sm { padding: 3px 10px; }
.tabgrid .row-open { display: inline-block; margin-inline-start: 6px; padding: 2px 4px; text-decoration: none; color: var(--accent, #1a5ce6); font-size: 15px; line-height: 1; }
table.lines td.c-bool { width: 56px; text-align: center; }
table.lines td.c-bool input { width: auto; }
table.lines td.col-dt { width: 200px; }
table.lines td.col-wide { min-width: 170px; }
table.lines td.col-int { width: 76px; }
table.lines td.col-sel { min-width: 150px; }
table.lines td.col-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ===================== Point of Sale ===================== */
/* `posapp`, not `pos`: `pos` is the positive-number modifier used across the reports
   (.kv.pos, td.pos, .bl-amt.pos), and a bare `.pos` rule turned every one of those into
   a full-screen fixed layer — it blanked the P&L behind its own net-profit figure. */
.posapp { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--canvas); z-index: 5; }
.pos-top {
  display: flex; align-items: center; gap: 14px; padding: 0 18px; height: 56px;
  background: var(--paper); border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.pos-exit {
  border: 1px solid var(--line); background: var(--canvas); color: var(--ink-2);
  padding: 7px 13px; border-radius: var(--r-sm); font-weight: 600;
}
.pos-exit:hover { border-color: var(--accent); color: var(--accent); }
.pos-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; }
.pos-title .ico { width: 20px; height: 20px; color: var(--accent); }
.pos-top .spacer { flex: 1; }
.pos-cashier { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 550; }
.pos-cashier .dot { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; }

.pos-body { flex: 1; display: grid; grid-template-columns: 1fr 384px; min-height: 0; }
.pos-catalog { display: flex; flex-direction: column; min-height: 0; padding: 16px 18px; gap: 12px; }
.pos-searchbar input {
  width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: var(--r-md);
  padding: 11px 15px; font-size: 14px; outline: 0;
}
.pos-searchbar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pos-cats { display: flex; gap: 7px; flex-wrap: wrap; }
.pos-chip {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-2);
  padding: 6px 14px; border-radius: 999px; font-weight: 550; font-size: 12.5px;
}
.pos-chip:hover { border-color: var(--accent); color: var(--accent); }
.pos-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.pos-grid {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-content: start; padding-bottom: 20px;
}
.pos-prod {
  display: flex; flex-direction: column; gap: 5px; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px 15px 13px; min-height: 96px; box-shadow: var(--e1);
  transition: transform .1s var(--ease), border-color .12s, box-shadow .12s;
}
.pos-prod:hover { border-color: var(--accent); box-shadow: var(--e2); transform: translateY(-1px); }
.pos-prod:active { transform: translateY(0) scale(.985); }
.pp-name { font-weight: 600; line-height: 1.3; }
.pp-price { margin-top: auto; font-weight: 700; color: var(--accent); font-size: 15px; }
.pp-stock, .pp-tag { font-size: 11.5px; color: var(--faint); }
.pos-prod.oos .pp-stock { color: var(--danger); }
.pos-prod.oos { opacity: .62; }
.pos-empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 60px 0; }

/* cart */
.pos-cart { background: var(--paper); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.pos-cart-head { padding: 14px 16px 0; }
.pos-cust {
  width: 100%; border: 1px solid var(--line); background: var(--canvas); border-radius: var(--r-sm);
  padding: 9px 12px; font-weight: 550; outline: 0;
}
.pos-cust:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pos-lines { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.pos-cart-empty { color: var(--faint); text-align: center; padding: 48px 12px; }
.pos-line { padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.pl-main { display: flex; justify-content: space-between; gap: 12px; }
.pl-name { font-weight: 600; }
.pl-sub { font-weight: 650; }
.pl-ctl { display: flex; align-items: center; gap: 7px; margin-top: 7px; }
.pl-btn {
  width: 28px; height: 28px; border: 1px solid var(--line); background: var(--canvas);
  border-radius: var(--r-xs); font-size: 17px; line-height: 1; color: var(--ink-2); font-weight: 600;
}
.pl-btn:hover { border-color: var(--accent); color: var(--accent); }
.pl-qty { width: 46px; text-align: center; border: 1px solid var(--line); border-radius: var(--r-xs); padding: 5px 0; outline: 0; background: var(--paper); }
.pl-qty:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pl-unit { color: var(--faint); font-size: 12px; }
.pl-rm { margin-left: auto; border: 0; background: none; color: var(--faint); font-size: 18px; width: 26px; height: 26px; border-radius: var(--r-xs); }
.pl-rm:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

.pos-sum { padding: 12px 16px; border-top: 1px solid var(--line); }
.ps-row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.ps-total { color: var(--ink); font-weight: 700; font-size: 18px; padding-top: 8px; }
.pos-pay { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 0 16px 10px; }
.pos-m { border: 1px solid var(--line); background: var(--canvas); color: var(--ink-2); padding: 11px 0; border-radius: var(--r-sm); font-weight: 600; }
.pos-m:hover { border-color: var(--accent); }
.pos-m.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pos-cash { padding: 0 16px 12px; }
.pos-tend { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pos-tend span { color: var(--muted); font-weight: 550; }
.pos-tend input { width: 150px; text-align: right; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; font-weight: 700; font-size: 15px; outline: 0; background: var(--paper); }
.pos-tend input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pos-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.pos-q { border: 1px solid var(--line); background: var(--canvas); border-radius: var(--r-xs); padding: 8px 0; font-weight: 600; font-size: 12px; color: var(--ink-2); }
.pos-q:hover { border-color: var(--accent); color: var(--accent); }
.pos-change { text-align: right; color: var(--muted); }
.pos-change b { color: var(--success); font-size: 16px; margin-left: 6px; }
.pos-charge {
  margin: 0 16px 16px; padding: 16px; border: 0; border-radius: var(--r-md);
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; box-shadow: var(--e2);
}
.pos-charge:hover:not(:disabled) { filter: brightness(1.07); }
.pos-charge:disabled { opacity: .45; cursor: not-allowed; }

/* receipt overlay */
.pos-receipt-back { position: fixed; inset: 0; background: rgba(14,16,23,.5); display: grid; place-items: center; z-index: 40; padding: 20px; }
.pos-receipt {
  background: var(--paper); border-radius: var(--r-lg); width: 340px; max-width: 100%; max-height: 92vh; overflow-y: auto;
  padding: 26px 26px 22px; box-shadow: var(--e3); text-align: center;
}
.pr-brand { font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.pr-meta { color: var(--muted); font-size: 12px; margin: 6px 0 16px; line-height: 1.5; }
.pr-lines { text-align: left; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 12px 0; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.pr-l { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.pr-l span:first-child { font-weight: 600; }
.pr-l span:nth-child(2) { color: var(--muted); font-size: 12px; }
.pr-l span:last-child { grid-column: 2; grid-row: 1; font-weight: 650; }
.pr-sum { text-align: left; display: flex; flex-direction: column; gap: 5px; }
.pr-sum > div { display: flex; justify-content: space-between; color: var(--muted); }
.pr-total { color: var(--ink) !important; font-weight: 700; font-size: 16px; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.pr-thanks { margin: 16px 0 18px; color: var(--muted); font-style: italic; }
.pr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pr-print { border: 1px solid var(--line); background: var(--canvas); color: var(--ink-2); padding: 12px; border-radius: var(--r-sm); font-weight: 600; }
.pr-new { border: 0; background: var(--accent); color: #fff; padding: 12px; border-radius: var(--r-sm); font-weight: 700; }

@media (max-width: 820px) {
  .pos-body { grid-template-columns: 1fr; }
  .pos-cart { border-left: 0; border-top: 1px solid var(--line); max-height: 46vh; }
}
.plg-name { font-size: 14px; font-weight: 650; margin: 22px 0 8px; }

/* ---------- grouped app menus (dropdown categories) ---------- */
.menu-group { position: relative; display: inline-flex; }
.menu-group .group-btn { display: inline-flex; align-items: center; gap: 5px; }
.menu-group .caret { font-size: 9px; color: var(--faint); transition: transform .15s var(--ease); }
.menu-group.open .caret { transform: rotate(180deg); }
.menu-group.active > .group-btn { color: var(--ink); font-weight: 600; background: var(--line-2); }
.menu-group.open > .group-btn { background: var(--line-2); color: var(--ink); }
/* Fixed, and positioned from the button in JS: the menu bar scrolls, and an absolutely
   placed dropdown inside a scroller is clipped by it. (The bar's backdrop-filter makes the
   bar itself the containing block, which is what the JS measures against.) */
.menu-drop {
  display: none; position: fixed; top: 60px; left: 0; z-index: 60;
  min-width: 208px; padding: 6px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e3);
}
.menu-group.open .menu-drop { display: block; }
.menu-drop-item {
  display: block; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; white-space: nowrap;
}
.menu-drop-item:hover { background: var(--line-2); color: var(--ink); }
.menu-drop-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
a.menu-item { display: inline-flex; align-items: center; text-decoration: none; }
.totals .trow.fxnote { color: var(--faint); font-size: 12px; border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 7px; }
.totals .trow.fxnote b { font-weight: 500; color: var(--muted); }
.report .rcur { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line-2); color: var(--faint); font-size: 12px; }

/* ---------- bank import & reconciliation ---------- */
.bank-wrap { max-width: 940px; margin: 0 auto; padding: 22px 18px 60px; display: flex; flex-direction: column; gap: 16px; }
.bank-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px 22px; box-shadow: var(--e1); }
.bank-card h3 { font-size: 13px; font-weight: 650; letter-spacing: -.005em; margin: 18px 0 8px; }
.bank-card h3:first-child { margin-top: 0; }
.bank-card.done { text-align: center; padding: 48px 22px; }
.bhint { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.bfield { display: block; margin-bottom: 12px; }
.bfield span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.bfield select { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; background: var(--paper); outline: 0; }
.bfield select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bank-card input[type="file"] { display: block; margin-bottom: 10px; font-size: 13px; }
.bank-card textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; outline: 0;
  background: var(--canvas); resize: vertical; margin-bottom: 12px;
}
.bank-card textarea:focus { border-color: var(--accent); background: var(--paper); }
.bmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.bsummary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.bsummary div { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.bsummary b { display: block; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.bsummary span { font-size: 12px; color: var(--muted); }
.bproblems { background: #fdf7f6; border: 1px solid #f0cfcc; border-radius: var(--r-sm); padding: 11px 14px; margin-bottom: 14px; font-size: 12.5px; }
.bproblems ul { margin: 6px 0 0 16px; padding: 0; color: var(--muted); }
.bpreview { margin-bottom: 14px; }
.bpreview .neg { color: var(--danger); }
.bpreview .pos { color: var(--success); }
.bwide { width: 100%; padding: 12px; }

.jtabs { display: flex; gap: 7px; flex-wrap: wrap; padding: 14px 18px 0; max-width: 940px; margin: 0 auto; width: 100%; }
.jtab { border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); padding: 7px 14px; border-radius: 999px; font-weight: 550; font-size: 12.5px; }
.jtab b { color: var(--muted); margin-left: 5px; font-weight: 650; }
.jtab:hover { border-color: var(--accent); }
.jtab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.jtab.on b { color: rgba(255,255,255,.75); }

.bline { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e1); overflow: hidden; }
.bl-head { display: flex; align-items: center; gap: 14px; padding: 13px 16px; }
.bl-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bl-date { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.bl-label { font-weight: 550; }
.bl-party { font-size: 12.5px; color: var(--muted); }
.bl-journal { font-size: 11px; color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.bl-amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bl-amt.neg { color: var(--danger); }
.bl-amt.pos { color: var(--success); }
.bl-body { border-top: 1px solid var(--line-2); padding: 14px 16px; background: var(--raised); }
.bl-loading { color: var(--muted); font-size: 13px; }
.bl-sugs { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.bl-sug {
  display: grid; grid-template-columns: auto 1fr auto; gap: 3px 12px; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 13px;
}
.bl-sug:hover { border-color: var(--accent); box-shadow: var(--e1); }
.bs-n { font-weight: 650; }
.bs-p { color: var(--ink-2); }
.bs-a { grid-row: 1 / 3; align-self: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.bs-w { grid-column: 1 / 3; font-size: 11.5px; color: var(--muted); }
.bl-direct { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.bl-direct select { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; background: var(--paper); outline: 0; min-width: 200px; }
.bl-direct select:focus { border-color: var(--accent); }

/* ---------- contact form: radio, tags, child cards, notebook ---------- */
.radioset { display: inline-flex; gap: 6px; }
.radiopill {
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; cursor: pointer;
  font-weight: 550; font-size: 12.5px; color: var(--muted); background: var(--paper);
}
.radiopill input { display: none; }
.radiopill.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.tagfield { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tagchips { display: contents; }
.tagchip {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 550; white-space: nowrap;
}
.tagchip.mini { padding: 1px 8px; font-size: 11px; margin-right: 4px; }
.tagchip button { border: 0; background: none; color: inherit; opacity: .6; font-size: 14px; line-height: 1; padding: 0; }
.tagchip button:hover { opacity: 1; }
.tagadd { border: 1px dashed var(--line); border-radius: 999px; padding: 3px 9px; background: none; color: var(--muted); font-size: 12px; outline: 0; }
.tagadd:focus { border-color: var(--accent); color: var(--accent); }
.tagchip.c0 { background: #e8ecf1; color: #4a5563; }
.tagchip.c1 { background: #fdeaea; color: #b42318; }
.tagchip.c2 { background: #fdf1e3; color: #a35a09; }
.tagchip.c3 { background: #fdf7dc; color: #8a6d0b; }
.tagchip.c4 { background: #e6f6ec; color: #0d7a4f; }
.tagchip.c5 { background: #e2f3f6; color: #0e6f80; }
.tagchip.c6 { background: #e8f0fe; color: #1b4fd8; }
.tagchip.c7 { background: #efeafc; color: #6231c9; }
.tagchip.c8 { background: #fceaf4; color: #a31a68; }
.tagchip.c9 { background: #ecefe9; color: #4d6b39; }
:root[data-theme="dark"] .tagchip.c0 { background: #262b35; color: #aab2c0; }
:root[data-theme="dark"] .tagchip.c1 { background: #3a1d1d; color: #fca5a5; }
:root[data-theme="dark"] .tagchip.c2 { background: #3a2c15; color: #fbbf24; }
:root[data-theme="dark"] .tagchip.c3 { background: #37320f; color: #e8d44d; }
:root[data-theme="dark"] .tagchip.c4 { background: #123027; color: #4ade80; }
:root[data-theme="dark"] .tagchip.c5 { background: #102c33; color: #4dd4e8; }
:root[data-theme="dark"] .tagchip.c6 { background: #16233f; color: #7aa5ff; }
:root[data-theme="dark"] .tagchip.c7 { background: #241a3d; color: #b79bf5; }
:root[data-theme="dark"] .tagchip.c8 { background: #331428; color: #f39ac8; }
:root[data-theme="dark"] .tagchip.c9 { background: #1f2a19; color: #a3c98a; }

.childsec .chgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.chcard { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; background: var(--paper); transition: border-color .15s, box-shadow .15s; }
.chcard:hover { border-color: var(--accent); box-shadow: var(--e1); }
.ch-kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 650; margin-bottom: 4px; }
.ch-name { font-weight: 650; }
.ch-role { color: var(--muted); font-size: 12.5px; }
.ch-line { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.chadd { border: 1px dashed var(--line); background: none; border-radius: var(--r-md); color: var(--muted); padding: 12px; font-weight: 550; }
.chadd:hover { border-color: var(--accent); color: var(--accent); }

.nbook { margin-top: 26px; border-top: 1px solid var(--line); }
.nbtabs { display: flex; gap: 2px; margin: 0 0 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.nbtab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 15px; color: var(--muted); font-weight: 550; margin-bottom: -1px; }
.nbtab:hover { color: var(--ink); }
.nbtab.on { color: var(--accent); border-bottom-color: var(--accent); }
.nbpage .group { margin-bottom: 8px; }

.kcard.withav { display: flex; gap: 12px; align-items: flex-start; }
.kav { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--line-2); }
.kav.ini { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }
.kbody { min-width: 0; flex: 1; }
.ktags { margin-top: 7px; }
.dlg.wide { width: 460px; max-width: 92vw; }
.dlg-actions .spacer { flex: 1; }
.typeswitch { margin-bottom: 10px; }

/* ---------- workspace background wash ----------
   The canvas carries a soft colour so white cards read as raised rather than
   merging into the page. Each tint shifts the ground and the hairlines together
   so borders stay visible against it; the accent is never touched. Both themes
   are defined for every tint — a wash that only exists in light mode would leave
   dark mode painting light text on a light ground. */
:root {
  --wash-1: #eaf0fb;    /* faded blue, the default */
  --wash-2: #f4f7fd;
  --canvas: var(--wash-1);
  --line:   #dde5f2;
  --line-2: #e9eff8;
}
body {
  /* a barely-there vertical lift, so the wash reads as colour and not as flat grey */
  background: var(--canvas);
  background-image: linear-gradient(180deg, var(--wash-2) 0%, var(--canvas) 42%);
  background-attachment: fixed;
}
:root[data-bg="blue"]   { --wash-1: #eaf0fb; --wash-2: #f4f7fd; --line: #dde5f2; --line-2: #e9eff8; }
:root[data-bg="slate"]  { --wash-1: #eef1f5; --wash-2: #f6f8fa; --line: #dfe4eb; --line-2: #eaeef3; }
:root[data-bg="teal"]   { --wash-1: #e8f3f2; --wash-2: #f3faf9; --line: #d5e6e4; --line-2: #e4f0ef; }
:root[data-bg="violet"] { --wash-1: #f0edfb; --wash-2: #f8f6fd; --line: #e2ddf3; --line-2: #ece8f8; }
:root[data-bg="sand"]   { --wash-1: #f5f1e9; --wash-2: #fbf8f3; --line: #e8e0d2; --line-2: #f0ebe1; }
:root[data-bg="rose"]   { --wash-1: #fbedf1; --wash-2: #fdf6f8; --line: #f2dde4; --line-2: #f8e9ee; }
:root[data-bg="green"]  { --wash-1: #edf4ec; --wash-2: #f6faf5; --line: #dce8da; --line-2: #e8f1e7; }
:root[data-bg="plain"]  { --wash-1: #f6f7f9; --wash-2: #fafbfc; --line: #e9eaef; --line-2: #f1f2f6; }

:root[data-theme="dark"] {
  --wash-1: #0d131f;
  --wash-2: #101828;
  --canvas: var(--wash-1);
  --line: #24304a;
  --line-2: #1b2536;
}
:root[data-theme="dark"][data-bg="blue"]   { --wash-1: #0d131f; --wash-2: #101828; --line: #24304a; --line-2: #1b2536; }
:root[data-theme="dark"][data-bg="slate"]  { --wash-1: #0f1116; --wash-2: #141821; --line: #2a2f3a; --line-2: #21252e; }
:root[data-theme="dark"][data-bg="teal"]   { --wash-1: #0a1616; --wash-2: #0e1e1e; --line: #1f3634; --line-2: #172828; }
:root[data-theme="dark"][data-bg="violet"] { --wash-1: #12101f; --wash-2: #171429; --line: #2e2745; --line-2: #221d34; }
:root[data-theme="dark"][data-bg="sand"]   { --wash-1: #16130d; --wash-2: #1d1913; --line: #362f22; --line-2: #28231a; }
:root[data-theme="dark"][data-bg="rose"]   { --wash-1: #1a0f14; --wash-2: #22141a; --line: #3d2630; --line-2: #2d1c23; }
:root[data-theme="dark"][data-bg="green"]  { --wash-1: #0d150c; --wash-2: #121d11; --line: #24361f; --line-2: #1b2819; }
:root[data-theme="dark"][data-bg="plain"]  { --wash-1: #0f1116; --wash-2: #141821; --line: #2a2f3a; --line-2: #21252e; }

/* the top bar floats over the wash rather than sitting on a white slab */
.topbar { background: color-mix(in srgb, var(--paper) 78%, transparent); }
:root[data-theme="dark"] .topbar { background: color-mix(in srgb, var(--paper) 80%, transparent); }

/* ---------- team chat ---------- */
.chat { position: fixed; inset: 54px 0 0; display: grid; grid-template-columns: 236px 1fr; background: var(--paper); }
.chat:has(.ch-thread:not([hidden])) { grid-template-columns: 236px 1fr 320px; }
.ch-rail { border-right: 1px solid var(--line); overflow-y: auto; padding-bottom: 20px; background: var(--canvas); }
.ch-rail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint);
}
.ch-new { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 4px; border-radius: 5px; }
.ch-new:hover { background: var(--line-2); color: var(--ink); }
.ch-list { display: flex; flex-direction: column; }
.ch-none { padding: 4px 14px 8px; color: var(--faint); font-size: 12.5px; }
.ch-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: 0; padding: 6px 14px; color: var(--ink-2); font-size: 13.5px;
}
.ch-item:hover { background: var(--line-2); }
.ch-item.on { background: var(--accent); color: #fff; font-weight: 600; }
.ch-item.on .ch-hash, .ch-item.on .ch-badge { color: rgba(255,255,255,.8); }
.ch-hash { color: var(--faint); width: 12px; flex: none; }
.ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; }
.ch-av { width: 20px; height: 20px; border-radius: 5px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700; flex: none; }
.ch-av.big { width: 34px; height: 34px; border-radius: 8px; font-size: 12px; }

.ch-main { display: flex; flex-direction: column; min-width: 0; }
.ch-top { padding: 13px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ch-title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.ch-topic { color: var(--muted); font-size: 13px; flex: 1; min-width: 0; }
.ch-stream { flex: 1; overflow-y: auto; padding: 16px 0 20px; }
.ch-empty { color: var(--faint); text-align: center; padding: 60px 20px; }
.ch-day { display: flex; align-items: center; gap: 12px; margin: 18px 20px 12px; color: var(--faint); font-size: 11.5px; font-weight: 650; }
.ch-day::before, .ch-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ch-msg { display: flex; gap: 10px; padding: 3px 20px; position: relative; }
.ch-msg:not(.grouped) { margin-top: 12px; }
.ch-msg:hover { background: var(--raised); }
.ch-gutter { width: 34px; flex: none; }
.ch-body { min-width: 0; flex: 1; }
.ch-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 1px; }
.ch-meta b { font-size: 13.5px; font-weight: 650; }
.ch-meta span { color: var(--faint); font-size: 11.5px; }
.ch-text { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ch-link { display: inline-block; margin-top: 4px; font-size: 12.5px; background: var(--accent-soft); color: var(--accent);
  border-radius: 6px; padding: 2px 8px; font-weight: 550; }
.ch-rx { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.ch-chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.ch-chip.mine { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 650; }
.ch-replies { border: 0; background: none; color: var(--accent); font-size: 12.5px; font-weight: 600; padding: 4px 0 0; }
.ch-tools { position: absolute; right: 16px; top: -10px; display: none; gap: 2px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px; padding: 2px; box-shadow: var(--e1); }
.ch-msg:hover .ch-tools { display: flex; }
.ch-tools button { border: 0; background: none; padding: 3px 6px; border-radius: 5px; font-size: 14px; line-height: 1; }
.ch-tools button:hover { background: var(--line-2); }
.ch-composer { display: flex; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.ch-composer input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; outline: 0;
  background: var(--paper); font-size: 14px; }
.ch-composer input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.ch-thread { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; background: var(--paper); }
.ch-thread[hidden] { display: none; }
.ch-thread-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px;
  border-bottom: 1px solid var(--line); font-weight: 650; }
.ch-thread-head button { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); }
.ch-thread-body { flex: 1; overflow-y: auto; padding: 12px 0; }
.ch-msg.root { background: var(--raised); padding-top: 10px; padding-bottom: 10px; margin: 0 0 8px; }

/* The Copilot. Marked rather than disguised: a tinted rail down the left edge and a glyph
   instead of initials, so an answer written by software never reads as a colleague's. */
.ch-msg.bot { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.ch-msg.bot:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.ch-msg.bot::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.ch-av.bot { background: var(--accent); color: #fff; font-size: 15px; }
.ch-pending .ch-text { color: var(--faint); }
.ch-pending .ch-av { animation: ch-pulse 1.4s ease-in-out infinite; }
@keyframes ch-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .ch-pending .ch-av { animation: none; } }
@media (max-width: 860px) {
  .chat { grid-template-columns: 1fr; }
  .ch-rail { display: none; }
  .chat:has(.ch-thread:not([hidden])) { grid-template-columns: 1fr; }
  .ch-thread { position: fixed; inset: 54px 0 0; z-index: 20; }
}

/* ---------- home: search results & attention badges ---------- */
.appsearch .kbd {
  font: inherit; font-size: 11px; font-weight: 600; color: var(--faint);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: var(--canvas); flex: none;
}
.tilebadge {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--canvas); line-height: 1;
}
.apptile .icon { position: relative; }
.homefind {
  width: 100%; max-width: 760px; margin-top: 8px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; align-items: start;
}
.hf-group { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; box-shadow: var(--e1); }
.hf-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 6px;
}
.hf-head span { color: var(--muted); font-size: 11px; letter-spacing: 0; }
.hf-row { display: block; padding: 5px 7px; border-radius: var(--r-xs); color: var(--ink-2); font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-row:hover { background: var(--accent-soft); color: var(--accent); }
.hf-more { display: block; padding: 5px 7px; font-size: 12px; color: var(--accent); font-weight: 600; }
.hf-none { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 24px; }

/* ---------- POS register session ---------- */
.pos-sess { color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.pos-sess b { color: var(--ink); font-weight: 650; }
.pos-open { flex: 1; display: grid; place-items: center; padding: 24px; }
.po-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 34px 36px; width: 420px; max-width: 100%; box-shadow: var(--e2); text-align: center; }
.po-card h2 { font-size: 21px; letter-spacing: -.02em; margin-bottom: 8px; }
.po-card p { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.po-field { display: block; text-align: left; margin-bottom: 18px; }
.po-field span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.po-field input { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 14px;
  font-size: 20px; font-weight: 700; text-align: right; outline: 0; background: var(--paper); }
.po-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.po-go { width: 100%; padding: 14px; font-size: 15px; }
.po-alt { display: block; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.po-alt:hover { color: var(--accent); }
.closebox { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 14px; }
.cb-row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--muted); font-size: 13px; }
.cb-row b { color: var(--ink); }
.cb-row.tot { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 7px; font-weight: 650; color: var(--ink); }
.cb-diff { text-align: center; padding: 9px; border-radius: var(--r-sm); font-weight: 650; font-size: 13.5px;
  background: var(--line-2); color: var(--muted); margin-bottom: 12px; }
.cb-diff.ok { background: #e2f4ea; color: var(--success); }
.cb-diff.over { background: #fdf1e3; color: var(--warn); }
.cb-diff.short { background: #fdeeec; color: var(--danger); }
/* severity reads at a glance in the flag list */
.badge.high { background: #fdeeec; color: var(--danger); }
.badge.medium { background: #fdf1e3; color: var(--warn); }
.badge.low { background: var(--line-2); color: var(--muted); }
.badge.confirmed { background: #fdeeec; color: var(--danger); }
.badge.dismissed { background: var(--line-2); color: var(--muted); }
:root[data-theme="dark"] .badge.high, :root[data-theme="dark"] .badge.confirmed { background: #3a1d1d; color: #fca5a5; }
:root[data-theme="dark"] .badge.medium { background: #3a2c15; color: #fbbf24; }

/* ---------- payroll overview ---------- */
/* KPI tiles that navigate. They are buttons, so they carry a focus ring and read as
   controls to a screen reader — a number you can click should look and behave like one. */
.kpi.act, .mcard.act { cursor: pointer; text-align: left; font: inherit; width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease); }
.kpi.act:hover, .mcard.act:hover { border-color: var(--faint); box-shadow: var(--e2); transform: translateY(-1px); }
.kpi.act:focus-visible, .mcard.act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ksub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.kpi.hero .ksub { color: rgba(255, 255, 255, .55); }

.split2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }

/* The uncovered-employees warning. Payroll's quiet failure is a person simply not being
   in the run, so it gets a card of its own rather than a line in a table. */
.warncard { background: var(--paper); border: 1px solid var(--line);
  border-left: 3px solid var(--warn); border-radius: var(--r-lg); box-shadow: var(--e1); padding: 18px 20px; }
.warncard h3 { margin: 0 0 4px; font-size: 15px; }
.warncard p { margin: 0 0 10px; color: var(--muted); font-size: 13px; max-width: 62ch; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { background: var(--raised); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; color: var(--ink); }

table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.mini td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); }
table.mini tr:last-child td { border-bottom: 0; }
table.mini td.r, table.mini th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.mini td .sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
table.mini td.c { color: var(--muted); font-variant-numeric: tabular-nums; }
table.mini tr.rowlink { cursor: pointer; }
table.mini tr.rowlink:hover td { background: var(--raised); }

@media (max-width: 900px) {
  .split2 { grid-template-columns: 1fr; }
}

/* ---------- rearrangeable app grid ---------- */
/* A tile is an ordinary button until it is held, so it keeps the pointer cursor — a grab
   hand would promise a drag that a short click does not actually do. */
.apptile { cursor: pointer; touch-action: manipulation; }
.appgrid.rearranging .apptile { cursor: grab; }
.appgrid.rearranging .apptile.carried { cursor: grabbing; }

/* Rearrange mode announces itself the way iOS does: the icons wobble. The tile being
   carried lifts above the others instead of fading, so you can see what you are placing. */
@keyframes tilejiggle {
  0%   { transform: rotate(-.9deg); }
  50%  { transform: rotate(.9deg); }
  100% { transform: rotate(-.9deg); }
}
.appgrid.rearranging .apptile { animation: tilejiggle .28s ease-in-out infinite; }
/* Stagger the phase so twenty tiles do not wobble in lockstep. */
.appgrid.rearranging .apptile:nth-child(2n)  { animation-delay: -.07s; }
.appgrid.rearranging .apptile:nth-child(3n)  { animation-delay: -.14s; }
.appgrid.rearranging .apptile:nth-child(5n)  { animation-delay: -.21s; }
.appgrid .apptile.carried {
  animation: none; z-index: 5; position: relative;
  filter: drop-shadow(0 12px 22px rgba(14, 16, 23, .28));
}
.apptile { transition: transform .16s var(--ease), opacity .16s var(--ease); }
.apptile.carried { transition: none; }
.gridhint {
  margin-top: 14px; text-align: center; color: var(--faint); font-size: 12px;
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 30px;
}
.gridhint .kbd {
  display: inline-block; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--paper); font-size: 11px; line-height: 17px; color: var(--muted);
}
/* Wobbling is decoration; the mode still needs to be legible without it. */
@media (prefers-reduced-motion: reduce) {
  .apptile { transition: none; }
  .appgrid.rearranging .apptile { animation: none; outline: 2px dashed var(--faint); outline-offset: 3px; }
}

/* ---------- charts ---------- */
.svgchart { width: 100%; height: auto; display: block; overflow: visible; }
/* preserveAspectRatio="none" stretches the geometry, so text must be un-stretched by
   living in its own coordinate space — these labels are sized in user units and stay
   legible because the viewBox height is the same as the pixel height. */
.ch-val { font-size: 11px; font-weight: 600; fill: var(--ink); }
.ch-lab { font-size: 10px; fill: var(--muted); }
.ch-sub { font-size: 9px; fill: var(--faint); }
.ch-axis { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-note { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* .charthead already exists above for the div-based charts; only the note is new. */

.donutwrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; flex: none; }
.dn-tot { font-size: 15px; font-weight: 700; fill: var(--ink); }
.dn-cap { font-size: 9px; fill: var(--muted); }
.ch-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; }
.ch-legend li { display: flex; align-items: center; gap: 9px; padding: 4px 0; font-size: 13px; }
.ch-legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.ch-legend span { color: var(--muted); flex: 1; }
.ch-legend b { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- budget vs actual ---------- */
/* The bar shows how much of the plan is used; the tick shows how much of the PERIOD is
   gone. Spend at 40% is only good news if the tick is past it. */
.bcell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.bbar { position: relative; flex: 1; height: 7px; border-radius: 4px; background: var(--line-2); overflow: visible; }
.bbar i { position: absolute; inset: 0 auto 0 0; height: 100%; border-radius: 4px; display: block; }
.bbar i.ok { background: var(--success); }
.bbar i.over { background: var(--danger); }
.bbar em {
  position: absolute; top: -3px; width: 2px; height: 13px; background: var(--ink);
  opacity: .45; border-radius: 1px; transform: translateX(-1px);
}
.bpct { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; width: 38px; text-align: right; }
table.mini tr.totrow td { border-top: 1px solid var(--line); border-bottom: 0; padding-top: 9px; }
table.mini td.pos { color: var(--success); }
table.mini td.neg { color: var(--danger); }

/* ---------- documents (shared drive) ---------- */
.docs { position: relative; min-height: calc(100vh - 46px); display: flex; flex-direction: column; }
.docs-bar {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: var(--paper); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.docs-search { min-width: 260px; flex: 0 1 340px; }
.docs-usage { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.docs-crumbs {
  display: flex; align-items: center; gap: 6px; padding: 12px 20px 0; flex-wrap: wrap;
  font-size: 13.5px;
}
.docs-crumbs .crumb { color: var(--muted); padding: 3px 7px; border-radius: var(--r-xs); }
.docs-crumbs .crumb:hover { background: var(--line-2); color: var(--ink); }
.docs-crumbs .crumb.here { color: var(--ink); font-weight: 650; }
.docs-crumbs .crumb-sep { color: var(--faint); }
.docs-title { padding: 14px 20px 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.docs-body { padding: 6px 20px 40px; flex: 1; }
.docs-sect {
  margin: 16px 0 8px; font-size: 11.5px; font-weight: 650; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.docs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px;
}
.doc-card {
  position: relative; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 12px 12px; cursor: pointer;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.doc-card:hover { border-color: var(--faint); box-shadow: var(--e2); transform: translateY(-1px); }
.doc-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.doc-name {
  margin-top: 10px; font-size: 13.5px; font-weight: 600; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  word-break: break-word; padding-right: 4px;
}
.doc-meta { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.doc-card.folder { display: flex; align-items: center; gap: 10px; padding: 11px 12px; }
.doc-card.folder .doc-name { margin-top: 0; flex: 1; }
.fglyph {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 6px; border-radius: 10px;
  color: #fff; font-size: 11px; font-weight: 750; letter-spacing: .03em;
}
.folder-glyph { background: transparent; color: var(--accent); min-width: 34px; height: 34px; padding: 0; }
.folder-glyph svg { width: 30px; height: 30px; }
.doc-star, .doc-more {
  position: absolute; top: 7px; border: 0; background: none; color: var(--faint);
  font-size: 15px; line-height: 1; padding: 5px 6px; border-radius: var(--r-xs); cursor: pointer;
  opacity: 0; transition: opacity .12s;
}
.doc-card:hover .doc-star, .doc-card:hover .doc-more,
.doc-card:focus-within .doc-star, .doc-card:focus-within .doc-more,
.doc-star.on { opacity: 1; }
.doc-star { right: 32px; }
.doc-star.on { color: var(--warn); }
.doc-star:hover, .doc-more:hover { background: var(--line-2); color: var(--ink); }
.doc-more { right: 5px; font-weight: 700; }
.doc-card.folder .doc-star, .doc-card.folder .doc-more { top: 50%; transform: translateY(-50%); }
.docs-none { padding: 70px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.docs-drop {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 10%, transparent); pointer-events: none;
}
.docs-drop div {
  background: var(--accent); color: #fff; font-weight: 650; padding: 14px 26px;
  border-radius: var(--r-lg); box-shadow: var(--e3); border: 2px dashed rgba(255, 255, 255, .6);
}
.docs-pop {
  position: fixed; z-index: 70; min-width: 160px; padding: 5px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--e3); display: flex; flex-direction: column;
}
.docs-pop button {
  border: 0; background: none; color: var(--ink); text-align: left; font-size: 13.5px;
  padding: 8px 11px; border-radius: var(--r-sm); cursor: pointer;
}
.docs-pop button:hover { background: var(--line-2); }
.docs-pop button.danger { color: var(--danger); }
.docs-progress { background: var(--ink); }
.docs-view {
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column;
  background: rgba(10, 12, 18, .82); backdrop-filter: blur(6px);
}
.docs-view header {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #fff;
}
.docs-view-name { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; min-width: 0; }
.docs-view-name .fglyph { min-width: 30px; height: 30px; border-radius: 8px; font-size: 9.5px; }
.docs-view-size { color: rgba(255, 255, 255, .55); font-weight: 400; font-size: 12.5px; }
.docs-view header .btn { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.docs-view header .btn:hover { background: rgba(255, 255, 255, .22); }
.docs-view-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 18px 18px; min-height: 0; }
.docs-view-body img, .docs-view-body video {
  max-width: 100%; max-height: 100%; border-radius: var(--r-sm); box-shadow: var(--e3);
}
.docs-view-body iframe {
  width: min(980px, 100%); height: 100%; border: 0; border-radius: var(--r-sm); background: #fff;
}
.docs-audio { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.docs-audio .fglyph { width: 74px; height: 74px; border-radius: 18px; font-size: 16px; }
@media (max-width: 640px) {
  .docs-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .docs-search { min-width: 150px; flex: 1 1 150px; }
  .doc-star, .doc-more { opacity: 1; }
}

/* documents → vendor bill */
.doc-linkchip {
  margin-top: 7px; display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; cursor: pointer;
}
.doc-linkchip:hover { filter: brightness(.95); }
.docs-dlg-file { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.docs-dlg-file .fglyph { min-width: 26px; height: 26px; border-radius: 7px; font-size: 8.5px; }
.docs-dlg-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* documents: OCR note in the bill dialog */
.docs-ocr {
  margin: 10px 2px 0; font-size: 12px; color: var(--muted);
  padding: 7px 10px; border-radius: var(--r-sm); background: var(--canvas);
}
.docs-ocr.ok { color: var(--success); background: color-mix(in srgb, var(--success) 9%, transparent); }
.docs-ocr.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.dlg .ocr-filled { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 45%, transparent); border-radius: var(--r-sm); }

/* documents: the source document docked beside a record form (Odoo-style) */
.sheet-wrap { position: relative; }
.sheet-wrap.has-doc { justify-content: flex-start; gap: 16px; }
.sheet-wrap.has-doc .sheet-col { max-width: none; flex: 1 1 52%; min-width: 0; container-type: inline-size; }
/* Docked beside a document the sheet is roughly half its designed width, so its
   two-column field grid folds to one as soon as the sheet itself gets tight —
   a container query, because the viewport media query cannot see the split. */
@container (max-width: 880px) {
  .groups { grid-template-columns: 1fr; gap: 0; }
  .sheet { padding: 24px 22px; overflow-x: auto; }
}
.doc-side {
  flex: 1 1 48%; min-width: 320px; max-width: 780px;
  position: sticky; top: 58px; align-self: flex-start;
  height: calc(100vh - 100px); display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--e1);
}
.doc-side header {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: var(--raised);
}
.doc-side-name { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; min-width: 0; }
.doc-side-name .fglyph { min-width: 26px; height: 26px; border-radius: 7px; font-size: 8.5px; }
.doc-side-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-side iframe { flex: 1; border: 0; width: 100%; background: #fff; }
.doc-side-img { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 12px; }
.doc-side-img img { max-width: 100%; height: auto; border-radius: var(--r-xs); }
.doc-side-none { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 13px; }
.doc-side-pill {
  position: absolute; top: calc(26px + var(--alert-h, 0px)); right: 18px; z-index: 5;
  border: 1px solid var(--line); background: var(--paper); color: var(--accent);
  font-size: 12.5px; font-weight: 650; padding: 6px 12px; border-radius: 999px;
  cursor: pointer; box-shadow: var(--e2);
}
.doc-side-pill:hover { border-color: var(--accent); }
@media (max-width: 1000px) {
  .sheet-wrap.has-doc { flex-direction: column; }
  .doc-side { position: static; height: 60vh; max-width: none; width: 100%; }
}

/* documents: attachment picker + panel controls */
.doc-side-pick {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; padding: 5px 8px;
  max-width: 44%; min-width: 0;
}
.doc-side header .btn.primary { color: #fff; }

/* ---------- the door ----------
   Read at arm's length, one-handed, in a doorway. Everything is bigger than it would be
   on a desk screen, and the verdict is a colour before it is words. */
.door-wrap { max-width: 640px; margin: 0 auto; padding: 18px 16px 60px; }
.door-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.door-ev { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.door-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.door-counts { display: flex; gap: 10px; margin-bottom: 16px; }
.dc { flex: 1; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
      padding: 12px 14px; text-align: center; }
.dc .n { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.dc .l { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 2px; }

.door-input {
  width: 100%; font-size: 19px; padding: 15px 18px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--paper); outline: 0; letter-spacing: .04em;
}
.door-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.verdict:empty { display: none; }
.verdict { margin-top: 14px; border-radius: var(--r-md); padding: 18px 20px; color: #fff; }
.verdict.in   { background: var(--success); }
.verdict.warn { background: var(--warn); }
.verdict.stop { background: var(--danger); }
.v-big { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.v-small { font-size: 14px; opacity: .92; margin-top: 3px; }

.door-list { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.door-row {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; width: 100%;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 15px; font: inherit; cursor: pointer;
}
.door-row:hover { border-color: var(--accent); }
.door-row.in { background: var(--raised); opacity: .62; }
.dr-name { font-weight: 600; font-size: 15px; }
.dr-x { color: var(--muted); font-weight: 400; }
.dr-meta { color: var(--muted); font-size: 12.5px; grid-column: 1; }
.dr-code { grid-row: 1; grid-column: 2; font-variant-numeric: tabular-nums; color: var(--faint);
           font-size: 12.5px; letter-spacing: .04em; }
.dr-in { grid-column: 2; font-size: 12px; color: var(--success); font-weight: 600; }
.dr-tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px;
          border-radius: 4px; margin-left: 6px; font-weight: 600; }
.dr-tag.wait { background: var(--warn); color: #fff; }
@media (max-width: 560px) { .door-counts .dc .n { font-size: 22px; } .door-ev { font-size: 18px; } }

/* The door, continued: the camera, the verdict's own buttons, and the registration desk. */
.door-wrap.desk { max-width: 980px; }
.door-title { min-width: 0; }
.door-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.door-mode { margin: 0; }
.dc-here .n { color: var(--success); }
.door-meter { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin: -6px 0 16px; }
.door-meter span { display: block; height: 100%; width: 0; background: var(--success); transition: width .3s var(--ease); }
.door-state { background: var(--raised); border: 1px solid var(--line); border-inline-start: 3px solid var(--warn);
  border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.cam { position: relative; border-radius: var(--r-md); overflow: hidden; background: #000; margin-bottom: 12px;
  aspect-ratio: 4 / 3; max-height: 56vh; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-aim { position: absolute; inset: 16% 20%; border: 3px solid rgba(255,255,255,.88); border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0,0,0,.28); pointer-events: none; }
.cam-stop { position: absolute; bottom: 10px; inset-inline-end: 10px; }
.door-entry { display: flex; gap: 8px; align-items: stretch; }
.door-entry .door-input { flex: 1; min-width: 0; }
.door-cambtn { white-space: nowrap; }
.door-note { margin-top: 10px; color: var(--muted); font-size: 13px; background: var(--raised);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; }
.v-kind { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; opacity: .9; margin-bottom: 2px; }
.verdict .v-big { font-size: 26px; overflow-wrap: anywhere; }
.v-acts { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.v-acts .btn { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.45); }
.v-acts .btn:hover { background: rgba(255,255,255,.28); }
.door-opts { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.door-opt { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.desk-filter { margin: 0; }
.door-more { padding: 10px 14px; color: var(--muted); font-size: 13px; }
.desk-list { margin-top: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.desk-list .empty { padding: 40px 20px; }
.desk-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 10px 14px; border-top: 1px solid var(--line-2); }
.desk-row:first-child { border-top: 0; }
.desk-row.in { background: var(--raised); }
.desk-row.in .kav { background: var(--success); color: #fff; }
.desk-row.wait .kav { background: var(--line-2); color: var(--muted); }
.desk-row .kav { width: 36px; height: 36px; font-size: 12.5px; }
.desk-name { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.desk-meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk-code { font-variant-numeric: tabular-nums; color: var(--faint); font-size: 12.5px; letter-spacing: .04em; }
.desk-acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.desk-in { color: var(--success); font-size: 12.5px; font-weight: 600; }
.desk-wait { color: var(--warn); font-size: 12.5px; font-weight: 600; }
@media (max-width: 640px) {
  .door-head { flex-wrap: wrap; }
  .door-tools { justify-content: flex-start; }
  .door-entry { flex-wrap: wrap; }
  .door-cambtn { flex: 1 0 100%; }
  .desk-row { grid-template-columns: auto minmax(0, 1fr); }
  .desk-code { display: none; }
  .desk-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .desk-in, .desk-wait { flex: 1 0 100%; }
}
/* The hidden frame a badge prints from (the desk's "Print the badge after each check-in"). */
.print-frame { position: fixed; bottom: 0; inset-inline-end: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }

/* A ticket code on a form, with its QR code. */
.ro-qr { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ro-code { font-variant-numeric: tabular-nums; letter-spacing: .05em; font-weight: 600; }
.qrbox { display: inline-block; width: 112px; height: 112px; background: #fff; padding: 6px; border: 1px solid var(--line); border-radius: 8px; }
.qrbox svg { display: block; width: 100%; height: 100%; }

/* Kanban cards: a status badge at the foot, and the card's own buttons (an attendee's Check In). */
.kcard .kfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kbadge { font-size: 11px; padding: 2px 8px; }
.kacts { margin-top: 9px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge.registered { background: #e8f0fe; color: #1b4fd8; }
.badge.attended { background: #e2f4ea; color: var(--success); }
.badge.waitlisted { background: #fdf1e3; color: var(--warn); }
.badge.cancelled { background: #fdeeec; color: var(--danger); }
.badge.no_show { background: #eef0f4; color: #59606f; }
:root[data-theme="dark"] .badge.registered { background: #16233f; color: #7aa5ff; }
:root[data-theme="dark"] .badge.attended { background: #123027; color: #4ade80; }
:root[data-theme="dark"] .badge.waitlisted { background: #3a2c15; color: #fbbf24; }
:root[data-theme="dark"] .badge.cancelled { background: #3a1d1d; color: #fca5a5; }
:root[data-theme="dark"] .badge.no_show { background: #262b35; color: #aab2c0; }

/* A near-match warning inside the quick-create dialog: advisory, never blocking. */
.qc-note { background: var(--raised); border: 1px solid var(--line); border-left: 3px solid var(--warn);
  border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; color: var(--muted); margin: 4px 0 2px; }

/* ---------- relation picker ----------
   Looks like the other inputs at rest; becomes a list while you type. */
.m2o { position: relative; }
.m2o .m2o-text { width: 100%; }
.m2o-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--faint); font-size: 17px; line-height: 1;
  padding: 2px 6px; border-radius: 5px; cursor: pointer; opacity: 0;
  transition: opacity .12s var(--ease);
}
.m2o:hover .m2o-clear, .m2o:focus-within .m2o-clear { opacity: 1; }
.m2o-clear:hover { color: var(--danger); background: var(--raised); }

.m2o-pop {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--e3); padding: 4px; max-height: 292px; overflow-y: auto;
}
.m2o-pop[hidden] { display: none !important; }
.m2o-opt {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 11px; border-radius: 6px; font: inherit; color: var(--ink); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m2o-opt:hover, .m2o-opt.on { background: var(--accent-soft); }
/* The create row is the last resort, so it reads as an action rather than a record. */
.m2o-new { color: var(--accent); font-weight: 550; border-top: 1px solid var(--line-2);
  border-radius: 0 0 6px 6px; margin-top: 2px; }
.m2o-new b { font-weight: 700; }
.m2o-none { padding: 9px 11px; color: var(--faint); font-size: 13px; }

/* A report figure you can open. It stays quiet until hovered — a report is for reading
   first, and rows that all look like buttons read like a form. */
.rrow.drill { cursor: pointer; border-radius: 6px; margin: 0 -8px; padding-left: 8px; padding-right: 8px;
  transition: background .12s var(--ease); }
.rrow.drill:hover { background: var(--accent-soft); }
.rrow.drill:hover span:first-child { color: var(--accent); }

/* Accrual / cash. The basis changes what the number MEANS, so it sits beside the report,
   not buried in settings — the way QuickBooks puts it at the top of the statement. */
.basis { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--paper); }
.bs-btn { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 550;
  padding: 5px 13px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.bs-btn.on { background: var(--accent); color: #fff; }

/* ---------- rental calendar ----------
   Items down the side, days across the top, a cell per unit-day. Load reads as tint:
   nothing, some, all — with "out now" as an underline and turnaround as hatching. */
.rcal-wrap { overflow-x: auto; }
.rcal { border-collapse: separate; border-spacing: 2px; font-size: 12px; min-width: 100%; }
.rcal th, .rcal td { padding: 0; text-align: center; }
.rcal thead th { font-weight: 500; color: var(--muted); padding: 4px 0 6px; min-width: 34px; font-variant-numeric: tabular-nums; }
.rcal thead th .dow { display: block; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.rcal thead th.today { color: var(--accent); font-weight: 700; }
.rcal th.item { text-align: left; position: sticky; left: 0; background: var(--paper); padding: 4px 10px 4px 0; min-width: 170px; font-weight: 500; z-index: 1; }
.rcal th.item a { color: var(--ink); text-decoration: none; }
.rcal th.item .ch-note { display: block; }
.rcal td { height: 34px; min-width: 34px; border-radius: var(--r-xs); background: var(--canvas); font-variant-numeric: tabular-nums; }
.rcal td.wkend { background: color-mix(in srgb, var(--canvas) 70%, var(--line)); }
.rcal td.today { box-shadow: inset 0 0 0 1.5px var(--accent-soft); }
.rcal td.part { background: color-mix(in srgb, var(--accent) 22%, var(--paper)); color: var(--ink); cursor: pointer; }
.rcal td.full { background: var(--accent); color: #fff; cursor: pointer; }
.rcal td.isout { box-shadow: inset 0 -3px 0 var(--success); }
.rcal td.turn { background: repeating-linear-gradient(135deg, var(--line) 0 4px, var(--canvas) 4px 8px); color: var(--muted); cursor: pointer; }
.rcal td span i { font-style: normal; opacity: .6; font-size: 10px; }
.rcal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.rcal-legend .lg::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; background: var(--canvas); }
.rcal-legend .part::before { background: color-mix(in srgb, var(--accent) 22%, var(--paper)); }
.rcal-legend .full::before { background: var(--accent); }
.rcal-legend .isout::before { box-shadow: inset 0 -3px 0 var(--success); }
.rcal-legend .turn::before { background: repeating-linear-gradient(135deg, var(--line) 0 3px, var(--canvas) 3px 6px); }
.kpi.bad .kv { color: var(--danger); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; margin: 0 6px; }
.seg a { padding: 5px 10px; font-size: 12px; color: var(--muted); text-decoration: none; }
.seg a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; line-height: 16px; background: var(--canvas); color: var(--muted); white-space: nowrap; }
.pill.s-overdue { background: color-mix(in srgb, var(--danger) 14%, var(--paper)); color: var(--danger); }
.chips a.chip { text-decoration: none; }

/* ---------- Close the books (period close, control accounts, stamps, audit) ----------
   Tones are mixed from the status tokens rather than written as literals, so the same
   classes read correctly on the light and the dark canvas. */
.cl-dash { max-width: 1100px; }
.cl-dash .listcard { padding: 16px 18px; }
.cl-dash .listcard > .charthead { margin-bottom: 10px; gap: 12px; flex-wrap: wrap; }
.cl-dash .listcard.cl-check { padding: 16px 0 0; }
.cl-check > .charthead { padding: 0 18px; }
.cl-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cl-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.cl-date input { border: 1px solid var(--line); border-radius: var(--r-xs); padding: 4px 8px; background: var(--paper);
  color: var(--ink); font: inherit; font-size: 12.5px; }
.cl-date input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cl-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.cl-head h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.02em; }
.cl-head p { margin: 0; max-width: 64ch; }
.cl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cl-check { padding-bottom: 2px; }
.cl-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 11px 18px;
  border-top: 1px solid var(--line-2); color: inherit; text-decoration: none; transition: background .12s var(--ease); }
.cl-item:hover { background: var(--raised); }
.cl-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cl-ico { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.cl-item.ok .cl-ico { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.cl-item.warn .cl-ico { background: color-mix(in srgb, var(--warn) 17%, transparent); color: var(--warn); }
.cl-item.bad .cl-ico { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.cl-item.info .cl-ico { background: var(--line-2); color: var(--muted); }
.cl-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cl-txt b { font-weight: 600; font-size: 13.5px; }
.cl-txt span { color: var(--muted); font-size: 12.5px; }
.cl-go { color: var(--faint); }
.cl-st { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.cl-st.ok { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.cl-st.warn { background: color-mix(in srgb, var(--warn) 17%, transparent); color: var(--warn); }
.cl-st.bad { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.cl-st.info { background: var(--line-2); color: var(--muted); }
.kpi.hero .cl-st { background: rgba(255, 255, 255, .14); color: #fff; }
.cl-banner { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-left: 3px solid var(--faint);
  border-radius: var(--r-md); background: var(--paper); box-shadow: var(--e1); padding: 13px 18px; font-size: 13.5px; }
.cl-banner span { color: var(--muted); font-size: 12.5px; }
.cl-banner.ok { border-left-color: var(--success); }
.cl-banner.warn { border-left-color: var(--warn); }
.cl-banner.bad { border-left-color: var(--danger); }
.cl-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--line-2);
  color: var(--muted); font-size: 11px; font-weight: 600; vertical-align: 1px; white-space: nowrap; }
td > .cl-tag:first-child { margin-left: 0; }
.cl-hash { font: 11.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.cl-why { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: normal; }
.cl-sign { display: flex; flex-direction: column; gap: 10px; }
.cl-sign p { margin: 0; }
.cl-sign textarea { width: 100%; min-height: 60px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px;
  font: inherit; font-size: 13px; background: var(--paper); color: var(--ink); resize: vertical; }
.cl-sign textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cl-who { font-size: 13px; line-height: 1.6; }
.cl-who .cl-st { margin-right: 6px; }
.cl-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cl-empty { padding: 28px 12px; }
tr.cl-result > td { background: var(--raised); padding: 10px 12px; }
table.mini.cl-diff { margin-top: 8px; }
@media (max-width: 760px) {
  .cl-dash .kpis { grid-template-columns: 1fr; }
  .cl-head { align-items: flex-start; }
  .cl-dash .listcard { overflow-x: auto; }
}
.cl-amt { width: 130px; }
.cl-hint { color: var(--accent); font-size: 12px; margin-top: 3px; white-space: normal; }

/* Duplicate warning above an invoice or bill. Red: very likely the same document twice.
   Yellow: worth a look while it is still a draft. */
.dup-alert { margin: 0 0 12px; padding: 11px 16px; border-radius: var(--r-md); border: 1px solid var(--line);
  border-left: 3px solid var(--warn); background: var(--paper); font-size: 13px; line-height: 1.7; box-shadow: var(--e1); }
.dup-alert.red { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, var(--paper)); }
.dup-alert.yellow { background: color-mix(in srgb, var(--warn) 6%, var(--paper)); }
.dup-alert b { display: block; }
.dup-alert.red b { color: var(--danger); }
.dup-alert.yellow b { color: var(--warn); }
.dup-alert a { font-weight: 600; margin-right: 6px; }
.dup-alert span { color: var(--muted); }
/* A value suggested from the vendor's history, until someone changes it. */
select.predicted, input.predicted { background-color: color-mix(in srgb, var(--accent) 7%, var(--paper)); }

/* KPI strip above a list: one chip per key filter, with its count (and total where money). */
.kpistrip { display: flex; gap: 8px; padding: 10px 18px 2px; flex-wrap: wrap; }
.kchip { display: inline-flex; align-items: baseline; gap: 7px; padding: 7px 12px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--paper); box-shadow: var(--e1); font: inherit; cursor: pointer;
  color: var(--ink); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.kchip:hover { border-color: var(--faint); box-shadow: var(--e2); }
.kchip.on { border-color: var(--accent); background: var(--accent-soft); }
.kchip.zero { opacity: .62; }
.kc-n { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kc-l { font-size: 12.5px; color: var(--muted); }
.kc-s { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.linkbtn { border: 1px solid var(--line); background: var(--paper); border-radius: var(--r-sm); padding: 4px 8px;
  font-size: 13px; cursor: pointer; }
.linkbtn:hover { border-color: var(--faint); }
/* ◀ ▶ step the report period. */
.period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pstep { border: 1px solid var(--line); background: var(--paper); border-radius: var(--r-xs); padding: 4px 8px;
  font-size: 11px; color: var(--muted); cursor: pointer; line-height: 1.4; }
.pstep:hover { color: var(--ink); border-color: var(--faint); }

/* POS: cash in more than one currency, and snoozing products off the till. */
.pos-cash.multi { display: flex; flex-direction: column; gap: 8px; }
.pt-cur { display: flex; flex-direction: column; gap: 5px; }
.pos-tend i { font-style: normal; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.pc-alt { color: var(--muted); font-size: 12px; margin-left: 4px; }
.pc-pick { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-left: 6px; }
.pc-cur { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 3px 10px; font: inherit;
  font-weight: 650; cursor: pointer; color: var(--ink); }
.pc-cur.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pos-exit.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.pos-grid.snoozing .pos-prod { outline: 2px dashed color-mix(in srgb, var(--warn) 55%, transparent); outline-offset: -4px; }
.dlg-actions.snz { flex-wrap: wrap; }
.pt-more { display: flex; gap: 6px; }
.pos-cash.multi .pt-cur { display: grid; grid-template-columns: 1fr; gap: 4px; }
.pos-cash.multi .pos-quick { gap: 4px; }
.bbar i.hot { background: var(--warn); }

/* Cards of rows inside a dashboard get the same inner margin as the chart cards beside
   them; without it their headings sat flush against the card's edge. */
.dash .listcard { padding: 16px 18px; }
.dash .listcard > .charthead { margin-bottom: 10px; gap: 12px; flex-wrap: wrap; }
/* Line numbers, and note lines that carry only words. */
table.lines .ln { width: 28px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
table.lines tr.noteline input[data-lf="description"] { font-style: italic; }
table.lines tr.noteline [data-lf="qty"], table.lines tr.noteline [data-lf="price_unit"],
table.lines tr.noteline [data-lf="tax_rate"], table.lines tr.noteline [data-lf="discount"], table.lines tr.noteline [data-sub] { opacity: .35; }

/* Team Chat: polls and pins. */
.ch-poll { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; max-width: 420px; }
.ch-popt { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--paper); border-radius: var(--r-sm); padding: 7px 11px; font: inherit;
  color: var(--ink); cursor: pointer; text-align: left; }
.ch-popt:hover { border-color: var(--faint); }
.ch-popt.mine { border-color: var(--accent); }
.po-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); z-index: 0; transition: width .3s var(--ease); }
.po-l, .po-n { position: relative; z-index: 1; }
.po-n { font-weight: 650; font-variant-numeric: tabular-nums; }
.po-tot { font-size: 11.5px; color: var(--muted); }
.ch-pinned-by { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.ch-top { position: relative; }
.ch-pins { margin-left: auto; }
.ch-pinlist { position: absolute; right: 12px; top: calc(100% + 4px); z-index: 20; width: min(380px, 90vw); max-height: 320px; overflow: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e3); padding: 6px; }
.ch-pinitem { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; color: var(--ink);
  padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 13px; }
.ch-pinitem:hover { background: var(--line-2); }
.ch-pinitem span { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.ch-msg.flash { background: var(--accent-soft); transition: background .6s var(--ease); }
/* The chat fills the window and the message list scrolls inside it. A grid row sized to its
   content let a busy channel grow past the screen and push the composer out of sight. */
.chat { grid-template-rows: minmax(0, 1fr); }
.ch-rail, .ch-main, .ch-thread, .ch-stream { min-height: 0; }
/* The running timer in the top bar. */
.tbtimer { flex: none; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 10px;
  font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); cursor: pointer; margin-right: 6px; }
.tbtimer.on { color: var(--success); border-color: color-mix(in srgb, var(--success) 45%, var(--line)); font-weight: 650; }
@media (max-width: 760px) { .tbtimer #tbtime { display: none; } }

/* Company tree: a company, its branches and its people, indented. */
.tree-q { min-width: 220px; }
.listcard.tree { padding-left: 0; padding-right: 0; }
.listcard.tree > .charthead { padding: 0 18px; }
.tr-row { display: flex; align-items: center; gap: 8px; padding: 7px 18px 7px 12px; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.tr-row:hover { background: var(--raised); }
.tr-tog { width: 20px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0; }
.tr-tog:disabled { cursor: default; }
.tr-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.tr-name:hover { color: var(--accent); }
.tr-sub { color: var(--muted); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tr-amt { display: flex; gap: 10px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }

/* Replenishment */
.rp-wrap { overflow-x: auto; }
table.rp td, table.rp th { white-space: nowrap; }
table.rp td a { color: inherit; }
table.rp .neg { color: var(--danger); }
.rp-q { width: 72px; text-align: right; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; }
.pill.ok   { background: color-mix(in srgb, var(--success) 14%, var(--paper)); color: var(--success); }
.pill.warn { background: color-mix(in srgb, #d97706 14%, var(--paper)); color: #b45309; }
.pill.bad  { background: color-mix(in srgb, var(--danger) 14%, var(--paper)); color: var(--danger); }
.pill.info { background: color-mix(in srgb, var(--accent) 12%, var(--paper)); color: var(--accent); }

/* Reconcile — split one line */
.bl-split { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 8px; }
.sp-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.sp-head b { color: var(--ink); }
.sp-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sp-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); width: 64px; }
.sp-row select { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 8px; background: var(--paper); color: var(--ink); min-width: 160px; max-width: 100%; }
.sp-row select.sp-wide { min-width: 260px; flex: 1; }
.sp-amt { width: 110px; text-align: right; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 8px; background: var(--paper); color: var(--ink); font: inherit; }
.sp-del { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 6px; }
.sp-del:hover { color: var(--danger); }
.sp-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sp-foot .spacer { flex: 1; }
.sp-left { font-size: 12.5px; }
.sp-left.ok { color: var(--success); }
.sp-left.bad { color: var(--danger); }
.bs-a small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); text-align: right; }
.ps-svc label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ps-svc input { accent-color: var(--accent); }
.pr-note { font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; }

/* Salary indexation */
.si-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.si-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.si-form input, .si-form select { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 9px; background: var(--paper); color: var(--ink); font: inherit; }
.si-form .si-wide { grid-column: 1 / -1; }
.period .hy { font-variant-numeric: tabular-nums; min-width: 44px; text-align: center; }

/* Similar tickets */
.dup-alert.info { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--paper)); }
.dup-alert.info b { color: var(--accent); }
.sim-t { margin-top: 6px; }
.sim-t blockquote { margin: 4px 0 4px 2px; padding: 6px 10px; border-left: 2px solid var(--line); color: var(--ink); white-space: pre-wrap; font-size: 12.5px; max-height: 7.5em; overflow: auto; }

/* Maintenance schedule */
.ms-grid { border-collapse: separate; border-spacing: 2px; font-size: 11.5px; min-width: 100%; }
.ms-grid th { font-weight: 500; color: var(--muted); padding: 4px 2px; text-align: center; min-width: 64px; }
.ms-grid th b { color: var(--ink); font-size: 13px; }
.ms-grid th.wk, .ms-grid td.wk { opacity: .7; }
.ms-grid th.tod b { color: var(--danger); }
.ms-grid th.who { text-align: left; min-width: 110px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.ms-grid td { vertical-align: top; background: var(--canvas); border-radius: 6px; padding: 3px; height: 34px; }
.ms-grid td.tod { box-shadow: inset 0 0 0 1px var(--danger); }
.ms-chip { display: block; margin: 0 0 3px; padding: 3px 6px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 14%, var(--paper));
  color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.ms-chip.in_progress { background: color-mix(in srgb, #d97706 18%, var(--paper)); }
.ms-chip.done { background: var(--line); color: var(--muted); text-decoration: line-through; }
.ms-chip.urgent { box-shadow: inset 3px 0 0 var(--danger); }
.ms-chip.late { background: color-mix(in srgb, var(--danger) 16%, var(--paper)); }

/* =====================================================================================
   Premium theme — midnight navy, royal blue and signal green, set in Avenir Next.
   The palette follows the reference the owner chose on 2026-10-04 (a navy-to-royal hero
   with a green call to action). Only colours and the typeface family are borrowed —
   no marks, artwork or copy. It sits last in the file so it settles every earlier rule
   of equal specificity; the dark-theme and wash blocks above are matched selector for
   selector where they would otherwise win.
   ===================================================================================== */

/* Avenir Next ships with macOS and iOS, so it is referenced with local() — nothing is
   downloaded and the CSP stays 'self'. The weight ranges matter: this stylesheet asks for
   in-between weights (550, 620, 680…) that a static family would round up to Bold. Each
   range lands them on the face a designer would pick: 450–579 Medium, 580–699 Demi Bold.
   Elsewhere the stack falls through to the platform's own UI face. */
@font-face { font-family: "C1 Sans"; font-style: normal; font-weight: 1 449;
  src: local("AvenirNext-Regular"), local("Avenir Next Regular"); }
@font-face { font-family: "C1 Sans"; font-style: normal; font-weight: 450 579;
  src: local("AvenirNext-Medium"), local("Avenir Next Medium"); }
@font-face { font-family: "C1 Sans"; font-style: normal; font-weight: 580 699;
  src: local("AvenirNext-DemiBold"), local("Avenir Next Demi Bold"); }
@font-face { font-family: "C1 Sans"; font-style: normal; font-weight: 700 799;
  src: local("AvenirNext-Bold"), local("Avenir Next Bold"); }
@font-face { font-family: "C1 Sans"; font-style: normal; font-weight: 800 1000;
  src: local("AvenirNext-Heavy"), local("Avenir Next Heavy"); }
@font-face { font-family: "C1 Sans"; font-style: italic; font-weight: 1 449;
  src: local("AvenirNext-Italic"), local("Avenir Next Italic"); }
@font-face { font-family: "C1 Sans"; font-style: italic; font-weight: 450 579;
  src: local("AvenirNext-MediumItalic"), local("Avenir Next Medium Italic"); }
@font-face { font-family: "C1 Sans"; font-style: italic; font-weight: 580 699;
  src: local("AvenirNext-DemiBoldItalic"), local("Avenir Next Demi Bold Italic"); }
@font-face { font-family: "C1 Sans"; font-style: italic; font-weight: 700 1000;
  src: local("AvenirNext-BoldItalic"), local("Avenir Next Bold Italic"); }

:root {
  --font: "C1 Sans", "Avenir Next", Avenir, "Segoe UI Variable Text", "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  /* the palette */
  --night: #0d0032;        /* top of the hero, the top bar */
  --indigo: #15277c;
  --royal: #1e56d5;        /* bottom of the hero */
  --electric: #216ffb;     /* glows, chart highlights — decoration, never body text */
  --signal: #3cd95d;       /* the call to action. Navy text on it (10.6:1); white is 1.9:1 */
  --signal-hi: #55e273;
  --signal-ink: #0d0032;
  --hero: linear-gradient(180deg, #0d0032 0%, #111a5c 36%, #15277c 62%, #1e56d5 100%);

  /* The workspace's own colour still arrives inline and wins; this is the stock accent.
     #1a5ce6 holds 5.65:1 as text on white, where the brighter electric blue is 4.44:1. */
  --accent: #1a5ce6;
  --accent-ink: var(--accent);   /* accent used as TEXT; dark mode lightens it */

  --ink: #0f1235;
  --ink-2: #3a3f5c;
  --muted: #5e6685;
  --faint: #8a92b2;
  --paper: #ffffff;
  --raised: #f7f9fd;
  --success: #0b7a32;
  --warn: #b45309;
  --danger: #c8372d;

  --r-xs: 7px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* navy-tinted elevation reads as depth on the cool wash; grey shadows read as dirt */
  --e1: 0 1px 2px rgba(13, 0, 50, .05), 0 1px 3px rgba(13, 0, 50, .04);
  --e2: 0 12px 28px -12px rgba(13, 0, 50, .20), 0 2px 6px -2px rgba(13, 0, 50, .06);
  --e3: 0 32px 72px -22px rgba(13, 0, 50, .40), 0 8px 20px -8px rgba(13, 0, 50, .12);
}
:root[data-bg="blue"] { --wash-1: #eef2fa; --wash-2: #f8fafe; --line: #e0e6f2; --line-2: #edf1f8; }

body { font-family: var(--font); letter-spacing: 0; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
h1, h2, h3, .sheet h1, .doc-title h1 { letter-spacing: -0.018em; }
a:focus-visible, button:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 75%, transparent); outline-offset: 2px; }

/* ---------- top bar: midnight, the way the reference opens ---------- */
:root .topbar, :root[data-theme="dark"] .topbar {
  background: linear-gradient(100deg, rgba(13, 0, 50, .97) 0%, rgba(17, 26, 92, .96) 62%, rgba(21, 39, 124, .95) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 0 12px 30px -20px rgba(13, 0, 50, .8);
  color: #fff;
}
.topbar :focus-visible { outline-color: var(--signal); }
.topbar .home-btn { color: rgba(255, 255, 255, .72); }
.topbar .home-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.topbar .brand-name { color: #fff; font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; }
.topbar .appname {
  background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.topbar .menu-item { color: rgba(255, 255, 255, .74); font-weight: 500; position: relative; }
.topbar .menu-item:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.topbar .menu-item.active,
.topbar .menu-group.active > .group-btn,
.topbar .menu-group.open > .group-btn { color: #fff; background: rgba(255, 255, 255, .14); font-weight: 600; }
/* The open screen is marked in green, a short bar under the label. */
.topbar .menu-item.active::after,
.topbar .menu-group.active > .group-btn::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px;
  border-radius: 2px; background: var(--signal);
}
.topbar .menu-group .caret { color: rgba(255, 255, 255, .55); }
.topbar .theme-btn, .topbar .tbtimer {
  background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .82);
}
.topbar .theme-btn:hover, .topbar .tbtimer:hover { border-color: rgba(255, 255, 255, .36); color: #fff; }
.topbar .tbtimer.on { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 55%, transparent); }
.topbar .user-chip {
  background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); color: #fff; font-weight: 600;
}
.topbar .user-chip:hover { border-color: rgba(255, 255, 255, .36); box-shadow: none; }
.topbar .user-chip .dot { background: var(--signal); color: var(--signal-ink); }
.loadbar {
  height: 3px; background: linear-gradient(90deg, var(--signal), var(--electric));
  box-shadow: 0 0 12px rgba(60, 217, 93, .55);
}
.menu-drop { border-radius: var(--r-md); padding: 7px; }
.menu-drop-item { font-weight: 500; }

/* ---------- buttons: pills, and the one that matters is green ---------- */
.btn {
  border-radius: 999px; font-weight: 600; padding: 7px 17px; letter-spacing: 0;
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); background: var(--paper); }
.btn.primary {
  background: var(--signal); border-color: transparent; color: var(--signal-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 6px 16px -8px rgba(28, 160, 60, .85);
}
.btn.primary:hover {
  background: var(--signal-hi); filter: none; transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), 0 12px 24px -10px rgba(28, 160, 60, .9);
}
.btn.primary:active { transform: translateY(0); }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 34%, transparent); }
.btn.sm { padding: 5px 13px; }

/* ---------- surfaces ---------- */
.cpanel { box-shadow: 0 1px 0 var(--line), 0 10px 24px -22px rgba(13, 0, 50, .5); border-bottom-color: transparent; }
.cpanel .crumbs, .cpanel.odoo .crumbs { font-weight: 600; font-size: 16px; letter-spacing: -.012em; }
.cpanel.odoo .crumbs.stacked .rec { font-weight: 600; font-size: 16px; }
.searchbox { border-radius: 999px; padding: 7px 14px; background: var(--raised); }
.listcard, .groupcard, .chartcard, .report, .jcard, .mcard, .kpi, .hf-group, .warncard { box-shadow: var(--e1); }
.sheet { border-radius: var(--r-lg); box-shadow: var(--e2); }
.sheet .title-input, .sheet .title-ro { font-weight: 600; font-size: 28px; letter-spacing: -.02em; }
.lines-sec h3 { border-bottom-color: var(--accent); }
.statusbar .step { font-weight: 500; }
.statusbar .step.current { color: var(--accent-ink); font-weight: 600; }

table.list th {
  font-weight: 600; font-size: 11px; letter-spacing: .06em; color: var(--muted);
  background: var(--raised); padding-top: 10px; padding-bottom: 10px;
}
table.list tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, var(--paper)); }
table.lines th, table.rtable th, table.mini th { font-weight: 600; letter-spacing: .05em; }

.badge { font-weight: 600; padding: 3px 11px; }
.badge.draft, .badge.packed { background: #eef1f7; color: #4f5778; }
.badge.sale, .badge.posted, .badge.shipped { background: #e8f0ff; color: #1a4fc4; }
.badge.done, .badge.paid, .badge.delivered { background: #e2f7e7; color: var(--success); }
.kbar-fill.s-sale, .kbar-fill.s-posted, .kbar-fill.s-shipped { background: var(--royal); }
.kbar-fill.s-paid, .kbar-fill.s-done, .kbar-fill.s-delivered { background: var(--signal); }

.kcard { border-radius: var(--r-md); }
.kcard .t { font-weight: 600; }
.kv { font-weight: 600; letter-spacing: -.022em; }
.mv { font-weight: 600; }
/* The headline figure gets the hero treatment: the same night-to-royal sweep. */
:root .kpi.hero, :root[data-theme="dark"] .kpi.hero {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(33, 111, 251, .55), transparent 58%),
    linear-gradient(155deg, #0d0032 0%, #15277c 68%, #1e56d5 100%);
  border-color: transparent; box-shadow: 0 20px 40px -20px rgba(13, 0, 50, .7);
}
.kpi.hero .kv.pos { color: var(--signal); }
.jcard.j-sale { border-top-color: var(--royal); }
.jcard.j-cash { border-top-color: #1fae45; }
.jl-count { color: var(--accent-ink); }

.dlg-back { background: rgba(13, 0, 50, .46); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dlg { border-radius: var(--r-xl); padding: 30px; }
.dlg h3 { font-weight: 600; font-size: 18px; }
.toast { background: var(--night); box-shadow: inset 3px 0 0 var(--signal), var(--e3); border-radius: var(--r-sm); }
.toast.error { background: var(--danger); box-shadow: var(--e3); }

/* ---------- home: the hero ---------- */
.appgrid-wrap {
  position: relative; isolation: isolate; color: #fff;
  padding: clamp(36px, 7vh, 84px) 24px 64px;
  background:
    radial-gradient(900px 520px at 86% 6%, rgba(33, 111, 251, .42), transparent 62%),
    radial-gradient(720px 440px at 4% 98%, rgba(60, 217, 93, .14), transparent 60%),
    var(--hero);
}
.home-hero {
  width: 100%; max-width: 1080px; display: grid; gap: 48px; align-items: center;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); margin-bottom: clamp(36px, 6vh, 64px);
}
.hh-eyebrow { font-size: 13.5px; font-weight: 600; color: rgba(255, 255, 255, .7); margin-bottom: 14px; }
.hh-title {
  font-size: clamp(40px, 5.4vw, 66px); line-height: 1.03; font-weight: 500;
  letter-spacing: -.028em; color: #fff; margin: 0 0 18px;
}
.hh-sub { font-size: 18px; line-height: 1.45; color: rgba(255, 255, 255, .82); max-width: 40ch; margin-bottom: 30px; }
.home-hero .appsearch {
  max-width: 520px; height: 54px; margin: 0; border: 0; border-radius: 999px; padding: 0 20px;
  background: #fff; color: #6b7394; box-shadow: 0 20px 44px -18px rgba(0, 0, 0, .5);
}
.home-hero .appsearch input { font-size: 15px; color: #0f1235; }
.home-hero .appsearch input::placeholder { color: #7a82a3; }
.home-hero .appsearch .kbd { background: #f1f4fa; border-color: #e0e6f2; color: #6b7394; }
.home-hero .appsearch:focus-within { box-shadow: 0 0 0 4px rgba(60, 217, 93, .55), 0 20px 44px -18px rgba(0, 0, 0, .5); }

/* What needs you today: the live attention counts, as floating cards. */
.hh-cards { display: grid; gap: 14px; min-height: 120px; }
.hh-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  background: var(--paper); color: var(--ink); border-radius: var(--r-lg); padding: 16px 20px;
  box-shadow: 0 26px 50px -24px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
  animation: rise .36s var(--ease) both;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.hh-card:nth-child(2) { margin-left: 34px; animation-delay: .06s; }
.hh-card:nth-child(3) { margin-right: 24px; animation-delay: .12s; }
.hh-card:hover { transform: translateY(-2px); box-shadow: 0 32px 56px -24px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .1); }
.hh-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.hh-ico .ico { width: 19px; height: 19px; }
.hh-ico.ok { background: var(--accent); border-radius: 50%; font-weight: 700; font-size: 18px; }
.hh-txt { display: flex; flex-direction: column; min-width: 0; }
.hh-app { font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.hh-cap { font-size: 13.5px; color: var(--muted); }
.hh-num { font-size: 34px; font-weight: 500; letter-spacing: -.03em; color: var(--ink); }

/* the apps sit on the hero like icons on a phone's wallpaper */
.appgrid-wrap .appgrid { max-width: 920px; gap: 12px 10px; }
.appgrid-wrap .apptile { color: #fff; }
.appgrid-wrap .apptile .label { font-weight: 500; font-size: 13px; color: rgba(255, 255, 255, .92); }
.appgrid-wrap .apptile:hover {
  background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.appgrid-wrap .tilebadge { box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
/* white count on red: a fixed deep red, since dark mode's lifted --danger is too pale for it */
.tilebadge { background: #d6342c; }
.appgrid-wrap .gridhint { color: rgba(255, 255, 255, .55); }
.appgrid-wrap .gridhint .kbd { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; }
.appgrid-wrap .homefind { max-width: 1080px; }
.appgrid-wrap .hf-none { color: rgba(255, 255, 255, .8); }

/* ---------- sign in ---------- */
.login-wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 6vw, 96px);
  align-items: center; justify-content: center; padding: 40px clamp(20px, 6vw, 96px);
  background:
    radial-gradient(900px 560px at 88% 0%, rgba(33, 111, 251, .45), transparent 62%),
    radial-gradient(700px 480px at 0% 100%, rgba(60, 217, 93, .14), transparent 60%),
    var(--hero);
}
.login-hero { max-width: 600px; color: #fff; justify-self: end; }
.lh-eyebrow { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, .72); margin-bottom: 16px; }
.lh-title { font-size: clamp(38px, 4.8vw, 64px); line-height: 1.04; font-weight: 500; letter-spacing: -.028em; margin: 0 0 20px; }
.lh-sub { font-size: 18px; line-height: 1.5; color: rgba(255, 255, 255, .82); max-width: 34ch; }
.login-card { border-radius: var(--r-xl); padding: 42px 40px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); }
.login-card .logo { font-weight: 600; font-size: 24px; letter-spacing: -.02em; }
.login-card label { font-weight: 600; }
.login-card input { border-radius: var(--r-sm); }
.login-card .btn { padding: 13px; font-size: 15px; }
@media (max-width: 880px) {
  .login-wrap { grid-template-columns: 1fr; justify-items: center; }
  .login-hero { justify-self: center; text-align: center; }
  .lh-sub { margin: 0 auto; }
}

@media (max-width: 860px) {
  .home-hero { grid-template-columns: 1fr; gap: 28px; }
  .hh-card:nth-child(2), .hh-card:nth-child(3) { margin: 0; }
  .hh-sub { font-size: 16.5px; }
  .hh-cards { gap: 10px; min-height: 0; }
  .hh-card { padding: 11px 16px; border-radius: 16px; gap: 12px; }
  .hh-ico { width: 32px; height: 32px; border-radius: 10px; }
  .hh-app { font-size: 15px; }
  .hh-num { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .hh-card { animation: none; }
  .btn.primary:hover, .hh-card:hover { transform: none; }
}

/* ---------- dark: the same night, carried through ---------- */
:root[data-theme="dark"] {
  --ink: #edf0fb;
  --ink-2: #c3c9e1;
  --muted: #949cc0;
  --faint: #6b749c;
  --paper: #0f1433;
  --raised: #141a42;
  --success: #3cd95d;
  --warn: #fbbf24;
  --danger: #ff7a73;
  --accent-soft: color-mix(in srgb, var(--accent) 26%, #0f1433);
  /* The accent arrives inline and cannot be changed here, so text set in it is lifted
     toward white instead: royal on night paper is under 3:1, this is over 6:1. */
  --accent-ink: color-mix(in srgb, var(--accent) 58%, #fff);
  --e1: 0 1px 2px rgba(0, 0, 0, .45);
  --e2: 0 12px 28px -12px rgba(0, 0, 0, .65);
  --e3: 0 32px 72px -22px rgba(0, 0, 0, .85);
}
:root[data-theme="dark"][data-bg="blue"] { --wash-1: #080b24; --wash-2: #0c1131; --line: #232b5a; --line-2: #19204a; }
:root[data-theme="dark"] .badge.draft, :root[data-theme="dark"] .badge.packed { background: #1d2450; color: #b4bbd8; }
:root[data-theme="dark"] .badge.sale, :root[data-theme="dark"] .badge.posted, :root[data-theme="dark"] .badge.shipped { background: #16285e; color: #8fb1ff; }
:root[data-theme="dark"] .badge.paid, :root[data-theme="dark"] .badge.done, :root[data-theme="dark"] .badge.delivered { background: #0f3324; color: #5be27a; }
:root[data-theme="dark"] .appgrid-wrap { background:
    radial-gradient(900px 520px at 86% 6%, rgba(33, 111, 251, .30), transparent 62%),
    radial-gradient(720px 440px at 4% 98%, rgba(60, 217, 93, .10), transparent 60%),
    linear-gradient(180deg, #070a24 0%, #0d1446 45%, #15277c 100%); }
:root[data-theme="dark"] .hh-card { box-shadow: 0 26px 50px -24px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .08); }
/* Accent as text, lifted in dark. :where() keeps each rule at the weight of the one it
   replaces, so a link that sets its own colour (a menu row, a breadcrumb) keeps it. */
:where(:root[data-theme="dark"]) a { color: var(--accent-ink); }
:where(:root[data-theme="dark"]) .mhint,
:where(:root[data-theme="dark"]) .hf-more,
:where(:root[data-theme="dark"]) .sb-ico,
:where(:root[data-theme="dark"]) .addline { color: var(--accent-ink); }
:where(:root[data-theme="dark"]) .searchbox .chip,
:where(:root[data-theme="dark"]) .filter-menu button.on,
:where(:root[data-theme="dark"]) .menu-drop-item.active,
:where(:root[data-theme="dark"]) .hf-row:hover,
:where(:root[data-theme="dark"]) .kadd:hover,
:where(:root[data-theme="dark"]) .pill.info { color: var(--accent-ink); }
:where(:root[data-theme="dark"]) .cpanel.odoo .cp-search .chip,
:where(:root[data-theme="dark"]) .cpanel.odoo .crumbs.stacked a:hover,
:where(:root[data-theme="dark"]) .msopt:has(input:checked) { color: var(--accent-ink); }

/* ---------- sign-in links: "Forgot password?" and the set-password page ---------- */
.login-card .linkbtn {
  display: block; margin: 14px auto 0; background: none; border: 0; padding: 4px 8px;
  color: var(--accent-ink); font-weight: 600; font-size: 13px; border-radius: var(--r-xs);
}
.login-card .linkbtn:hover { text-decoration: underline; }
.login-card .login-done { line-height: 1.55; margin-bottom: 22px; }
.login-card .pw-rule { margin-top: 8px; font-size: 12px; color: var(--muted); }
.login-card .btn.wide { width: 100%; margin-top: 8px; }
.login-card > .btn:not(.primary) { width: 100%; }
/* a long login or address must wrap inside the card, not widen the page on a phone */
.login-card .sub b, .login-card .login-done b { overflow-wrap: anywhere; }

/* ---------- Accounting home: KPIs, what to do, insights; journals in a folding rail ---------- */
.acc-period { display: flex; align-items: center; gap: 10px; }
.ap-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink-2); display: grid; place-items: center; font-size: 15px; }
.ap-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-ink); }
.ap-btn:disabled { opacity: .35; cursor: default; }
.ap-now { display: flex; flex-direction: column; align-items: center; line-height: 1.2; min-width: 200px; }
.ap-now b { font-weight: 600; font-size: 14.5px; }
.ap-now b em { font-style: normal; font-weight: 500; color: var(--muted); }
.ap-now span { font-size: 11.5px; color: var(--muted); }

.acc-home { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; padding: 18px 18px 64px;
  max-width: 1480px; margin: 0 auto; transition: grid-template-columns .22s var(--ease); }
.acc-home.rail-open { grid-template-columns: 296px minmax(0, 1fr); }
.acc-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* the rail: folded = a column of journal badges; open = the journal cards, compact */
.acc-rail { position: sticky; top: 70px; align-self: start; max-height: calc(100vh - 88px); overflow-y: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--e1); padding: 8px; }
.acc-rail-toggle { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none;
  padding: 9px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 600; }
.acc-rail-toggle:hover { background: var(--line-2); }
.art-ico { width: 28px; text-align: center; font-size: 15px; }
.art-label { flex: 1; text-align: left; }
.art-chev { color: var(--muted); transition: transform .2s var(--ease); }
.acc-home:not(.rail-open) .art-label, .acc-home:not(.rail-open) .art-chev { display: none; }
.acc-home:not(.rail-open) .art-chev { transform: rotate(180deg); }
.acc-rail-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.arj { border-radius: var(--r-md); }
.acc-home.rail-open .arj { border: 1px solid var(--line-2); padding: 4px; }
.arj-head { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none;
  padding: 6px; border-radius: var(--r-sm); text-align: left; }
.arj-head:hover { background: var(--line-2); }
.arj-dot { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #fff; background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.j-sale .arj-dot { background: linear-gradient(145deg, #3b7bff, #1a4fc4); }
.j-purchase .arj-dot { background: linear-gradient(145deg, #e8a33a, #b45309); }
.j-bank .arj-dot { background: linear-gradient(145deg, #2bb3a3, #0f766e); }
.j-cash .arj-dot { background: linear-gradient(145deg, #4fd36b, #158a36); }
.j-misc .arj-dot { background: linear-gradient(145deg, #a48bea, #6d4fc0); }
.arj-name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--line-2); color: var(--ink-2);
  font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.rb.bad { background: #d6342c; color: #fff; }
.acc-home:not(.rail-open) .arj-name { display: none; }
.acc-home:not(.rail-open) .rb { position: absolute; top: 0; right: 0; box-shadow: 0 0 0 2px var(--paper); }
.arj-body { padding: 2px 4px 6px 4px; }
.acc-home:not(.rail-open) .arj-body, .arj.shut .arj-body { display: none; }
.arj-body .jl { padding: 6px 6px; }
.arj-body .jaction { margin: 6px 0 2px 6px; }

/* KPI tiles */
/* As many tiles a row as fit beside the rail: sized by the space left, not the window. */
.acc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); gap: 14px; }
.akpi { display: flex; flex-direction: column; gap: 5px; padding: 18px 18px 16px; border-radius: var(--r-lg);
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--e1); color: var(--ink);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); min-width: 0; }
.akpi:hover { transform: translateY(-2px); box-shadow: var(--e2); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.ak-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ak-value { font-size: 27px; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-value .neg { color: var(--danger); }
.ak-line { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.ak-line .muted { color: var(--muted); }
.akpi-profit {
  background: radial-gradient(120% 140% at 100% 0%, rgba(33, 111, 251, .55), transparent 58%),
              linear-gradient(155deg, #0d0032 0%, #15277c 68%, #1e56d5 100%);
  border-color: transparent; color: #fff; box-shadow: 0 18px 36px -20px rgba(13, 0, 50, .7);
}
.akpi-profit .ak-label, .akpi-profit .ak-line, .akpi-profit .ak-line .muted { color: rgba(255, 255, 255, .78); }
.akpi-profit .ak-value .neg { color: #ff8a84; }
.dl { font-weight: 700; font-size: 12px; white-space: nowrap; }
.dl.up { color: var(--success); } .dl.down { color: var(--danger); } .dl.flat { color: var(--muted); font-weight: 500; }
.akpi-profit .dl.up { color: var(--signal); } .akpi-profit .dl.down { color: #ff8a84; } .akpi-profit .dl.flat { color: rgba(255, 255, 255, .6); }
.tone-ok { color: var(--success); } .tone-warn { color: var(--warn); } .tone-bad { color: var(--danger); }

/* what to do + insights */
.acc-two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.acc-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--e1); padding: 20px 22px; min-width: 0; }
.acc-card .charthead { margin-bottom: 8px; }
.td-sec { padding-top: 12px; }
.td-sec + .td-sec { border-top: 1px solid var(--line-2); margin-top: 6px; }
.td-sec h4 { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.td-sec h4 span { font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--danger); font-weight: 600; }
.td-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.td-row:last-child { border-bottom: 0; }
.td-main { flex: 1; min-width: 0; }
.td-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-row.tone-bad .td-title::before, .td-row.tone-warn .td-title::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin: 0 8px 1px 0; vertical-align: middle; background: var(--warn); }
.td-row.tone-bad .td-title::before { background: var(--danger); }
.td-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-acts { display: flex; gap: 6px; flex: none; }
.td-done { color: var(--success); font-weight: 600; font-size: 13px; padding: 8px 0; }
.td-more { display: inline-block; margin: 6px 0 2px; font-size: 12.5px; font-weight: 600; }
.ins { display: flex; align-items: flex-start; gap: 12px; padding: 11px 10px; margin: 0 -10px; border-radius: var(--r-md); color: var(--ink); }
a.ins:hover { background: var(--line-2); }
.ins + .ins { border-top: 1px solid var(--line-2); }
.ins-ico { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.ins-good .ins-ico { background: color-mix(in srgb, var(--success) 15%, var(--paper)); color: var(--success); }
.ins-bad .ins-ico { background: color-mix(in srgb, var(--danger) 15%, var(--paper)); color: var(--danger); }
.ins-warn .ins-ico { background: color-mix(in srgb, var(--warn) 16%, var(--paper)); color: var(--warn); }
.ins-info .ins-ico { background: color-mix(in srgb, var(--accent) 14%, var(--paper)); color: var(--accent-ink); }
.ins-txt { flex: 1; line-height: 1.45; font-size: 13.5px; }
.ins-go { color: var(--muted); }

.acc-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.acc-charts .chartcard { min-width: 0; }
.acc-charts .legend { margin: -8px 0 6px; }

@media (max-width: 1080px) { .acc-two, .acc-charts { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .acc-home, .acc-home.rail-open { grid-template-columns: minmax(0, 1fr); padding: 12px 12px 56px; }
  /* On a phone the rail becomes a strip of journal badges across the top. */
  .acc-rail { position: static; max-height: none; }
  .acc-home:not(.rail-open) .acc-rail { display: flex; align-items: center; gap: 4px; padding: 6px; }
  .acc-home:not(.rail-open) .acc-rail-list { flex-direction: row; overflow-x: auto; margin: 0; }
  .acc-home:not(.rail-open) .acc-rail-toggle { width: auto; }
  .ap-now { min-width: 0; }
  .ap-now span { display: none; }
}
@media (max-width: 560px) {
  /* two tiles a row, the profit tile across both: the whole picture in one screen */
  .acc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .akpi { padding: 14px 13px 12px; }
  .akpi-profit { grid-column: 1 / -1; order: -1; }
  .ak-value { font-size: 21px; }
  .ak-line { font-size: 11.5px; }
  .td-row { flex-wrap: wrap; }
  .td-acts { width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { .acc-home { transition: none; } .akpi:hover { transform: none; } }
/* The blank count slot shares its class name with the empty-state block (.empty, 76px of
   padding), which is what stretched the Bank and Cash journal cards. */
.jl-count.empty { padding: 0; }
/* Money in and out: six months must fit any card width, so the bars share the space
   instead of each taking a fixed 22px (which ran past the card's edge). */
.acc-charts .chart { gap: 6px; }
.acc-charts .bars { gap: 3px; }
.acc-charts .bar { width: auto; flex: 1 1 0; max-width: 22px; }
/* The fade on an overflowing menu bar is a mask, and a mask hides EVERYTHING painted by the
   bar — including its open dropdown, which hangs below it. While a menu is open, no fade. */
.topbar .menubar.scrolls:has(.menu-group.open) { -webkit-mask-image: none; mask-image: none; }

/* ---------- the path above each screen's title, Odoo-style (crumbs.js) ----------
   "Accounting / Invoices" above "INV/2026/0042 ⚙": earlier steps are small links, the
   screen itself is the title. More than two earlier steps fold into "…". The selectors
   name the crumbs' own classes (.bc-link, .bc-drop-item) so they outrank the older
   `.cpanel.odoo .crumbs.stacked a` rules on every kind of screen. */
.cpanel .crumbs.bc {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.25; min-width: 0;
}
.crumbs.bc .bc-path {
  display: flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%;
  font-size: 12px; font-weight: 550; letter-spacing: 0; white-space: nowrap; color: var(--muted);
}
.crumbs.bc .bc-path a.bc-link {
  font-size: 12px; font-weight: 550; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; max-width: 240px; border-radius: 4px;
}
.crumbs.bc .bc-path a.bc-link:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.crumbs.bc .bc-path a.bc-link:focus-visible, .crumbs.bc .bc-dots:focus-visible, .crumbs.bc .bc-drop a.bc-drop-item:focus-visible,
.bc-gear:focus-visible, .bc-menu button:focus-visible {
  outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
.crumbs.bc .bc-sep { color: var(--faint); font-weight: 400; }
.crumbs.bc .bc-cur { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.cpanel .crumbs.stacked.bc .rec {
  font-size: 16px; font-weight: 600; letter-spacing: -.012em; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumbs.bc .bc-more { position: relative; display: inline-flex; }
.crumbs.bc .bc-dots {
  border: 0; background: var(--line-2); color: var(--muted); font: inherit; font-weight: 700; line-height: 1;
  padding: 1px 6px 4px; border-radius: 5px; cursor: pointer;
}
.crumbs.bc .bc-dots:hover, .crumbs.bc .bc-more.open .bc-dots { background: var(--accent-soft); color: var(--accent-ink); }
/* Below the sticky top bar (z-index 50), above the page. */
.crumbs.bc .bc-drop {
  display: none; position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 45; min-width: 200px; max-width: 320px;
  flex-direction: column; padding: 5px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e3);
}
.crumbs.bc .bc-more.open .bc-drop { display: flex; }
.crumbs.bc .bc-drop a.bc-drop-item {
  display: block; max-width: none; padding: 7px 10px; border-radius: var(--r-xs);
  font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crumbs.bc .bc-drop a.bc-drop-item:hover { background: var(--line-2); color: var(--ink); text-decoration: none; }
.bc-gear {
  display: inline-grid; place-items: center; width: 26px; height: 26px; flex: 0 0 auto;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer;
}
.bc-gear:hover, .bc-gear[aria-expanded="true"] { background: var(--line-2); color: var(--ink); }
/* A record with no path yet (rare: a one-off screen): the gear rides beside the title. */
.crumbs.stacked:not(.bc) .bc-gear { display: none; }
.crumbs.stacked:not(.bc):has(.bc-gear) {
  display: grid; grid-template-columns: minmax(0, auto) auto; column-gap: 6px; align-items: center; justify-content: start;
}
.crumbs.stacked:not(.bc):has(.bc-gear) > a { grid-column: 1 / -1; }
.crumbs.stacked:not(.bc):has(.bc-gear) .rec { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs.stacked:not(.bc):has(.bc-gear) .bc-gear { display: inline-grid; }
.bc-menu {
  position: absolute; top: calc(100% + 6px); z-index: 45; min-width: 180px; display: flex; flex-direction: column; padding: 5px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--e3);
}
.bc-menu button {
  text-align: start; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink);
  padding: 8px 10px; border-radius: var(--r-xs); cursor: pointer; white-space: nowrap;
}
.bc-menu button:hover { background: var(--line-2); }
.bc-menu button.danger { color: var(--danger); }
/* A phone shows the step you came from as a back link, "‹ Invoices", over the title, with
   thumb-sized tap areas that do not move the layout. */
@media (max-width: 760px) {
  .crumbs.bc .bc-more, .crumbs.bc .bc-sep, .crumbs.bc .bc-path a.bc-link:not(.bc-parent) { display: none; }
  .crumbs.bc .bc-path a.bc-link.bc-parent {
    position: relative; z-index: 1; max-width: 70vw; font-size: 13px; color: var(--accent-ink);
    padding-block: 10px; padding-inline: 0 14px; margin-block: -10px;
  }
  /* '‹' is a mirrored character: under dir=rtl the browser draws it as '›' by itself. */
  .crumbs.bc .bc-path a.bc-link.bc-parent::before {
    content: '‹'; content: '‹' / ''; font-size: 17px; line-height: 0; margin-inline-end: 4px; position: relative; top: 1px;
  }
  .cpanel .crumbs.stacked.bc .rec { font-size: 20px; }
  .bc-gear { width: 40px; height: 40px; margin-block: -7px; margin-inline: -4px -8px; }
}

/* Accounting home rail: a journal's name opens its list; the arrow says so on hover. '›' is a
   mirrored glyph, so a right-to-left page draws it pointing the other way by itself. */
.arj-go { color: var(--muted); font-size: 17px; line-height: 1; opacity: 0; transition: opacity .15s var(--ease); }
.acc-home.rail-open .arj-head:hover .arj-go, .acc-home.rail-open .arj-head:focus-visible .arj-go { opacity: 1; }
.acc-home:not(.rail-open) .arj-go { display: none; }
/* A bank card's Reconcile button (logical margins: right-to-left needs no mirror rule). */
.arj-body .jrecon { margin-block: 6px 2px; margin-inline: 6px 0; }

/* ---------- Helpdesk overview and hours on the card ---------- */
.kmeta-l { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.khours { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hd-kpis { grid-template-columns: repeat(3, 1fr); }
.hd-perfgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.hd-perf td.r .sub { font-size: 11px; color: var(--muted); font-weight: 400; }
.hd-perf td .ch-note { font-weight: 400; }
.hd-teamhead { margin-block-end: -6px; }
.hd-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.hd-team { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--e1); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.hd-team-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hd-team-name { font-weight: 650; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.hd-team-name:hover { color: var(--accent); }
.hd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hd-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; font: inherit; cursor: pointer;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.hd-stat:hover { border-color: var(--faint); box-shadow: var(--e1); }
.hd-stat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hd-stat .n { font-size: 20px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hd-stat .l { font-size: 11px; color: var(--muted); }
.hd-stat.zero .n { color: var(--faint); }
.hd-stat.bad .n { color: var(--danger); }
@media (max-width: 760px) {
  .hd-kpis { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hd-kpis .kpi { padding: 12px 12px 10px; gap: 4px; }
  .hd-kpis .kl { font-size: 11.5px; line-height: 1.25; }
  .hd-kpis .kv { font-size: 24px; }
  .hd-perfgrid { grid-template-columns: 1fr; }
  .hd-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Journal card lines open their lists, and now look it: a clear hover tint, the label darkening,
   and a chevron at the end, always faint so a touch screen (no hover) still shows the way in.
   '›' is a mirrored glyph, so a right-to-left page points it the other way by itself. */
.arj-body .jl:hover { background: var(--line-2); }
.arj-body .jl:not(.danger):hover .jl-label { color: var(--ink); }
.arj-body .jl:focus-visible { outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.jl-go { color: var(--faint); font-size: 16px; line-height: 1; margin-inline-start: 2px; transition: color .12s var(--ease); }
.arj-body .jl:hover .jl-go, .arj-body .jl:focus-visible .jl-go { color: var(--accent-ink); }

/* Accounting › Follow-up (public/followup.js): overdue rows in red, the email preview frame. */
table.mini tr.late td { color: var(--danger); }
table.mini tr.late td a { color: inherit; font-weight: 600; }
table.mini tr.rowlink td:first-child { width: 28px; }
.dlg.fu-preview { width: 720px; max-width: 94vw; }
.fu-frame { width: 100%; height: 540px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
/* Payment run lines: room for the amount, the reference and the check. */
.tabline[data-lm="payment_run_line"] table.lines input { min-width: 92px; }
.tabline[data-lm="payment_run_line"] table.lines input[data-lf="reference"] { min-width: 150px; }
.tabline[data-lm="payment_run_line"] table.lines td { vertical-align: top; }
/* ---------- Sales: the catalog picker on a quotation (sales.js) ----------
   Products as tiles with their photo and the quotation's price; + and − change the quotation's
   own lines. Logical properties only, so a right-to-left page needs no mirror rule. */
.catalogbtn { margin-inline-start: 8px; vertical-align: middle; }
.dlg.sc-dlg { width: 940px; max-width: 96vw; max-height: 88vh; padding: 22px 22px 16px; display: flex; flex-direction: column; }
.sc-head { display: flex; align-items: center; gap: 12px; }
.sc-head h3 { margin: 0; flex: 0 0 auto; }
.sc-search { flex: 1; min-width: 0; padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--raised); font: inherit; color: var(--ink); }
.sc-search:focus { outline: 0; border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 3px var(--accent-soft); }
.sc-close { flex: 0 0 auto; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 17px; cursor: pointer; }
.sc-close:hover, .sc-close:focus-visible { background: var(--line-2); color: var(--ink); outline: 0; }
.sc-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 14px 2px; }
.sc-cat { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 5px 13px; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.sc-cat:hover { border-color: var(--accent); }
.sc-cat.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.sc-grid { flex: 1; min-height: 240px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding-block: 12px; align-content: start; }
.sc-tile { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper);
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease); }
.sc-tile.in { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 2px var(--accent-soft); }
.sc-img { aspect-ratio: 4 / 3; margin-block-end: 4px; border-radius: 9px; background: var(--line-2); display: grid; place-items: center; overflow: hidden; }
.sc-img img { width: 100%; height: 100%; object-fit: cover; }
.sc-img span { font-size: 28px; font-weight: 700; color: var(--muted); }
.sc-name { text-align: left; min-height: 2.6em; font-weight: 600; font-size: 13.5px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sc-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11.5px; color: var(--muted); }
.sc-out { color: var(--danger); }
.sc-price { font-weight: 650; font-variant-numeric: tabular-nums; }
.sc-price s { margin-inline-start: 4px; font-weight: 400; font-size: 12px; color: var(--muted); }
.sc-ctl { margin-block-start: auto; padding-block-start: 6px; }
.sc-ctl .sc-add { width: 100%; }
.sc-qty { display: flex; align-items: center; justify-content: space-between; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.sc-qty b { font-variant-numeric: tabular-nums; }
.sc-qty button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--line-2); color: var(--ink); font-size: 17px; font-weight: 600; cursor: pointer; }
.sc-qty button:hover, .sc-qty button:focus-visible { background: var(--accent-soft); color: var(--accent-ink); outline: 0; }
.sc-empty { grid-column: 1 / -1; padding-block: 48px; text-align: center; color: var(--muted); }
.sc-foot { display: flex; align-items: center; gap: 8px; padding-block-start: 12px; border-block-start: 1px solid var(--line-2); }
.sc-foot .spacer { flex: 1; }
.sc-count { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .dlg.wide.sc-dlg { max-height: 92vh; padding: 16px; }
  .sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sc-qty button { width: 38px; height: 38px; }
}

/* VAT returns (public/vatreturn.js): the grids above a return's form and the drill-down table */
.vat-grids { margin-block: 8px 4px; }
.vat-grids > summary { cursor: pointer; padding-block: 6px; }
table.mini tr.sum td { font-weight: 700; background: rgba(127, 127, 127, .08); }
table.mini tr.warnrow td { color: var(--warn); }
.vat-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 8px 2px; }
.tblwrap { overflow-x: auto; }

/* Accounting Activity (public/activity.js) */
.au-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 8px 14px 12px; }
.au-filters label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); min-width: 130px; }
.au-filters label.au-grow { flex: 1 1 220px; }
.au-filters select, .au-filters input { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, transparent); color: inherit; }
.au-day { padding: 0 14px 6px; }
.au-day h4 { margin: 14px 0 6px; font-size: 13px; position: sticky; top: 0; background: var(--surface, var(--bg)); padding-block: 4px; }
.au-row { border-bottom: 1px solid var(--line-2); }
.au-head { display: grid; grid-template-columns: 44px max-content max-content minmax(0, 14rem) minmax(0, 1fr); gap: 4px 10px; align-items: baseline; width: 100%; text-align: start;
  background: none; border: 0; padding: 7px 2px; font: inherit; font-size: 13px; color: inherit; cursor: pointer; }
.au-head:hover { background: rgba(127, 127, 127, .06); }
.au-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.au-head .cl-tag { justify-self: start; }
.au-who { font-weight: 600; }
.au-rec { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-sum { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-detail { padding: 4px 8px 12px 54px; font-size: 12.5px; }
.au-ch { max-width: 640px; margin-block: 6px; }
.au-facts, .au-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); margin-block: 6px; }
.au-fact b { color: inherit; font-weight: 600; text-transform: capitalize; }
.au-more { text-align: center; padding: 10px; }
.au-note { padding: 6px 14px 12px; }
.au-rec-host { margin-block: 10px; }
.au-rec-sec > summary { cursor: pointer; font-weight: 600; font-size: 13px; padding-block: 6px; }
.au-rec-body { padding-block: 4px; }
@media (max-width: 720px) {
  .au-head { grid-template-columns: 44px 1fr; }
  .au-head .au-rec, .au-head .au-sum { grid-column: 1 / -1; white-space: normal; padding-inline-start: 54px; }
  .au-detail { padding-inline-start: 8px; }
  .au-filters label { min-width: 46%; flex: 1 1 46%; }
}
