:root {
  --bg: #080c12; --bg2: #0d1520; --bg3: #111d2e;
  --border: #1e2d42; --border-bright: #2a3f5c;
  --text: #c8d8e8; --text-dim: #5a7a9a; --text-bright: #e8f2ff;
  --accent-blue: #2196f3; --accent-cyan: #00bcd4; --accent-green: #4caf50;
  --accent-gold: #ffc107; --accent-red: #f44336; --accent-purple: #9c27b0;
  --nx-primary: #1a6ef5; --nx-glow: rgba(26, 110, 245, 0.15);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--bg); color: var(--text);
  min-height: 100vh;
}

/* ─── Top bar ─── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg3) 100%);
  flex-wrap: wrap; gap: 16px;
}
.topbar-brand { display: flex; align-items: center; gap: 16px; }
.nx-logo {
  font-family: 'Syne', sans-serif; font-size: 32px; font-weight: 800;
  color: var(--text-bright); letter-spacing: -1px;
  background: rgba(26,110,245,0.08); border: 1px solid rgba(26,110,245,0.25);
  border-radius: 6px; padding: 2px 12px;
}
.topbar-title { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; color: var(--text-bright); }
.topbar-sub { font-size: 10px; color: var(--text-dim); letter-spacing: 0.5px; margin-top: 3px; }
.topbar-meta { display: flex; align-items: center; gap: 14px; }
.topbar-updated { font-size: 10px; color: var(--text-dim); }
.topbar-user { font-size: 10px; color: var(--text-dim); text-transform: capitalize; }
.btn-refresh {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 1px;
  background: rgba(33,150,243,0.08); color: var(--accent-blue);
  border: 1px solid rgba(33,150,243,0.3); border-radius: 4px;
  padding: 6px 12px; cursor: pointer; transition: all .15s;
}
.btn-refresh:hover { background: rgba(33,150,243,0.18); }

/* Tier 2 SKU-flagging: the one write action in this otherwise read-only dashboard */
.approve-btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.3px;
  background: rgba(76,175,80,0.08); color: var(--accent-green);
  border: 1px solid rgba(76,175,80,0.3); border-radius: 4px;
  padding: 5px 10px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.approve-btn:hover:not(:disabled) { background: rgba(76,175,80,0.18); }
.approve-btn:disabled { opacity: 0.5; cursor: wait; }

/* Tier 1: "this might already exist" warning — sits above the create-new suggestion */
.possible-match-warning {
  margin-top: 4px; padding: 6px 8px;
  background: rgba(255,193,7,0.08); border: 1px solid rgba(255,193,7,0.3);
  border-radius: 4px; color: var(--accent-gold); font-size: 11px;
}
.candidate-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 4px; padding: 3px 4px; border-radius: 3px;
}
/* Visually the obvious default — never auto-selected, still needs a click (see app.js comment) */
.candidate-top { background: rgba(76,175,80,0.06); border: 1px solid rgba(76,175,80,0.2); }
.candidate-top-label {
  color: var(--accent-green); font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; font-size: 9px;
}
.link-match-btn, .link-supplier-btn, .inline-link-supplier-btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.3px;
  background: rgba(76,175,80,0.1); color: var(--accent-green);
  border: 1px solid rgba(76,175,80,0.35); border-radius: 4px;
  padding: 4px 8px; cursor: pointer; transition: all .15s; white-space: nowrap; margin-left: auto;
}
.link-match-btn:hover:not(:disabled), .link-supplier-btn:hover:not(:disabled), .inline-link-supplier-btn:hover:not(:disabled) { background: rgba(76,175,80,0.22); }
.link-match-btn:disabled, .link-supplier-btn:disabled, .inline-link-supplier-btn:disabled { opacity: 0.5; cursor: wait; }

/* "Create new supplier" (12 Aug 2026) — deliberately its own, red-tinted
   style, distinct from every other action here. Not because it's more
   "dangerous" in the write sense (approve-btn also writes to live
   Linnworks) but because it's the only one with NO confirmed undo path —
   the color says "think twice", not "this is broken". Same style reused
   for the inline version (renderPoBlocked) — same action, same risk. */
.create-supplier-btn, .inline-create-supplier-btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.3px;
  background: rgba(244,67,54,0.08); color: var(--accent-red);
  border: 1px solid rgba(244,67,54,0.35); border-radius: 4px;
  padding: 5px 10px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.create-supplier-btn:hover:not(:disabled), .inline-create-supplier-btn:hover:not(:disabled) { background: rgba(244,67,54,0.18); }
.create-supplier-btn:disabled, .inline-create-supplier-btn:disabled { opacity: 0.5; cursor: wait; }

/* Task 6 (19 Aug 2026) — "Mark completed" for an auto-created product
   that just needs its Linnworks-only fields filled in. Green like the
   link/match actions: no external write, no risk, a straightforward
   "confirm the real work is done" click. */
.mark-completed-btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.3px;
  background: rgba(76,175,80,0.1); color: var(--accent-green);
  border: 1px solid rgba(76,175,80,0.35); border-radius: 4px;
  padding: 4px 8px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.mark-completed-btn:hover:not(:disabled) { background: rgba(76,175,80,0.22); }
.mark-completed-btn:disabled { opacity: 0.5; cursor: wait; }

/* ─── Main / sections ─── */
.main { max-width: 1280px; margin: 0 auto; padding: 0 40px; }
.section { padding: 40px 0; border-bottom: 1px solid var(--border); }
.section:last-of-type { border-bottom: none; }
.section-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
  cursor: pointer; user-select: none; border-radius: 4px;
}
.section-header:hover { background: rgba(255,255,255,0.02); }
.section-header:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 4px; }
/* Phase D (30 Sep 2026) — collapsible sections. rightWrap holds an
   existing count-pill (if any) plus the new toggle icon, both flush
   right — see app.js's initCollapsibleSections() for why this is one
   wrapper rather than margin-left:auto on each element individually. */
.section-header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.section-header-right .count-pill { margin-left: 0; }
.section-toggle-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; font-size: 13px; color: var(--text-dim);
  background: var(--bg2); border: 1px solid var(--border); border-radius: 6px;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}
/* Real user feedback (30 Sep 2026): the original bare-glyph chevron was
   too subtle to notice on a first look — this gives it a real button-like
   frame (matching .count-pill/.section-num's own existing bordered-pill
   look) so it reads as an actual control, not decoration. */
.section-header:hover .section-toggle-icon {
  color: var(--accent-blue); border-color: rgba(33,150,243,0.35); background: rgba(33,150,243,0.08);
}
.section.collapsed .section-toggle-icon { transform: rotate(-90deg); }
.section.collapsed .section-header { margin-bottom: 0; }
.section.collapsed > *:not(.section-header) { display: none; }
.section-num {
  font-family: 'Syne', sans-serif; font-size: 11px; font-weight: 700; color: var(--accent-blue);
  background: rgba(33,150,243,0.08); border: 1px solid rgba(33,150,243,0.2);
  border-radius: 4px; padding: 4px 10px; letter-spacing: 2px;
}
.section-label { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 4px; }
.section-title { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; color: var(--text-bright); letter-spacing: -0.3px; }
.subsection-title {
  font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; color: var(--text-bright);
  margin: 24px 0 4px; padding-top: 18px; border-top: 1px solid var(--border);
}
.count-pill {
  margin-left: auto; font-size: 11px; color: var(--text-dim);
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px;
}

/* Retry-create-PO shortcut banner (12 Aug 2026) — pure navigation, shown
   after resolving an exception. Green like the other "this went fine"
   affordances, never auto-navigates on its own. */
.retry-po-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 10px 14px; border-radius: 6px; font-size: 12px;
  background: rgba(76,175,80,0.08); border: 1px solid rgba(76,175,80,0.3); color: var(--text);
}
.retry-po-banner[hidden] { display: none; }
.retry-po-btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.3px;
  background: rgba(76,175,80,0.15); color: var(--accent-green);
  border: 1px solid rgba(76,175,80,0.4); border-radius: 4px;
  padding: 5px 10px; cursor: pointer; transition: all .15s;
}
.retry-po-btn:hover { background: rgba(76,175,80,0.28); }
.retry-po-dismiss {
  margin-left: auto; background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 4px;
}
.retry-po-dismiss:hover { color: var(--text-bright); }

/* ─── Badges ─── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 9px; letter-spacing: 1px;
  text-transform: uppercase; padding: 3px 10px; border-radius: 3px; font-weight: 500; white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.badge-live, .badge-done { background: rgba(76,175,80,0.1); color: var(--accent-green); border: 1px solid rgba(76,175,80,0.25); }
.badge-live::before, .badge-done::before { background: var(--accent-green); }
.badge-dev, .badge-in-progress, .badge-mostly-done { background: rgba(255,193,7,0.1); color: var(--accent-gold); border: 1px solid rgba(255,193,7,0.25); }
.badge-dev::before, .badge-in-progress::before, .badge-mostly-done::before { background: var(--accent-gold); animation: pulse 1.5s infinite; }
.badge-planned, .badge-not-started { background: rgba(90,122,154,0.1); color: var(--text-dim); border: 1px solid var(--border); }
.badge-planned::before, .badge-not-started::before { background: var(--text-dim); }
.badge-red, .badge-error, .badge-critical, .badge-high { background: rgba(244,67,54,0.1); color: var(--accent-red); border: 1px solid rgba(244,67,54,0.25); }
.badge-red::before, .badge-error::before, .badge-critical::before, .badge-high::before { background: var(--accent-red); }
.badge-medium { background: rgba(255,193,7,0.1); color: var(--accent-gold); border: 1px solid rgba(255,193,7,0.25); }
.badge-medium::before { background: var(--accent-gold); }
.badge-low { background: rgba(90,122,154,0.1); color: var(--text-dim); border: 1px solid var(--border); }
.badge-low::before { background: var(--text-dim); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ─── Cards ─── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 6px;
  padding: 18px; position: relative; overflow: hidden;
}
.card-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.card-label { font-size: 8px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
.card-title { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 600; color: var(--text-bright); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.card-body { font-size: 11px; line-height: 1.7; color: var(--text); }
.card-stats { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.stat { text-align: left; }
.stat-num { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 8px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-top: 4px; }
.stat-create .stat-num { color: var(--accent-blue); }
.stat-update .stat-num { color: var(--accent-gold); }
.stat-nochange .stat-num { color: var(--accent-green); }
.stat-error .stat-num { color: var(--accent-red); }
.skeleton { color: var(--text-dim); font-size: 11px; padding: 20px; }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; border-radius: 6px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 11px; background: var(--bg2); }
thead th {
  background: var(--bg3); text-align: left; padding: 10px 14px; font-size: 9px;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); font-weight: 500;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.6; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(26,110,245,0.03); }
.empty-state { color: var(--text-dim); text-align: center; padding: 24px !important; }
.mono-small { font-size: 10px; color: var(--text-dim); }
.tag { display: inline-block; font-size: 8.5px; letter-spacing: 0.5px; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; margin: 1px 2px 1px 0; border: 1px solid var(--border-bright); color: var(--text-dim); }
.tag-blue { color: var(--accent-blue); border-color: rgba(33,150,243,0.3); background: rgba(33,150,243,0.06); }
.tag-gold { color: var(--accent-gold); border-color: rgba(255,193,7,0.3); background: rgba(255,193,7,0.06); }

/* ─── Filter bar ─── */
.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

/* 19-20 Oct 2026 — the "Include Demo Company exceptions" toggle, kept
   simple enough to reuse anywhere a filter-bar needs a plain checkbox. */
.checkbox-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text-dim);
  cursor: pointer; user-select: none;
}
.checkbox-label input[type="checkbox"] { cursor: pointer; }

/* Real bug, found live 9 Sep 2026 (Claude wiring Stage D testing): this
   rule only ever styled a select's CLOSED box — its OPEN dropdown list
   is rendered by the browser's own native chrome, which ignores most
   page CSS unless `option` itself is styled too, so every select's open
   list (not just the new AI-provider one) showed a jarring, unstyled
   white panel. Broadened from `.filter-bar select` to plain `select` so
   any select anywhere gets the closed-box styling for free (the new
   #ai-chat-provider-select lives outside .filter-bar and had NEITHER
   before this fix), and `select option` added for the open list. */
select {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  background: var(--bg2); color: var(--text); border: 1px solid var(--border);
  border-radius: 4px; padding: 6px 10px;
}
select option {
  background: var(--bg2); color: var(--text);
}
.po-input {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  background: var(--bg2); color: var(--text-bright); border: 1px solid var(--border);
  border-radius: 4px; padding: 7px 12px; min-width: 240px;
}
.po-input:focus { outline: none; border-color: var(--accent-blue); }

/* ─── Xero PO -> Linnworks PO preview card ─── */
.po-preview-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 6px;
  padding: 18px; margin-top: 4px;
}
.po-preview-row { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-bottom: 6px; }
.po-preview-row .label { color: var(--text-dim); min-width: 110px; }
.po-line-list { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.po-line-row { font-size: 11px; padding: 4px 0; display: flex; gap: 10px; flex-wrap: wrap; }
.po-already-created {
  margin-top: 10px; padding: 8px 10px; border-radius: 4px; font-size: 11px;
  background: rgba(76,175,80,0.08); color: var(--accent-green); border: 1px solid rgba(76,175,80,0.3);
}
.po-blocked {
  margin-top: 10px; padding: 8px 10px; border-radius: 4px; font-size: 11px;
  background: rgba(244,67,54,0.08); color: var(--accent-red); border: 1px solid rgba(244,67,54,0.3);
}
.po-candidate-list { margin-top: 6px; }
.po-blocked .inline-create-supplier-btn { margin-top: 8px; }
.po-blocked #inline-supplier-result { margin-top: 6px; }

/* Task 3 (14 Aug 2026) — "supplier already linked but blank in Linnworks"
   notice. Gold, not red: unlike create-supplier (no undo path at all),
   this can only ever touch a supplier that's already confirmed linked and
   only fills in blank fields — a real write, but meaningfully lower risk. */
.po-supplier-incomplete {
  margin-top: 8px; padding: 8px 10px; border-radius: 4px; font-size: 11px;
  background: rgba(255,193,7,0.08); color: var(--accent-gold); border: 1px solid rgba(255,193,7,0.3);
}
.refresh-supplier-details-btn {
  margin-top: 6px; display: inline-block;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.3px;
  background: rgba(255,193,7,0.1); color: var(--accent-gold);
  border: 1px solid rgba(255,193,7,0.35); border-radius: 4px;
  padding: 5px 10px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.refresh-supplier-details-btn:hover:not(:disabled) { background: rgba(255,193,7,0.2); }
.refresh-supplier-details-btn:disabled { opacity: 0.5; cursor: wait; }
.po-supplier-incomplete #refresh-supplier-details-result { margin-top: 6px; }
.create-po-btn {
  margin-top: 12px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.3px;
  background: rgba(76,175,80,0.1); color: var(--accent-green);
  border: 1px solid rgba(76,175,80,0.35); border-radius: 4px;
  padding: 7px 14px; cursor: pointer; transition: all .15s;
}
.create-po-btn:hover:not(:disabled) { background: rgba(76,175,80,0.22); }
.create-po-btn:disabled { opacity: 0.5; cursor: wait; }

/* ─── Goods receipt (Stage 4, 26 Aug 2026) ─── */
.section-note {
  font-size: 11px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.5;
}
.section-note code {
  font-family: 'IBM Plex Mono', monospace; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 5px; color: var(--accent-cyan);
}

/* ─── Amazon Orders (Phase 4, 28 Sep 2026) ─── */
.amazon-subsection-label {
  font-family: 'Syne', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-dim); margin: 24px 0 10px;
}
.amazon-recon-box {
  border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; margin-top: 10px; font-size: 12px;
}
.amazon-recon-box.amazon-recon-match { border-color: rgba(76,175,80,0.35); background: rgba(76,175,80,0.06); }
.amazon-recon-box.amazon-recon-diff { border-color: rgba(255,193,7,0.35); background: rgba(255,193,7,0.06); }
.amazon-recon-box.amazon-recon-error { border-color: rgba(244,67,54,0.35); background: rgba(244,67,54,0.06); }
.amazon-sync-health-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 12px; flex-wrap: wrap;
}
.amazon-sync-health-row:last-child { border-bottom: none; }
.goods-receipt-form { margin-bottom: 16px; }
.goods-receipt-form input[type="text"], .goods-receipt-form textarea, .goods-receipt-form select {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  background: var(--bg2); color: var(--text-bright); border: 1px solid var(--border);
  border-radius: 4px; padding: 7px 12px;
}
.goods-receipt-form input[type="text"]:focus, .goods-receipt-form textarea:focus { outline: none; border-color: var(--accent-blue); }
.goods-receipt-form textarea { width: 100%; margin-bottom: 10px; resize: vertical; font-family: 'IBM Plex Mono', monospace; }
#gr-po-ref { min-width: 220px; }
#gr-received-by { min-width: 200px; flex: 1; }
.gr-line-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 8px; padding: 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: 4px;
}
.gr-line-row input[type="text"] { min-width: 180px; }
.gr-line-row input[type="number"] {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; width: 90px;
  background: var(--bg); color: var(--text-bright); border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px;
}
.gr-remove-line-btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--accent-red);
  background: rgba(244,67,54,0.08); border: 1px solid rgba(244,67,54,0.3); border-radius: 4px;
  padding: 5px 9px; cursor: pointer;
}
.btn-primary { background: rgba(76,175,80,0.1); color: var(--accent-green); border-color: rgba(76,175,80,0.35); }
.btn-primary:hover:not(:disabled) { background: rgba(76,175,80,0.22); }
.btn-primary:disabled { opacity: 0.5; cursor: wait; }
.gr-result-ok {
  margin-bottom: 14px; padding: 8px 10px; border-radius: 4px; font-size: 11px;
  background: rgba(76,175,80,0.08); color: var(--accent-green); border: 1px solid rgba(76,175,80,0.3);
}
.gr-result-error {
  margin-bottom: 14px; padding: 8px 10px; border-radius: 4px; font-size: 11px;
  background: rgba(244,67,54,0.08); color: var(--accent-red); border: 1px solid rgba(244,67,54,0.3);
}
.gr-result-line { padding: 2px 0; }

/* ─── Footer ─── */
/* ─── PO Lifecycle (Stage 10, 26 Aug 2026) ─── */
.po-lc-lines-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11px; }
.po-lc-lines-table th, .po-lc-lines-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.po-lc-lines-table th { color: var(--text-dim); font-weight: 500; text-transform: uppercase; font-size: 9px; letter-spacing: 0.5px; }
.po-lc-cross-system { margin-top: 8px; padding: 10px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg2); }
.po-lc-cross-system.po-lc-has-discrepancy { border-color: rgba(255,193,7,0.35); background: rgba(255,193,7,0.05); }
.po-lc-cross-system.po-lc-clean { border-color: rgba(76,175,80,0.3); background: rgba(76,175,80,0.05); }
.po-lc-no-match { padding: 10px; border-radius: 4px; font-size: 11px; color: var(--text-dim); background: var(--bg2); border: 1px solid var(--border); margin-top: 8px; }
.po-lc-discrepancy-list { margin: 8px 0; padding: 8px; border-radius: 4px; background: rgba(255,193,7,0.08); color: var(--accent-gold); font-size: 11px; }
.po-lc-clean-match { margin: 8px 0; font-size: 11px; color: var(--accent-green); }
#po-lc-detail details { margin-top: 8px; }
#po-lc-detail summary { cursor: pointer; color: var(--accent-blue); font-size: 11px; padding: 4px 0; }
.po-lc-view-btn { font-size: 10px; padding: 4px 10px; }
#po-lc-pagination { align-items: center; }
#po-lc-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

.footer { text-align: center; padding: 28px 40px; color: var(--text-dim); font-size: 10px; border-top: 1px solid var(--border); }

/* ─── AI Assistant chat (Block F, 27 Aug 2026) ─── */
.ai-chat-log {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 360px; overflow-y: auto;
  padding: 14px; border-radius: 6px; margin-bottom: 12px;
  background: var(--bg2); border: 1px solid var(--border); min-height: 60px;
}
.ai-chat-msg { display: flex; flex-direction: column; gap: 3px; max-width: 80%; }
.ai-chat-msg-user { align-self: flex-end; align-items: flex-end; }
.ai-chat-msg-assistant, .ai-chat-msg-error { align-self: flex-start; }
.ai-chat-role { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.ai-chat-text {
  font-size: 12px; line-height: 1.5; white-space: pre-wrap;
  padding: 8px 12px; border-radius: 6px;
}
.ai-chat-msg-user .ai-chat-text { background: rgba(26,110,245,0.12); border: 1px solid rgba(26,110,245,0.3); color: var(--text-bright); }
.ai-chat-msg-assistant .ai-chat-text { background: var(--bg3); border: 1px solid var(--border); color: var(--text); }
.ai-chat-msg-error .ai-chat-text { background: rgba(244,67,54,0.08); border: 1px solid rgba(244,67,54,0.3); color: var(--accent-red); }
.ai-disclaimer { margin-top: 10px; font-size: 10px; color: var(--text-dim); text-align: center; letter-spacing: 0.02em; }

/* Phase 1 STEP 2 of the approved "full A-to-Z AI access" plan (4 Sep
   2026) — the real action-preview card, per the plan's own "What a
   proposal actually shows" section: structured real fields, never the
   model's own free prose. Approve is red-tinted like create-supplier-btn
   above — same real reason (no confirmed undo path), not because it's
   "more dangerous" in the write sense than any other action here. */
.ai-action-card {
  margin-top: 8px; padding: 10px 12px; border-radius: 6px;
  background: var(--bg3); border: 1px solid rgba(244,67,54,0.3);
  font-size: 11px; color: var(--text);
}
.ai-action-card-head {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-gold);
  margin-bottom: 6px;
}
.ai-action-card-row { margin-bottom: 3px; }
.ai-action-label { color: var(--text-dim); margin-right: 4px; }
.ai-action-env {
  font-family: 'IBM Plex Mono', monospace; font-size: 9px; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--border); border-radius: 3px; padding: 1px 4px;
}
.ai-action-lines { margin: 6px 0; padding-left: 18px; }
.ai-action-lines li { margin-bottom: 2px; }
.ai-action-sku { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--text-dim); }
.ai-action-card-note {
  margin-top: 6px; padding: 5px 8px; border-radius: 4px;
  background: rgba(255,193,7,0.08); border: 1px solid rgba(255,193,7,0.25); color: var(--accent-gold);
}
.ai-action-card-warning {
  margin-top: 6px; font-weight: 600; letter-spacing: 0.2px;
  color: var(--accent-red);
}
.ai-action-card-buttons { display: flex; gap: 8px; margin-top: 10px; }
.ai-action-approve-btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.3px;
  background: rgba(244,67,54,0.08); color: var(--accent-red);
  border: 1px solid rgba(244,67,54,0.35); border-radius: 4px;
  padding: 5px 10px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.ai-action-approve-btn:hover:not(:disabled) { background: rgba(244,67,54,0.18); }
.ai-action-reject-btn {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.3px;
  background: var(--bg2); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 5px 10px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.ai-action-reject-btn:hover:not(:disabled) { background: var(--bg3); color: var(--text); }
.ai-action-approve-btn:disabled, .ai-action-reject-btn:disabled { opacity: 0.4; cursor: default; }
.ai-action-card-decided {
  margin-top: 8px; font-size: 10px; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--text-dim);
}

.ai-chat-layout { display: flex; gap: 16px; align-items: flex-start; }
.ai-chat-sidebar { flex: 0 0 220px; display: flex; flex-direction: column; gap: 8px; }
.ai-chat-main { flex: 1; min-width: 0; }
.ai-new-chat-btn { width: 100%; text-align: center; }

/* Claude wiring Stage D (9 Sep 2026) — the per-conversation provider
   switch. Reuses the plain <select> convention already established for
   #po-env-select, and the same gold "read this before you proceed"
   tone already used by .ai-action-card-note, since choosing Claude is a
   real, informed decision each time (residency is still unconfirmed
   with Ryan), not a routine setting. */
.ai-provider-label { font-size: 10px; color: var(--text-dim); letter-spacing: 0.02em; }
#ai-chat-provider-select { width: 100%; }
.ai-provider-caution {
  font-size: 10px; line-height: 1.4; margin: 0;
  padding: 6px 8px; border-radius: 4px;
  background: rgba(255,193,7,0.08); border: 1px solid rgba(255,193,7,0.25); color: var(--accent-gold);
}
.ai-chat-active-provider {
  font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 6px;
}
.ai-chat-active-provider.is-claude { color: var(--accent-gold); }

.ai-chat-sessions-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 360px; overflow-y: auto;
  padding: 6px; border-radius: 6px;
  background: var(--bg2); border: 1px solid var(--border);
}
.ai-chat-session-item {
  padding: 8px 10px; border-radius: 4px; cursor: pointer;
  font-size: 11px; color: var(--text-dim); border: 1px solid transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.ai-chat-session-item:hover { background: var(--bg3); color: var(--text); }
.ai-chat-session-item.active { background: rgba(26,110,245,0.1); border-color: rgba(26,110,245,0.3); color: var(--text-bright); }
.ai-chat-session-title { overflow: hidden; text-overflow: ellipsis; }
.ai-chat-session-badge {
  flex: none; font-family: 'IBM Plex Mono', monospace; font-size: 8px; letter-spacing: 0.03em;
  border-radius: 3px; padding: 1px 4px; border: 1px solid var(--border); color: var(--text-dim);
}
.ai-chat-session-badge.is-claude { color: var(--accent-gold); border-color: rgba(255,193,7,0.3); }
.ai-chat-empty { text-align: center; padding: 30px 10px; color: var(--text-dim); font-size: 11px; }

@media (max-width: 700px) {
  .ai-chat-layout { flex-direction: column; }
  .ai-chat-sidebar { flex: none; width: 100%; }
}

@media (max-width: 700px) {
  .topbar, .main { padding-left: 18px; padding-right: 18px; }
}

/* Morning Brief (Snapshot & Agents, Phase 14, 5 Oct 2026) */
.morning-brief-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.morning-brief-tasks li {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 4px;
  padding: 8px 12px; font-size: 12px; color: var(--text);
}

/* Account Health agent draft (Snapshot & Agents, Phase 15, 5 Oct 2026) */
.ah-draft { margin-top: 8px; padding: 10px; background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; }
.ah-draft-label { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.ah-draft-text {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text);
  white-space: pre-wrap; word-break: break-word; margin: 0 0 8px; max-height: 260px; overflow-y: auto;
}
