:root {
  --black:      #000000;
  --black-soft: #0a0a0a;
  --slate:      #2E3339;
  --slate-mid:  #3a4048;
  --gold:       #B9975B;
  --gold-light: #DFBA7C;
  --gold-pale:  #f0d9a8;
  --white:      #ffffff;
  --white-80:   rgba(255,255,255,0.8);
  --white-50:   rgba(255,255,255,0.5);
  --white-20:   rgba(255,255,255,0.2);
  --white-10:   rgba(255,255,255,0.1);
  --white-06:   rgba(255,255,255,0.06);
  --white-03:   rgba(255,255,255,0.03);
  --gold-20:    rgba(185,151,91,0.2);
  --gold-10:    rgba(185,151,91,0.1);
  --gold-05:    rgba(185,151,91,0.05);
  --green-light:#34a363;
}
/* Light mode: flip the black/white palette while keeping the gold accent.
   Variable NAMES stay the same (e.g. var(--white) still means "text color");
   only the color values invert. This lets the whole stylesheet re-skin
   without touching every rule. */
html.light {
  --black:      #f5f5f7;
  --black-soft: #ffffff;
  --slate:      #e8eaed;
  --slate-mid:  #d0d4da;
  --white:      #1a1a1a;
  --white-80:   rgba(26,26,26,0.82);
  --white-50:   rgba(26,26,26,0.58);
  --white-20:   rgba(26,26,26,0.22);
  --white-10:   rgba(26,26,26,0.10);
  --white-06:   rgba(26,26,26,0.05);
  --white-03:   rgba(26,26,26,0.025);
}
.theme-toggle { background: none; border: 1px solid rgba(185,151,91,0.2); color: rgba(185,151,91,0.7); font-size: 14px; padding: 3px 9px; cursor: pointer; font-family: inherit; line-height: 1; border-radius: 2px; }
.theme-toggle:hover { border-color: var(--gold); color: var(--gold-light); }
/* ── Custom Scrollbar ── */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: var(--black-soft); }
*::-webkit-scrollbar-thumb { background: var(--gold-20); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--gold); }
*::-webkit-scrollbar-corner { background: var(--black-soft); }
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--gold-20) var(--black-soft);
  --font:       'Poppins', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--black); color: var(--white); min-height: 100vh; font-size: 14px; line-height: 1.6; }

/* HEADER */
.site-header { background: var(--black); border-bottom: 1px solid var(--gold-20); padding: 0 2rem; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.logo-area { display: flex; align-items: center; gap: 16px; }
.logo-mark { width: 36px; height: 36px; flex-shrink: 0; border-radius: 4px; object-fit: cover; }
.logo-text { font-size: 18px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--white); }
.logo-text span { color: var(--gold); }
.header-divider { width: 1px; height: 20px; background: var(--white-20); }
.header-sub { font-size: 10px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--white-50); }
.header-badge { background: var(--gold); color: var(--black); font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 4px 10px; }

/* LAYOUT */
.app { display: flex; min-height: calc(100vh - 60px); }
.sidebar { width: 270px; flex-shrink: 0; background: var(--black-soft); border-right: 1px solid var(--gold-20); display: flex; flex-direction: column; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.main { flex: 1; overflow: hidden; min-width: 0; }

/* SIDEBAR */
.sidebar-section { padding: 1.5rem 1.25rem 0.5rem; }
.sidebar-label { font-size: 9px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.75rem; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; color: var(--white-50); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; transition: all 0.15s; border-left: 2px solid transparent; margin-bottom: 2px; }
.nav-item:hover { background: var(--white-06); color: var(--white-80); border-left-color: var(--white-20); }
.nav-item.active { background: var(--gold-10); color: var(--gold-light); border-left-color: var(--gold); }
.nav-num { font-size: 10px; font-weight: 700; color: var(--gold); width: 16px; flex-shrink: 0; }
.nav-item.active .nav-num { color: var(--gold-light); }
.sidebar-divider { height: 1px; background: var(--white-10); margin: 0.75rem 0; }
.config-group { padding: 0 1.25rem; margin-bottom: 1rem; }
.config-label { font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--white-50); display: block; margin-bottom: 6px; }
.config-label span { color: var(--gold-light); font-weight: 500; text-transform: none; letter-spacing: 0; }
.config-input { width: 100%; background: var(--white-06); border: 1px solid var(--white-10); padding: 7px 10px; color: var(--white); font-family: var(--font); font-size: 12px; outline: none; transition: border-color 0.15s; }
.config-input:focus { border-color: var(--gold); }
.config-input option { background: var(--black); }
.config-slider { width: 100%; -webkit-appearance: none; appearance: none; height: 3px; background: var(--white-10); outline: none; cursor: pointer; margin-top: 4px; }
.config-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: var(--gold); cursor: pointer; border: 2px solid var(--black); }
.config-slider::-moz-range-thumb { width: 14px; height: 14px; background: var(--gold); cursor: pointer; border: 2px solid var(--black); border-radius: 0; }
.formula-box { background: var(--white-03); border: 1px solid var(--white-10); padding: 8px 10px; font-size: 10px; font-weight: 500; letter-spacing: 0.04em; color: var(--white-50); margin-top: 4px; }
.formula-box strong { color: var(--gold-light); }
.lt-total-box { background: var(--gold-10); border: 1px solid var(--gold-20); padding: 8px 10px; font-size: 11px; color: var(--white-80); }
.lt-total-box strong { color: var(--gold-light); font-size: 14px; }
.run-btn { margin: 0.5rem 1.25rem 0; width: calc(100% - 2.5rem); background: var(--gold); color: var(--black); border: none; padding: 12px 0; font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; cursor: pointer; transition: all 0.15s; }
.run-btn:hover { background: var(--gold-light); }
.run-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sku-count-box { padding: 0.75rem 1.25rem; font-size: 10px; color: var(--white-50); letter-spacing: 0.06em; }
.sku-count-box span { color: var(--gold-light); font-weight: 700; }

/* PANELS */
.panel { display: none; padding: 2rem 2.5rem; }
.panel.active { display: block; }
.panel-eyebrow { font-size: 9px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.panel-heading { font-size: 28px; font-weight: 900; letter-spacing: -0.01em; text-transform: uppercase; line-height: 1; margin-bottom: 6px; }
.panel-heading em { color: var(--gold); font-style: normal; }
.panel-sub { font-size: 12px; font-weight: 300; color: var(--white-50); margin-bottom: 2rem; max-width: 680px; line-height: 1.7; }

/* STAT CARDS */
.stat-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; background: var(--white-10); border: 1px solid var(--white-10); margin-bottom: 1.5rem; }
.stat-card { background: var(--black-soft); padding: 1.25rem; position: relative; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--slate-mid); }
.stat-card.gold::before  { background: var(--gold); }
.stat-card.green::before { background: var(--green-light); }
.stat-card.amber::before { background: #d4a017; }
.stat-card.red::before   { background: #e05252; }
.stat-label { font-size: 8px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--white-50); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; color: var(--white); }
.stat-value.gold { color: var(--gold-light); }
.stat-value.sm { font-size: 14px; margin-top: 4px; font-weight: 600; line-height: 1.3; }
.stat-sub { font-size: 11px; font-weight: 300; color: var(--white-50); margin-top: 5px; }

/* TABLES */
.table-card { background: var(--black-soft); border: 1px solid var(--white-10); margin-bottom: 1.5rem; }
.table-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--white-10); display: flex; align-items: center; justify-content: space-between; background: var(--slate); }
.table-title { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--white); }
.table-sub { font-size: 11px; font-weight: 300; color: var(--white-50); margin-top: 2px; }
.table-wrap { overflow-x: auto; max-height: 520px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; padding: 5px 6px; background: var(--slate); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--white-50); border-bottom: 1px solid var(--white-10); white-space: normal; line-height: 1.2; vertical-align: bottom; position: sticky; top: 0; z-index: 1; }
th.r, td.r { text-align: right; }
td { padding: 4px 6px; border-bottom: 1px solid var(--white-06); color: var(--white-80); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
#tournament-body tbody tr:nth-child(even) td,
#po-body tbody tr:nth-child(even) td { background: var(--white-03); }
tr:hover td { background: var(--white-06) !important; }
.winner-row td { background: var(--gold-05) !important; }
.mono-cell { font-family: var(--font); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: 0; }
td.method-cell, th.method-cell { white-space: normal; max-width: 150px; font-size: 11px; line-height: 1.3; }

/* BADGES */
.badge { display: inline-block; padding: 2px 7px; font-size: 8px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.badge-winner { background: var(--gold-20); color: var(--gold-light); border: 1px solid var(--gold-20); }
.badge-good   { background: rgba(42,125,79,0.15); color: #5ec98a; border: 1px solid rgba(42,125,79,0.3); }
.badge-ok     { background: rgba(160,112,0,0.15); color: var(--gold-light); border: 1px solid var(--gold-20); }
.badge-poor   { background: rgba(155,44,44,0.15); color: #f08080; border: 1px solid rgba(155,44,44,0.3); }

/* PROGRESS BAR */
.pbar-wrap { background: var(--white-10); height: 4px; width: 100px; overflow: hidden; }
.pbar-fill { height: 100%; }

/* CHART */
.chart-grid { display: grid; grid-template-columns: 1fr 280px; gap: 1px; background: var(--white-10); margin-bottom: 1.5rem; }
.chart-card { background: var(--black-soft); padding: 1.25rem; border: 1px solid var(--white-10); }
.chart-card-title { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--white-50); margin-bottom: 1rem; }
.qtr-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--white-06); font-size: 12px; }
.qtr-row:last-child { border-bottom: none; font-weight: 600; color: var(--gold-light); }
.qtr-name { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--white-50); }
.qtr-val { font-family: var(--font); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.gold-line { height: 1px; background: linear-gradient(90deg, var(--gold) 0%, transparent 100%); margin: 0.75rem 0; }

/* EXPORT BTN */
.export-btn { background: var(--gold); color: var(--black); border: none; padding: 10px 20px; font-family: var(--font); font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.export-btn:hover { background: var(--gold-light); }

/* FORMULA DISPLAY */
.formula-display { background: var(--slate); border-left: 3px solid var(--gold); padding: 10px 16px; font-family: 'Courier New', monospace; font-size: 12px; color: var(--white-80); margin-bottom: 1rem; }
.formula-display strong { color: var(--gold-light); }

/* LEAD TIME BREAKDOWN */
.lt-breakdown { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: var(--white-10); border: 1px solid var(--white-10); margin-bottom: 1rem; }
.lt-cell { background: var(--black-soft); padding: 1rem 1.25rem; }
.lt-cell-label { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--white-50); margin-bottom: 6px; }
.lt-cell-val { font-size: 20px; font-weight: 700; color: var(--gold-light); }
.lt-cell-sub { font-size: 11px; font-weight: 300; color: var(--white-50); margin-top: 2px; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 5rem 2rem; }
.empty-icon { width: 48px; height: 48px; border: 1px solid var(--white-20); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 1.5rem; color: var(--gold); }
.empty-title { font-size: 18px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.5rem; color: var(--white-50); }
.empty-sub { font-size: 12px; font-weight: 300; color: var(--white-20); }

/* UPLOAD CARDS */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--white-10); border: 1px solid var(--white-10); margin-bottom: 2rem; }
.upload-card { background: var(--black-soft); padding: 2rem; }
.upload-card-icon { font-size: 22px; color: var(--gold); margin-bottom: 1rem; line-height: 1; }
.upload-card-title { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--white); margin-bottom: 0.75rem; }
.upload-card-desc { font-size: 11px; font-weight: 300; color: var(--white-50); line-height: 1.9; margin-bottom: 0; }
.upload-col { display: inline-block; background: var(--slate); color: var(--gold-light); font-family: 'Courier New', monospace; font-size: 10px; padding: 1px 6px; margin: 0 2px; }
.upload-status { margin-top: 0.75rem; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--white-50); min-height: 18px; }
.upload-status.loaded { color: var(--gold-light); }
.upload-status.error { color: #f08080; }
.action-btn { width: 100%; background: transparent; border: 1px solid var(--white-20); padding: 10px; font-family: var(--font); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; color: var(--white-80); transition: all 0.15s; margin-top: 1rem; display: block; text-align: center; }
.action-btn:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-05); }
.action-btn.gold-btn { background: var(--gold-10); border-color: var(--gold); color: var(--gold-light); }
.action-btn.gold-btn:hover { background: var(--gold-20); }

/* PARSE STATS */
.parse-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; margin-bottom: 2rem; }
.parse-stat { background: var(--slate); padding: 12px; text-align: center; border: 1px solid var(--white-06); }
.parse-stat-val { font-size: 22px; font-weight: 700; color: var(--gold-light); line-height: 1; }
.parse-stat-lbl { font-size: 9px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--white-50); margin-top: 4px; }

/* PROGRESS BAR (sidebar) */
.progress-area { padding: 0 1.25rem; margin-top: 0.75rem; }
.progress-label { font-size: 9px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--white-50); margin-bottom: 6px; }
.progress-track { height: 3px; background: var(--white-10); }
.progress-fill { height: 100%; background: var(--gold); transition: width 0.2s; }

/* TABLE CONTROLS */
.table-controls { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-input { background: var(--slate); border: 1px solid var(--white-10); color: var(--white); font-family: var(--font); font-size: 12px; padding: 8px 12px; outline: none; width: 260px; transition: border-color 0.15s; }
.search-input:focus { border-color: var(--gold); }
.search-input::placeholder { color: var(--white-20); }
.th-sortable { cursor: pointer; user-select: none; }
.th-sortable:hover { color: var(--white-80) !important; }
.sort-arrow { color: var(--gold); margin-left: 4px; }

/* DRILL BUTTON */
.drill-btn { background: transparent; border: 1px solid var(--white-20); color: var(--white-50); padding: 4px 10px; font-family: var(--font); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.drill-btn:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-05); }

/* PO TARGET CARD */
.po-target-card { background: var(--gold-10); border: 1px solid var(--gold-20); border-left: 4px solid var(--gold); padding: 1.25rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.po-target-label { font-size: 9px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.po-target-date { font-size: 22px; font-weight: 700; color: var(--gold-light); font-family: 'Courier New', monospace; }
.po-target-sub { font-size: 11px; font-weight: 300; color: var(--white-50); margin-top: 2px; }

/* DRILLDOWN MODAL */
.drilldown-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 2rem; overflow-y: auto; }
.drilldown-panel { background: var(--black-soft); border: 1px solid var(--gold-20); width: 100%; max-width: 1120px; flex-shrink: 0; }
.drilldown-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--gold-20); background: var(--slate); }
.drilldown-eyebrow { font-size: 9px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.drilldown-title { font-size: 20px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--white); }
.dd-close { background: transparent; border: 1px solid var(--white-20); color: var(--white-50); width: 32px; height: 32px; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; flex-shrink: 0; }
.dd-close:hover { border-color: var(--gold); color: var(--gold-light); }
.drilldown-tabs { display: flex; border-bottom: 1px solid var(--white-10); background: var(--black); }
.dd-tab { background: transparent; border: none; border-bottom: 2px solid transparent; padding: 12px 20px; font-family: var(--font); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--white-50); cursor: pointer; transition: all 0.15s; }
.dd-tab:hover { color: var(--white-80); }
.dd-tab.active { color: var(--gold-light); border-bottom-color: var(--gold); }
.drilldown-body { padding: 1.5rem; max-height: calc(100vh - 220px); overflow-y: auto; }

/* ANIMATIONS */
@keyframes fadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.panel.active > * { animation: fadeUp 0.25s ease both; }
.panel.active > *:nth-child(2) { animation-delay: 0.05s; }
.panel.active > *:nth-child(3) { animation-delay: 0.1s; }
.panel.active > *:nth-child(4) { animation-delay: 0.15s; }

/* ERP CONNECTION */
.erp-section { border: 1px solid var(--white-10); margin-bottom: 2rem; }
.erp-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; background: var(--slate); border-bottom: 1px solid var(--white-10); cursor: pointer; }
.erp-header:hover { background: var(--slate-mid); }
.erp-header-title { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--white); }
.erp-header-sub { font-size: 10px; color: var(--white-50); }
.erp-toggle { font-size: 14px; color: var(--gold); transition: transform 0.2s; }
.erp-toggle.open { transform: rotate(180deg); }
.erp-body { display: none; background: var(--black-soft); }
.erp-body.open { display: block; }
.erp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--white-10); }
.erp-cell { background: var(--black-soft); padding: 1.5rem; }
.erp-cell-title { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.erp-field { margin-bottom: 0.75rem; }
.erp-field label { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--white-50); margin-bottom: 4px; }
.erp-field input, .erp-field select { width: 100%; background: var(--white-06); border: 1px solid var(--white-10); padding: 8px 10px; color: var(--white); font-family: var(--font); font-size: 12px; outline: none; transition: border-color 0.15s; }
.erp-field input:focus, .erp-field select:focus { border-color: var(--gold); }
.erp-field select option { background: var(--black); }
.erp-field input::placeholder { color: var(--white-20); }
.erp-status-bar { padding: 0.75rem 1.25rem; border-top: 1px solid var(--white-10); display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--white-50); }
.erp-status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; }
.erp-status-dot.off { background: var(--white-20); }
.erp-status-dot.on { background: var(--green-light); }
.erp-status-dot.busy { background: var(--gold); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.3;} }
.erp-pull-row { display: flex; gap: 8px; margin-top: 0.5rem; }
.erp-pull-row .action-btn { margin-top: 0; flex: 1; }

/* METHOD CHECKBOX POPUP */
.method-popup-wrap { position: relative; display: inline-block; }
.method-popup-btn { padding: 5px 8px; font-size: 11px; background: var(--slate); color: var(--white); border: 1px solid var(--white-10); border-radius: 3px; font-family: var(--font); cursor: pointer; white-space: nowrap; }
.method-popup-btn:hover { border-color: var(--gold); }
.method-popup { display: none; position: absolute; top: 100%; left: 0; z-index: 50; background: var(--black-soft); border: 1px solid var(--white-10); border-radius: 4px; padding: 8px 0; min-width: 240px; max-height: 360px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.method-popup.open { display: block; }
.method-popup label { display: flex; align-items: center; gap: 8px; padding: 5px 12px; font-size: 11px; color: var(--white-80); cursor: pointer; }
.method-popup label:hover { background: var(--white-06); }
.method-popup input[type="checkbox"] { accent-color: var(--gold); }
.method-popup-actions { display: flex; gap: 6px; padding: 6px 12px; border-top: 1px solid var(--white-10); margin-top: 4px; }
.method-popup-actions button { flex: 1; padding: 4px 8px; font-size: 10px; font-family: var(--font); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; border: 1px solid var(--white-10); border-radius: 3px; background: var(--slate); color: var(--white-50); }
.method-popup-actions button:hover { border-color: var(--gold); color: var(--white); }
.method-popup-actions button.apply { background: var(--gold); color: var(--black); border-color: var(--gold); }

/* CLAUDE AI Q&A WIDGET — collapsible chat in Step 03. Reuses .erp-section /
   .erp-header / .erp-body for the frame; only the message/input styles are
   custom. */
.claude-section { margin-bottom: 1.5rem; }
.claude-messages { max-height: 320px; overflow-y: auto; padding: 1rem 1.25rem; background: var(--black-soft); }
.claude-msg { margin: 6px 0; padding: 8px 12px; font-size: 12px; line-height: 1.5; border-radius: 2px; white-space: pre-wrap; word-wrap: break-word; font-family: var(--font); }
.claude-msg-user      { background: var(--slate); color: var(--white-80); border-left: 2px solid var(--gold); }
.claude-msg-assistant { background: var(--gold-05); color: var(--white-80); border-left: 2px solid var(--gold-light); }
.claude-msg-thinking  { color: var(--gold-light); font-style: italic; background: var(--gold-05); border-left: 2px solid var(--gold); display: flex; align-items: center; padding: 10px 12px; font-size: 12px; }
.claude-spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(185,151,91,0.2); border-top-color: var(--gold); border-radius: 50%; animation: claude-spin 0.8s linear infinite; margin-right: 10px; flex-shrink: 0; }
.claude-elapsed { color: var(--white-50); font-size: 11px; margin-left: 4px; font-variant-numeric: tabular-nums; }
@keyframes claude-spin { to { transform: rotate(360deg); } }
.claude-msg-error     { background: rgba(224, 82, 82, 0.12); color: #e05252; border-left: 2px solid #e05252; }
.claude-hint          { color: var(--white-50); font-size: 11px; padding: 6px 0; line-height: 1.7; }
.claude-input-row     { display: flex; gap: 8px; padding: 0.75rem 1.25rem 1rem; border-top: 1px solid var(--white-10); background: var(--slate); }
.claude-input         { flex: 1; background: var(--white-06); border: 1px solid var(--white-10); color: var(--white); font-family: var(--font); font-size: 12px; padding: 8px 10px; outline: none; transition: border-color 0.15s; }
.claude-input:focus   { border-color: var(--gold); }
.claude-input::placeholder { color: var(--white-20); }
#claude-toggle        { transition: transform 0.2s; }
#claude-toggle.open   { transform: rotate(180deg); }

/* CUSTOMER FORECAST UPLOAD (V6.89) — list of uploaded files below the
   upload card, with filename + timestamp + per-row delete button. */
.customer-forecast-card { border-left: 3px solid var(--gold-light); }
.cf-uploads-list { margin-top: 1rem; border-top: 1px solid var(--white-10); }
.cf-upload-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--white-06); font-size: 12px; }
.cf-upload-row:last-child { border-bottom: none; }
.cf-upload-meta { color: var(--white-50); font-size: 10px; margin-top: 2px; }
.cf-remove-btn { background: transparent; border: 1px solid rgba(224,82,82,0.3); color: #e05252; padding: 4px 12px; font-size: 9px; font-family: var(--font); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; transition: all 0.15s; flex-shrink: 0; }
.cf-remove-btn:hover { background: rgba(224,82,82,0.12); border-color: #e05252; }
.cf-summary { margin-top: 0.75rem; font-size: 10px; color: var(--white-50); padding: 0 12px; letter-spacing: 0.05em; }

/* RESPONSIVE */
@media (max-width: 960px) {
  .sidebar { display: none; }
  .upload-grid { grid-template-columns: 1fr; }
  .erp-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .parse-stats { grid-template-columns: 1fr 1fr; }
}
