/* ===========================================
   CutQuote — Theme System
   Dark (default) + Light theme via data-theme attribute
   =========================================== */

/* ─── Dark theme (default) — Forge design system ─── */
:root, [data-theme="dark"] {
  --bg: #0f1117;
  --bg-alt: #0a0c10;
  --panel: #161a23;
  --panel-alt: #1e2330;
  --border: rgba(255, 255, 255, 0.07);
  --accent: #4a9eff;
  --accent-hover: #6db8ff;
  --accent-dim: rgba(74, 158, 255, 0.12);
  --accent-glow: 0 0 20px rgba(74, 158, 255, 0.15);
  --text: #e8ecf4;
  --text-dim: #8b92a5;
  --text-muted: #555d73;
  --danger: #ff6b6b;
  --success: #4adf8a;
  --warning: #ffb84a;
  --price: #f1f5f9;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --toggle-bg: rgba(255,255,255,0.15);
  --toggle-hover: rgba(255,255,255,0.22);
}

/* ─── Light theme — "Clean Workshop" warm cream ─── */
[data-theme="light"] {
  --bg: #f5f3f0;
  --bg-alt: #ece9e4;
  --panel: #ffffff;
  --panel-alt: #faf9f7;
  --border: #e2dfd9;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-dim: rgba(37, 99, 235, 0.08);
  --accent-glow: 0 0 20px rgba(37, 99, 235, 0.10);
  --text: #1a1a2e;
  --text-dim: #5c5c73;
  --text-muted: #9c9cb0;
  --danger: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --price: #0f172a;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --toggle-bg: rgba(0,0,0,0.18);
  --toggle-hover: rgba(0,0,0,0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

#app {
  height: 100vh;
  overflow: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { background: var(--border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: var(--accent-glow); }
.btn-primary:focus-visible { box-shadow: 0 0 0 3px var(--accent-dim), var(--accent-glow); outline: none; }
.btn-accent { background: var(--success); border-color: var(--success); color: #fff; }
.btn-accent:hover { background: var(--success); border-color: var(--success); opacity: 0.9; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; font-weight: 600; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { border-color: rgba(255, 90, 90, 0.25); color: var(--text-muted); background: transparent; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(255, 107, 107, 0.08); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--panel-alt); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-full { width: 100%; }

/* ─── FORMS ─── */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim), var(--accent-glow);
}
input::placeholder { color: var(--text-muted); }

.error-msg {
  color: var(--danger);
  font-size: 13px;
  min-height: 20px;
  margin: 8px 0;
}

/* ─── AUTH PAGES ─── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-alt);
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
}
.accent { color: var(--accent); }
.tagline {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 4px;
}
.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 13px;
}
.auth-forgot {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
}
.auth-forgot a {
  color: var(--text-muted);
}
.auth-forgot a:hover {
  color: var(--accent);
}

/* ─── APP LAYOUT (Sidebar + Main) ─── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── SIDEBAR — always dark, even in light theme ─── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: linear-gradient(180deg, #161a24 0%, #0f1117 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.sidebar-logo {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-logo h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #e8ecf4;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.sidebar-brand-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #e8ecf4;
  font-family: 'Sora', sans-serif;
}
.sidebar-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-icon-btn {
  background: none;
  border: none;
  padding: 6px;
  border-radius: 8px;
  color: #555d73;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-icon-btn:hover {
  color: #e8ecf4;
  background: rgba(255, 255, 255, 0.08);
}
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
}
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #8b92a5;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #e8ecf4; text-decoration: none; }
.nav-item.active {
  background: rgba(74, 158, 255, 0.1);
  color: #4a9eff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #4a9eff;
}
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}
.nav-new-quote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 10px 8px;
  padding: 9px 14px;
  background: var(--accent, #4a9eff);
  color: #fff;
  border-radius: 8px;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  cursor: pointer;
}
.nav-new-quote:hover {
  background: #3b8ce8;
  box-shadow: 0 2px 10px rgba(74, 158, 255, 0.35);
  text-decoration: none;
}
.nav-new-quote:active {
  box-shadow: none;
  filter: brightness(0.9);
}
.nav-new-quote svg {
  flex-shrink: 0;
}
.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 8px 12px;
}
.nav-section {
  padding: 8px 12px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #555d73;
  font-weight: 600;
}
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-footer .btn {
  color: #e8ecf4;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}
.sidebar-footer .btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.user-info {
  margin-bottom: 8px;
}
.user-email {
  display: block;
  font-size: 12px;
  color: #e8ecf4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-company {
  display: block;
  font-size: 11px;
  color: #555d73;
}

/* ─── MAIN CONTENT ─── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  position: relative;
}
.main-content::before {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse at top right, rgba(74, 158, 255, 0.04) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] .main-content::before {
  background: radial-gradient(ellipse at top right, rgba(37, 99, 235, 0.03) 0%, transparent 65%);
}

/* ─── PAGE HEADER ─── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}
.page-header h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* ─── PANELS ─── */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
}
[data-theme="light"] .panel {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.panel h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── STATS ROW ─── */
.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  text-align: center;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ─── QUOTE LIST ─── */
.quote-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.quote-list-item:hover { background: var(--panel-alt); }
.quote-list-item:last-child { border-bottom: none; }
.quote-number {
  font-weight: 600;
  color: var(--accent);
  font-size: 14px;
}
.quote-customer {
  color: var(--text);
  font-size: 13px;
}
.quote-date {
  color: var(--text-muted);
  font-size: 12px;
}
.quote-total {
  font-weight: 600;
  color: var(--success);
  font-size: 14px;
}
.quote-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.status-draft { background: var(--panel-alt); color: var(--text-dim); }
.status-sent { background: rgba(74,158,255,0.15); color: var(--accent); }
.status-accepted { background: rgba(74,223,138,0.15); color: var(--success); }
.status-declined { background: rgba(255,90,90,0.15); color: var(--danger); }

/* ─── SETTINGS PAGES ─── */
.settings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.settings-hint {
  color: var(--text-dim);
  font-size: 13px;
}

/* ─── Account Tabs ─── */
.account-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow-x: auto;
}
.account-tab {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.account-tab:hover {
  color: var(--text);
  background: var(--panel-alt);
}
.account-tab.active {
  color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
}

/* ─── CARDS (Machine profiles, Materials) ─── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s, border-color 0.25s;
}
[data-theme="light"] .card {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.card-default {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.expand-arrow {
  font-size: 10px;
  color: var(--text-dim);
  width: 14px;
}
.card-title {
  font-weight: 600;
  font-size: 15px;
}
.card-actions {
  display: flex;
  gap: 6px;
}
.card-body {
  padding: 16px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.card-stat {
  text-align: center;
}
.card-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.card-stat-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}

/* ─── BADGES ─── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--panel-alt);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.badge-accent {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: transparent;
}
.badge-dim {
  background: transparent;
  border-color: var(--border);
}

/* ─── FORM PANELS ─── */
.form-panel {
  margin-bottom: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.form-grid-tight {
  grid-template-columns: repeat(3, 1fr);
}
.span-2 { grid-column: span 2; }

/* ── Forge Toggle Switch ── */
.forge-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-top: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease-out, background 0.15s ease-out;
  user-select: none;
}
.forge-toggle:hover {
  border-color: rgba(74, 158, 255, 0.25);
  background: var(--accent-dim);
}
.forge-toggle input[type="checkbox"] {
  display: none;
}
.forge-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  min-width: 44px;
  border-radius: 12px;
  background: var(--toggle-bg);
  transition: background 0.2s ease-out;
}
.forge-toggle input:checked + .forge-toggle-track {
  background: var(--accent);
}
.forge-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.forge-toggle input:checked + .forge-toggle-track::after {
  transform: translateX(20px);
}
.forge-toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.forge-toggle-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.sub-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 12px;
}

/* ─── CHECKBOX ─── */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: auto;
}

/* ─── SUCCESS MSG ─── */
.success-msg {
  color: var(--success);
  font-size: 13px;
  min-height: 20px;
  margin: 8px 0;
}

/* ─── DATA TABLES ─── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
}
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.data-table tr:last-child td { border-bottom: none; }
/* ─── Forge Row Hover (system-wide interactive table rows) ─── */
/* Apply .forge-table to any table for hover effect — no structural overrides */
/* Background on td (not tr) so it shows over inline td backgrounds */
.data-table tr:hover td,
.admin-table tbody tr:hover td,
.po-lines-table tbody tr:hover td,
.nest-parts-table tbody tr:hover td,
.forge-table tr:hover td {
  background: var(--accent-dim);
}
/* Shadow + left accent on the row itself */
.data-table tr:hover,
.admin-table tbody tr:hover,
.po-lines-table tbody tr:hover,
.nest-parts-table tbody tr:hover,
.forge-table tr:hover {
  box-shadow: inset 3px 0 0 var(--accent), 0 1px 6px rgba(0,0,0,0.15);
}
/* Exclude thead rows from hover */
.data-table thead tr:hover td,
.forge-table thead tr:hover td { background: transparent; }
.data-table thead tr:hover,
.forge-table thead tr:hover { box-shadow: none; }
.data-table tr[draggable="true"] { transition: opacity 0.15s; }
.data-table .drag-handle:active { cursor: grabbing; }
.td-actions {
  text-align: right;
  white-space: nowrap;
}
.td-actions .btn { margin-left: 4px; }

/* ─── QUOTE BUILDER TWO-PANEL LAYOUT ─── */
.quote-builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.qb-left, .qb-right {
  min-width: 0;
}
.qb-left .panel, .qb-right .panel {
  padding: 20px;
}
.qb-calc-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

/* ─── Form Row (2-col inline) ─── */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ─── Calculator Results ─── */
.calc-results {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.calc-results h4 {
  margin-bottom: 8px;
  color: var(--accent);
}
.cost-breakdown {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.cost-breakdown h4 {
  margin-bottom: 8px;
  color: var(--text);
}

/* ─── Features Section ─── */
.features-section {
  margin-top: 12px;
}
.features-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.features-header label {
  font-weight: 600;
  font-size: 0.9em;
  color: var(--text-dim);
}
.feature-add-btns {
  display: flex;
  gap: 4px;
}
.feature-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 6px 8px;
  background: var(--panel-alt);
  border-radius: var(--radius-sm);
}
.feature-row input {
  width: 70px;
  padding: 4px 6px;
  font-size: 0.85em;
}
.feature-label {
  font-size: 0.85em;
  color: var(--text-dim);
  min-width: 70px;
}

/* ─── Customer Info Section ─── */
.customer-info-section {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.customer-info-section h4 {
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 0.9em;
}

/* ─── Quote Items Section ─── */
.quote-items-section {
  margin-bottom: 16px;
}

/* ─── Inline Edit ─── */
.inline-edit {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: inherit;
  width: 100%;
}
.inline-edit:hover, .inline-edit:focus {
  border-color: var(--border);
  background: var(--panel-alt);
  outline: none;
}
.inline-edit-sm {
  width: 60px;
}

/* ─── Quote Totals ─── */
.quote-totals {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--panel-alt);
  border-radius: var(--radius);
}
.totals-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.95em;
}
.totals-row input {
  width: 60px;
  display: inline;
}
.totals-grand {
  border-top: 2px solid var(--accent);
  padding-top: 8px;
  margin-top: 4px;
  font-weight: 700;
  font-size: 1.1em;
  color: var(--accent);
}

/* ─── Quote Actions ─── */
.qb-quote-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Job Card dropdown */
.qb-quote-actions .btn-dropdown a:hover {
  background: var(--accent-dim, rgba(74,158,255,0.08));
}

/* ─── Calc Mode Toggle ─── */
.calc-mode-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.calc-mode-toggle .btn {
  flex: 1;
}

/* ─── DXF Tab Bar (multi-DXF upload) ─── */
.dxf-tab-bar-wrap {
  position: relative;
  margin-bottom: 10px;
  overflow: hidden;
}
.dxf-tab-bar-wrap .tab-scroll-btn {
  position: absolute;
  top: 0;
  bottom: 8px;
  width: 28px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.dxf-tab-bar-wrap .tab-scroll-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
.dxf-tab-bar-wrap .tab-scroll-btn.left {
  left: 0;
  background: linear-gradient(90deg, var(--panel) 50%, transparent);
}
.dxf-tab-bar-wrap .tab-scroll-btn.right {
  right: 0;
  background: linear-gradient(270deg, var(--panel) 50%, transparent);
}
.dxf-tab-bar {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.dxf-tab-bar::-webkit-scrollbar { display: none; }
.dxf-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--panel-alt);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
  border-bottom: none;
  transition: background 0.15s;
}
.dxf-tab:hover { background: var(--border); }
.dxf-tab.active {
  background: var(--panel);
  border-color: var(--border);
  color: var(--accent);
}
.dxf-tab-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  background: var(--border);
  color: var(--text-dim);
}
.dxf-tab-indicator.done {
  background: var(--success);
  color: #fff;
}
.dxf-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.dxf-tab-close {
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.dxf-tab-close:hover { color: var(--danger); }
.dxf-tab-add {
  color: var(--accent);
  font-size: 16px;
  padding: 6px 12px;
  opacity: 0.7;
}
.dxf-tab-add:hover { opacity: 1; }

/* Per-tab calc result summary */
.dxf-tab-calc-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-top: 10px;
  background: rgba(74, 158, 255, 0.08);
  border: 1px solid rgba(74, 158, 255, 0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dim);
}
.dxf-tab-calc-total {
  font-weight: 600;
  font-size: 14px;
}

/* Sticky action bar for multi-DXF */
.dxf-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 10px 0 4px;
  margin-top: 12px;
}

/* Floating "Add All to Quote" bar */
#qbDxfFloatingBar {
  margin-top: 8px;
}
.dxf-floating-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(74, 158, 255, 0.08);
  border: 1px solid rgba(74, 158, 255, 0.2);
  border-radius: var(--radius);
  transition: background 0.3s, border-color 0.3s;
}
.dxf-floating-bar-inner.all-complete {
  background: rgba(74, 223, 138, 0.1);
  border-color: rgba(74, 223, 138, 0.35);
}
.dxf-floating-bar-status {
  font-size: 13px;
  color: var(--text-dim);
}
.dxf-floating-bar-inner .btn-success {
  white-space: nowrap;
}
#qbDxfFloatingBar.all-done .dxf-floating-bar-inner {
  animation: floatBarPulse 0.6s ease;
}
@keyframes floatBarPulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ─── DXF Upload Section ─── */
.dxf-upload-section {
  margin-top: 8px;
}
.dxf-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-top: 12px;
}
.dxf-dropzone:hover, .dxf-dropzone-active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.dxf-dropzone-inner p {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 8px;
}
.dxf-dropzone-icon {
  font-size: 32px;
  display: block;
}
.dxf-browse-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  font-size: 13px;
  display: inline;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.dxf-parsed-info {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.dxf-upsell {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}
.dxf-upsell p {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}
.dxf-upsell a {
  color: var(--accent);
  font-weight: 600;
}

/* ─── DXF Multi-Shape Selection ─── */
.dxf-multi-shape-hint {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(74, 223, 138, 0.08);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--success);
}
.dxf-multi-shape-hint p {
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.dxf-multi-shape-hint kbd {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--text-dim);
}
.dxf-shape-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dxf-sel-count {
  color: var(--text-dim);
  font-size: 11px;
  margin-left: auto;
}
/* ─── DXF Layer Filter ─── */
.dxf-layer-filter { margin-top: 10px; }
.dxf-layer-filter > label { font-size: 12px; margin-bottom: 6px; display: block; }
.dxf-layer-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 160px;
  overflow-y: auto;
}
.dxf-layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.dxf-layer-item:last-child { border-bottom: none; }
.dxf-layer-item:hover { background: var(--panel-alt); }
.dxf-layer-item.excluded { opacity: 0.5; }
.dxf-layer-toggle {
  font-size: 16px;
  line-height: 1;
  color: var(--accent);
  flex-shrink: 0;
}
.dxf-layer-item.excluded .dxf-layer-toggle { color: var(--text-dim); }
.dxf-layer-name {
  color: var(--text);
  font-weight: 500;
}
.dxf-layer-count {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}

.dxf-shape-list {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 260px;
  overflow-y: auto;
}
.dxf-shape-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.dxf-shape-item:last-child { border-bottom: none; }
.dxf-shape-item:hover { background: var(--panel-alt); }
.dxf-shape-item.selected { background: var(--accent-dim); }
.dxf-shape-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dxf-shape-label {
  color: var(--text);
  font-weight: 500;
}
.dxf-shape-dims {
  color: var(--text-dim);
  font-size: 11px;
}
.dxf-shape-qty-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-dim);
}
.dxf-shape-qty-input {
  width: 60px;
  padding: 2px 4px;
  text-align: center;
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.dxf-shape-qty-input:focus {
  border-color: var(--accent);
  outline: none;
}
.dxf-shape-check {
  color: var(--success);
  font-weight: bold;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.dxf-shape-result {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.dxf-shape-result:last-of-type { border-bottom: none; }
.dxf-shape-result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.dxf-part-thumb {
  width: 72px;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  flex-shrink: 0;
}
.dxf-shape-result-title {
  flex: 1;
  min-width: 0;
}
.dxf-shape-result-title h5 {
  margin: 0 0 2px;
}
.dxf-shape-result-dims {
  color: var(--text-dim);
  font-size: 12px;
}
.dxf-shape-result-total {
  padding: 10px 0;
  font-size: 14px;
  color: var(--text);
}

/* ─── Accent text helper ─── */
.accent { color: var(--accent); }

/* ─── Shape Section (selector + params + thumbnail) ─── */
.shape-section {
  margin-bottom: 12px;
}
.shape-with-thumb {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.shape-fields {
  flex: 1;
  min-width: 0;
}
.shape-thumb-wrap {
  flex-shrink: 0;
  width: 140px;
  height: 120px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.shape-thumb {
  width: 100%;
  height: 100%;
  display: block;
}

/* ─── Preview Section (canvas + feature list below) ─── */
.preview-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.preview-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.preview-canvas-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.part-preview-canvas {
  width: 100%;
  height: 300px;
  display: block;
  cursor: default;
}

/* ─── Feature List (below preview canvas) ─── */
.feature-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}
.feature-list-empty {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 8px;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--panel-alt);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.feature-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.feature-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  min-width: 80px;
}
.feature-pos {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.feature-pos label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0;
  font-weight: 600;
}
.feature-pos input {
  width: 64px;
  padding: 5px 8px;
  font-size: 13px;
}
.feature-item .btn-sm {
  padding: 4px 8px;
  font-size: 12px;
  flex-shrink: 0;
  margin-left: 6px;
}

/* ─── Nesting Section ─── */
.nest-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.nest-section h4 {
  margin-bottom: 8px;
  color: var(--accent);
}
.nest-collapsible {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 12px;
}
.nest-collapsible-header {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  background: var(--panel-alt);
  user-select: none;
  border-radius: var(--radius);
}
.nest-collapsible.open .nest-collapsible-header {
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.nest-collapsible-header:hover {
  background: var(--border);
}
.nest-collapsible-arrow {
  display: inline-block;
  margin-right: 6px;
  font-size: 10px;
  transition: transform 0.15s;
}
.nest-collapsible-body {
  padding: 0;
}
.nest-collapsible-body .nest-canvas {
  border: none;
  border-radius: 0 0 var(--radius) var(--radius);
  min-height: 200px;
}
.nest-canvas {
  width: 100%;
  min-height: 200px;
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
  .quote-builder-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar { width: 60px; min-width: 60px; }
  .sidebar-logo h2, .sidebar-brand-text, .nav-item span:not(.nav-icon), .nav-section,
  .user-info, .sidebar-footer .btn, .sidebar-icons { display: none; }
  .sidebar-brand { justify-content: center; }
  .nav-new-quote span { display: none; }
  .nav-new-quote { justify-content: center; margin: 4px 6px 8px; padding: 10px; }
  .nav-divider { margin: 6px 8px; }
  .sidebar-logo { padding: 16px 8px; text-align: center; justify-content: center; }
  .nav-item { justify-content: center; padding: 12px; }
  .main-content { padding: 16px; }
  .stats-row { flex-direction: column; }
  .form-row-2 { grid-template-columns: 1fr; }
  .shape-with-thumb { flex-direction: column; }
  .shape-thumb-wrap { width: 100%; height: 100px; }
}

/* ─── Logo Upload (Account Settings) ─── */
.logo-upload-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.logo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-preview img {
  max-height: 60px;
  max-width: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 4px;
}
.logo-upload-btn {
  display: flex;
  align-items: center;
}
.text-dim { color: var(--text-dim); }

/* ─── Customer Save Row ─── */
.customer-save-row {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}
.customer-info-section select {
  margin-bottom: 8px;
}

/* ─── PDF Modal Overlay ─── */
.pdf-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pdf-modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 900px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #333);
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #e0e0e0);
  flex-shrink: 0;
}
.pdf-modal-actions {
  display: flex;
  gap: 8px;
}
.pdf-modal-iframe {
  flex: 1;
  border: none;
  background: #fff;
}

/* ─── Quote Terms Section ─── */
.quote-terms-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #333);
}

/* ===========================================
   Admin Dashboard Styles
   =========================================== */

/* Impersonation banner */
.admin-impersonate-bar {
  background: #dc2626;
  color: #fff;
  padding: 8px 20px;
  text-align: center;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.admin-impersonate-bar .btn { background: #fff; color: #dc2626; border: none; font-weight: 600; }

/* Admin tabs */
.admin-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border, #333);
}
.admin-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active {
  color: var(--accent, #1a6dcc);
  border-bottom-color: var(--accent, #1a6dcc);
}

/* Stats grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.admin-stat-card {
  background: var(--panel);
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  padding: 20px;
}
.admin-stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.admin-stat-card.accent .stat-value { color: var(--accent, #1a6dcc); }
.admin-stat-card.success .stat-value { color: #22c55e; }
.admin-stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.admin-stat-card .stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  opacity: 0.7;
}

/* Sections */
.admin-section {
  margin-bottom: 28px;
}
.admin-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table thead th {
  background: var(--panel);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border, #333);
}
.admin-table thead th.c { text-align: center; }
.admin-table thead th.r { text-align: right; }
.admin-table tbody td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border, #333);
  color: var(--text-primary);
}
.admin-table tbody td.c { text-align: center; }
.admin-table tbody td.r { text-align: right; }
/* admin-table hover — now handled by Forge Row Hover */

/* Status pills */
.admin-status-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.status-pill {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border, #333);
  text-align: center;
}
.status-pill .status-count {
  font-size: 22px;
  font-weight: 700;
  display: block;
  color: var(--text-primary);
}
.status-pill .status-name {
  font-size: 11px;
  text-transform: capitalize;
  color: var(--text-muted);
}
.status-pill.paid .status-count { color: #22c55e; }
.status-pill.sent .status-count { color: var(--accent, #1a6dcc); }
.status-pill.accepted .status-count { color: #f59e0b; }
.status-pill-sm {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--panel);
  border: 1px solid var(--border, #333);
}
.status-pill-sm.paid { color: #22c55e; border-color: #22c55e; }
.status-pill-sm.sent { color: var(--accent, #1a6dcc); border-color: var(--accent, #1a6dcc); }
.status-pill-sm.accepted { color: #f59e0b; border-color: #f59e0b; }
.status-pill-sm.draft { color: var(--text-muted); }

/* Mini bar chart for revenue */
.mini-bar {
  height: 8px;
  background: var(--accent, #1a6dcc);
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.3s;
}

/* ===========================================
   Dashboard — Modern Command Center
   =========================================== */

/* Loading state */
.dash-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 20px;
  color: var(--text-dim);
  font-size: 14px;
}
.dash-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: dash-spin 0.7s linear infinite;
}
@keyframes dash-spin {
  to { transform: rotate(360deg); }
}

/* Header */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-greeting {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
}
.dash-subtitle {
  color: var(--text-dim);
  font-size: 14px;
}
.dash-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-period-toggle {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.dash-period-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.dash-period-btn:hover {
  color: var(--text);
  background: var(--panel-alt);
}
.dash-period-btn.active {
  background: var(--accent);
  color: #fff;
}

/* KPI Cards Row */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.dash-kpi-card {
  background: linear-gradient(135deg, rgba(30, 35, 50, 0.7) 0%, rgba(20, 24, 35, 0.5) 100%);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  box-shadow: var(--shadow-sm);
  animation: kpiFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.dash-kpi-card:nth-child(1) { animation-delay: 0s; }
.dash-kpi-card:nth-child(2) { animation-delay: 0.08s; }
.dash-kpi-card:nth-child(3) { animation-delay: 0.16s; }
.dash-kpi-card:nth-child(4) { animation-delay: 0.24s; }
.dash-kpi-card:hover {
  border-color: rgba(74, 158, 255, 0.3);
  box-shadow: var(--shadow-md), var(--accent-glow);
  transform: translateY(-2px);
}
[data-theme="light"] .dash-kpi-card {
  background: var(--panel);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

/* ── Orders KPI Cards (mirrors dashboard KPI cards) ── */
.orders-kpi-card {
  background: linear-gradient(135deg, rgba(30, 35, 50, 0.7) 0%, rgba(20, 24, 35, 0.5) 100%);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  box-shadow: var(--shadow-sm);
}
.orders-kpi-card:hover {
  border-color: rgba(74, 158, 255, 0.3);
  box-shadow: var(--shadow-md), var(--accent-glow);
  transform: translateY(-2px);
}
[data-theme="light"] .orders-kpi-card {
  background: var(--panel);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.dash-kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}
.dash-kpi-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dash-kpi-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.2;
}
.dash-kpi-success {
  color: var(--success);
}
.dash-kpi-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
  font-weight: 500;
}

/* Forge entrance animation */
@keyframes kpiFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Charts Row */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.dash-chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.dash-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.dash-chart-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}
.dash-chart-total {
  font-size: 12px;
  color: var(--text-dim);
}
.dash-chart-body {
  height: 150px;
}

/* Pipeline + Setup Row */
.dash-pipeline-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.dash-pipeline-card,
.dash-setup-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.dash-pipeline-card h3,
.dash-setup-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  text-transform: none;
  letter-spacing: 0;
}

/* Pipeline bars */
.dash-pipeline-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-pipe-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-pipe-label {
  width: 60px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: right;
  flex-shrink: 0;
}
.dash-pipe-track {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.dash-pipe-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.dash-pipe-count {
  width: 28px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}
.dash-pipeline-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.dash-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-dim);
}
.dash-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Setup checklist */
.dash-setup-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-setup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}
.dash-setup-row.done {
  border-color: rgba(74, 223, 138, 0.2);
  background: rgba(74, 223, 138, 0.04);
}
.dash-setup-info {
  flex: 1;
  min-width: 0;
}
.dash-setup-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.dash-setup-hint {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
}

/* Stripe CTA */
.dash-stripe-cta {
  margin-top: 14px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(74, 158, 255, 0.08) 100%);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
}
.dash-stripe-cta-icon {
  color: #22c55e;
  flex-shrink: 0;
}
.dash-stripe-cta-text {
  flex: 1;
  min-width: 0;
}
.dash-stripe-cta-text strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}
.dash-stripe-cta-text p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  margin: 0;
}

/* Lifetime Stats Bar */
.dash-lifetime-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-bottom: 20px;
}
.dash-lifetime-item {
  flex: 1;
  text-align: center;
}
.dash-lifetime-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.3;
}
.dash-lifetime-label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}
.dash-lifetime-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  margin: 0 8px;
}

/* Responsive */
@media (max-width: 1100px) {
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-charts-row { grid-template-columns: 1fr; }
  .dash-pipeline-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dash-kpi-row { grid-template-columns: 1fr; }
  .dash-header { flex-direction: column; }
  .dash-controls { flex-direction: column; align-items: stretch; }
  .dash-lifetime-bar { flex-wrap: wrap; gap: 12px; }
  .dash-lifetime-divider { display: none; }
  .dash-lifetime-item { min-width: 45%; }
}

/* ─── Notification Bell ─── */
.notif-bell {
  position: relative;
}
.notif-badge {
  position: absolute;
  top: 0; right: 0;
  background: #ff5a5a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  padding: 0 4px;
}
.notif-dropdown {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 380px;
  max-height: 460px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 1000;
  overflow: hidden;
}
.notif-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.notif-dropdown-body {
  overflow-y: auto;
  max-height: 400px;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.notif-item:hover {
  background: rgba(255,255,255,0.04);
}
.notif-item.unread {
  background: rgba(74,158,255,0.06);
  border-left: 3px solid #4a9eff;
}
.notif-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.notif-content {
  flex: 1;
  min-width: 0;
}
.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.notif-message {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-time {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
  margin-top: 3px;
}

/* ─── ACTIVE ORDERS ─── */
.dash-active-orders h3 svg {
  display: inline;
}
.dash-delivered-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-delivered-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(6,182,212,0.05);
  font-size: 13px;
}
.dash-delivered-quote {
  font-weight: 600;
  color: #06b6d4;
  min-width: 80px;
}
.dash-delivered-customer {
  flex: 1;
  color: var(--text-muted);
}
.dash-delivered-total {
  font-weight: 600;
  color: var(--text);
  min-width: 80px;
  text-align: right;
}
.dash-delivered-date {
  color: var(--text-muted);
  font-size: 12px;
  min-width: 80px;
  text-align: right;
}

/* =========================================
   Onboarding Wizard
   ========================================= */
.onboarding-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.onboarding-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.onboarding-header {
  text-align: center;
  padding: 24px 32px 0;
}
.onboarding-header h1 {
  font-size: 26px;
  margin: 0;
  color: var(--text);
}
.onboarding-subtitle {
  color: var(--text-dim);
  margin: 4px 0 16px;
  font-size: 14px;
}

/* Progress Steps */
.onboarding-progress {
  margin-bottom: 4px;
}
.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}
.progress-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--panel-alt);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.3s;
}
.progress-step.active .progress-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.progress-step.done .progress-dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  font-size: 16px;
}
.progress-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}
.progress-step.active .progress-label {
  color: var(--accent);
}
.progress-step.done .progress-label {
  color: var(--success);
}
.progress-line {
  width: 60px;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  margin-bottom: 20px;
}

/* Wizard Body */
.onboarding-body {
  padding: 20px 32px 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.onboarding-footer {
  padding: 12px 32px 20px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
}
.wizard-step h3 {
  margin: 0 0 4px;
  font-size: 20px;
  color: var(--text);
}
.step-desc {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 16px;
  line-height: 1.5;
}

/* Logo Upload */
.logo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.logo-upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
}
.logo-icon {
  font-size: 28px;
  color: var(--accent);
  font-weight: 300;
}
.logo-hint {
  font-size: 11px;
  color: var(--text-muted);
}
.logo-preview {
  max-width: 180px;
  max-height: 80px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* Form Row */
.form-row {
  display: flex;
  gap: 12px;
}

/* Laser Type Selector */
.laser-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.laser-type-btn {
  background: var(--panel-alt);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.laser-type-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.laser-type-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent);
}
.laser-type-icon {
  font-size: 28px;
  margin-bottom: 2px;
  color: var(--text);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}
.laser-type-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.laser-type-desc {
  font-size: 11px;
  color: var(--text-dim);
}

/* Power Grid */
.power-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.power-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--panel-alt);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.power-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.power-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Seed Summary */
.seed-summary {
  background: var(--accent-dim);
  border: 1px solid rgba(74, 158, 255, 0.2);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 16px;
}
.seed-summary h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}
.seed-summary ul {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.8;
}
.seed-summary li strong {
  color: var(--text);
}

/* Wizard Actions */
.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 0;
  gap: 12px;
}
.wizard-actions .arrow {
  margin: 0 2px;
}

/* Done Step */
.wizard-done {
  text-align: center;
}
.done-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 32px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.done-summary {
  text-align: left;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 20px 0;
}
.done-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
}
.done-item + .done-item {
  border-top: 1px solid var(--border);
}
.done-check {
  color: var(--success);
  font-size: 16px;
  font-weight: bold;
  margin-top: 2px;
  flex-shrink: 0;
}
.done-item strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}
.done-detail {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 2px;
}
.done-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin: 16px 0 0;
}
.done-video-link {
  margin-top: 16px;
  text-align: center;
}

/* Field Hint */
.field-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Optional Label Tag */
.optional {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 11px;
}

/* Large Primary Button */
.btn-lg {
  padding: 12px 32px;
  font-size: 16px;
}

/* Wizard Divider */
.wizard-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* Checkbox Label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* =========================================
   Workflow Info Cards (dismissible)
   ========================================= */
.workflow-info {
  background: var(--accent-dim);
  border: 1px solid rgba(74, 158, 255, 0.2);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  position: relative;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.workflow-info-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.workflow-info-body {
  flex: 1;
}
.workflow-info-body strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}
.workflow-info-dismiss {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  line-height: 1;
  border-radius: var(--radius-sm);
}
.workflow-info-dismiss:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

/* ─── Video Demo Modal ─── */
.video-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
.video-modal {
  width: 90vw;
  max-width: 960px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalSlideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.video-modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.video-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.video-modal-close:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.video-modal-body {
  position: relative;
  padding-top: 56.25%; /* 16:9 */
}
.video-modal-body iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.workflow-info-video {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}
.workflow-info-video:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
.workflow-info-video svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ─── Vendor Help Button & Panel ─── */
.vendor-help-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.vendor-help-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}
.vendor-help-btn svg { pointer-events: none; }

.vendor-help-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  max-height: 600px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 48px rgba(0,0,0,0.4);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  animation: vendorHelpSlideUp 0.2s ease-out;
  overflow: hidden;
}
@keyframes vendorHelpSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.vendor-help-panel.closing {
  animation: vendorHelpSlideDown 0.15s ease-in forwards;
}
@keyframes vendorHelpSlideDown {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(20px); }
}

.vendor-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.vendor-help-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.vendor-help-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  padding: 0 4px;
  line-height: 1;
}
.vendor-help-close:hover { color: var(--text); }

.vendor-help-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.vendor-help-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.vendor-help-tab:hover { color: var(--text); }
.vendor-help-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.vendor-help-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.vendor-help-pane { display: none; }
.vendor-help-pane.active { display: block; }

.vendor-help-form .form-group {
  margin-bottom: 12px;
}
.vendor-help-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.vendor-help-form input,
.vendor-help-form textarea,
.vendor-help-form select {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}
.vendor-help-form textarea {
  resize: vertical;
  min-height: 100px;
}
.vendor-help-form .form-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.vendor-help-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.vendor-help-status {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}
.vendor-help-status.success {
  background: rgba(52,211,153,0.12);
  color: var(--success);
}
.vendor-help-status.error {
  background: rgba(248,113,113,0.12);
  color: var(--danger);
}

.vendor-help-screenshot-preview {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 120px;
}
.vendor-help-screenshot-preview img {
  width: 100%;
  height: auto;
  display: block;
}
.vendor-help-screenshot-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}
.vendor-help-screenshot-label svg { flex-shrink: 0; }

/* ─── Booking Modal (large centered popover) ─── */
.vendor-booking-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: vendorFadeIn 0.15s ease-out;
}
@keyframes vendorFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.vendor-booking-modal {
  width: 90vw;
  max-width: 800px;
  height: 80vh;
  max-height: 700px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.vendor-booking-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.vendor-booking-modal-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.vendor-booking-modal-body {
  flex: 1;
  overflow: hidden;
}
.vendor-booking-modal-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* ─── Forge Scrollbar (system-wide for modals + scrollable panels) ─── */
.modal-overlay *::-webkit-scrollbar,
#partDetailContent::-webkit-scrollbar {
  width: 6px;
}
.modal-overlay *::-webkit-scrollbar-track,
#partDetailContent::-webkit-scrollbar-track {
  background: transparent;
}
.modal-overlay *::-webkit-scrollbar-thumb,
#partDetailContent::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}
.modal-overlay *::-webkit-scrollbar-thumb:hover,
#partDetailContent::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.22);
}
/* Light theme */
[data-theme="light"] .modal-overlay *::-webkit-scrollbar-thumb,
[data-theme="light"] #partDetailContent::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
}
[data-theme="light"] .modal-overlay *::-webkit-scrollbar-thumb:hover,
[data-theme="light"] #partDetailContent::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.28);
}
/* Firefox */
.modal-overlay *, #partDetailContent {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
[data-theme="light"] .modal-overlay *,
[data-theme="light"] #partDetailContent {
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}

/* ─── Generic Forge Modal (reusable) ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
.modal-overlay.visible {
  opacity: 1;
}
.modal-overlay .modal-content {
  width: 90vw;
  max-width: 480px;
  max-height: 85vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-overlay.visible .modal-content {
  transform: translateY(0) scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover {
  color: var(--text);
}
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─── Material Product Edit Modal ─── */
.mat-product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: vendorFadeIn 0.15s ease-out;
}
.mat-product-modal {
  width: 90vw;
  max-width: 640px;
  max-height: 85vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mat-product-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mat-product-modal-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.mat-product-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
}
.mat-product-modal-body::-webkit-scrollbar {
  display: none;                  /* Chrome/Safari */
}

/* ─── NestAPI Forge Modals ─── */
.nest-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1600;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
.nest-modal-overlay.visible {
  opacity: 1;
}
.nest-modal {
  width: 90vw;
  max-width: 520px;
  max-height: 88vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.nest-modal-overlay.visible .nest-modal {
  transform: translateY(0) scale(1);
}
.nest-modal.large {
  max-width: 960px;
}
.nest-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.nest-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nest-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.nest-modal-body::-webkit-scrollbar {
  width: 6px;
}
.nest-modal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.nest-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
/* Params grid */
.nest-params-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.nest-params-grid .form-group {
  margin-bottom: 0;
}
.nest-params-grid label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}
.nest-params-grid input,
.nest-params-grid select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
/* Toggle inside nest params — strip container chrome for inline use */
.nest-params-grid .forge-toggle {
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  height: 38px;
  display: flex;
  align-items: center;
}
.nest-params-grid .forge-toggle:hover {
  background: none;
  border-color: transparent;
}
/* Progress stats table */
.nest-progress-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 12px;
}
.nest-progress-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}
.nest-progress-table td {
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text);
}
.nest-progress-table tr:last-child td {
  font-weight: 700;
  color: var(--accent);
}
/* KPI row */
.nest-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.nest-kpi-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}
.nest-kpi-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.nest-kpi-value {
  font-size: 20px;
  font-weight: 800;
}
/* Sheet render gallery */
.nest-sheet-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.nest-sheet-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
/* NestAPI sheet render image wrapper — used in both modal and inline results */
.nest-sheet-img-wrap {
  background: #fff;
}
.nest-sheet-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
.nest-sheet-card .nest-sheet-stats {
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.nest-sheet-stats b {
  color: var(--text);
}
/* Timer ring */
.nest-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.nest-timer-ring {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.nest-timer-ring svg {
  transform: rotate(-90deg);
}
.nest-timer-ring .ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 4;
}
.nest-timer-ring .ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s linear;
}
.nest-timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.nest-timer-info {
  flex: 1;
}
.nest-timer-phase {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.nest-timer-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Thin styled scrollbar for FabOps linked tables (supplier modal) */
.fo-linked-scroll {
  scrollbar-width: thin;                         /* Firefox */
  scrollbar-color: var(--border) transparent;    /* Firefox: thumb track */
}
.fo-linked-scroll::-webkit-scrollbar {
  width: 4px;
}
.fo-linked-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.fo-linked-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.fo-linked-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ─── FabOps: Purchase Orders ─── */
.po-status-badge, .po-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.po-status-new        { background: rgba(85,93,115,0.18); color: var(--text-muted); }
.po-status-sent       { background: rgba(74,158,255,0.15); color: #4a9eff; }
.po-status-partially_received { background: rgba(255,184,74,0.15); color: #ffb84a; }
.po-status-fully_received     { background: rgba(74,223,138,0.15); color: #4adf8a; }
.po-status-cancelled  { background: rgba(255,107,107,0.15); color: #ff6b6b; }
.po-type-goods        { background: rgba(74,158,255,0.12); color: #4a9eff; }
.po-type-services     { background: rgba(6,182,212,0.15); color: #06b6d4; }

.po-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.po-detail-grid .form-group { margin-bottom: 0; }
.po-detail-grid .form-group label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
  display: block;
}
.po-detail-grid .form-group input,
.po-detail-grid .form-group select,
.po-detail-grid .form-group textarea {
  width: 100%;
  box-sizing: border-box;
}

.po-lines-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.po-lines-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
}
.po-lines-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}
/* po-lines-table hover — now handled by Forge Row Hover */
.po-lines-table .po-line-desc {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.po-lines-table .po-line-actions {
  text-align: right;
  white-space: nowrap;
}

.po-action-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.po-action-bar .btn { font-size: 13px; }

.po-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-top: 12px;
  font-size: 13px;
}
.po-totals .po-total-row {
  display: flex;
  gap: 16px;
  align-items: baseline;
}
.po-totals .po-total-label {
  color: var(--text-dim);
  min-width: 120px;
  text-align: right;
}
.po-totals .po-total-value {
  min-width: 100px;
  text-align: right;
  font-weight: 600;
}
.po-totals .po-grand-total .po-total-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--price);
}

.po-add-line-modal {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.po-add-line-body {
  width: 520px; max-width: 96vw;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px;
}
.po-add-line-body h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 700;
}
.po-add-line-body .form-group {
  margin-bottom: 12px;
}
.po-add-line-body .form-group label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
  display: block;
}
.po-add-line-body .po-line-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.po-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.po-header-row h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.po-back-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}
.po-back-link:hover { color: var(--accent); }

[data-theme="light"] .po-status-new   { background: rgba(85,93,115,0.10); }
[data-theme="light"] .po-status-sent  { background: rgba(37,99,235,0.10); color: #2563eb; }
[data-theme="light"] .po-status-partially_received { background: rgba(217,119,6,0.10); color: #d97706; }
[data-theme="light"] .po-status-fully_received     { background: rgba(5,150,105,0.10); color: #059669; }
[data-theme="light"] .po-status-cancelled  { background: rgba(220,38,38,0.10); color: #dc2626; }
[data-theme="light"] .po-type-goods    { background: rgba(37,99,235,0.08); color: #2563eb; }
[data-theme="light"] .po-type-services { background: rgba(6,182,212,0.10); color: #0891b2; }

.mat-product-modal-body .sub-form {
  border: none;
  padding: 0;
  margin: 0;
  background: none;
}

/* =========================================
   Break-Even Calculator Modal
   ========================================= */
.be-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 24px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  animation: beOverlayIn 0.2s ease-out both;
}
@keyframes beOverlayIn { from { opacity: 0; } to { opacity: 1; } }

.be-panel {
  width: 720px; max-width: 96vw;
  max-height: calc(100vh - 48px);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: bePanelIn 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes bePanelIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

.be-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.be-header-left { display: flex; align-items: center; gap: 12px; }
.be-title { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; letter-spacing: -0.3px; }
.be-subtitle { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }
.be-close {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.be-close:hover { border-color: var(--danger); color: var(--danger); background: rgba(255,107,107,0.08); }

.be-body { flex: 1; overflow-y: auto; padding: 20px; }

.be-section { margin-bottom: 16px; }
.be-section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.be-cog-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 2px; display: inline-flex; align-items: center; border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.be-cog-btn:hover { color: var(--accent); background: var(--accent-dim); }

/* Schedule row */
.be-schedule-grid {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.be-schedule-item { display: flex; flex-direction: column; gap: 3px; }
.be-schedule-item .be-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.be-schedule-item .be-input-sm { width: 80px; }
.be-schedule-result {
  margin-left: auto; display: flex; align-items: baseline; gap: 6px;
  padding: 6px 12px; background: var(--accent-dim); border-radius: var(--radius-sm);
}
.be-hours-value { font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: -0.3px; }
.be-hours-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }

/* Costs grid */
.be-costs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Input rows */
.be-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.be-row:last-child { margin-bottom: 0; }
.be-row-label {
  font-size: 13px; color: var(--text); font-weight: 400; flex: 1;
}
.be-row-hint { display: block; font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.be-row-input { display: flex; align-items: center; gap: 6px; }
.be-input {
  width: 110px; padding: 8px 10px; font-size: 14px; font-weight: 500;
  text-align: right; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.be-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.be-unit { font-size: 11px; color: var(--text-muted); font-weight: 500; min-width: 36px; }

/* Results area */
.be-results {
  margin-top: 16px; padding: 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
}
.be-result-main { text-align: center; margin-bottom: 14px; }
.be-result-value {
  font-size: 32px; font-weight: 800; color: var(--accent);
  letter-spacing: -0.5px; line-height: 1.2;
}
.be-result-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-top: 4px; }

/* Breakdown rows */
.be-bd-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.be-bd-row:last-child { margin-bottom: 0; }
.be-bd-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.be-bd-name { font-size: 12px; color: var(--text-dim); width: 110px; flex-shrink: 0; }
.be-bd-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,0.04); border-radius: 3px; overflow: hidden; }
.be-bd-bar { height: 100%; border-radius: 3px; transition: width 0.3s ease; min-width: 0; }
.be-bd-val { font-size: 12px; font-weight: 600; color: var(--text); width: 64px; text-align: right; }
.be-bd-pct { font-size: 11px; color: var(--text-muted); width: 32px; text-align: right; }

.be-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 20px; border-top: 1px solid var(--border); flex-shrink: 0;
}

/* Sub-modal (lease, labor, facility calculators) */
.be-sub-overlay {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(2px);
}
.be-sub-panel {
  width: 480px; max-width: 94vw; max-height: 90vh;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.be-sub-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.be-sub-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 0; }
.be-sub-body { padding: 20px; overflow-y: auto; flex: 1; }
.be-sub-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 20px; border-top: 1px solid var(--border);
}
.be-sub-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted);
  margin: 14px 0 8px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.be-sub-section-label:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.be-sub-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.be-sub-row:last-child { margin-bottom: 0; }
.be-sub-label { font-size: 13px; color: var(--text); flex: 1; }
.be-sub-result {
  margin-top: 16px; padding: 16px; text-align: center;
  background: var(--accent-dim); border: 1px solid rgba(74,158,255,0.2);
  border-radius: var(--radius);
}
.be-sub-result-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 4px;
}
.be-sub-result-value {
  font-size: 28px; font-weight: 800; color: var(--accent);
  letter-spacing: -0.5px; line-height: 1.2;
}
.be-sub-result-detail { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Calculator trigger button (next to hourly rate inputs) */
.be-trigger-btn {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: var(--radius-sm); padding: 6px 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; transition: all 0.15s;
  white-space: nowrap;
}
.be-trigger-btn:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-dim);
}
.be-trigger-btn svg { flex-shrink: 0; }

/* Light theme overrides for breakdown bars */
[data-theme="light"] .be-bd-bar-wrap { background: rgba(0,0,0,0.06); }

/* Responsive */
@media (max-width: 768px) {
  .be-panel { width: 98vw; }
  .be-costs-grid { grid-template-columns: 1fr; }
  .be-schedule-grid { flex-direction: column; align-items: stretch; }
  .be-schedule-result { margin-left: 0; justify-content: center; }
}

@media (max-width: 500px) {
  .vendor-help-panel {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 8px;
    max-height: calc(100vh - 80px);
  }
  .vendor-booking-modal,
  .mat-product-modal {
    width: 96vw;
    height: 90vh;
    max-height: 90vh;
  }
}

/* ════════════════════════════════════════════════
   PAINTING CALCULATOR MODAL
   ════════════════════════════════════════════════ */
.painting-calc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease-out;
}
.painting-calc-modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  color: var(--text);
  animation: modalSlideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.painting-calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.painting-calc-section {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.painting-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.painting-field-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.painting-calc-grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.painting-calc-grid5 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  gap: 10px;
}
.painting-input {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.painting-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}
.painting-readonly {
  padding: 7px 10px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-sizing: border-box;
}
.painting-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}
.painting-slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  -webkit-appearance: auto;
  appearance: auto;
}
.painting-chip-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.painting-preset-chip {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.painting-preset-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.painting-preset-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.painting-preset-chip.small {
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 8px;
}
.painting-result-card {
  margin: 12px 20px;
  padding: 14px 18px;
  background: var(--accent-dim);
  border: 1px solid rgba(74, 158, 255, 0.2);
  border-radius: var(--radius-sm);
}
.painting-calc-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.sec-op-item:hover {
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
}
.painting-area-badge {
  white-space: nowrap;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 600px) {
  .painting-calc-grid3 { grid-template-columns: 1fr 1fr; }
  .painting-calc-grid5 { grid-template-columns: 1fr 1fr 1fr; }
  .painting-calc-modal { max-width: 98vw; }
}

/* ─── Programming Page ─── */
.programming-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0;
}

/* Header — machine selector + search bar (single line) */
.prog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.prog-header-left {
  flex-shrink: 0;
}
.prog-machine-select {
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 180px;
  padding: 6px 10px;
}
.prog-search-box {
  flex: 1;
  position: relative;
  max-width: 360px;
}
.prog-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.prog-search-input {
  padding-left: 32px !important;
  font-size: 0.85rem;
}
.prog-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
}

/* Two-panel layout */
.prog-layout {
  display: flex;
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.prog-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Filter chips (single compact row) */
.prog-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.prog-filter-select {
  font-size: 0.8rem;
  padding: 4px 8px;
  min-width: 120px;
  max-width: 180px;
  border-radius: var(--radius-sm);
}
.prog-count-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 4px;
}

/* Table wrapper */
.prog-table-wrap {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.prog-table {
  width: 100%;
  font-size: 0.82rem;
}
.prog-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 2;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 10px;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.prog-table tbody td {
  padding: 6px 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.prog-th-check { width: 36px; text-align: center; }
.prog-cell-check { width: 36px; text-align: center; }
.prog-sort-th { cursor: pointer; user-select: none; transition: color 0.15s; }
.prog-sort-th:hover { color: var(--accent); }
.prog-sort-th.active { color: var(--accent); font-weight: 700; }

/* Table rows */
.prog-row { cursor: pointer; transition: background 0.1s; }
.prog-row:hover { background: var(--accent-dim); }

/* DXF thumbnail in table */
.prog-cell-thumb { width: 44px; padding: 3px 4px !important; }
.prog-thumb {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.prog-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: crisp-edges;
}
.prog-thumb-empty {
  opacity: 0.4;
}

/* Part cell (stacked number + name) */
.prog-cell-part { min-width: 140px; }
.prog-part-number {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent);
  line-height: 1.2;
}
.prog-part-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* Quote / PO cell */
.prog-quote-link {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
}
.prog-po-ref {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Material chip */
.prog-material-chip {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--toggle-bg);
  border-radius: 10px;
  white-space: nowrap;
}

/* Empty state */
.prog-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Action bar (sticky bottom) */
.prog-action-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  margin-top: 10px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
}
.prog-action-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.prog-action-count {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
}
.prog-action-error {
  font-size: 0.8rem;
  color: var(--danger);
}

/* Pagination */
.prog-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── Nest Sidebar ─── */
.prog-sidebar {
  width: 260px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.prog-sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}
.prog-sidebar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 10px;
  padding: 0 6px;
}
.prog-sidebar-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Nest sidebar filters */
.prog-nest-filters {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prog-nest-status-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.prog-nest-tab {
  flex: 1;
  padding: 3px 4px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.prog-nest-tab:hover {
  color: var(--text);
  background: var(--panel-alt);
}
.prog-nest-tab.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.prog-nest-search {
  width: 100%;
  padding: 5px 24px 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.prog-nest-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.prog-nest-search::placeholder {
  color: var(--text-muted);
}
.prog-nest-pag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.prog-nest-pag .btn-sm {
  padding: 2px 8px;
  font-size: 0.75rem;
  min-width: 24px;
}

/* Nest cards */
.prog-nest-card {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.prog-nest-card:hover {
  background: var(--accent-dim);
}
.prog-nest-card:last-child {
  border-bottom: none;
}
.prog-nest-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.prog-nest-number {
  font-weight: 700;
  font-size: 0.85rem;
}
.prog-nest-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.prog-nest-card-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ─── Nest Detail View ─── */
.nest-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.nest-detail-header {
  margin-bottom: 16px;
}
/* Info grid — horizontal KPI-style cards */
.nest-info-grid {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.nest-info-card {
  flex: 1;
  min-width: 110px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.nest-info-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.nest-info-value {
  font-size: 0.95rem;
  font-weight: 700;
}
.nest-info-unit {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.nest-detail-notes {
  padding: 8px 12px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.nest-detail-items {
  flex: 1;
  overflow-y: auto;
}
.nest-detail-customer-group {
  margin-bottom: 20px;
}
.nest-detail-customer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 8px 0;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 10px;
  color: var(--text);
}
.nest-detail-po-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 6px 10px;
  font-weight: 500;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}
.nest-po-qty {
  margin-left: auto;
  font-size: 0.75rem;
  opacity: 0.7;
}
/* Parts table inside nest detail */
.nest-parts-table {
  margin-bottom: 14px;
}
.nest-parts-table th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 10px;
  border-bottom: 2px solid var(--border);
}
.nest-parts-table td {
  padding: 7px 10px;
  font-size: 0.82rem;
}
.nest-parts-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}
/* nest-parts-table hover — now handled by Forge Row Hover */
.nest-partname-cell {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nest-detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.badge-secondary { background: var(--text-muted); color: var(--bg); }

@media (max-width: 900px) {
  .prog-layout { flex-direction: column; }
  .prog-sidebar { width: 100%; max-height: 200px; }
}

/* ─── HELP SYSTEM — icon, slide-out panel, help center page ─── */

/* Help icon (? circle) */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  transition: background 0.15s ease-out, color 0.15s ease-out, box-shadow 0.15s ease-out;
  flex-shrink: 0;
  line-height: 1;
}
.help-icon:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--accent-glow);
}

/* Help panel overlay */
.help-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.25s ease-out;
  pointer-events: none;
}
.help-panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Help panel slide-out */
.help-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 2010;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.help-panel.open {
  transform: translateX(0);
}

.help-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.help-panel-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.help-panel-header-left svg { color: var(--accent); flex-shrink: 0; }
.help-panel-header-left h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}
.help-panel-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.help-panel-browse,
.help-panel-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.help-panel-browse:hover,
.help-panel-close:hover {
  background: var(--panel-alt);
  color: var(--text);
  border-color: var(--accent);
}
.help-panel-close {
  font-size: 20px;
  line-height: 1;
  padding: 2px 8px;
}

.help-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.help-panel-body h1, .help-panel-body h2, .help-panel-body h3, .help-panel-body h4 {
  color: var(--text);
  margin: 20px 0 8px;
  font-weight: 600;
}
.help-panel-body h2 { font-size: 16px; }
.help-panel-body h3 { font-size: 14px; }
.help-panel-body h4 { font-size: 13px; color: var(--text-dim); }
.help-panel-body p { margin: 0 0 12px; }
.help-panel-body ul, .help-panel-body ol { margin: 0 0 12px; padding-left: 20px; }
.help-panel-body li { margin-bottom: 4px; }
.help-panel-body strong { color: var(--text); font-weight: 600; }
.help-panel-body em { color: var(--text-dim); }
.help-panel-body a { color: var(--accent); text-decoration: none; }
.help-panel-body a:hover { text-decoration: underline; }
.help-panel-body code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 12px;
  font-family: 'SFMono-Regular', Consolas, monospace;
}
.help-panel-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  margin: 0 0 12px;
}
.help-panel-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
}
.help-panel-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 0 0 12px;
  padding: 8px 14px;
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-size: 13px;
}
.help-panel-body blockquote p { margin: 0; }
.help-panel-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.help-panel-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 12px;
  font-size: 13px;
}
.help-panel-body th, .help-panel-body td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}
.help-panel-body th {
  background: var(--panel-alt);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-dim);
}

/* Video button in help panel */
.help-video-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(74,158,255,0.2);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Sora', sans-serif;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.help-video-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}
.help-video-btn:hover svg { stroke: #fff; }
.help-video-inline { margin: 0 0 0 4px; padding: 4px 10px; font-size: 12px; }

/* Help panel footer */
.help-panel-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.help-related { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.help-related-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-right: 4px;
}
.help-related-link {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 8px;
  background: var(--accent-dim);
  border-radius: 10px;
  transition: background 0.15s;
}
.help-related-link:hover { background: rgba(74,158,255,0.2); }
.help-panel-footer-links {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}
.help-browse-all {
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
}
.help-browse-all:hover { color: var(--accent); }

/* ─── Help Center Page ─── */
.help-center {
  max-width: 1100px;
  margin: 0 auto;
}
.help-center-header {
  text-align: center;
  padding: 32px 0 24px;
}
.help-center-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 0 0 6px;
}
.help-center-subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 20px;
}
.help-center-search {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
}
.help-center-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.help-center-search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: 'Sora', sans-serif;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.help-center-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim), var(--accent-glow);
}
.help-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}
.help-search-clear:hover { color: var(--text); }

/* Video Library banner */
.help-video-library {
  margin-bottom: 24px;
}
.help-video-library-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-offset);
  border: 1px solid var(--border);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.help-video-library-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  flex-shrink: 0;
}
.help-video-library-text {
  flex: 1;
  min-width: 0;
}
.help-video-library-text h3 {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.help-video-library-text p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.help-video-library-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s;
}
.help-video-library-btn:hover {
  opacity: 0.85;
  color: #fff;
  text-decoration: none;
}

.help-center-body {
  display: flex;
  gap: 24px;
  padding-bottom: 40px;
}
.help-center-sidebar {
  width: 200px;
  flex-shrink: 0;
}
.help-cat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 20px;
}
.help-cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  font-family: 'Sora', sans-serif;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.help-cat-btn:hover { background: var(--panel-alt); color: var(--text); }
.help-cat-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.help-cat-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--panel-alt);
  padding: 1px 6px;
  border-radius: 8px;
  min-width: 20px;
  text-align: center;
}
.help-cat-btn.active .help-cat-count {
  background: rgba(74,158,255,0.2);
  color: var(--accent);
}

.help-center-content {
  flex: 1;
  min-width: 0;
}
.help-cat-section { margin-bottom: 28px; }
.help-cat-heading {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.help-article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.help-article-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.25s, transform 0.25s;
}
.help-article-card:hover {
  border-color: rgba(74,158,255,0.3);
  box-shadow: var(--shadow-md), var(--accent-glow);
  transform: translateY(-2px);
}
.help-article-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.4;
}
.help-article-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.help-article-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  border-radius: 8px;
}
.help-article-badge.video {
  background: var(--accent-dim);
  color: var(--accent);
}
.help-article-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--panel-alt);
  padding: 2px 6px;
  border-radius: 8px;
}

/* Article inline view (in help center page) */
.help-article-inline { max-width: 700px; }
.help-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-family: 'Sora', sans-serif;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 16px;
  transition: color 0.15s;
}
.help-back-btn:hover { color: var(--accent-hover); }
.help-article-inline-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 0 0 16px;
}
.help-article-inline-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.help-article-inline-body h2 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; color: var(--text); }
.help-article-inline-body h3 { font-size: 14px; font-weight: 600; margin: 20px 0 6px; color: var(--text); }
.help-article-inline-body p { margin: 0 0 12px; }
.help-article-inline-body ul, .help-article-inline-body ol { margin: 0 0 12px; padding-left: 20px; }
.help-article-inline-body li { margin-bottom: 4px; }
.help-article-inline-body strong { color: var(--text); font-weight: 600; }
.help-article-inline-body a { color: var(--accent); text-decoration: none; }
.help-article-inline-body a:hover { text-decoration: underline; }
.help-article-inline-body code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 12px;
}
.help-article-inline-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  margin: 0 0 12px;
}
.help-article-inline-body pre code { background: none; border: none; padding: 0; }
.help-article-inline-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 0 0 12px;
  padding: 8px 14px;
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
}
.help-article-inline-body blockquote p { margin: 0; }
.help-article-inline-body hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.help-article-inline-body table { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 13px; }
.help-article-inline-body th, .help-article-inline-body td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}
.help-article-inline-body th {
  background: var(--panel-alt);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-dim);
}

.help-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.help-empty svg { margin-bottom: 12px; opacity: 0.5; }
.help-empty p { font-size: 14px; }

/* Responsive */
@media (max-width: 700px) {
  .help-panel { width: 100vw; }
  .help-center-body { flex-direction: column; }
  .help-center-sidebar { width: 100%; }
  .help-cat-list { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .help-article-grid { grid-template-columns: 1fr; }
}

/* ─── GANTT CHART (Production Scheduling) ─── */
.gantt-container {
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.gantt-row:hover {
  background: rgba(74, 158, 255, 0.03);
}
.gantt-block {
  transition: opacity 0.15s, transform 0.1s ease;
}
.gantt-block:hover {
  transform: scaleY(1.08);
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.gantt-track {
  border-radius: 3px;
}
.gantt-shift-markers {
  user-select: none;
}
.gantt-day-cell {
  min-height: 48px;
}

/* Day column header hover */
.gantt-day-col:hover {
  background: var(--accent-dim) !important;
}

/* ─── Day Detail Modal ─── */
.modal-overlay .dd-modal {
  max-width: 95vw;
  width: 80vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.dd-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.dd-resource {
  margin-bottom: 20px;
}
.dd-resource:last-child {
  margin-bottom: 0;
}
.dd-resource-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding: 0 2px;
}
.dd-resource-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dd-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dd-resource-name {
  font-size: 13px;
  font-weight: 600;
}
.dd-resource-type {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.dd-resource-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-dim);
}
.dd-util {
  font-weight: 700;
  font-size: 12px;
}
.dd-stat {
  font-weight: 500;
}

/* Timeline track */
.dd-timeline {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dd-time-axis {
  position: relative;
  height: 20px;
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.dd-time-mark {
  position: absolute;
  top: 0;
  height: 100%;
}
.dd-time-line {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--border);
}
.dd-time-label {
  position: absolute;
  left: 4px;
  top: 3px;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.dd-track {
  position: relative;
  height: 56px;
}
.dd-shift-gap {
  position: absolute;
  top: 0;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 3px,
    rgba(255,255,255,0.03) 3px,
    rgba(255,255,255,0.03) 6px
  );
  border-left: 1px dashed rgba(255,255,255,0.08);
  border-right: 1px dashed rgba(255,255,255,0.08);
}
.dd-empty-track {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* Job blocks in day detail */
.dd-block {
  position: absolute;
  top: 4px;
  height: calc(100% - 8px);
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.dd-block:hover {
  transform: scaleY(1.06);
  z-index: 2;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.dd-block-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.dd-block-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dd-block-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dd-block-time {
  font-weight: 600;
  color: var(--text-muted);
}
.dd-nest-badge {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(52,211,153,0.2);
  color: #34d399;
  flex-shrink: 0;
}
.dd-overdue-badge {
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(248,113,113,0.2);
  color: #f87171;
  flex-shrink: 0;
}

/* Light theme overrides for Gantt */
[data-theme="light"] .gantt-row:hover {
  background: rgba(37, 99, 235, 0.03);
}
[data-theme="light"] .gantt-block:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
[data-theme="light"] .gantt-track > div:first-child {
  background: rgba(0,0,0,0.03) !important;
}
[data-theme="light"] .gantt-day-cell > div[style*="dashed"] {
  border-color: rgba(0,0,0,0.08) !important;
  background: rgba(0,0,0,0.01) !important;
}

/* Light theme: day detail */
[data-theme="light"] .dd-timeline {
  background: rgba(0, 0, 0, 0.015);
  border-color: var(--border);
}
[data-theme="light"] .dd-shift-gap {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.03) 3px,
    rgba(0,0,0,0.03) 6px
  );
  border-left-color: rgba(0,0,0,0.08);
  border-right-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .dd-block:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

/* ─── SCHEDULE ADVISOR ─── */
.advisor-modal {
  max-width: 640px;
  width: 90vw;
}
.advisor-modal .modal-body {
  padding: 20px 24px;
  max-height: 70vh;
  overflow-y: auto;
}
.advisor-summary {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.5;
}
.advisor-usage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent);
  margin-bottom: 16px;
}
.advisor-card {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  border-left: 3px solid var(--accent);
  animation: kpiFadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.advisor-card-critical {
  border-left-color: var(--danger);
}
.advisor-card-warning {
  border-left-color: var(--warning);
}
.advisor-card-info {
  border-left-color: var(--accent);
}
.advisor-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.advisor-severity-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.advisor-severity-badge.critical {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger);
}
.advisor-severity-badge.warning {
  background: rgba(255, 184, 74, 0.15);
  color: var(--warning);
}
.advisor-severity-badge.info {
  background: var(--accent-dim);
  color: var(--accent);
}
.advisor-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.advisor-card-metric {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.advisor-card-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 8px;
}
.advisor-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.advisor-action-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.advisor-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 0;
  color: var(--text-dim);
  font-size: 14px;
}
.advisor-spinner::before {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: advisorSpin 0.8s linear infinite;
}
@keyframes advisorSpin {
  to { transform: rotate(360deg); }
}
.advisor-limit-card {
  text-align: center;
  padding: 32px 24px;
}
.advisor-limit-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.advisor-limit-card p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 16px;
}
.advisor-limit-card .advisor-countdown {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
}
.advisor-addon-cta {
  display: inline-block;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease-out, box-shadow 0.25s ease-out;
}
.advisor-addon-cta:hover {
  background: var(--accent-hover);
  box-shadow: var(--accent-glow);
}
.advisor-error {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-dim);
}
.advisor-error p {
  font-size: 14px;
  margin-bottom: 16px;
}

/* Light theme overrides for Schedule Advisor */
[data-theme="light"] .advisor-card {
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .advisor-action-chip {
  background: var(--bg-alt, #ece9e4);
}

/* ══════════════════════════════════════════════════
   FabOps Orders — Saved Views Bar + Composable Filters
   ══════════════════════════════════════════════════ */

/* ── Saved Views Tab Bar ── */
.fo-views-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.fo-view-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.15s ease-out;
  white-space: nowrap;
}
.fo-view-tab:hover {
  background: var(--panel-alt);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
}
.fo-view-tab.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(74, 158, 255, 0.3);
  font-weight: 600;
}
.fo-view-default-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 2px;
}
.fo-view-save-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-out;
  margin-left: auto;
}
.fo-view-save-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── View Context Menu (right-click) ── */
.fo-view-ctx-menu {
  position: fixed;
  z-index: 1000;
  min-width: 160px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px 0;
  font-family: 'Sora', sans-serif;
}
.fo-view-ctx-menu div {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
}
.fo-view-ctx-menu div:hover {
  background: var(--accent-dim);
}

/* ── Composable Filter Bar ── */
.fo-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.fo-filter-search {
  position: relative;
  max-width: 340px;
}
.fo-filter-search input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.25s;
}
.fo-filter-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim), var(--accent-glow);
}
.fo-filter-search input::placeholder {
  color: var(--text-muted);
}
.fo-filter-search button,
.fo-filter-search .search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}
.fo-filter-search button:hover,
.fo-filter-search .search-clear:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

/* ── Status Chips (multi-select toggle) ── */
.fo-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.fo-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: var(--panel);
  color: var(--text-dim);
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease-out;
}
.fo-status-chip:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--panel-alt);
  color: var(--text);
}
.fo-status-chip.active {
  border-color: currentColor;
  color: inherit;
}

/* ── Filter Dropdowns Row ── */
.fo-filter-dropdowns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.fo-filter-dropdowns select,
.fo-filter-dropdowns input[type="date"] {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  min-width: 0;
  max-width: 180px;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.fo-filter-dropdowns select {
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b92a5' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.fo-filter-dropdowns input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
  opacity: 0.7;
}
.fo-filter-dropdowns input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
[data-theme="light"] .fo-filter-dropdowns input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
}
.fo-filter-dropdowns select:focus,
.fo-filter-dropdowns input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.fo-filter-dropdowns label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: -4px;
}

/* ── Active Filter Pills ── */
.fo-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 0 4px;
}
.fo-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.fo-filter-pill button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.1s;
}
.fo-filter-pill button:hover {
  opacity: 1;
}
.fo-clear-all-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 8px;
  transition: color 0.15s;
}
.fo-clear-all-btn:hover {
  color: var(--danger);
}

/* ── Light Theme Overrides for Orders Filter/Views ── */
[data-theme="light"] .fo-view-tab:hover {
  border-color: var(--border);
  background: var(--panel-alt);
}
[data-theme="light"] .fo-view-tab.active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.25);
}
[data-theme="light"] .fo-view-ctx-menu {
  background: var(--panel);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}
[data-theme="light"] .fo-status-chip {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text-dim);
}
[data-theme="light"] .fo-status-chip:hover {
  background: var(--panel-alt);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="light"] .fo-filter-search button:hover,
[data-theme="light"] .fo-filter-search .search-clear:hover {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .fo-filter-dropdowns select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235c5c73' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ── FabOps Order Detail Modal ── */
.fo-order-detail-modal {
  animation: kpiFadeIn 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.fo-od-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.fo-od-body::-webkit-scrollbar {
  width: 6px;
}
.fo-od-body::-webkit-scrollbar-track {
  background: transparent;
}
.fo-od-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}
.fo-od-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.14);
}
.fo-od-actions button:hover,
.fo-od-actions a:hover {
  filter: brightness(1.15);
}

/* Light theme overrides */
[data-theme="light"] .fo-od-body {
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}
[data-theme="light"] .fo-od-body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
}
[data-theme="light"] .fo-od-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.18);
}

/* Spinner animation for inline loading indicators */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ─── Pipeline Kanban ─── */
.pipeline-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.pipeline-card[draggable="true"] {
  cursor: grab;
}
.pipeline-card[draggable="true"]:active {
  cursor: grabbing;
}
.pipeline-cards::-webkit-scrollbar {
  width: 4px;
}
.pipeline-cards::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
