/* ==========================================================================
   Inovbi — enterprise component library

   The shared vocabulary every module composes its pages from: status
   badges, object headers, KPI tiles, hand-authored SVG charts, document
   flow, work-list primitives, key/value lists, tabs, timelines.

   Promoted from the old sales.css (which every module already loaded)
   with intel.css / workflow.css / customer360.css folded in. Class names
   are unchanged so existing templates keep working; all values now come
   from tokens.css.
   ========================================================================== */


/* ======================================================================
   Status system — one treatment per semantic tier, used everywhere.
   Prefer the {% status_badge %} tag (erp/status.py registry) over hand
   -writing the modifier class in templates.
   ====================================================================== */
.status-pill {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 2px var(--space-2); border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 600; white-space: nowrap;
  background: var(--neutral-bg); color: var(--text-muted); border: 1px solid var(--line);
}
.status-pill--positive { background: var(--ok-bg);   color: var(--ok-fg);   border-color: transparent; }
.status-pill--warning  { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.status-pill--negative { background: var(--crit-bg); color: var(--crit-fg); border-color: transparent; }
.status-pill--neutral  { background: var(--info-bg); color: var(--info-fg); border-color: transparent; }
.status-pill--info     { background: var(--info-bg); color: var(--info-fg); border-color: transparent; }
/* a small leading dot for extra (non-colour-only) differentiation */
.status-pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ======================================================================
   Approval inbox — mobile card view (plugin_modules/workflow/templates/
   workflow/inbox.html). The table's own Approve/Reject buttons sit in
   its last column, off the right edge of any phone-width screen behind
   a horizontal scroll — exactly the control this page exists for — so
   below the breakpoint the table is swapped for one full-width card per
   request, its actions right there without scrolling.
   ====================================================================== */
.erp-approval-cards { display: none; }
@media (max-width: 720px) {
  .erp-approval-table { display: none; }
  .erp-approval-cards { display: flex; flex-direction: column; gap: var(--space-3); }
}
.erp-approval-card {
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4);
  background: var(--surface);
}
.erp-approval-card__doc { display: block; font-weight: 600; color: var(--brand); text-decoration: none; margin-bottom: var(--space-1); }
.erp-approval-card__note { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: var(--space-2); }
.erp-approval-card__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-3);
}
.erp-approval-card__overdue { color: var(--crit-fg); font-weight: 600; }
.erp-approval-card__actions { display: flex; gap: var(--space-2); }
.erp-approval-card__actions form { flex: 1; margin: 0; }
.erp-approval-card__actions .btn { width: 100%; }

/* ======================================================================
   Object / detail header
   ====================================================================== */
.detail-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-5); flex-wrap: wrap;
  margin-bottom: var(--space-6); padding-bottom: var(--space-5); border-bottom: 1px solid var(--line);
}
.detail-header__title { font-size: var(--text-2xl); margin-bottom: var(--space-1); }
.detail-header__meta { font-size: var(--text-sm); color: var(--text-muted); display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
.detail-header__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* ======================================================================
   Tabs
   ====================================================================== */
.tab-row { display: flex; gap: var(--space-2); border-bottom: 2px solid var(--line); margin-bottom: var(--space-6); overflow-x: auto; }
.tab-row a, .tab-row button {
  padding: var(--space-3) var(--space-2); font-size: var(--text-md); font-weight: 600; color: var(--text-muted);
  text-decoration: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap; background: none; cursor: pointer; font-family: inherit;
}
.tab-row a:hover, .tab-row button:hover { color: var(--text); }
.tab-row a.is-active, .tab-row button.is-active { color: var(--brand); border-color: var(--brand); }
.tab-row button:focus-visible { outline: 2px solid var(--brand); outline-offset: -4px; }

/* ======================================================================
   Line-item table (documents)
   ====================================================================== */
.line-items-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.line-items-table th, .line-items-table td { padding: var(--space-2) var(--space-3); text-align: start; border-bottom: 1px solid var(--line); }
.line-items-table th { font-size: var(--text-2xs); color: var(--text-subtle); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.line-items-table td.num, .line-items-table th.num { text-align: end; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.line-items-table tfoot td { border-bottom: none; font-weight: 600; }
.line-items-table input, .line-items-table select { width: 100%; padding: 6px var(--space-2); border: 1px solid var(--line-strong); border-radius: var(--radius-xs); font-size: var(--text-sm); }

/* [data-row-toggle] icon + the pricing/tax/calculated-values detail
   panel it reveals — see shell.js's generic data-row-toggle handler. */
.btn-icon-toggle {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  color: var(--text-muted); font-size: var(--text-sm); line-height: 1;
  transition: transform 0.15s ease;
}
.btn-icon-toggle[aria-expanded="true"] { transform: rotate(90deg); color: var(--brand); }
.line-detail { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: var(--space-5); padding: var(--space-3) 0; }
.line-detail__heading { margin: 0 0 var(--space-2); font-size: var(--text-2xs); color: var(--text-subtle); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.m-list-item--detail { background: var(--surface-sunken); }

/* ======================================================================
   Document flow / related documents
   ====================================================================== */
.doc-flow { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.doc-flow__node {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); font-size: var(--text-sm); min-width: 120px;
  transition: border-color var(--dur-fast) var(--ease);
}
.doc-flow__node:hover { border-color: var(--brand); }
.doc-flow__node--current { border-color: var(--brand); background: var(--brand-tint); }
.doc-flow__node-type { font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-subtle); }
.doc-flow__node-number { font-weight: 600; }
.doc-flow__arrow { color: var(--text-subtle); padding: 0 var(--space-2); font-size: var(--text-lg); }
.doc-flow__group { display: flex; flex-direction: column; gap: var(--space-2); }

/* Document status/workflow bar (Quotation/Order/Delivery/Invoice detail
   pages) — a chevron breadcrumb: each step is an arrow-notched block,
   interlocked with the next via a negative margin + a matching clip-path
   notch, so the strip reads as one continuous directional flow rather
   than a row of separate pills. */
.doc-workflow {
  --doc-workflow-notch: 14px;
  display: flex; align-items: stretch; flex-wrap: wrap;
  margin-bottom: var(--space-5); border-radius: var(--radius-md);
  border: 1px solid var(--line); overflow: hidden;
}
.doc-workflow__step {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-5) var(--space-3) calc(var(--space-5) + var(--doc-workflow-notch));
  margin-inline-start: calc(-1 * var(--doc-workflow-notch));
  clip-path: polygon(
    0 0, calc(100% - var(--doc-workflow-notch)) 0, 100% 50%,
    calc(100% - var(--doc-workflow-notch)) 100%, 0 100%, var(--doc-workflow-notch) 50%
  );
  font-size: var(--text-sm); font-weight: 600; white-space: nowrap;
  text-decoration: none; background: var(--surface-sunken); color: var(--text-disabled);
}
.doc-workflow__step:first-child {
  margin-inline-start: 0; padding-inline-start: var(--space-5);
  clip-path: polygon(0 0, calc(100% - var(--doc-workflow-notch)) 0, 100% 50%, calc(100% - var(--doc-workflow-notch)) 100%, 0 100%);
}
a.doc-workflow__step:hover { filter: brightness(0.96); }
.doc-workflow__step--done { background: var(--ok-bg); color: var(--ok-fg); }
.doc-workflow__step--current { background: var(--brand); color: #fff; }
.doc-workflow__step--cancelled { background: var(--crit-bg); color: var(--crit-fg); }
.doc-workflow__step--pending { background: var(--surface-sunken); color: var(--text-disabled); cursor: default; }

/* Below the width where 4-5 chevrons no longer fit on one line, `flex-wrap`
   alone breaks the clip-path notch trick (a wrapped step keeps the notch
   that assumed a horizontal neighbor, reading as a stray jagged edge).
   Drop the chevron shape and stack steps as a plain full-width divided
   list instead. */
@media (max-width: 640px) {
  .doc-workflow { flex-direction: column; }
  .doc-workflow__step,
  .doc-workflow__step:first-child {
    clip-path: none; margin-inline-start: 0; width: 100%;
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--line);
  }
  .doc-workflow__step:last-child { border-bottom: none; }
}

/* ======================================================================
   Form + layout grids
   ====================================================================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
.form-grid .field { grid-column: span 1; }
.form-grid .field--full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

.two-col, .two-col-even { display: grid; gap: var(--space-5); align-items: start; }
.two-col { grid-template-columns: 2fr 1fr; }
.two-col-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .two-col, .two-col-even { grid-template-columns: 1fr; } }

/* ======================================================================
   Key/value list
   ====================================================================== */
.kv-list { display: flex; flex-direction: column; gap: var(--space-3); }
.kv-list__row { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-sm); }
.kv-list__label { color: var(--text-muted); }

/* Document summary — the dense label/value block under a document's
   header + workflow bar (Customer/addresses/rep on the left, dates/
   currency/terms on the right), read at a glance before ever opening a
   tab. Distinct from .kv-list (built for a narrow sidebar panel with
   space-between) — here the label is a fixed-width column so a block of
   rows lines up into a clean two-column grid, closer to how a real
   commercial document is laid out. */
.doc-summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3) var(--space-8);
  padding-bottom: var(--space-5); margin-bottom: var(--space-5); border-bottom: 1px solid var(--line);
}
.doc-summary__col { display: flex; flex-direction: column; gap: var(--space-2); }
.doc-summary__row { display: flex; gap: var(--space-4); font-size: var(--text-sm); align-items: baseline; }
.doc-summary__label { flex: 0 0 150px; color: var(--text-muted); font-weight: 600; }
.doc-summary__value { color: var(--text); }
.doc-summary__value a { color: var(--brand); text-decoration: none; }
.doc-summary__value a:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .doc-summary { grid-template-columns: 1fr; }
  .doc-summary__label { flex-basis: 110px; }
}

/* Partner-role cards (Sold-to/Bill-to/Ship-to/Payer) — a grid of small panels. */
.partner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.partner-card__role { font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-subtle); font-weight: 600; margin-bottom: var(--space-2); }
.partner-card__name { font-weight: 600; margin-bottom: var(--space-1); }
.partner-card__name a { color: inherit; text-decoration: none; }
.partner-card__name a:hover { color: var(--brand); }
.partner-card__line { font-size: var(--text-sm); color: var(--text-muted); }
.kv-list__value { font-weight: 600; text-align: end; }

/* definition table — label / value rows inside a panel */
.kv-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.kv-table th, .kv-table td { text-align: start; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); vertical-align: top; }
.kv-table tr:last-child th, .kv-table tr:last-child td { border-bottom: none; }
.kv-table th { width: 42%; font-weight: 500; color: var(--text-muted); }
.kv-table td { font-weight: 600; color: var(--text); }

/* functional-area section: a full-width panel that stacks with the next.
   Fields flow in a responsive grid, label above value. */
.erp-section { margin: 0 0 var(--space-4); }
.kv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4) var(--space-6); margin: 0; padding: var(--space-5);
}
.kv-grid__item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kv-grid__label {
  font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-subtle); margin: 0;
}
.kv-grid__value { font-size: var(--text-sm); font-weight: 600; color: var(--text); margin: 0; word-break: break-word; }

/* form fieldsets — grouped sections on a create/edit form */
.form-fieldset { border: none; padding: 0; margin: 0 0 var(--space-6); }
.form-fieldset > legend {
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-md);
  padding: 0; margin-bottom: var(--space-4); width: 100%;
  border-bottom: 1px solid var(--line); padding-bottom: var(--space-2);
}

/* ======================================================================
   Comments + activity feed
   ====================================================================== */
.comment { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: none; }
.comment__meta { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: var(--space-1); }
.comment__body { font-size: var(--text-sm); }

.activity-item { display: flex; gap: var(--space-3); padding: var(--space-2) 0; font-size: var(--text-sm); color: var(--text-muted); }
.activity-item__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex-shrink: 0; }
.activity-item strong { color: var(--text); }

/* ======================================================================
   Notification centre
   ====================================================================== */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: none; }
.notif-item__dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 6px; flex-shrink: 0; }
.notif-item.is-unread { background: var(--brand-tint); }
.notif-item.is-unread .notif-item__dot { background: var(--brand); }
.notif-item__body { min-width: 0; }
.notif-item__title { font-size: var(--text-sm); font-weight: 600; color: var(--text); }
a.notif-item__title:hover { color: var(--brand); text-decoration: underline; }
.notif-item__text { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--text-muted); }
.notif-item__meta { margin-top: var(--space-1); font-size: var(--text-xs); color: var(--text-subtle); display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ======================================================================
   Pipeline board (kanban)
   ====================================================================== */
.pipeline-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2); }
.pipeline-column { background: var(--surface-sunken); border-radius: var(--radius-md); padding: var(--space-3); }
.pipeline-column__header { display: flex; justify-content: space-between; align-items: center; font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: var(--space-3); }
.pipeline-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-3); margin-bottom: var(--space-2); text-decoration: none; color: inherit; }
.pipeline-card:hover { border-color: var(--brand); }
.pipeline-card__name { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-1); }
.pipeline-card__meta { font-size: var(--text-xs); color: var(--text-muted); display: flex; justify-content: space-between; gap: var(--space-2); }

/* ======================================================================
   KPI card row (headline metrics)
   ====================================================================== */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-6); }
.kpi-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4);
  box-shadow: var(--elev-1);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--elev-2); border-color: var(--brand); }
.kpi-card__label { font-size: var(--text-xs); color: var(--text-muted); font-weight: 600; margin-bottom: var(--space-2); }
.kpi-card__value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; line-height: 1; }
.kpi-card__meta { font-size: var(--text-xs); margin-top: var(--space-2); display: flex; align-items: center; gap: var(--space-1); color: var(--text-muted); }
.kpi-card__meta--up { color: var(--ok-fg); }
.kpi-card__meta--down { color: var(--crit-fg); }
.kpi-card__meta--flat { color: var(--text-muted); }

/* ======================================================================
   Workspace tile grid (submodule launchers with a KPI)
   ====================================================================== */
.kpi-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-6); }
.kpi-tile {
  display: flex; flex-direction: column; gap: var(--space-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: var(--space-4); text-decoration: none; color: inherit; box-shadow: var(--elev-1);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.kpi-tile:hover { transform: translateY(-2px); box-shadow: var(--elev-2); border-color: var(--brand); }
.kpi-tile__top { display: flex; align-items: center; gap: var(--space-3); }
.kpi-tile__icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--brand-tint); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: var(--text-lg);
}
.kpi-tile__heading { min-width: 0; }
.kpi-tile__title { font-weight: 600; font-size: var(--text-sm); }
.kpi-tile__desc { font-size: var(--text-xs); color: var(--text-muted); }
.kpi-tile__body { margin-top: -2px; }
.kpi-tile__stat { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; line-height: 1; }
.kpi-tile__substat { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }
.kpi-tile__action { font-size: var(--text-xs); color: var(--brand); font-weight: 600; margin-top: 2px; }

/* ======================================================================
   Compact KPI stat grid (intel / dense overviews)
   ====================================================================== */
.kpi-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-5); }
.kpi-stat { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); background: var(--surface); box-shadow: var(--elev-1); }
.kpi-stat__label { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: var(--space-2); }
.kpi-stat__value { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; }

/* ======================================================================
   Analytics — hand-authored inline SVG charts fed by server-computed
   geometry (erp/services/charts.py). No JS charting dependency.
   ====================================================================== */
.analytics-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--space-4); margin-bottom: var(--space-4); align-items: stretch; }
@media (max-width: 900px) { .analytics-grid { grid-template-columns: 1fr; } }

.chart-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5); display: flex; flex-direction: column;
  box-shadow: var(--elev-1);
}
.chart-panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.chart-panel__head h3 { font-size: var(--text-base); font-weight: 600; }
.chart-panel__head span { font-size: var(--text-2xs); color: var(--text-subtle); white-space: nowrap; }

/* Line chart (erp/dashboard/_line_plot.html). The box has a default
   height; inside a flex-column card it grows to fill the card instead
   (flex: 1 1 0), so the chart follows the card's size rather than its
   width — a wide screen no longer makes it taller than its card. */
.line-chart-box { --lc-gutter: 40px; display: flex; flex-direction: column; height: 180px; min-height: 120px; padding-inline-end: var(--space-3); }
.chart-panel > .line-chart-box { flex: 1 1 auto; }
.line-chart__plot { position: relative; flex: 1 1 0; min-height: 0; margin-inline-start: var(--lc-gutter); }
.line-chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.line-chart__grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.line-chart__tick {
  position: absolute; inset-inline-start: calc(-1 * var(--lc-gutter)); width: calc(var(--lc-gutter) - 6px);
  transform: translateY(-50%); font-size: 10px; line-height: 1; color: var(--text-subtle); white-space: nowrap; pointer-events: none;
}
.line-chart__stop-start { stop-color: var(--brand); stop-opacity: 0.28; }
.line-chart__stop-end { stop-color: var(--brand); stop-opacity: 0; }
.line-chart__line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.line-chart__dot {
  position: absolute; width: 9px; height: 9px; margin-block: -4.5px 0; margin-inline: -4.5px 0; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--brand); box-sizing: border-box;
}
.line-chart__dot:hover { transform: scale(1.35); }
.line-chart__labels { position: relative; flex: none; height: 1.4em; margin-block: var(--space-2) 0; margin-inline: var(--lc-gutter) 0; font-size: var(--text-xs); color: var(--text-muted); }
.line-chart__labels span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.line-chart__headline { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-3); flex-wrap: wrap; }
.line-chart__headline-value { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.line-chart__headline-label { font-size: var(--text-xs); color: var(--text-subtle); }

.bar-chart { position: relative; height: 150px; flex: 1; }
.bar-chart__grid { position: absolute; inset: 0; pointer-events: none; }
.bar-chart__grid-line { position: absolute; inset-inline-start: 0; inset-inline-end: 0; border-top: 1px dashed var(--line); }
.bar-chart__grid-line span { position: absolute; inset-inline-start: 0; top: -7px; font-size: 9.5px; color: var(--text-subtle); background: var(--surface); padding-inline-end: 5px; }
.bar-chart__bars { position: relative; display: flex; align-items: flex-end; gap: var(--space-3); height: 100%; padding-top: var(--space-4); }
.bar-chart__col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-chart__value { font-size: 10.5px; font-weight: 600; color: var(--text); margin-bottom: var(--space-1); }
.bar-chart__track { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.bar-chart__fill {
  width: 100%; min-height: 3px; border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-strong) 100%);
  transition: opacity var(--dur-fast) var(--ease);
}
.bar-chart__col:hover .bar-chart__fill { opacity: 0.85; }
.bar-chart__label { font-size: var(--text-2xs); color: var(--text-muted); text-align: center; margin-top: var(--space-2); line-height: 1.2; }

.bubble-chart { width: 100%; height: auto; display: block; }
.bubble-chart__grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.bubble-chart__tick { font-size: 9.5px; fill: var(--text-subtle); font-family: var(--font-body); }
.bubble-chart__tick--x { text-anchor: middle; }
.bubble-chart__bubble { fill: var(--brand); fill-opacity: 0.18; stroke: var(--brand); stroke-width: 1.5; transition: fill-opacity var(--dur-fast) var(--ease); }
.bubble-chart__bubble:hover { fill-opacity: 0.38; }
.bubble-chart__legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-4); }
.bubble-chart__legend-item { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--text-muted); }
.bubble-chart__legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }

.donut-chart { display: flex; align-items: center; gap: var(--space-5); }
.donut-chart__svg { width: 140px; height: 140px; flex: none; }
.donut-chart__seg { transition: opacity var(--dur-fast) var(--ease); }
.donut-chart__seg:hover { opacity: 0.8; }
.donut-chart__total-value { font-family: var(--font-display); font-size: 16px; font-weight: 700; fill: var(--text); }
.donut-chart__total-label { font-size: 6.5px; fill: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.04em; }
.donut-chart__legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
.donut-chart__legend strong { color: var(--text); margin-inline-start: var(--space-1); font-variant-numeric: tabular-nums; }
.donut-chart__swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline-end: var(--space-2); }
.donut-chart__seg--1, .donut-chart__swatch--1 { stroke: var(--chart-cat-1); background: var(--chart-cat-1); }
.donut-chart__seg--2, .donut-chart__swatch--2 { stroke: var(--chart-cat-2); background: var(--chart-cat-2); }
.donut-chart__seg--3, .donut-chart__swatch--3 { stroke: var(--chart-cat-3); background: var(--chart-cat-3); }
.donut-chart__seg--4, .donut-chart__swatch--4 { stroke: var(--chart-cat-4); background: var(--chart-cat-4); }
.donut-chart__seg--5, .donut-chart__swatch--5 { stroke: var(--chart-cat-5); background: var(--chart-cat-5); }
.donut-chart__seg--6, .donut-chart__swatch--6 { stroke: var(--chart-cat-6); background: var(--chart-cat-6); }

.gauge-row { display: flex; gap: var(--space-4); flex: 1; align-items: center; }
@media (max-width: 480px) { .gauge-row { flex-wrap: wrap; } }
.gauge { flex: 1; min-width: 100px; display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; }
.gauge__svg { width: 100%; max-width: 130px; display: block; }
.gauge__track { stroke: var(--surface-sunken); }
.gauge__tick { stroke: var(--surface); stroke-width: 1.5; }
.gauge__value-arc { stroke: var(--brand); }
.gauge__value-arc--positive { stroke: var(--ok); }
.gauge__value-arc--warning { stroke: var(--signal-strong); }
.gauge__value-arc--negative { stroke: var(--crit); }
.gauge__value-arc--neutral { stroke: var(--text-subtle); }
.gauge__figure { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; color: var(--text); margin-top: var(--space-1); }
.gauge__label { font-size: var(--text-2xs); color: var(--text-muted); margin-top: 2px; }

/* ======================================================================
   Alert / risk list
   ====================================================================== */
.alert-card { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.alert-card:last-child { border-bottom: none; }
.alert-card__message { font-size: var(--text-sm); }
.alert-card__severity { font-size: var(--text-2xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; padding: 2px var(--space-2); border-radius: var(--radius-pill); white-space: nowrap; }
.alert-card__severity--high { background: var(--crit-bg); color: var(--crit-fg); }
.alert-card__severity--medium { background: var(--warn-bg); color: var(--warn-fg); }
.alert-card__severity--low { background: var(--surface-sunken); color: var(--text-muted); }

/* ======================================================================
   Customer 360 object page
   ====================================================================== */
.c360-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.c360-kpi-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--elev-1); }
.c360-kpi-tile__label { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: var(--space-2); }
.c360-kpi-tile__value { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; color: var(--text); }
.c360-kpi-tile__sub { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }
.c360-kpi-tile__value--positive { color: var(--ok-fg); }
.c360-kpi-tile__value--negative { color: var(--crit-fg); }

.c360-aging-bar { display: flex; height: 12px; border-radius: var(--radius-pill); overflow: hidden; background: var(--surface-sunken); margin-bottom: var(--space-3); }
.c360-aging-bar__segment { height: 100%; }
.c360-aging-bar__segment--0_30 { background: var(--ok); }
.c360-aging-bar__segment--31_60 { background: var(--signal); }
.c360-aging-bar__segment--61_90 { background: #d98a3a; }
.c360-aging-bar__segment--91_120 { background: #cf6a4a; }
.c360-aging-bar__segment--120_plus { background: var(--crit); }

.c360-aging-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: var(--text-xs); color: var(--text-muted); margin-bottom: var(--space-4); }
.c360-aging-legend__swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline-end: var(--space-1); vertical-align: middle; }

.c360-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.c360-table th, .c360-table td { text-align: start; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); }
.c360-table th { color: var(--text-subtle); font-weight: 600; font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.02em; }
.c360-table tr:last-child td { border-bottom: none; }

.c360-timeline { display: flex; flex-direction: column; }
.c360-timeline__item { display: flex; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.c360-timeline__item:last-child { border-bottom: none; }
.c360-timeline__dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 6px; }
.c360-timeline__date { font-size: var(--text-xs); color: var(--text-muted); min-width: 84px; flex-shrink: 0; }
.c360-timeline__label { font-size: var(--text-sm); }

.c360-stage-row { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.c360-stage-chip { background: var(--surface-sunken); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-size: var(--text-xs); color: var(--text-muted); flex: 1; min-width: 100px; text-align: center; }
.c360-stage-chip strong { display: block; font-size: var(--text-lg); color: var(--text); }

.c360-risk-reasons { list-style: none; padding: 0; margin: var(--space-3) 0 0; }
.c360-risk-reasons li { font-size: var(--text-sm); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
.c360-risk-reasons li:last-child { border-bottom: none; }

/* ======================================================================
   Dashboard framework  (erp/dashboards.py + erp/templates/erp/dashboard/)

   .erp-dash is the top-level grid: an analytical main column plus an
   optional right-hand filter/context rail (only present when a view
   supplies dashboard.filters). Inside the main column, KPIs sit in a
   dedicated 4-across grid, then large/secondary analytics pair up by
   width (Card.wide = 2 grid tracks), then worklists/alerts, then the
   submodule tile launcher and quick actions — priority ordered top to
   bottom, matching the console's existing visual language throughout.
   ====================================================================== */
.erp-dash { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-5); align-items: start; }
.erp-dash--no-rail { grid-template-columns: minmax(0, 1fr); }
.erp-dash__main { min-width: 0; }
.erp-dash__rail { position: sticky; top: calc(var(--shell-header-h) + var(--space-4)); }

.erp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-5); }
/* A one-time settle-in on load, not a scroll trigger — a dashboard's KPI
   row is what a visitor came to see, almost always already in the
   viewport, so this reads as "the numbers just loaded" rather than a
   scroll gimmick. Pure CSS, gated the same way as every other motion
   rule in this codebase (see static/site/site.css's own Motion section
   for the shared convention): skipped entirely under reduced motion,
   so a script-free or reduced-motion visitor just sees the finished
   dashboard immediately. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes erp-kpi-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  /* Opacity only, deliberately never `transform`: a `both`-filled CSS
     animation outranks a plain `:hover` rule in the cascade for as
     long as it keeps filling, so animating `transform` here would
     permanently pin a.erp-kpi's hover-lift (below) to the keyframe's
     end value the moment the entrance finished — the card would stop
     lifting on hover right after page load. */
  .erp-kpi { animation: erp-kpi-fade 0.45s var(--ease) both; }
  .erp-kpis .erp-kpi:nth-child(2) { animation-delay: 0.05s; }
  .erp-kpis .erp-kpi:nth-child(3) { animation-delay: 0.1s; }
  .erp-kpis .erp-kpi:nth-child(4) { animation-delay: 0.15s; }
  .erp-kpis .erp-kpi:nth-child(n+5) { animation-delay: 0.2s; }
}
.erp-kpi {
  display: block; container-type: inline-size; min-width: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--elev-1);
  text-decoration: none; color: inherit;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
a.erp-kpi:hover { transform: translateY(-2px); box-shadow: var(--elev-2); border-color: var(--brand); }
.erp-kpi__label { display: flex; align-items: center; gap: 5px; font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); margin-bottom: var(--space-2); }
.erp-kpi__icon { flex: none; opacity: .7; }

/* One or two KPIs marked emphasis="lead with this number" — a solid
   brand-filled tile among the plain white ones, the same "make the one
   number that matters loudest" trick a lot of admin dashboards use. */
.erp-kpi--emphasis { background: var(--brand); border-color: var(--brand); }
.erp-kpi--emphasis .erp-kpi__label,
.erp-kpi--emphasis .erp-kpi__unit,
.erp-kpi--emphasis .erp-kpi__value,
.erp-kpi--emphasis .erp-kpi__cmp { color: #fff; }
.erp-kpi--emphasis .erp-kpi__label { color: rgba(255, 255, 255, .82); }
.erp-kpi--emphasis .erp-kpi__icon { opacity: .85; }
.erp-kpi--emphasis .erp-kpi__trend--up { color: #bdf0d4; }
.erp-kpi--emphasis .erp-kpi__trend--down { color: #ffd2ca; }
.erp-kpi--emphasis .erp-kpi__trend--flat { color: rgba(255, 255, 255, .75); }
.erp-kpi--emphasis .erp-kpi__spark { color: #fff; opacity: .9; }
a.erp-kpi--emphasis:hover { border-color: var(--brand-strong); box-shadow: var(--elev-2); }

/* kpi.status ('warning'|'negative') — a real threshold was crossed, not
   just "here's a number". A colored left rail + tinted value, same
   status colors used everywhere else (never a KPI's only signal —
   the label/comparison text next to it always says why). */
.erp-kpi--status-warning { border-inline-start: 3px solid var(--warn); }
.erp-kpi--status-warning .erp-kpi__value { color: var(--warn-fg); }
.erp-kpi--status-negative { border-inline-start: 3px solid var(--crit); }
.erp-kpi--status-negative .erp-kpi__value { color: var(--crit-fg); }
.erp-kpi__value-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); min-width: 0; }
.erp-kpi__value { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 600; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.erp-kpi__unit { font-size: var(--text-lg); color: var(--text-muted); font-weight: 500; }
.erp-kpi__unit--pre { margin-inline-end: 2px; }
/* An isolated unit: a right-to-left currency symbol (د.ت, ر.س) placed
   before the amount otherwise turns the digits that follow it into an
   RTL run, and "21 798.000" renders as "798.000 21". */
.erp-kpi__unit { unicode-bidi: isolate; }
.erp-kpi__spark { flex: none; width: 44px; height: 18px; align-self: center; }
.erp-kpi__spark[data-trend="up"] { color: var(--ok-fg); }
.erp-kpi__spark[data-trend="down"] { color: var(--crit-fg); }
.erp-kpi--emphasis .erp-kpi__spark[data-trend] { color: #fff; }
/* The sparkline only shows when the tile has room for it beside the
   value (each tile is its own container) — on a 6-across laptop band it
   used to push past the tile's right edge. */
@container (max-width: 260px) { .erp-kpi__spark { display: none; } }
.erp-kpi__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin-top: var(--space-3); font-size: var(--text-xs); }
.erp-kpi__trend { font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.erp-kpi__trend--up { color: var(--ok-fg); }
.erp-kpi__trend--down { color: var(--crit-fg); }
.erp-kpi__trend--flat { color: var(--text-subtle); }
.erp-kpi__cmp { color: var(--text-subtle); }

.erp-analytics { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); align-items: start; }
.erp-analytics__wide { grid-column: span 2; }

.erp-dash__region { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); align-items: start; }
@media (prefers-reduced-motion: no-preference) {
  .erp-dash__region > * { animation: erp-kpi-fade 0.45s var(--ease) 0.1s both; }
  .erp-dash__region > *:nth-child(2) { animation-delay: 0.18s; }
  .erp-dash__region > *:nth-child(3) { animation-delay: 0.26s; }
}
.erp-worklist { margin: 0; }
.erp-worklist + .erp-worklist { margin-top: 0; }

/* ---- filter / context rail (erp/dashboard/_filters.html) ---- */
.erp-filters__form { display: flex; flex-direction: column; }
.erp-filters__field { margin-bottom: var(--space-4); }
.erp-filters__submit { align-self: flex-start; }
.erp-filters__reset { font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); text-decoration: none; }
.erp-filters__reset:hover { color: var(--brand); }
.erp-filters__active { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }

@media (max-width: 1180px) {
  .erp-dash { grid-template-columns: minmax(0, 1fr); }
  .erp-dash__rail { position: static; }
  .erp-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .erp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .erp-kpis { grid-template-columns: minmax(0, 1fr); }
  .erp-analytics__wide { grid-column: 1 / -1; }
}

.erp-ranking { padding: var(--space-2) var(--space-5) var(--space-4); }
.erp-ranking__row { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; font-size: var(--text-sm); }
.erp-ranking__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-ranking__label a { color: var(--text); text-decoration: none; }
.erp-ranking__label a:hover { color: var(--brand); }
.erp-ranking__bar { height: 8px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.erp-ranking__fill { height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--brand-strong), var(--brand)); }
.erp-ranking__value { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-muted); }

.erp-quick-actions { margin-top: var(--space-6); }
.erp-quick-actions__label { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-3); }
.erp-quick-actions__row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.erp-quick-actions__row .btn .ic { margin-inline-end: 4px; }

/* ======================================================================
   Object header  (erp/_object_header.html)
   ====================================================================== */
.obj-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-5); flex-wrap: wrap;
  margin-bottom: var(--space-6); padding-bottom: var(--space-5); border-bottom: 1px solid var(--line);
}
.obj-header__title { font-size: var(--text-2xl); }
.obj-header__subtitle { font-size: var(--text-md); color: var(--text-muted); margin-top: 2px; }
.obj-header__subtitle a { color: var(--brand); text-decoration: none; }
.obj-header__subtitle a:hover { text-decoration: underline; }
.obj-header__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-3); font-size: var(--text-sm); }
.obj-header__meta-item { color: var(--text-muted); }
.obj-header__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.obj-header__actions form { margin: 0; display: inline; }

/* ======================================================================
   Enterprise list table  (erp/_data_table.html + _filter_bar + _pagination)
   ====================================================================== */
.erp-table-scroll { overflow-x: auto; }
/* legacy tables not yet wrapped still scroll on narrow viewports */
.panel:has(> .data-table) { overflow-x: auto; }

.erp-th-sort { display: inline-flex; align-items: center; gap: var(--space-1); color: inherit; text-decoration: none; }
.erp-th-sort:hover { color: var(--brand); }
.erp-th-sort.is-asc, .erp-th-sort.is-desc { color: var(--brand); }
.erp-th-sort span { font-size: 8px; }

.erp-cell-link { color: var(--brand); text-decoration: none; font-weight: 600; }
.erp-cell-link:hover { text-decoration: underline; }

.erp-filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.erp-filter-bar__search {
  display: flex; align-items: center; gap: var(--space-2);
  flex: 1 1 240px; min-width: 200px;
  padding: 0 var(--space-3); height: 38px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.erp-filter-bar__search .ic { color: var(--text-subtle); flex-shrink: 0; }
.erp-filter-bar__search input { flex: 1; border: none; outline: none; background: none; font: inherit; font-size: var(--text-base); color: var(--text); min-width: 0; }
.erp-filter-bar__select { display: flex; flex-direction: column; gap: 3px; }
.erp-filter-bar__select-label { font-size: var(--text-2xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.erp-filter-bar__select select {
  height: 38px; padding: 0 var(--space-3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); font: inherit; font-size: var(--text-base); color: var(--text);
}
.erp-filter-bar__go { flex-shrink: 0; }
.erp-filter-bar__saved { display: flex; flex-wrap: wrap; gap: var(--space-2); width: 100%; }

.erp-chip {
  display: inline-flex; align-items: center; padding: 4px var(--space-3);
  border-radius: var(--radius-pill); border: 1px solid var(--line);
  font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); text-decoration: none;
  background: var(--surface);
}
.erp-chip:hover { border-color: var(--brand); color: var(--brand); }
.erp-chip.is-active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

.erp-pagination { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }
.erp-pagination__status { font-size: var(--text-sm); color: var(--text-muted); }

@media (max-width: 640px) {
  .erp-filter-bar { flex-direction: column; align-items: stretch; }
  .erp-filter-bar__select select { width: 100%; }
  .obj-header__actions { width: 100%; }
}

/* ---------- permission matrix (Roles) ---------- */
.erp-perm-toolbar { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.erp-perm-toolbar .erp-filter-bar__search { flex: 1 1 auto; margin-bottom: 0; }
.erp-perm-toolbar__count { font-size: var(--text-sm); color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

.erp-perm-module { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: var(--space-3); }
.erp-perm-module__header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); background: var(--surface-sunken);
  border-bottom: 1px solid var(--line);
}
.erp-perm-module__title { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; }
.erp-perm-module__actions { display: flex; gap: var(--space-2); }
.erp-perm-module__body { padding: var(--space-3) var(--space-4); }
.erp-perm-module__subhead { font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin: var(--space-3) 0 var(--space-2); }
.erp-perm-module__subhead:first-child { margin-top: 0; }
.erp-perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-2); }
.erp-perm-grid .checkbox-item { padding: var(--space-2) var(--space-3); margin-bottom: 0; }
.line-items-table__qty { width: 150px; }
