/* ============================================================================
   AGC Hardware — application stylesheet
   Design source: AGC-Hardware-UI-Concept.html (Oct 2026). Tokens in
   design-tokens.css (loaded first). Inter variable font, local only.

   The old component names (.pagehead/.kpis/.card/table.data/.btn--ghost …)
   are kept as aliases of the concept's components so every page shares one
   look; new markup uses the concept's own names (.metric/.panel/.badge …).
   ============================================================================ */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 13px; line-height: 1.5;
  color: var(--navy);
  background: var(--canvas);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 29px; line-height: 1.25; letter-spacing: -1px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: -.2px; }
h3 { font-size: 13px; font-weight: 650; }
p { line-height: 1.6; }
p.muted { font-size: 12px; margin-bottom: 14px; }

/* ── Icons & utilities ──────────────────────────────────────────────────── */
svg.ico { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; font-size: 12px; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.spacer { flex: 1; }
.green { color: var(--deep); }
.red { color: var(--red); }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.mt { margin-top: 20px; }
kbd { font: 10px var(--font-sans); color: #7d858a; border: 1px solid #dfe2dc; border-radius: 4px;
  background: #fafbf8; padding: 1px 5px; }
code { background: #f6f8f2; border: 1px solid var(--line); padding: 1px 7px; border-radius: 4px;
  font-size: .85em; }

/* ── Shell ──────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.shell--auth { grid-template-columns: 1fr; }
.main { min-width: 0; display: flex; flex-direction: column; }
.main > .content { flex: 1; }

/* Sidebar */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  background: var(--navy); color: #b9c0cd; display: flex; flex-direction: column;
  padding: 27px 16px 14px; border-top: 3px solid var(--green); scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 5px 24px; color: #fff; }
.brand svg { flex-shrink: 0; }
.brand > span { font-size: 18px; font-weight: 750; letter-spacing: -.65px; white-space: nowrap; line-height: 1.15; }
.brand strong { color: var(--green2); font-size: 14px; letter-spacing: -.3px; }
.brand small { display: block; letter-spacing: 2.5px; font-weight: 450; font-size: 8px; color: #99a6b6; margin-top: 2px; }
.workspace-switch { display: flex; gap: 9px; align-items: center; text-align: left; background: #232a39;
  border: 1px solid #343b4a; border-radius: 8px; padding: 11px 9px; width: 100%; color: #edf0f4; margin-bottom: 20px; }
.workspace-switch b { font-size: 11px; font-weight: 550; display: block; }
.workspace-switch small { display: block; font-size: 10px; color: #9aa6b8; margin-top: 2px; }
.workspace-switch > .ico:first-child { color: #9ba7b8; }
.workspace-switch > .ico:last-child { margin-left: auto; width: 13px; }
.workspace-switch:hover { border-color: #46506a; }
.nav-search { display: flex; align-items: center; gap: 9px; width: 100%; background: #ffffff0a; border: 1px solid #343b4a;
  border-radius: 7px; padding: 8px 10px; color: #9aa6b8; font-size: 11px; margin-bottom: 18px; text-align: left; }
.nav-search:hover { background: #ffffff12; color: #dfe4ec; }
.nav-search .ico { width: 15px; height: 15px; }
.nav-search kbd { margin-left: auto; background: none; border-color: #3b4454; color: #8e9aad; }
.nav-label { font-size: 9px; letter-spacing: 1.6px; color: #8e9aad; margin: 0 12px 10px; text-transform: uppercase;
  display: flex; align-items: center; font-weight: 500; }
.nav-label button { color: #9ca6b6; font-size: 18px; line-height: 12px; padding: 0 2px; margin-left: auto; }
.nav-label button:hover { color: #fff; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav .nav-section { font-size: 9px; letter-spacing: 1.6px; color: #8e9aad; text-transform: uppercase; font-weight: 500;
  margin: 14px 12px 6px; padding: 0; display: flex; align-items: center; width: auto; text-align: left; background: none; border: 0; }
.nav .nav-section .nav-caret { width: 11px; height: 11px; margin-left: auto; opacity: .7; transition: transform .18s; }
.nav-group.collapsed .nav-caret { transform: rotate(-90deg); }
.nav-group.collapsed .nav-links { display: none; }
.nav-group.collapsed .nav-section { color: var(--green2); }
.nav-group > .nav-links { display: flex; flex-direction: column; gap: 3px; }
.nav a, .nav-item { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 7px;
  font-size: 12px; font-weight: 480; color: #b5bfce; transition: .18s; letter-spacing: 0; text-transform: none; }
.nav a .ico, .nav-item .ico { width: 18px; height: 18px; color: #a3afc0; }
.nav a:hover, .nav-item:hover { background: #ffffff08; color: #fff; }
.nav a.active, .nav a[aria-current="page"], .nav-item.active { background: #23aa081c; color: #fff; }
.nav a.active::before, .nav a[aria-current="page"]::before { content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px;
  width: 3px; border-radius: 0 2px 2px 0; background: var(--green2); }
.nav a.active .ico, .nav a[aria-current="page"] .ico { color: var(--green2); }
.nav a .count, .nav-count { margin-left: auto; border-radius: 5px; background: #323a49; color: #dce0e7; padding: 0 6px;
  font-size: 10px; font-weight: 500; letter-spacing: 0; }
.nav a.active .count { background: #23aa0829; color: #8ee074; }
.nav a .count.alert { background: #ce272d33; color: #ff9a9d; }
.nav-divider { height: 1px; background: #343b473d; margin: 11px 12px; }
.pinned-label { margin-top: 22px; }
.pins { display: flex; flex-direction: column; gap: 2px; }
.pins a { display: flex; align-items: center; gap: 10px; color: #b6becc; font-size: 11px; padding: 7px 12px; border-radius: 6px; }
.pins a:hover { color: #fff; background: #ffffff08; }
.pins .pin-dot { width: 5px; height: 5px; background: #96a376; border-radius: 50%; flex-shrink: 0; }
.pins a .unpin { margin-left: auto; color: #6f7a8c; font-size: 14px; line-height: 1; padding: 0 3px; opacity: 0; }
.pins a:hover .unpin { opacity: 1; }
.pins .pins-empty { font-size: 10px; color: #6f7a8c; padding: 2px 12px 0; line-height: 1.5; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; }
.sidebar .quick-link { display: flex; align-items: center; gap: 10px; border: 1px solid #354038;
  background: linear-gradient(110deg, #23aa080d, #ffffff02); padding: 11px 9px; border-radius: 9px; width: 100%;
  text-align: left; color: #d6dddb; font-size: 11px; }
.sidebar .quick-link:hover { border-color: #46b82e66; }
.sidebar .quick-link > .ico:first-child { color: var(--green2); }
.sidebar .quick-link > .ico:last-child { width: 13px; margin-left: auto; }
.sidebar .quick-link small { display: block; font-size: 9px; color: #95a49a; margin-top: 3px; }
.profile { display: flex; align-items: center; width: 100%; gap: 9px; border-top: 1px solid #303745; margin-top: 14px;
  padding: 15px 3px 2px; text-align: left; color: #f5f5f5; }
.profile > span:nth-child(2) { min-width: 0; }
.profile b { font-size: 11px; font-weight: 550; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile small { display: block; font-size: 10px; color: #9aa6b7; }
.profile > .ico { margin-left: auto; width: 14px; color: #9aa6b7; }
.avatar { width: 33px; height: 33px; display: inline-flex; align-items: center; justify-content: center; background: #e8eddb;
  color: #46553d; border-radius: 50%; font-weight: 650; font-size: 11px; border: 1px solid #ffffff33; flex-shrink: 0;
  text-transform: uppercase; }

/* Topbar */
.topbar { height: 73px; background: #fafaf7; border-bottom: 1px solid #ddded6; display: flex; align-items: center;
  padding: 0 32px; gap: 16px; position: sticky; top: 0; z-index: 25; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 11px; white-space: nowrap; min-width: 0; overflow: hidden; }
.breadcrumb a, .breadcrumb > span { color: var(--muted); }
.breadcrumb a:hover { color: var(--deep); }
.breadcrumb .ico { width: 12px; height: 12px; color: #9aa1a8; }
.breadcrumb b { font-weight: 500; color: var(--navy); overflow: hidden; text-overflow: ellipsis; }
.global-search { display: flex; align-items: center; gap: 9px; width: 300px; max-width: 34%; background: #fff;
  border: 1px solid #dedfd7; padding: 8px 10px; border-radius: 7px; color: #7b8387; text-align: left; font-size: 11px; margin-left: auto; }
.global-search:hover { border-color: #c5c9bd; }
.global-search .ico { width: 16px; height: 16px; }
.global-search kbd { margin-left: auto; }
.concept-tag { font-size: 9px; letter-spacing: .7px; white-space: nowrap; color: var(--deep); font-weight: 650; }
.concept-tag > span { color: #6d7969; letter-spacing: 0; font-weight: 400; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: #fff; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0; color: var(--navy); }
.icon-btn:hover { background: #f1f4ee; }
.icon-btn .ico { width: 17px; height: 17px; }
.notification-button { position: relative; }
.notification-button i { position: absolute; top: 5px; right: 7px; width: 6px; height: 6px; background: var(--green);
  border-radius: 50%; border: 1px solid #fff; display: none; }
.notification-button.has-alerts i { display: block; }
.top-avatar { border: 0; width: 30px; height: 30px; }
.menu-toggle { display: none; }
.backbtn { flex-shrink: 0; }

/* Content column */
.pagehead { padding: 30px 32px 0; max-width: 1750px; margin: 0 auto 24px; width: 100%; }
.body { padding: 0 32px 28px; max-width: 1750px; margin: 0 auto; width: 100%; }
.body:first-child, .pos:first-child { padding-top: 30px; }
.crumbs { font-size: 9px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--slate); font-weight: 550;
  margin-bottom: 8px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.crumbs a:hover { color: var(--deep); }
.crumbs .sep { color: #b1b7ad; }
.crumbs .cur { color: var(--deep); }
.ph-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ph-row h1 { margin: 0; min-width: 0; }
.ph-row .spacer { flex: 1; }
.ph-row > span[style*="flex:1"] { flex: 1; }
.ph-row .badge { position: relative; top: 2px; }
.ph-row form { display: inline-flex; align-items: center; gap: 9px; margin: 0; }
.ph-row form.toolbar { margin: 0; }
.ph-sub, .page-header p { font-size: 12px; color: var(--muted); margin-top: 8px; max-width: 760px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; flex-wrap: wrap; }
.period-filter { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

/* Tabs */
.tabs-row { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d3d6cd; margin-bottom: 22px; gap: 10px; }
.tabs { display: flex; gap: 25px; overflow-x: auto; }
.tab { padding: 0 0 12px; color: var(--muted); font-size: 11px; position: relative; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tab.active { font-weight: 600; color: var(--navy); }
.tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--green); }
.tab-count { font-size: 9px; padding: 0 5px; background: #dcded5; border-radius: 4px; color: #5d6b56; }
.tab.active .tab-count { color: var(--deep); background: #dcecd5; }
.live-status { font-size: 10px; display: flex; gap: 6px; align-items: center; color: #65705f; }
.live-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: #fff; border: 1px solid #d8dad2;
  border-radius: 7px; padding: 9px 13px; font-size: 11px; font-weight: 550; white-space: nowrap; box-shadow: 0 1px 1px #191e2b05;
  min-height: 35px; color: var(--navy); cursor: pointer; transition: background .15s, border-color .15s; text-decoration: none; line-height: 1.2; }
.btn:hover { background: #f5f7f1; }
.btn .ico, .btn svg { width: 15px; height: 15px; }
.btn, .btn-primary { }
/* The app's plain .btn is its primary action → concept btn-primary. */
.btn:not(.btn--ghost):not(.btn--secondary):not(.btn--danger):not(.btn-dark):not(.btn-danger):not(.btn-default):not(.btn-plain),
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 2px 2px #14700618; }
.btn:not(.btn--ghost):not(.btn--secondary):not(.btn--danger):not(.btn-dark):not(.btn-danger):not(.btn-default):not(.btn-plain):hover,
.btn-primary:hover { background: #1e9607; border-color: #1e9607; }
.btn--secondary, .btn-dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn--secondary:hover, .btn-dark:hover { background: #2a3244; border-color: #2a3244; }
.btn--ghost, .btn-default { background: #fff; color: var(--navy); border-color: #d8dad2; }
.btn--ghost:hover, .btn-default:hover { background: #f5f7f1; }
.btn--danger, .btn-danger { background: #fff; color: var(--red); border-color: #e6c9ca; }
.btn--danger:hover, .btn-danger:hover { background: #fdf3f3; }
.btn.sm, .btn--sm, .btn-sm { padding: 6px 10px; min-height: 29px; font-size: 10.5px; }
.btn-plain { background: none; border: 0; box-shadow: none; padding: 0; color: var(--deep); font-size: 11px; min-height: 24px; }
.btn--wide { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ── Metrics (KPI cards) ────────────────────────────────────────────────── */
.kpis, .metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi, .metric { container-type: inline-size; background: #fff; border: 1px solid var(--panel-border); border-radius: 10px; padding: 17px 18px; position: relative;
  min-height: 108px; overflow: hidden; text-align: left; display: block; color: var(--navy); min-width: 0; }
a.kpi, a.metric { transition: border-color .15s, box-shadow .15s; }
a.kpi:hover, a.metric:hover { border-color: #8fc67c; box-shadow: 0 3px 8px #191e2b08; }
.kpi .lab, .metric-label { font-size: 11px; color: #627064; display: flex; align-items: center; gap: 8px; font-weight: 450;
  letter-spacing: 0; text-transform: none; }
.kpi .lab .ico, .metric-label .ico { width: 15px; height: 15px; color: #8d9687; margin-left: auto; }
.kpi .val, .metric-value { font-size: clamp(15px, 8.2cqw, 27px); letter-spacing: -.6px; line-height: 1.3; font-weight: 600;
  margin: 10px 0 7px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--navy); }
.kpi .val small, .metric-value small, .kpi .val .cur-sym, .chart-total .cur-sym { font-style: normal; font-size: .55em; color: #7e8778; margin-right: 4px; font-weight: 450; letter-spacing: 0; }
.kpi .val a { color: inherit; }
.kpi .dl, .metric-note { font-size: 10px; color: #7b8576; line-height: 1.5; }
.kpi .dl b { color: var(--deep); font-weight: 550; }
.trend { font-size: 9px; font-weight: 550; color: var(--deep); background: var(--green-bg); padding: 2px 4px; border-radius: 3px; margin-right: 5px; }
.trend.warn { color: #a36900; background: var(--amber-bg); }
.trend.down { color: var(--red-ink); background: var(--red-bg); }
.spark { position: absolute; right: 15px; bottom: 26px; width: 67px; height: 27px; opacity: .85; }
.kpi.alert { background: linear-gradient(180deg, #fffdf8, #fff); border-color: #ecd9b4; }
.kpi.alert .val { color: #9b6100; }
.kpi.good { border-color: #bfd9af; }
.kpi.good .val { color: var(--deep); }
.stat .label { font-size: 11px; color: #627064; display: block; margin-bottom: 6px; }
.stat-num { font-size: 27px; font-weight: 600; letter-spacing: -.9px; }
.stat-sub { color: var(--muted); font-size: 11px; margin-top: 4px; }

/* Quick strip (dashboard shortcuts, smart buttons on documents) */
.quick-strip, .smartbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 22px; }
.smartbar { display: flex; flex-wrap: wrap; }
.quick-card, .smartbtn { background: #ffffff85; border: 1px solid #d8ddd0; border-radius: 9px; padding: 12px 13px; display: flex;
  align-items: center; text-align: left; gap: 10px; font-size: 11px; font-weight: 550; color: var(--navy); min-width: 0; }
.quick-card:hover, .smartbtn:hover { background: #fff; border-color: #b4cda4; }
.quick-card .ico { color: var(--deep); width: 17px; height: 17px; }
.quick-card > .ico:last-child { margin-left: auto; width: 12px; color: #7e8c73; }
.quick-card small, .smartbtn span { display: block; font-size: 9.5px; font-weight: 400; color: var(--muted); margin-top: 2px;
  letter-spacing: 0; text-transform: none; }
.smartbtn { flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 14px; }
.smartbtn b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Panels / cards ─────────────────────────────────────────────────────── */
.card, .panel { background: #fff; border: 1px solid var(--panel-border); border-radius: 11px; min-width: 0; }
.card { padding: 19px 20px; }
.card > h2, .panel-head h2 { margin-bottom: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card > h2 .r, h2 .r { margin-left: auto; font-weight: 450; font-size: 11px; color: var(--muted); }
.card > h2 + .tbl-wrap, .card > h2 + form > .tbl-wrap:first-child { border-top: 1px solid var(--row-line); }
.card > .tbl-wrap, .card > form > .tbl-wrap { margin-left: -20px; margin-right: -20px; border-left: 0; border-right: 0; border-radius: 0; }
.card > .tbl-wrap:last-child, .card > form:last-child > .tbl-wrap:last-child { margin-bottom: -19px; border-bottom: 0; border-radius: 0 0 11px 11px; }
.card > .tbl-wrap:last-child table.data tr:last-child td { border-bottom: 0; }
.card > .tbl-wrap:first-child { margin-top: -19px; border-top: 0; border-radius: 11px 11px 0 0; }
.card > h3, .section-title { margin: 22px 0 10px; font-size: 12px; font-weight: 600; }
.card > h2:not(:first-child), .card > form > h2:not(:first-child) { margin-top: 24px; }
.card p.muted:last-child { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 19px 20px 0; gap: 10px; flex-wrap: wrap; }
.panel-head h2 { margin-bottom: 0; }
.panel-head p { font-size: 10px; color: var(--muted); margin-top: 3px; }
.panel-head .btn { font-size: 10px; }
.panel-body { padding: 19px 20px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid #edf0e8; background: #fcfcfa; display: flex; align-items: center;
  justify-content: space-between; font-size: 10px; color: #7a8472; gap: 10px; border-radius: 0 0 11px 11px; }
.panel-foot a { color: var(--deep); font-weight: 550; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 19px; align-items: start; }
.grid-2 + .grid-2, .grid-2 + .card, .card + .grid-2, .card + .card, .grid-2 + .panel, .panel + .panel, .card + .panel, .panel + .card { margin-top: 19px; }
.g-main, .flow, .dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr); gap: 19px; align-items: start; }
.finance-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.g-main > *, .grid-2 > *, .flow > *, .kpis > *, .dashboard-grid > * { min-width: 0; }

/* Chart panel */
.chart-summary { display: flex; align-items: center; gap: 14px; padding: 20px 22px 0; flex-wrap: wrap; }
.chart-total { font-size: 24px; font-weight: 600; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.chart-total small, .chart-total .cur-sym { font-style: normal; font-size: 12px; font-weight: 450; color: var(--muted); letter-spacing: 0; margin-right: 5px; }
.chart-legend { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 9px; color: var(--muted); }
.legend-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 5px; }
.legend-dot.previous { background: #b7c0b0; }
.sales-chart { padding: 8px 20px 0; position: relative; }
.sales-chart svg { width: 100%; height: 183px; display: block; }
.chart-labels { display: flex; justify-content: space-between; color: #8a9386; font-size: 9px; margin: 6px 20px 17px; }
.chart-bottom { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #eceee7; padding: 13px 20px; gap: 10px; }
.chart-bottom small { font-size: 9px; color: var(--muted); display: block; margin-bottom: 3px; }
.chart-bottom b { font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums; }
.chart-bottom .line { height: 3px; border-radius: 2px; background: #e5e9df; margin-top: 6px; overflow: hidden; }
.chart-bottom .line i { height: 100%; background: var(--green); display: block; }

/* Attention list / activity */
.attention-number { color: #9b6100; background: var(--amber-bg); padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 550; }
.attention-list { padding: 7px 19px 0; }
.attention-item { display: flex; gap: 10px; align-items: flex-start; border-bottom: 1px solid #edf0e8; padding: 14px 0; width: 100%; text-align: left; color: var(--navy); }
.attention-item:last-child { border-bottom: 0; }
.attention-item:hover .attention-copy b { color: var(--deep); }
.attention-icon { display: flex; align-items: center; justify-content: center; width: 29px; height: 29px; border-radius: 7px;
  background: var(--amber-bg); color: #ad750d; flex-shrink: 0; }
.attention-icon.danger { background: var(--red-bg); color: var(--red); }
.attention-icon.green { background: var(--green-bg); color: var(--deep); }
.attention-icon.blue { background: #edf2f5; color: var(--slate); }
.attention-icon .ico { width: 15px; height: 15px; }
.attention-copy { min-width: 0; flex: 1; }
.attention-copy b { font-size: 11.5px; font-weight: 550; display: block; }
.attention-copy small { font-size: 9.5px; color: var(--muted); display: block; margin-top: 3px; }
.attention-item > .ico { margin-left: auto; align-self: center; width: 14px; color: #8a9483; }
.activity-list { padding: 8px 20px 12px; }
.activity-item { display: flex; gap: 11px; padding: 11px 0; font-size: 11px; border-bottom: 1px solid #f1f3ec; }
.activity-item:last-child { border-bottom: 0; }
.activity-mark { width: 27px; height: 27px; border-radius: 50%; background: #eff3e9; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #637359; font-size: 9px; font-weight: 600; text-transform: uppercase; }
.activity-mark .ico { width: 14px; height: 14px; }
.activity-item > div { min-width: 0; flex: 1; }
.activity-item b { font-weight: 550; }
.activity-item small { display: block; color: #7b8575; font-size: 9.5px; margin-top: 3px; }
.activity-item time { margin-left: auto; color: #969d91; font-size: 9.5px; white-space: nowrap; }
.exceptions { list-style: none; }
.exceptions li a { display: flex; align-items: center; gap: 10px; padding: 12px 0; font-size: 12px; font-weight: 500; color: var(--navy);
  border-bottom: 1px solid #edf0e8; }
.exceptions li:last-child a { border-bottom: 0; }
.exceptions li a:hover { color: var(--deep); }
.exceptions li a svg { margin-left: auto; color: #8a9483; flex: none; }
/* Key → value lists (document facts, compliance calendar) */
.cal { list-style: none; font-size: 12px; }
.cal li { display: grid; grid-template-columns: minmax(84px, max-content) 1fr; gap: 4px 14px; padding: 9px 0; border-bottom: 1px solid #edf0e7; align-items: baseline; }
.cal li:last-child { border-bottom: 0; }
.cal li b { color: #7a8870; font-weight: 500; }
.cal li b.num { text-align: right; min-width: 110px; }
.detail-row { display: flex; justify-content: space-between; gap: 20px; font-size: 11.5px; padding: 11px 0; border-bottom: 1px solid #edf0e7; }
.detail-row > span:first-child { color: #859279; }
.detail-row > span:last-child { text-align: right; }
.timeline { border-left: 1px solid #dfe7d5; padding-left: 17px; margin: 6px 0 0 5px; }
.timeline > div { position: relative; margin-bottom: 16px; font-size: 11.5px; }
.timeline > div:last-child { margin-bottom: 0; }
.timeline > div::before { content: ''; position: absolute; left: -21px; top: 5px; width: 6px; height: 6px; border: 1px solid #9ab489; background: #fff; border-radius: 50%; }
.timeline small { display: block; font-size: 9.5px; color: #859279; margin-top: 3px; }
.steps { display: flex; gap: 6px; margin: 0 0 23px; }
.steps .step, .statusbar .st { flex: 1; font-size: 10px; color: #8e9a84; font-weight: 500; background: none; border: 0; padding: 0;
  border-radius: 0; text-transform: none; letter-spacing: 0; }
.steps .step::before, .statusbar .st::before { content: ''; display: block; height: 3px; background: #e3e9dc; margin-bottom: 7px; border-radius: 2px; }
.step.done, .st.done { color: var(--deep); }
.step.done::before, .st.done::before { background: var(--green); }
.st.cur { color: var(--navy); font-weight: 600; }
.st.cur::before { background: var(--navy); }
.statusbar { display: flex; gap: 6px; margin: 0 0 23px; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.tbl-wrap, .table-scroll { background: #fff; border: 1px solid #e5e8df; border-radius: 10px; overflow-x: auto; max-width: 100%; }
table.data, .data-table { width: 100%; border-collapse: collapse; font-size: 12px; background: #fff; }
table.data th, .data-table th { text-align: left; font-size: 10px; color: #7f8879; background: var(--head-bg); font-weight: 500;
  padding: 11px 16px; border-bottom: 1px solid #e9ece3; white-space: nowrap; letter-spacing: .02em; }
table.data th a { color: inherit; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
table.data th .caret { opacity: .45; font-size: 8px; }
table.data th.sorted .caret { opacity: 1; color: var(--deep); }
table.data td, .data-table td { padding: 12px 16px; border-bottom: 1px solid var(--row-line); vertical-align: middle; color: var(--navy); }
table.data tr:last-child td, .data-table tr:last-child td { border-bottom: 0; }
table.data tr:hover td, .data-table tbody tr:hover td { background: #fafcf7; }
table.data tr[onclick], .data-table tbody tr[data-record] { cursor: pointer; }
table.data th.num, table.data td.num, .data-table th.num, .data-table td.num { text-align: right; }
table.data th.num a { justify-content: flex-end; }
table.data td b { font-weight: 600; }
table.data td.card-lead, table.data td:first-child > b:only-child { white-space: nowrap; }
table.data td .muted { font-weight: 400; }
table.data a.lead, table.data td .lead { font-weight: 600; color: var(--navy); }
table.data a.lead:hover { color: var(--deep); }
table.data code { font-size: 11px; }
table.data tr[style*="font-weight:bold"] td, table.data tr.total td { font-weight: 600; background: #fcfcfa; }
table.data tr[style*="border-top"] td { border-top: 2px solid var(--navy); }
table.data tr.grp-row td { background: #f0f6ea; }
table.data tr.muted td, table.data td.muted { color: var(--muted); }
table.data td input, table.data td select { padding: 6px 8px; font-size: 12px; }
.record-id { font-size: 10.5px; font-weight: 600; color: #44663a; }
.secondary { display: block; font-size: 9.5px; color: #85907e; margin-top: 3px; font-weight: 400; }
.cell-product { display: flex; align-items: center; gap: 10px; }
.product-avatar { display: inline-flex; align-items: center; justify-content: center; width: 31px; height: 34px; border: 1px solid #e6e9df;
  border-radius: 6px; background: #f5f5ef; color: #68775c; flex-shrink: 0; }
.product-avatar .ico { width: 19px; height: 19px; color: inherit; }
.stock-level { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.stock-dot { width: 5px; height: 5px; background: var(--green); border-radius: 50%; }
.stock-dot.low { background: #d98a00; }
.stock-dot.out { background: var(--red); }
.progress, .pbar { height: 4px; width: 70px; max-width: 100%; background: #e7ecdf; border-radius: 2px; overflow: hidden; margin-left: auto; }
.progress i, .pbar i { display: block; height: 100%; background: var(--green); border-radius: 2px; }
.pbar.warn i { background: #d98a00; }
.qa { display: flex; gap: 4px; justify-content: flex-end; }
.qa a, .qa button { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; }
.qa a:hover, .qa button:hover { border-color: var(--green); color: var(--deep); background: var(--green-bg); }
.expander { display: inline-block; color: var(--muted); transition: transform .2s; }
.expander.open { transform: rotate(90deg); color: var(--deep); }
tr.detail td { border-bottom: 1px solid var(--row-line); }
.density-compact table.data td, .density-compact .data-table td { padding-top: 7px; padding-bottom: 7px; }
.density-compact .kpi, .density-compact .metric { min-height: 92px; padding: 13px 15px; }

/* List toolbar / filters / pagination */
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar:last-child { margin-bottom: 0; }
.toolbar > .btn--sm, .toolbar > .btn-sm, .toolbar > form > .btn--sm, .list-panel .toolbar .btn { min-height: 35px; padding-top: 8px; padding-bottom: 8px; }
.toolbar > input, .toolbar > select { min-height: 35px; }
form.toolbar { margin-bottom: 0; }
.list-panel { padding: 0; }
.list-panel > .toolbar { padding: 15px 18px; border-bottom: 1px solid #e8ece1; margin: 0; }
.list-panel .tbl-wrap { border: 0; border-radius: 0; }
.list-panel .empty { padding: 48px 20px; }
.list-panel .pager { padding: 12px 18px; border-top: 1px solid #e9ece3; margin: 0; }
.search, .input-search { display: flex; align-items: center; gap: 8px; border: 1px solid #dfe3d7; border-radius: 6px; background: #fff;
  padding: 0 10px; min-width: 210px; flex: 1; max-width: 350px; }
.search .ico, .input-search .ico, .search svg { width: 15px; height: 15px; color: #89947d; flex-shrink: 0; }
.search input, .input-search input { width: 100%; min-width: 0; outline: 0; border: 0; background: none; padding: 9px 0; font-size: 12px; box-shadow: none; }
.search input:focus { outline: 0; box-shadow: none; }
.search:has(input.htmx-request)::after { content: ''; flex-shrink: 0; width: 13px; height: 13px; border: 2px solid #d8dad2;
  border-top-color: var(--green); border-radius: 50%; animation: spin .6s linear infinite; }
.filter-select { border: 1px solid #dfe3d7; background: #fff; border-radius: 6px; padding: 8px 9px; font-size: 11px; max-width: 180px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; background: #ffffff80; border: 1px solid #d8ddd0; border-radius: 6px;
  padding: 6px 10px; color: #6c785e; cursor: pointer; transition: .15s; white-space: nowrap; }
.chip:hover { background: #fff; border-color: #b4cda4; }
.chip.on, .chip.active { background: #e3f1dc; border-color: #b4cda4; color: var(--deep); font-weight: 550; }
.chip .ico { width: 12px; height: 12px; }
.count { margin-left: auto; font-size: 10.5px; color: #7d8873; white-space: nowrap; }
.count b { color: var(--navy); font-weight: 600; }
.view-toggle { display: flex; border: 1px solid #dfe3d7; border-radius: 6px; overflow: hidden; }
.view-toggle a, .view-toggle button { border: 0; background: #fff; padding: 7px 9px; color: #88927e; display: inline-flex; cursor: pointer; }
.view-toggle a.active, .view-toggle button.active { background: #eff3e9; color: var(--deep); }
.view-toggle .ico { width: 14px; height: 14px; }
.filter-area { background: #f7faf3; padding: 14px 18px; border-bottom: 1px solid #dfe6d6; display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.filter-area .field, .filter-area .lf { margin: 0; flex: 1; min-width: 120px; }
.selection-bar { display: flex; align-items: center; gap: 12px; padding: 9px 18px; background: #edf7e8; color: var(--deep); font-size: 11px; border-bottom: 1px solid #d8e7cf; }
.pager, .table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #7d8873; font-size: 10.5px; flex-wrap: wrap; margin-top: 12px; }
.pagination { display: flex; gap: 5px; align-items: center; }
.pagination a, .pagination button, .pagination span.cur { border: 1px solid #dfe3d7; background: #fff; border-radius: 5px; min-width: 26px; height: 26px;
  font-size: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; color: var(--navy); }
.pagination a:hover { background: #f5f7f1; }
.pagination span.cur { background: #edf5e8; color: var(--deep); border-color: #bfd9af; }
.pagination .ico { width: 13px; height: 13px; }
.pagination .filter-select { padding: 4px 6px; font-size: 10px; height: 26px; }
input[type=checkbox] { accent-color: var(--green); width: 13px; height: 13px; cursor: pointer; }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; line-height: 1.5; padding: 3px 7px; border-radius: 5px;
  background: #eff1eb; color: #66715d; white-space: nowrap; font-weight: 500; letter-spacing: 0; text-transform: none; vertical-align: middle; }
.badge::before { content: ''; width: 4px; height: 4px; background: currentColor; border-radius: 50%; flex-shrink: 0; }
.badge--success, .badge.success { background: var(--green-bg); color: var(--deep); }
.badge--warning, .badge.warning { background: var(--amber-bg); color: var(--amber-ink); }
.badge--danger, .badge.danger { background: var(--red-bg); color: var(--red-ink); }
.badge--muted, .badge--info, .badge.blue { background: #edf2f5; color: var(--slate); }
.notepill { display: inline-block; background: var(--green-bg); color: var(--deep); font-size: 10px; padding: 3px 8px; border-radius: 5px; font-weight: 550; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Empty / notices / messages ─────────────────────────────────────────── */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ico, .empty svg { width: 28px; height: 28px; margin: 0 auto 10px; color: #91a180; display: block; opacity: 1; }
.empty b { display: block; color: var(--navy); font-size: 13px; margin-bottom: 5px; }
.empty p { font-size: 11.5px; margin-bottom: 0; }
.empty .btn { margin-top: 15px; }
.notice, .msg { display: block; align-items: center; gap: 10px; background: #f4f7ef; border: 1px solid #d7e2ce; border-radius: 8px;
  padding: 12px 15px; color: #57684a; font-size: 11.5px; margin-bottom: 18px; line-height: 1.55; }
.notice, .msg:has(> .ico) { display: flex; }
.notice .ico, .msg > .ico { color: var(--deep); width: 17px; flex-shrink: 0; }
.msg--warning > .ico { color: #b9791b; } .msg--error > .ico, .msg--danger > .ico { color: var(--red); }
.notice .btn { margin-left: auto; }
.msg--success { background: var(--green-bg); border-color: #c6e4bd; color: var(--deep); }
.msg--warning { background: #fdf6e7; border-color: #ecd9b4; color: #7a5a12; }
.msg--error, .msg--danger { background: var(--red-bg); border-color: #efc3c5; color: var(--red-ink); }
.msg--info { background: #f4f7ef; }
.messages { margin-bottom: 20px; }
.insight { padding: 18px; border: 1px solid #e2e8d9; border-radius: 8px; background: #fafcf7; margin-bottom: 12px; }
.insight h3 { margin-bottom: 8px; }
.insight p { font-size: 11px; line-height: 1.8; color: #7c8a70; }
.audit-caption { font-size: 10px; color: #839176; line-height: 1.8; margin-top: 15px; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
input, select, textarea { font-family: var(--font-sans); font-size: 12px; color: var(--navy); padding: 9px 11px; border: 1px solid #d8e0ce;
  border-radius: 6px; background: #fff; transition: border-color .12s, box-shadow .12s; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #23aa0855; outline-offset: 1px; border-color: var(--green); }
input.bad, select.bad { border-color: var(--red); box-shadow: 0 0 0 2px #ce272d26; }
textarea { resize: vertical; min-height: 70px; }
input[type="file"] { padding: 7px; font-size: 11px; }
label, .label { font-size: 11px; font-weight: 550; color: #536448; }
.label--wide { font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.req { color: var(--red); margin-left: 2px; }
form.stack { display: flex; flex-direction: column; gap: 2px; max-width: 680px; }
.fsec { margin-bottom: 22px; }
.fsec .st { font-size: 9px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--deep); font-weight: 600; padding-bottom: 8px;
  border-bottom: 1px solid var(--row-line); margin-bottom: 14px; }
.errsum { background: var(--red-bg); border: 1px solid #efc3c5; border-left: 3px solid var(--red); border-radius: 8px; padding: 12px 16px;
  margin-bottom: 20px; font-size: 12px; color: var(--red-ink); }
.errsum b { display: block; margin-bottom: 4px; }
.formline { display: grid; grid-template-columns: 190px 1fr; gap: 14px; align-items: start; padding: 7px 0; }
.formline > label { padding-top: 9px; }
.formline > div { min-width: 0; }
.formline select, .formline textarea, .formline input:not([type="checkbox"]):not([type="radio"]) { width: 100%; }
.formline .help, .fe, .field small { font-size: 10.5px; color: var(--muted); margin-top: 5px; display: block; }
.fe { color: var(--red); }
.lf, .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 11px; min-width: 0; }
.lf label, .field label { font-weight: 550; color: #536448; font-size: 11px; letter-spacing: 0; text-transform: none; }
.lf input, .lf select, .lf textarea, .field input, .field select, .field textarea { width: 100%; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.actions { display: flex; gap: 9px; margin: 18px 0 0; flex-wrap: wrap; align-items: center; }
.actions:first-child { margin-top: 0; }
.gs-input { width: 100%; font-size: 13px; padding: 11px 14px; border-radius: 7px; border: 1px solid #d8e0ce; background: #fff; }
.segmented { display: inline-flex; border: 1px solid #dfe3d7; border-radius: 6px; padding: 3px; background: var(--head-bg); }
.segmented button, .segmented a { border: 0; background: none; color: #7b8870; padding: 5px 10px; border-radius: 4px; font-size: 10.5px; }
.segmented .active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px #191e2b15; }
.settings-row { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e8ece1; padding: 16px 0; gap: 14px; }
.settings-row:last-child { border-bottom: 0; }
.settings-row p { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.toggle { width: 33px; height: 19px; border-radius: 20px; border: 0; background: #cfd8c5; padding: 3px; display: flex; align-items: center; flex-shrink: 0; }
.toggle.active { background: var(--green); justify-content: flex-end; }
.toggle::after { content: ''; width: 13px; height: 13px; background: #fff; border-radius: 50%; }
.totals-box, .pos-totals, .cart-totals { font-size: 12px; font-variant-numeric: tabular-nums; }
.totals-box .tr, .pos-totals .tr, .cart-totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; color: #748067; }
.totals-box .tr.grand, .pos-totals .tr.grand, .cart-totals .grand { font-size: 18px; color: var(--navy); border-top: 1px solid #e9ede2; padding-top: 12px; font-weight: 600; margin-top: 8px; }
.pos-totals, .totals-box { margin-left: auto; max-width: 340px; padding-top: 10px; margin-top: 10px; border-top: 1px dashed #dce1d3; }
.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.summary-box { padding: 14px; background: #f6f8f2; border: 1px solid #e7ecdf; border-radius: 8px; }
.summary-box label { color: #7b8870; font-size: 10px; display: block; }
.summary-box b { font-size: 18px; font-weight: 600; display: block; margin-top: 7px; font-variant-numeric: tabular-nums; }

/* ── Dialogs ────────────────────────────────────────────────────────────── */
dialog:not(.drawer) { border: 1px solid #d8ded0; box-shadow: 0 25px 100px #10152240; border-radius: 13px; color: var(--navy); padding: 0;
  width: min(540px, calc(100vw - 32px)); max-height: 85vh; overflow: auto; margin: auto; background: #fff; }
dialog:not(.drawer)::backdrop { background: #141b2b65; backdrop-filter: blur(3px); }
dialog.wide, .modal.wide { width: min(780px, calc(100vw - 32px)); }
.modal-pad { padding: 22px 24px; min-width: 0; }
.modal-pad > h2 { font-size: 18px; margin-bottom: 6px; }
.modal-pad > h2 + p.muted { margin-bottom: 16px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 19px 24px; border-bottom: 1px solid #e8ece1; gap: 10px; }
.modal-head h2, .modal-head h3 { font-size: 18px; margin: 0; }
.modal-x { font-size: 20px; line-height: 1; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.modal-x:hover { color: var(--navy); background: #f1f4ee; }
.modal-body { padding: 22px 24px; }
.modal-foot { border-top: 1px solid #e8ece1; padding: 15px 24px; display: flex; justify-content: flex-end; align-items: center; gap: 9px; background: #fafcf7; }
dialog .tbl-wrap { border-radius: 8px; }
dialog .lf:last-of-type { margin-bottom: 14px; }

/* Global search (Ctrl K) */
dialog.search-dialog { width: min(670px, calc(100vw - 28px)); margin: 12vh auto 0; max-height: 75vh; }
.search-modal-input { display: flex; gap: 12px; align-items: center; padding: 17px 21px; border-bottom: 1px solid #e8ece1; }
.search-modal-input > .ico { color: #819172; width: 20px; height: 20px; }
.search-modal-input input { border: 0; outline: 0 !important; flex: 1; min-width: 0; font-size: 13px; background: none; padding: 0; box-shadow: none; }
.key-btn { font-size: 9px; border: 1px solid #dfe3d7; background: #f8faf4; color: #7b8870; padding: 3px 5px; border-radius: 4px; }
.gs-results { padding: 6px 11px 10px; overflow: auto; max-height: 43vh; }
.gs-group-title { font-size: 9px; color: #8a967e; letter-spacing: 1px; padding: 12px 10px 5px; text-transform: uppercase; font-weight: 500; }
.gs-hit { width: 100%; display: flex; gap: 11px; align-items: center; padding: 10px; border-radius: 7px; text-align: left; font-size: 11.5px; color: var(--navy); }
.gs-hit:hover, .gs-hit:focus, .gs-hit.selected { background: #f0f6ea; outline: 0; }
.gs-hit small { display: block; color: #849279; font-size: 9.5px; margin-top: 3px; }
.gs-hit > .ico { color: #748566; width: 18px; height: 18px; }
.gs-hit kbd { margin-left: auto; }
.search-footer { border-top: 1px solid #e8ece1; padding: 11px 19px; display: flex; justify-content: space-between; color: #929c88; font-size: 9px; }
.search-footer kbd { font-size: 8px; margin: 0 4px; }
.gs-empty { padding: 20px 10px; font-size: 11.5px; color: var(--muted); }

/* Notifications (bottom-right popups + bell panel) */
.agc-notify { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.agc-note { pointer-events: auto; display: flex; gap: 11px; align-items: flex-start; background: #fff; border: 1px solid var(--panel-border);
  border-radius: 10px; padding: 12px 13px; box-shadow: 0 10px 40px #191e2b1f; animation: agc-note-in .28s ease; transition: opacity .2s; }
.agc-note-ic { flex-shrink: 0; width: 29px; height: 29px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: var(--amber-bg); color: #ad750d; }
.agc-note--danger .agc-note-ic { background: var(--red-bg); color: var(--red); }
.agc-note--info .agc-note-ic { background: var(--green-bg); color: var(--deep); }
.agc-note-ic svg, .agc-note-ic .ico { width: 15px; height: 15px; }
.agc-note-body { flex: 1; min-width: 0; }
.agc-note-title { font-size: 11.5px; font-weight: 550; color: var(--navy); }
.agc-note-detail { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.agc-note-link { display: inline-block; margin-top: 6px; font-size: 10.5px; font-weight: 550; color: var(--deep); }
.agc-note-link:hover { text-decoration: underline; }
.agc-note-x { flex-shrink: 0; font-size: 18px; line-height: 1; color: var(--muted); padding: 0 2px; }
.agc-note-x:hover { color: var(--navy); }
.notification { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid #e8ece1; font-size: 12px; }
.notification:last-child { border-bottom: 0; }
.notification p { font-size: 11px; color: #809071; margin: 3px 0 5px; }
.notification a.btn-plain { font-size: 10.5px; }
@keyframes agc-note-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Toasts (Django messages) */
.toast-wrap { position: fixed; bottom: 25px; left: calc(50% + 118px); transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; max-width: 85vw; }
.toast { background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 8px; box-shadow: 0 5px 20px #191e2b22; font-size: 12px;
  display: flex; align-items: center; gap: 10px; min-width: 240px; animation: appear .18s ease; }
.toast .tk { width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 10px; font-weight: 700; }
.toast.warn .tk { background: #d98a00; }
.toast.err .tk { background: var(--red); }
@keyframes appear { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* Footer */
.footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 32px 18px; font-size: 9.5px; color: #8a9381; gap: 15px; max-width: 1750px; margin: 0 auto; width: 100%; }
.footer > span:first-child { display: flex; gap: 6px; align-items: center; }
.footer b { font-weight: 450; color: #69765f; margin-left: 8px; }
.footer button, .footer a { color: #7b8870; font-size: 9.5px; }
.footer kbd { font-size: 8px; margin-left: 6px; }
.keyboard-list { display: grid; grid-template-columns: 1fr auto; gap: 12px 14px; font-size: 12px; align-items: center; }

/* ── Skeleton / HTMX ────────────────────────────────────────────────────── */
.skel { background: linear-gradient(90deg, #eee 25%, #f5f5f2 50%, #eee 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 4px; height: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.nav-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; background: linear-gradient(90deg, #23aa08, #46b82e, #23aa08);
  background-size: 200% 100%; animation: navprog 1s linear infinite; pointer-events: none; }
@keyframes navprog { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 6vh 20px; position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 15% 8%, rgba(35,170,8,.16), transparent 45%), radial-gradient(ellipse at 85% 92%, rgba(70,184,46,.10), transparent 50%),
    linear-gradient(160deg, #1c2233, var(--navy) 55%, #12151e); }
.login-wrap::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='96' viewBox='0 0 84 96'%3E%3Cpolygon points='42,2 80,24 80,72 42,94 4,72 4,24' fill='none' stroke='%23ffffff' stroke-opacity='0.035' stroke-width='1.5'/%3E%3C/svg%3E"); }
.login-card { width: 390px; max-width: 100%; display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 1; background: #fff; border-radius: 13px;
  padding: 28px 30px 26px; border: 1px solid #ffffff14; box-shadow: 0 25px 100px #0b0f1a66; overflow: hidden; }
.login-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--green); }
.login-card form { display: flex; flex-direction: column; gap: 4px; }
.login-card .btn { margin-top: 8px; }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.login-brand .brand-name { font-size: 18px; font-weight: 750; letter-spacing: -.65px; color: var(--navy); line-height: 1.15; }
.login-brand .brand-name span { color: var(--green2); font-size: 14px; }
.login-brand .brand-division { font-size: 8px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); margin-top: 3px; font-weight: 450; }
.login-demo { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--row-line); }
.login-demo code { display: inline-block; margin: 0 6px 6px 0; font-size: 11px; }
.wordmark { font-weight: 750; letter-spacing: -.5px; font-size: 22px; color: var(--green); }
.wordmark span { color: var(--navy); font-weight: 300; letter-spacing: .12em; font-size: 13px; }

/* ── POS (counter sales) ────────────────────────────────────────────────── */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; padding: 0 32px 28px; max-width: 1750px; margin: 0 auto; width: 100%; align-items: start; }
.pos-left { min-width: 0; }
.pos-search-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.pos-search-row .input-search { max-width: none; }
.pos-search-row .input-search input { padding: 12px 0; font-size: 13px; }
.pos-categories { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.pos-products, .pos-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin: 14px 0; align-content: start; }
.product-card, .pos-tile { border: 1px solid #dfe3d7; border-radius: 10px; background: #fff; padding: 15px; text-align: left; position: relative; min-height: 150px;
  transition: .16s; display: flex; flex-direction: column; color: var(--navy); cursor: pointer; font: inherit; }
.product-card:hover, .pos-tile:hover { border-color: #8fc67c; box-shadow: 0 3px 8px #191e2b06; transform: translateY(-2px); }
.product-card .product-avatar { width: 46px; height: 45px; margin-bottom: 12px; background: #f1f3eb; }
.product-card .product-avatar .ico { width: 26px; height: 26px; }
.product-card .stock-tag { position: absolute; right: 11px; top: 13px; color: #6b7a5d; font-size: 9px; }
.product-card .stock-tag.out { color: var(--red); }
.product-card h3, .pos-tile .t-name { font-size: 11.5px; line-height: 1.4; margin-bottom: 4px; font-weight: 600; }
.product-card small, .pos-tile .t-unit { font-size: 9.5px; color: var(--muted); }
.product-card .price, .pos-tile .t-price { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; margin-top: auto; padding-top: 11px; font-variant-numeric: tabular-nums; }
.product-card .plus { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; background: var(--green-bg); color: var(--deep); font-weight: 400; font-size: 18px; line-height: 1; }
.pos-tile.oos, .product-card.oos { opacity: .55; }
.cart-panel, .pos-right { position: sticky; top: 94px; align-self: start; overflow: hidden; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--panel-border); border-radius: 11px; min-width: 0; }
.cart-title { padding: 16px 18px; border-bottom: 1px solid #e8ece1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.customer-picker, .pos-cart-head { padding: 13px 18px; background: #fcfdf9; border-bottom: 1px solid #e8ece1; display: flex; align-items: center; gap: 8px; }
.customer-picker select, .pos-cart-head select { width: 100%; padding: 9px; border-radius: 6px; border: 1px solid #dfe3d7; background: #fff; font-size: 11.5px; }
.cart-items, .pos-cart { padding: 0 18px; min-height: 120px; max-height: 46vh; overflow: auto; }
.cart-line, .pos-line { padding: 13px 0; border-bottom: 1px solid #edf0e7; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.cart-line:last-child, .pos-line:last-child { border: 0; }
.cart-line h3, .pos-line .l-name { font-size: 11.5px; font-weight: 600; }
.pos-line .l-sub { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; grid-column: 1 / -1; }
.pos-line .l-amt { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.quantity, .qtybox { display: inline-flex; align-items: center; border: 1px solid #dfe3d7; border-radius: 5px; overflow: hidden; width: max-content; background: #fff; }
.quantity button, .qtybox button { width: 23px; height: 23px; border: 0; background: #f7f9f3; font-size: 13px; line-height: 1; }
.quantity button:hover, .qtybox button:hover { background: #e8efe0; }
.quantity b { padding: 0 9px; font-size: 10.5px; font-weight: 500; }
.qtybox input { width: 48px; text-align: center; border: 0; border-left: 1px solid #e8ece1; border-right: 1px solid #e8ece1; border-radius: 0; padding: 3px 2px; font-size: 11px; height: 23px; }
.qtybox input:focus { outline: 0; }
.pos-line .price-input { width: 72px; font-size: 11px; padding: 3px 6px; height: 23px; border-radius: 5px; }
.cart-totals, .pos-right .pos-totals { border-top: 1px dashed #dce1d3; padding: 14px 18px; margin: 0; max-width: none; }
.cart-actions, .pos-actions { padding: 0 18px 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.cart-actions > .btn-primary, .pos-actions .btn--pay { width: 100%; order: 2; font-size: 12px; padding: 12px; min-height: 42px; }
.cart-actions > .btn:not(.btn-primary), .pos-actions > .btn:not(.btn--pay), .pos-actions > form { flex: 1; }
.pos-actions > form .btn { width: 100%; }
.pos-empty { padding: 28px 0; text-align: center; color: var(--muted); font-size: 11.5px; }
.pos-empty .ico { width: 26px; height: 26px; color: #91a180; margin-bottom: 8px; }
.pos-results { margin-bottom: 12px; }
.pos-results .panel { padding: 6px; }

/* Payment / success */
.tender { max-width: 560px; margin: 0 auto; }
.tender-due, .pay-amount { text-align: center; padding: 10px 0 4px; }
.tender-due .lab { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); font-weight: 550; }
.tender-due .amt, .pay-total { font-size: 34px; font-weight: 600; letter-spacing: -1px; color: var(--navy); font-variant-numeric: tabular-nums; margin: 7px 0 0; }
.tender-due .amt.change { color: var(--deep); }
.pay-total small { font-size: 16px; letter-spacing: 0; color: #8a977e; font-weight: 400; }
.pay-options, .tender-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 20px 0 14px; }
.pay-option, .tender-kind { padding: 13px 5px; border: 1px solid #dfe5d7; background: #fff; border-radius: 7px; font-size: 11px; text-align: center; font-weight: 500; cursor: pointer; }
.pay-option.active, .tender-kind.on { border-color: var(--green); color: var(--deep); background: #f1f9ed; }
.pay-option .ico, .tender-kind .ico { display: block; margin: 0 auto 7px; width: 20px; height: 20px; }
.quick-amts { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.quick-amts button { padding: 9px 14px; border-radius: 7px; border: 1px solid #dfe3d7; background: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.quick-amts button:hover { border-color: var(--green); color: var(--deep); }
.split-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.split-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: #f6f8f2; border: 1px solid #e7ecdf; border-radius: 7px; font-size: 12px; font-variant-numeric: tabular-nums; }
.success-screen { text-align: center; }
.card.success-screen { padding-top: 30px; padding-bottom: 28px; }
.success-screen > h2 { justify-content: center; margin-bottom: 4px; }
.success-screen .summary-grid { text-align: left; margin-top: 20px; }
.success-screen .actions { justify-content: center; margin-top: 22px; }
.success-circle { width: 60px; height: 60px; border-radius: 50%; background: var(--green-bg); display: flex; align-items: center; justify-content: center; color: var(--deep); margin: 0 auto 18px; }
.success-circle .ico { width: 28px; height: 28px; }
.success-screen p { color: #7e8c72; font-size: 11.5px; line-height: 1.8; margin-top: 10px; }
.receipts { display: flex; flex-direction: column; gap: 8px; }
.receipt { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: #f6f8f2; border: 1px solid #e7ecdf; border-radius: 8px; font-size: 12px; }
.receipt .ck { width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; }
.receipt .r { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); }

/* ── Workshop board ─────────────────────────────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; padding: 18px; }
.kanban-col { background: #dfe1d84d; border: 1px solid #d8ddd0; border-radius: 10px; padding: 12px; min-height: 320px; }
.kanban-head { display: flex; align-items: center; gap: 7px; margin: 0 0 14px; font-size: 11px; font-weight: 550; }
.kanban-head i { width: 6px; height: 6px; border-radius: 50%; background: #87947d; }
.kanban-head i.warn { background: #d98a00; } .kanban-head i.ok { background: var(--green); } .kanban-head i.navy { background: var(--navy); }
.kanban-head b { margin-left: auto; font-size: 10px; font-weight: 500; color: #7f8b73; }
.job-card { display: block; border: 1px solid #dfe3d7; background: #fff; border-radius: 8px; padding: 13px; margin-bottom: 11px; cursor: pointer; transition: .15s; color: var(--navy); }
.job-card:hover { box-shadow: 0 5px 12px #191e2b08; transform: translateY(-1px); border-color: #b4cda4; }
.job-card h3 { font-size: 11.5px; margin: 10px 0 4px; line-height: 1.45; }
.job-card p { font-size: 10.5px; color: #7c8873; }
.job-bottom { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #edf0e7; margin-top: 12px; padding-top: 9px; font-size: 9.5px; color: #7c8873; gap: 8px; }
.job-bottom .avatar { width: 22px; height: 22px; font-size: 8px; }
.job-card .badge { font-size: 8.5px; }
.kanban-empty { font-size: 10.5px; color: #8a9483; padding: 10px 4px; text-align: center; }

/* Reports / team / accounts */
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.report-card { padding: 22px; text-align: left; display: block; color: var(--navy); }
.report-card:hover { border-color: #8fc67c; }
.report-card > .ico { color: var(--deep); width: 23px; height: 23px; margin-bottom: 17px; }
.report-card h3 { font-size: 13px; }
.report-card p { font-size: 11px; color: var(--muted); margin: 7px 0 16px; line-height: 1.7; }
.report-card span { font-size: 10.5px; color: var(--deep); font-weight: 550; }
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.person-card { padding: 21px; display: flex; align-items: center; gap: 13px; text-align: left; }
.person-card .avatar { width: 42px; height: 42px; font-size: 13px; }
.person-card p { font-size: 10px; color: var(--muted); margin: 4px 0 8px; }
.account-card { border: 1px solid #dfe4d5; border-radius: 8px; padding: 15px; display: flex; align-items: center; gap: 11px; margin-bottom: 10px; color: var(--navy); background: #fff; }
.account-card:hover { border-color: #b4cda4; }
.account-card .account-icon { width: 35px; height: 35px; border-radius: 8px; background: #eff3e8; display: flex; align-items: center; justify-content: center; color: #6a7c56; flex-shrink: 0; }
.account-card h3 { font-size: 11.5px; }
.account-card p { font-size: 9.5px; color: var(--muted); margin-top: 3px; }
.account-card b { margin-left: auto; font-size: 14px; font-weight: 550; font-variant-numeric: tabular-nums; white-space: nowrap; }
.breakdown-bar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; margin: 16px 0; background: #e7ecdf; }
.breakdown-bar i { display: block; }
.block-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.block-card { padding: 18px; border: 1px solid #dfe5d7; border-radius: 8px; text-align: left; background: #fff; }
.block-card h3 { margin: 12px 0 6px; font-size: 12px; }
.block-card p { color: var(--muted); font-size: 10px; }

/* Inline charts (legacy bar rows) */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 74px; align-items: center; gap: 12px; font-size: 12px; }
.bar-track { height: 18px; background: #eef1e9; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--green); min-width: 3px; }
.bar-row .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.feed, .activity { list-style: none; display: flex; flex-direction: column; }
.feed li, .activity li { padding: 9px 0; border-bottom: 1px solid var(--row-line); font-size: 12px; }
.feed li:last-child, .activity li:last-child { border-bottom: 0; }
.audit-red, .audit-red td { color: var(--red) !important; font-weight: 600; }

/* ── Misc ───────────────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--green2); outline-offset: 2px; border-radius: 3px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5c7c4; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@supports not (font-variation-settings: normal) { body { font-family: Arial, Helvetica, sans-serif; } }
.tabbar, dialog.drawer { display: none; }
.ios-hint { position: fixed; left: 12px; right: 12px; z-index: 90; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--navy); color: #fff; font-size: 12px; line-height: 1.5; border-radius: 12px; box-shadow: 0 10px 40px #191e2b40; padding: 12px 14px; }
.ios-hint svg { width: 16px; height: 16px; vertical-align: -3px; color: var(--green2); }
.ios-hint b { color: var(--green2); }
.ios-hint button { margin-left: auto; color: #c5c7c4; font-size: 20px; line-height: 1; min-width: 44px; min-height: 44px; }
.offline-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 95; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--red); color: #fff;
  font-size: 12px; font-weight: 600; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.offline-banner svg { width: 15px; height: 15px; flex-shrink: 0; }
.offline-banner.hidden { display: none; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (min-width: 1550px) {
  .topbar, .pagehead, .body, .footer, .pos { padding-left: 40px; padding-right: 40px; }
  .pagehead { padding-top: 36px; }
  .kpi, .metric { padding: 20px; }
  .sales-chart svg { height: 210px; }
  table.data td, .data-table td { padding-top: 14px; padding-bottom: 14px; }
}
@media (max-width: 1200px) {
  .shell:not(.shell--auth) { grid-template-columns: 214px minmax(0, 1fr); }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .nav a.active::before { left: -12px; }
  .brand { gap: 7px; } .brand > span { font-size: 17px; } .brand strong { font-size: 12px; }
  .topbar { padding: 0 23px; gap: 14px; }
  .pagehead, .body, .footer, .pos { padding-left: 23px; padding-right: 23px; }
  .pagehead { padding-top: 25px; }
  .global-search { width: 230px; }
  .concept-tag span { display: none; }
  .kpis, .metrics { gap: 11px; }
  .kpi, .metric { padding: 15px 13px; }
  .spark { width: 48px; right: 10px; opacity: .6; }
  .g-main, .flow, .dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(265px, 1fr); }
  .pos { grid-template-columns: minmax(0, 1fr) 300px; }
  .kanban { gap: 10px; padding: 12px; } .kanban-col { padding: 9px; } .job-card { padding: 11px; }
  .tabs { gap: 20px; }
  .toast-wrap { left: calc(50% + 107px); }
}
@media (max-width: 1000px) {
  .topbar .breadcrumb { display: none; }
  .global-search { margin-left: 0; max-width: none; width: 300px; }
  .concept-tag { margin-left: auto; }
  .g-main, .flow, .dashboard-grid, .finance-grid { grid-template-columns: 1fr; }
  .quick-strip { grid-template-columns: repeat(2, 1fr); }
  .page-actions { flex-wrap: wrap; }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kanban-col { min-height: 200px; }
  .report-grid, .team-grid { grid-template-columns: repeat(2, 1fr); }
  .pos { grid-template-columns: 1fr; } .cart-panel, .pos-right { position: static; }
  .block-grid { grid-template-columns: repeat(2, 1fr); }
  .footer > span:nth-child(2) { display: none; }
  .ph-row h1 { font-size: 25px; }
}
@media (max-height: 850px) and (min-width: 821px) {
  .sidebar { padding-top: 21px; } .brand { margin-bottom: 18px; } .workspace-switch { margin-bottom: 16px; }
  .nav a { padding-top: 7px; padding-bottom: 7px; } .nav .nav-section { margin-top: 10px; }
  .pinned-label { margin-top: 16px; } .sidebar-bottom { padding-top: 12px; } .profile { padding-top: 12px; margin-top: 10px; }
}
@media (max-width: 820px) {
  .shell, .shell:not(.shell--auth) { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .menu-toggle { display: inline-flex; }
  .topbar { height: 63px; padding: 0 15px; gap: 10px; position: static; }
  .global-search { width: auto; flex: 1; max-width: none; }
  .global-search kbd { display: none; }
  .concept-tag { display: none; }
  .top-avatar { display: none; }
  .pagehead { padding: 20px 16px 0; margin-bottom: 18px; }
  .body, .pos { padding: 0 14px calc(84px + env(safe-area-inset-bottom, 0px)); }
  .body:first-child, .pos:first-child { padding-top: 20px; }
  .footer { padding: 12px 16px calc(80px + env(safe-area-inset-bottom, 0px)); font-size: 8.5px; }
  .ph-row h1 { font-size: 23px; }
  .ph-sub { font-size: 11px; }
  .formline { grid-template-columns: 1fr; gap: 4px; }
  .formline > label { padding-top: 0; }
  .form-row { grid-template-columns: 1fr; }
  .kpis, .metrics { gap: 10px; margin-bottom: 17px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi, .metric { padding: 15px 13px; min-height: 96px; }
  .kpi .val, .metric-value { font-size: clamp(16px, 8.2cqw, 24px); }
  .kpi .lab .ico, .metric-label .ico { display: none; }
  .spark { width: 45px; right: 11px; }
  .quick-strip { gap: 9px; } .quick-card > .ico:last-child { display: none; }
  .chart-total { font-size: 22px; } .chart-summary { gap: 9px; padding: 18px 15px 0; }
  .panel-head { padding: 17px 15px 0; } .panel-body { padding: 16px; } .card { padding: 16px; }
  .card > .tbl-wrap, .card > form > .tbl-wrap { margin-left: -16px; margin-right: -16px; }
  .card > .tbl-wrap:last-child { margin-bottom: -16px; } .card > .tbl-wrap:first-child { margin-top: -16px; }
  .grid-2 { grid-template-columns: 1fr; gap: 14px; }
  .list-panel > .toolbar, .toolbar { gap: 8px; }
  .list-panel > .toolbar { padding: 13px; }
  .search, .input-search { max-width: none; flex-basis: 100%; min-width: 0; }
  .toolbar .count { margin-left: 0; }
  table.data td, .data-table td { padding: 11px 13px; }
  table.data th, .data-table th { padding: 10px 13px; }
  .kanban { grid-template-columns: 1fr; gap: 9px; }
  .pos-products, .pos-tiles { grid-template-columns: repeat(2, 1fr); }
  .report-grid, .team-grid { grid-template-columns: 1fr; }
  .pay-options, .tender-kinds { grid-template-columns: repeat(3, 1fr); }
  .modal-head, .modal-body, .modal-pad { padding: 18px; }
  .modal-head h2 { font-size: 17px; }
  .toast-wrap { left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .agc-notify { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .ios-hint { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .statusbar .st, .steps .step { font-size: 9px; }

  /* Touch sizing: Safari zooms inputs under 16px; targets need 44px. */
  input, select, textarea { font-size: 16px; padding: 11px 13px; }
  .search input, .input-search input { font-size: 16px; }
  .btn { padding: 12px 16px; min-height: 44px; font-size: 12px; }
  .btn--sm, .btn-sm { min-height: 38px; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions > .btn, .actions > a.btn, .actions > button { width: 100%; }
  .qa a, .qa button { width: 40px; height: 40px; }
  .chip { padding: 9px 13px; }
  .tbl-wrap { -webkit-overflow-scrolling: touch; }

  /* Bottom tab bar */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: var(--navy); border-top: 1px solid #2b3240;
    padding: 4px env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px;
    min-width: 44px; padding: 6px 2px; color: #9aa6b8; font-size: 9px; font-weight: 500; letter-spacing: .3px; }
  .tabbar .ico, .tabbar svg { width: 20px; height: 20px; }
  .tabbar a.active, .tabbar a[aria-current="page"] { color: var(--green2); }

  /* Drawer ("More" / hamburger): the full sidebar as a sheet */
  dialog.drawer[open] { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100dvh; max-height: 100dvh;
    max-width: none; margin: 0; border: 0; overflow-y: auto; padding: 20px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    background: var(--navy); color: #b9c0cd; box-shadow: 15px 0 50px #191e2b40; animation: drawer-in .2s ease both; border-top: 3px solid var(--green); }
  dialog.drawer::backdrop { background: #19202e73; }
  @keyframes drawer-in { from { transform: translateX(-24px); } to { transform: none; } }
  .drawer-head { display: flex; align-items: center; gap: 10px; padding: 0 2px 16px 6px; color: #fff; }
  .drawer-head .brand { margin: 0; }
  .drawer-x { margin-left: auto; color: #c5c7c4; font-size: 26px; line-height: 1; min-width: 44px; min-height: 44px; }
  .drawer .nav a { padding: 11px 12px; }
  .drawer-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid #303745; display: flex; align-items: center; gap: 9px; color: #fff; }
  .drawer-foot .who { font-size: 11px; font-weight: 550; min-width: 0; }
  .drawer-foot .who small { display: block; color: #9aa6b7; font-size: 10px; font-weight: 400; }
  .drawer-foot form { margin-left: auto; }
  .drawer-foot .btn { background: #232a39; color: #edf0f4; border-color: #343b4a; min-height: 36px; padding: 8px 12px; font-size: 11px; }

  /* Field-flow tables become stacked cards (opt-in: .tbl--cards + data-label). */
  table.data.tbl--cards { display: block; }
  table.data.tbl--cards thead, table.data.tbl--cards tr:first-child:has(th) { display: none; }
  table.data.tbl--cards tbody { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
  table.data.tbl--cards tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
  table.data.tbl--cards tbody tr:hover td { background: #fff; }
  table.data.tbl--cards tbody td { display: block; border-bottom: 0; padding: 5px 0; }
  table.data.tbl--cards tbody td.num { text-align: left; }
  table.data.tbl--cards tbody td[data-label]::before { content: attr(data-label); display: block; font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase;
    color: var(--muted); font-weight: 550; margin-bottom: 1px; }
  table.data.tbl--cards tbody td.card-lead { order: -1; grid-column: 1 / -1; border-bottom: 1px solid var(--row-line); padding-bottom: 7px; margin-bottom: 3px; }
  table.data.tbl--cards .lowpri { display: none; }
}
@media (max-width: 480px) {
  /* Phones keep two figure tiles per row — one per row made every page a long scroll. */
  .kpis, .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi, .metric { padding: 12px 12px 11px; min-height: 0; }
  .kpi .val, .metric-value { font-size: clamp(15px, 9cqw, 21px); }
  .kpi .lab, .metric-label { font-size: 10px; }
  .kpi .dl { font-size: 10px; line-height: 1.3; }
  .kpi--wide { grid-column: 1 / -1; }
  .pos-products, .pos-tiles { grid-template-columns: repeat(2, 1fr); }
  .pay-options, .tender-kinds { grid-template-columns: repeat(2, 1fr); }
  .summary-grid { grid-template-columns: 1fr; }
  .chart-bottom { grid-template-columns: 1fr 1fr; }
  .quick-strip { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .topbar, .footer, .tabbar, .agc-notify, .toast-wrap, .backbtn, .page-actions, .ph-row .btn, .ph-row form { display: none !important; }
  .shell { display: block; } .body, .pagehead { padding: 0; max-width: none; }
  .card, .panel, .tbl-wrap { border-color: #ccc; box-shadow: none; }
}

/* Profile dialog header */
.profile-card { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.profile-card .avatar { width: 45px; height: 45px; font-size: 14px; }
.profile-card h3 { font-size: 14px; }

/* Sweep helpers (replace one-off inline styles) */
.stack-cards { display: grid; gap: 19px; }
table.data td.indent { padding-left: 32px; }
table.data tr.total td { font-weight: 600; background: #fcfcfa; }
table.data tr.total.grand td { border-top: 2px solid var(--navy); font-size: 13px; }
table.data tr.muted td { color: var(--muted); font-weight: 400; background: #fff; }
.ph-row form.toolbar input[type="date"], .ph-row form input[type="date"] { padding: 7px 9px; font-size: 11.5px; }
.ph-row form select { padding: 7px 9px; font-size: 11.5px; }
.kpi .val--text { font-size: 16px; white-space: normal; letter-spacing: -.2px; line-height: 1.35; }
.card--narrow { max-width: 720px; }
.card--mid { max-width: 960px; }
/* Popups: never bury the page — four at most, two on a phone. */
.agc-notify > div { display: flex; flex-direction: column; gap: 10px; }
.agc-notify > div:empty { display: none; }
.agc-notify > div > .agc-note:nth-child(n+4) { display: none; }
@media (max-width: 820px) { .agc-notify > div > .agc-note:nth-child(n+2) { display: none; } }

/* ── Searchable select (core/static/core/js/select.js) ─────────────────── */
.agc-select { position: relative; display: inline-block; min-width: 0; max-width: 100%; vertical-align: middle; }
.formline .agc-select, .lf .agc-select, .field .agc-select, .customer-picker .agc-select, .pos-cart-head .agc-select, .picker-row .agc-select { width: 100%; }
.agc-select-native { position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; margin: 0; padding: 0; border: 0; }
.agc-select-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; text-align: left; background: #fff; border: 1px solid #d8e0ce;
  border-radius: 6px; padding: 8px 9px 8px 11px; font-size: 12px; color: var(--navy); cursor: pointer; line-height: 1.35; transition: border-color .12s, box-shadow .12s; }
.agc-select-btn:hover { border-color: #b4cda4; }
.agc-select-btn:focus-visible, .agc-select.open .agc-select-btn { outline: 2px solid #23aa0855; outline-offset: 1px; border-color: var(--green); }
.agc-select-btn.placeholder .agc-select-label { color: #8a9383; }
.agc-select-btn.bad { border-color: var(--red); box-shadow: 0 0 0 2px #ce272d26; }
.agc-select-btn:disabled { opacity: .55; cursor: not-allowed; }
.agc-select-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agc-select-btn > .ico { width: 14px; height: 14px; color: #7f8879; flex-shrink: 0; transition: transform .15s; }
.agc-select.open .agc-select-btn > .ico { transform: rotate(180deg); }
.agc-select--sm .agc-select-btn { min-height: 26px; padding: 3px 6px 3px 8px; font-size: 10.5px; }
.agc-select-pop { position: fixed; z-index: 120; background: #fff; border: 1px solid #d8ded0; border-radius: 9px; box-shadow: 0 18px 50px #10152226; overflow: hidden;
  animation: agc-pop .12s ease; }
.agc-select-pop.up { animation-name: agc-pop-up; }
.agc-select-search { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid #e8ece1; background: #fafbf7; }
.agc-select-search .ico { width: 15px; height: 15px; color: #819172; flex-shrink: 0; }
.agc-select-search input { flex: 1; min-width: 0; border: 0; background: none; padding: 3px 0; font-size: 12px; outline: 0 !important; box-shadow: none; }
.agc-select-list { max-height: 272px; overflow-y: auto; padding: 5px; }
.agc-select-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; font-size: 11.5px; color: var(--navy); background: none; border: 0; cursor: pointer; }
.agc-select-opt .ico { width: 13px; height: 13px; margin-left: auto; color: var(--deep); visibility: hidden; flex-shrink: 0; }
.agc-select-opt:hover, .agc-select-opt:focus-visible { background: #f0f6ea; outline: 0; }
.agc-select-opt.selected { background: #e3f1dc; color: var(--deep); font-weight: 550; }
.agc-select-opt.selected .ico { visibility: visible; }
.agc-select-opt.disabled { opacity: .45; cursor: not-allowed; }
.agc-select-group { font-size: 9px; color: #8a967e; letter-spacing: 1px; text-transform: uppercase; padding: 9px 10px 4px; font-weight: 500; }
.agc-select-empty { padding: 14px 10px; font-size: 11.5px; color: var(--muted); text-align: center; }
.picker-row { display: flex; gap: 8px; align-items: center; }
.picker-row .agc-select { flex: 1; }
@keyframes agc-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes agc-pop-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 820px) {
  .agc-select-btn { min-height: 46px; font-size: 16px; padding: 10px 11px 10px 13px; }
  .agc-select--sm .agc-select-btn { min-height: 38px; font-size: 13px; }
  .agc-select-search input { font-size: 16px; }
  .agc-select-opt { padding: 11px 12px; font-size: 14px; }
  .agc-select-list { max-height: 50vh; }
  /* Rows of controls line up on a phone too. */
  input, select, textarea { padding: 10px 13px; min-height: 46px; }
  textarea { min-height: 90px; }
  .toolbar .btn, .toolbar .btn.btn--sm, .toolbar > form > .btn.btn--sm, .picker-row .btn, .actions .btn { min-height: 46px; padding-top: 10px; padding-bottom: 10px; }
  .toolbar > input, .toolbar > select, .ph-row form input[type="date"], .ph-row form select { min-height: 46px; }
}
/* Page actions may wrap instead of pushing the header wider than the screen. */
.page-actions { flex-shrink: 1; min-width: 0; max-width: 100%; }

/* Polish pass: equal control heights in header/action rows, clearer sub-lines */
.ph-row .btn, .page-actions .btn, .ph-row .btn--sm, .page-actions .btn--sm { min-height: 35px; padding: 8px 13px; font-size: 11px; }
.ph-row .badge { top: 0; align-self: center; }
.kpi .dl, .metric-note { font-size: 10.5px; margin-top: 2px; }
.kpi .dl b { font-weight: 600; }
.kpi .val small { margin-left: 2px; }
table.data td .btn--sm, table.data td .btn { min-height: 29px; }
h2 .r { font-size: 11px; }
/* Click-to-sort headers (core/js/tables.js) */
table.data th.sortable-js { cursor: pointer; user-select: none; }
table.data th.sortable-js:hover { color: var(--navy); background: #f3f5ee; }
table.data th.sort-asc::after { content: " ▲"; font-size: 8px; color: var(--deep); }
table.data th.sort-desc::after { content: " ▼"; font-size: 8px; color: var(--deep); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
/* Quick action + pinned views sit above the navigation */
.quick-top { margin-bottom: 18px; }
.sidebar .pinned-label { margin-top: 0; }
.sidebar .pins { margin-bottom: 18px; }
.sidebar-bottom { padding-top: 14px; }

/* ── Communication ─────────────────────────────────────────────────────── */
.comms { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 19px; align-items: start; }
.comms-list { padding: 0; max-height: calc(100vh - 230px); display: flex; flex-direction: column; }
.comms-list > .toolbar { padding: 12px; border-bottom: 1px solid #e8ece1; margin: 0; }
.comms-list .input-search { max-width: none; }
.conv-items { overflow-y: auto; padding: 6px; }
.conv-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; color: var(--navy); }
.conv-item:hover { background: #f4f7ef; }
.conv-item.active { background: #e3f1dc; }
.conv-avatar { width: 34px; height: 34px; font-size: 11px; }
.conv-avatar .ico { width: 16px; height: 16px; }
.conv-avatar.customer { background: #e8f7e5; color: var(--deep); } .conv-avatar.supplier { background: #edf2f5; color: var(--slate); } .conv-avatar.group { background: #fbf1df; color: #ad750d; }
.conv-copy { min-width: 0; flex: 1; }
.conv-copy b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-copy small { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 9.5px; color: #969d91; }
.nav-count.unread { background: var(--green); color: #fff; }
.comms-thread { padding: 0; min-height: calc(100vh - 230px); display: flex; flex-direction: column; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #e8ece1; }
.thread-title h2 { margin: 0; } .thread-title p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.thread-body { flex: 1; display: flex; flex-direction: column; }
.messages-scroll { flex: 1; overflow-y: auto; padding: 18px; max-height: calc(100vh - 420px); min-height: 260px; display: flex; flex-direction: column; gap: 10px; }
.bubble-row { display: flex; gap: 9px; align-items: flex-end; max-width: 78%; }
.bubble-row.mine { margin-left: auto; flex-direction: row-reverse; }
.bubble-avatar { width: 26px; height: 26px; font-size: 9px; flex-shrink: 0; }
.bubble { background: #f4f6f0; border: 1px solid #e6eadf; border-radius: 12px 12px 12px 4px; padding: 9px 12px; font-size: 12.5px; line-height: 1.5; min-width: 120px; }
.bubble-row.mine .bubble { background: var(--navy); color: #fff; border-color: var(--navy); border-radius: 12px 12px 4px 12px; }
.bubble-row.mine .bubble .badge { background: #ffffff22; color: #e8f0e4; }
.bubble-row.mine .bubble .badge.success { background: #23aa0844; color: #b6efa6; }
.bubble-row.theirs .bubble { background: #fff; }
.bubble-note { background: #fff8e8; border-color: #efe0bd; border-style: dashed; }
.bubble-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.bubble-row.mine .bubble-meta { color: #b9c0cd; }
.bubble-subject { font-weight: 600; margin-bottom: 3px; }
.bubble-error { font-size: 10.5px; color: var(--red); margin-top: 4px; }
.bubble-time { font-size: 9.5px; color: #969d91; margin-top: 5px; }
.bubble-row.mine .bubble-time { color: #9aa6b7; }
.bubble-row.mine .bubble-time a { color: #8ee074; }
.composer { border-top: 1px solid #e8ece1; padding: 12px 16px 14px; background: #fcfdf9; display: flex; flex-direction: column; gap: 8px; }
.composer-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.composer-row textarea { flex: 1; min-height: 44px; resize: vertical; }
.composer-subject { width: 100%; }
#handoff-notice { margin: 0 16px 10px; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 12px; max-height: 240px; overflow: auto; padding: 4px 0; }
.member { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 450; color: var(--navy); }
@media (max-width: 1000px) { .comms { grid-template-columns: 1fr; } .comms-list { max-height: 320px; } .comms-thread { min-height: 0; } }
/* Multi-select (chips + search) */
.agc-multi { position: relative; width: 100%; }
.agc-multi-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 6px 8px; border: 1px solid #d8e0ce; border-radius: 6px; background: #fff; cursor: text; }
.agc-multi.open .agc-multi-box, .agc-multi-box:focus-within { outline: 2px solid #23aa0855; outline-offset: 1px; border-color: var(--green); }
.agc-multi-box.bad { border-color: var(--red); box-shadow: 0 0 0 2px #ce272d26; }
.agc-multi-chips { display: contents; }
.agc-chip { display: inline-flex; align-items: center; gap: 4px; background: #e3f1dc; color: var(--deep); border: 1px solid #b4cda4; border-radius: 6px; padding: 3px 4px 3px 9px; font-size: 11.5px; font-weight: 550; }
.agc-chip-x { color: var(--deep); font-size: 15px; line-height: 1; padding: 0 4px; border-radius: 4px; }
.agc-chip-x:hover { background: #cfe6c4; }
.agc-multi-input { flex: 1; min-width: 140px; border: 0 !important; outline: 0 !important; box-shadow: none !important; padding: 4px 2px !important; min-height: 0 !important; font-size: 12px !important; background: none; }
/* Message notifications (separate from alerts) */
.msg-button .msg-badge { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--green); color: #fff; font-size: 9.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fafaf7; }
.msg-button.has-alerts i { display: none; }
.agc-note--msg { border-color: #b4cda4; }
.agc-note--msg .agc-note-ic { background: var(--green-bg); color: var(--deep); }
a.notification { color: var(--navy); }
a.notification:hover b { color: var(--deep); }

/* Held sales (counter) */
.held { margin-bottom: 14px; }
.held-head { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 8px; }
.held-head .ico { width: 15px; height: 15px; color: #ad750d; }
.held-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
.held-card { flex: 0 0 220px; scroll-snap-align: start; background: #fff8e8; border: 1px solid #efe0bd; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.held-top { display: flex; align-items: center; gap: 6px; }
.held-top b { font-size: 12px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.held-top .agc-chip-x { color: #9b6100; }
.held-card small { font-size: 10.5px; color: #7a6a3f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.held-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; font-weight: 600; font-size: 13px; }
.cart-bar { display: none; }
@media (max-width: 820px) {
  .held-card { flex-basis: 200px; }
  /* Phone counter: the cart is a bottom sheet above the tab bar. */
  .pos { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .pos-right { position: fixed; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom, 0px)); z-index: 65; border-radius: 14px 14px 0 0; border-bottom: 0;
    max-height: 78vh; transform: translateY(calc(100% - 62px)); transition: transform .22s ease; box-shadow: 0 -10px 40px #191e2b26; }
  .pos-right.open { transform: none; }
  .cart-bar { display: flex; align-items: center; gap: 10px; width: 100%; height: 62px; padding: 0 18px; background: var(--navy); color: #fff; border-radius: 14px 14px 0 0; font-size: 13px; font-weight: 600; text-align: left; }
  .cart-bar b { margin-left: auto; font-size: 16px; }
  .cart-bar-hint { font-size: 10px; font-weight: 400; color: #9aa6b7; }
  .pos-right.open .cart-bar-hint { visibility: hidden; }
  .cart-bar .ico { width: 17px; height: 17px; }
  .pos-right .cart-title { display: none; }
  .cart-items, .pos-cart { max-height: 34vh; }
  .product-card { min-height: 128px; padding: 12px; }
  .product-card .product-avatar { width: 36px; height: 36px; margin-bottom: 8px; }
}
/* Landed cost per item (PO page) */
table.data td.cost-rows-cell { padding: 14px 16px 18px; background: #fcfcfa; }
table.data.cost-rows { border: 1px solid #e5e8df; border-radius: 8px; overflow: hidden; }
table.data.cost-rows tr.grp-row td { background: #fff; }
table.data.cost-rows tr.grp-row:hover td { background: #f4f7ef; }
table.data.cost-rows tr.detail > td { padding: 10px 14px 14px; background: #f6f8f2; }
table.data.breakdown { border: 1px solid #e5e8df; border-radius: 6px; font-size: 11.5px; background: #fff; }
.expander .ico { width: 14px; height: 14px; }
/* One figure card holding three equal figures (item page: sold this month / year / to date) */
.kpi--wide { grid-column: span 2; }
.kpi-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.kpi-split .lab { font-size: 10px; color: #7b8576; }
.kpi-split .val { font-size: clamp(17px, 3.6cqw, 27px); margin: 6px 0 4px; }
.kpi-split .dl { margin-top: 0; }
@media (max-width: 480px) { .kpi--wide { grid-column: auto; } .kpi-split { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .kpi-split .val { font-size: 17px; } .kpi-split .dl { font-size: 10px; } }
/* Danger figure card (overdue money) */
.kpi.danger { background: linear-gradient(180deg, #fff7f7, #fff); border-color: #efc3c5; }
.kpi.danger .val { color: var(--red-ink); }
/* Item photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo { margin: 0; border: 1px solid #e5e8df; border-radius: 10px; overflow: hidden; background: #fff; position: relative; }
.photo.main { border-color: #8fc67c; box-shadow: 0 0 0 2px #e3f1dc; }
.photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px; }
.photo-drop { display: flex; align-items: center; gap: 10px; min-height: 150px; border: 1px dashed #c9d0bf; border-radius: 10px; padding: 14px; cursor: pointer; color: #6b7c5d; background: #fafcf7; }
.photo-drop:hover { border-color: var(--green); background: #f1f9ed; }
.photo-drop .ico { width: 22px; height: 22px; color: var(--deep); }
.photo-drop small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.product-avatar.has-photo { padding: 0; overflow: hidden; background: #fff; }
.product-avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card .product-avatar.has-photo { width: 100%; height: 96px; border-radius: 8px; margin-bottom: 10px; }
.result-thumb { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }

/* ---- Visual run-through (Oct 2026): fixed layouts so tiles never orphan ---- */
.kpis--item { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis--item > .kpi { grid-column: span 2; }
.kpis--item > .kpi--wide { grid-column: span 3; }
.grid-13 { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 19px; align-items: start; }
.grid-13 .resale .secondary { white-space: normal; max-width: 170px; margin-left: auto; }
.grid-13 .resale table.data th, .grid-13 .resale table.data td { padding-left: 10px; padding-right: 10px; }
.grid-13 > * { min-width: 0; }
.grid-13 + .grid-2, .grid-13 + .card, .card + .grid-13, .kpis + .grid-13 { margin-top: 19px; }
.kpis + .grid-13 { margin-top: 0; }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.photo-drop { min-height: 118px; padding: 10px; }
.photo figcaption { padding: 6px; }
.more-row td { text-align: center; color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) {
  .kpis--item { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis--item > .kpi { grid-column: span 1; }
  .kpis--item > .kpi--wide { grid-column: span 2; }
  .grid-13 { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 480px) { .kpis--item { grid-template-columns: 1fr; } .kpis--item > .kpi, .kpis--item > .kpi--wide { grid-column: auto; } }
#agc-notify { transition: opacity .35s, transform .35s; }
#agc-notify.tucked { opacity: 0; transform: translateY(12px); pointer-events: none; }
#agc-notify.tucked .agc-note { pointer-events: none; }

/* ---- Phone (SIP softphone) ---- */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .field--wide { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 10px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--navy); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--green); }
.call-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border: 1px solid #cfe3c6; border-radius: 999px; background: #f1f9ed; color: #1f6b12; font-size: 10.5px; font-weight: 600; text-decoration: none; vertical-align: middle; line-height: 1.5; white-space: nowrap; }
.call-chip .ico { width: 11px; height: 11px; }
.call-chip:hover { background: var(--green); border-color: var(--green); color: #fff; }
.kpi .val .call-chip { font-size: 10.5px; position: relative; top: -3px; }
.phone-button { position: relative; }
.phone-button i { display: none; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); border: 1.5px solid #fff; }
.phone-button.ready i, .phone-button.in-call i { display: block; }
.phone-button.in-call { border-color: var(--green); background: #e6f5df; }
.phone-button.in-call i { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .5; } }
.phone-panel { position: fixed; right: 22px; bottom: 22px; width: 300px; z-index: 95; background: #fff; border: 1px solid #d8ded0; border-radius: 16px; box-shadow: 0 25px 80px #10152245; overflow: hidden; display: flex; flex-direction: column; font-size: 12px; animation: drawer-in .18s ease both; }
.phone-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-bottom: 1px solid #e8ece1; background: #fbfcf8; }
.phone-head-copy { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.phone-head-copy b { font-size: 12.5px; }
.phone-head-copy small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone-head-link { color: var(--muted); display: inline-flex; } .phone-head-link .ico { width: 15px; height: 15px; }
.phone-x { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.phone-dot { width: 9px; height: 9px; border-radius: 50%; background: #c9d0bf; flex-shrink: 0; }
.phone-dot.ok { background: var(--green); } .phone-dot.bad { background: var(--red); } .phone-dot.busy { background: #e0a100; }
.phone-screen { padding: 16px 16px 6px; text-align: center; min-height: 76px; }
.phone-number { width: 100%; border: 0; border-bottom: 1px solid #e3e8dc; border-radius: 0; font-size: 22px; font-weight: 600; letter-spacing: .5px; text-align: center; padding: 6px 4px; background: transparent; color: var(--navy); font-variant-numeric: tabular-nums; }
.phone-number:focus { outline: none; border-bottom-color: var(--green); box-shadow: none; }
.phone-number::placeholder { font-size: 13px; font-weight: 450; letter-spacing: 0; color: #a6ad9f; }
.phone-callee { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.phone-callee b { font-size: 17px; } .phone-callee small { color: var(--muted); font-size: 11px; }
.phone-timer { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 4px; }
.phone-note { font-size: 10.5px; color: var(--muted); margin-top: 6px; min-height: 0; }
.phone-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 22px 4px; }
.phone-keys button { border: 1px solid #e3e8dc; background: #fff; border-radius: 12px; height: 46px; font-size: 18px; font-weight: 550; color: var(--navy); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.phone-keys button small { font-size: 8px; letter-spacing: 1.5px; color: #9aa394; margin-top: 2px; font-weight: 500; }
.phone-keys button:hover { background: #f1f4ee; } .phone-keys button:active { background: #e6f5df; border-color: var(--green); }
.phone-actions { display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; gap: 6px; align-items: center; padding: 10px 14px 14px; }
.phone-ctl { border: 0; background: transparent; color: var(--navy); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 9.5px; padding: 6px 2px; border-radius: 10px; }
.phone-ctl .ico { width: 18px; height: 18px; }
.phone-ctl:hover:not(:disabled) { background: #f1f4ee; } .phone-ctl:disabled { opacity: .35; cursor: default; }
.phone-ctl.on { background: #e6f5df; color: #1f6b12; }
.phone-call { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 22px #23aa0850; }
.phone-call .ico { width: 24px; height: 24px; }
.phone-call:hover { filter: brightness(1.06); }
.phone-call--end { background: var(--red); box-shadow: 0 8px 22px #d1313150; }
.phone-recent { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.phone-recent:empty { display: none; }
.phone-recent small { font-size: 9.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding: 4px 2px 2px; }
.phone-recent button { border: 0; background: #f7f9f4; border-radius: 9px; padding: 7px 10px; display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; cursor: pointer; text-align: left; color: var(--navy); }
.phone-recent button span { color: var(--muted); font-variant-numeric: tabular-nums; }
.phone-recent button:hover { background: #e6f5df; }
.phone-incoming { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #191e2b; color: #fff; border-radius: 14px; box-shadow: 0 20px 60px #10152260; animation: drawer-in .2s ease both; max-width: calc(100vw - 24px); }
.phone-incoming-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--green); display: inline-flex; align-items: center; justify-content: center; animation: pulse 1.2s infinite; flex-shrink: 0; }
.phone-incoming-ic .ico { width: 18px; height: 18px; }
.phone-incoming-copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.phone-incoming-copy small { font-size: 10px; color: #b7bfcf; text-transform: uppercase; letter-spacing: 1px; }
.phone-incoming-copy b { font-size: 14px; } .phone-incoming-copy span { font-size: 11px; color: #c9d0dd; }
.phone-answer.btn { background: var(--green); }
.phone-decline.btn { background: var(--red); color: #fff; border-color: var(--red); }
.phone-state-badge.state-registered, .phone-state-badge.state-incall { background: var(--green-bg, #e6f5df); color: #1f6b12; }
.phone-state-badge.state-failed, .phone-state-badge.state-disconnected { background: var(--red-bg); color: var(--red); }
.kpi .ok { color: #1f6b12; font-weight: 600; }
@media (max-width: 820px) {
  .phone-panel { right: 0; left: 0; bottom: 0; width: auto; border-radius: 16px 16px 0 0; padding-bottom: 64px; }
  .phone-keys button { height: 52px; }
  .form-grid--2 { grid-template-columns: 1fr; }
}

/* ---- Servers: DEV / TEST / LIVE badge + "Test these changes" ---- */
.concept-tag.env-dev, .concept-tag.env-local { color: #8a5a00; }
.concept-tag.env-test { color: #1d4ed8; }
.live-dot.env-dev, .live-dot.env-local { background: #e0a100; } .live-dot.env-test { background: #2563eb; }
.env-badge.env-dev, .env-badge.env-local { background: #fff4d6; color: #8a5a00; }
.env-badge.env-test { background: #e3ecff; color: #1d4ed8; }
.env-badge.env-live { background: var(--green-bg, #e8f7e5); color: #1f6b12; }
.test-changes-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 8px; border-radius: 7px; border: 1px solid #c7d7ff; background: #eef3ff; color: #1d4ed8; font-size: 11px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.test-changes-btn .ico { width: 15px; height: 15px; }
.test-changes-btn b { background: #1d4ed8; color: #fff; border-radius: 999px; font-size: 10px; padding: 1px 6px; }
.test-changes-btn:hover { background: #dfe8ff; }
.changes { display: grid; gap: 14px; }
.change { border-left: 4px solid #e0a100; }
.change--ok { border-left-color: var(--green); } .change--problem { border-left-color: var(--red); }
.change-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.change-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.change-title h3 { margin: 0; font-size: 15px; } .change-title small { color: var(--muted); }
.change-summary { margin: 10px 0 0; font-size: 12.5px; line-height: 1.55; color: #3c4638; max-width: 900px; }
.change-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.change-votes { list-style: none; margin: 12px 0 0; padding: 10px 12px; background: #f7f9f4; border-radius: 9px; font-size: 11.5px; display: grid; gap: 6px; }
.change-votes small { color: var(--muted); margin-left: 4px; }
.change-verdict { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.change-verdict input { flex: 1; min-width: 220px; }
.change-problem.btn { color: var(--red); border-color: #f1c4c4; }
@media (max-width: 1000px) { .test-changes-btn span { display: none; } .test-changes-btn { padding: 0 8px; } }
@media (max-width: 820px) { .test-changes-btn { display: none; } }

/* ---- Presence (User activity) ---- */
.presence { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 11.5px; white-space: nowrap; }
.presence i { width: 8px; height: 8px; border-radius: 50%; background: #c9d0bf; flex-shrink: 0; }
.presence--active { color: #1f6b12; } .presence--active i { background: var(--green); box-shadow: 0 0 0 3px #e3f1dc; }
.presence--idle { color: #8a5a00; } .presence--idle i { background: #e0a100; }
.presence--out { color: var(--muted); }
.kpi .val .presence { font-size: 15px; }
.btn--warn.btn { color: var(--red); border-color: #f1c4c4; }
.btn--warn.btn:hover { background: var(--red-bg); }
td.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
td.row-actions form { margin: 0; }
.pbar--time { height: 8px; } .pbar--time i { background: var(--green); }

/* ---- Sign out everyone: countdown banner + kept drafts ---- */
.signout-banner { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 130; display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: #191e2b; color: #fff; border-radius: 14px; box-shadow: 0 20px 60px #10152260; max-width: calc(100vw - 24px); animation: drawer-in .2s ease both; }
.signout-ic { width: 36px; height: 36px; border-radius: 50%; background: #e0a100; color: #191e2b; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; animation: pulse 1.2s infinite; }
.signout-ic .ico { width: 18px; height: 18px; }
.signout-copy { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.signout-copy b { font-size: 14px; } .signout-copy b span { font-variant-numeric: tabular-nums; color: #ffd166; }
.signout-copy small { font-size: 11px; color: #c9d0dd; }
.signout-pending { align-items: center; } .signout-pending form { margin-left: auto; }
.draft-notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; background: #fff8e1; border: 1px solid #f3dc9a; border-radius: 10px; font-size: 12px; color: #6b4a00; }
.draft-notice > span { display: inline-flex; align-items: center; gap: 8px; flex: 1; }
.draft-notice .ico { width: 15px; height: 15px; }
.content > .draft-notice { margin: 14px 24px 0; }
.jnl-lines td:first-child { min-width: 280px; width: 36%; }
.jnl-lines td:first-child select, .jnl-lines td:first-child .agc-select { width: 100%; }
.jnl-lines td input { width: 100%; }

/* ---- Long tables: first 12 rows, then "Show all" ---- */
tr.clamped-hide { display: none; }
.tbl-more { display: flex; justify-content: center; padding: 8px 0 2px; }
.card > .tbl-more { margin: 0 -20px -8px; background: #fafbf7; border-top: 1px solid var(--row-line); padding: 8px; }
.card > .tbl-more:last-child { margin-bottom: -19px; border-radius: 0 0 11px 11px; }
.tbl-more button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 14px; font-size: 11.5px; font-weight: 600; color: var(--deep); cursor: pointer; }
.tbl-more button:hover { background: #f1f4ee; }
.tbl-more.open button::after { content: " ▴"; } .tbl-more:not(.open) button::after { content: " ▾"; }

/* ---- Attendance ---- */
.attendance-card .att-state { display: flex; flex-direction: column; gap: 4px; }
.attendance-card .att-state .presence { font-size: 16px; }
.attendance-card .att-state small { color: var(--muted); }
.att-consent { margin-top: 12px; padding: 12px 14px; background: #fff8e1; border: 1px solid #f3dc9a; border-radius: 10px; }
.att-consent p { margin: 0 0 10px; }

/* ---- Marketing ---- */
.check-list { display: flex; flex-direction: column; gap: 6px; }
.check-list--tall { max-height: 220px; overflow: auto; padding-right: 6px; }
.check-list--row { flex-direction: row; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.channel-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photo-opt { position: relative; cursor: pointer; border: 2px solid transparent; border-radius: 10px; overflow: hidden; display: block; background: #fff; }
.photo-opt img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-opt span { display: block; font-size: 10px; padding: 4px 6px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-opt input { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; accent-color: var(--green); }
.photo-opt:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 2px #e3f1dc; }
.bubble-preview { background: #e9f7e3; border-radius: 14px; padding: 12px 14px; font-size: 13px; max-width: 420px; white-space: pre-wrap; }
.photo-row { display: flex; gap: 8px; margin-top: 10px; } .photo-row img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.kpis--tight { gap: 10px; margin-bottom: 12px; } .kpis--tight .kpi { padding: 12px 14px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 12.5px; }
.consent-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.consent-chip--yes { background: #e3f1dc; color: #1f6b12; } .consent-chip--no { background: #f1f4ee; color: var(--muted); } .consent-chip--out { background: var(--red-bg); color: var(--red); }
.platform-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--row-line); }
.platform-card:last-child { border-bottom: 0; }
.platform-card .ic { width: 36px; height: 36px; border-radius: 9px; background: #f1f4ee; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; color: var(--deep); }
.platform-card .copy { flex: 1; min-width: 0; } .platform-card .copy b { font-size: 13px; } .platform-card .copy p { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.platform-card .act { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
@media (max-width: 820px) { .channel-pick { grid-template-columns: 1fr; } }
.mkt-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .mkt-row form { margin-left: auto; }

.change-fixed { margin: 12px 0 0; }

/* ---- Phone header tidy: compact actions, single-line search ---- */
@media (max-width: 820px) {
  .ph-row { gap: 8px; }
  .ph-row .btn { padding: 9px 12px; min-height: 38px; font-size: 11.5px; }
  .ph-row .btn .ico { width: 14px; height: 14px; }
  .ph-row .page-actions { display: contents; }
  .ph-row .badge { margin-right: auto; }
  .global-search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crumbs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card > h2 { font-size: 14px; }
  .card > h2 .r { flex-basis: 100%; margin-left: 0; }
}
/* Six figure tiles fit one row on wide screens instead of 5 + 1 orphan. */
@media (min-width: 1200px) { .kpis:has(> :nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
