/* ============================================================
   LEVI'S BUY PLAN SYSTEM — DESIGN SYSTEM (Light Mode / shadcn-style)
   Complete stylesheet: tokens, reset, layout, components, animations
   ============================================================ */

/* ── GOOGLE FONTS ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Surfaces (zinc scale, light mode) */
  --surface-1:   #ffffff;        /* main page bg, cards */
  --surface-2:   #fafafa;        /* sidebar, alt panels */
  --surface-3:   #f4f4f5;        /* table headers, hover bg */
  --surface-4:   #e4e4e7;        /* selected rows, pressed states */
  --surface-5:   #d4d4d8;        /* deep borders */

  /* Borders */
  --border:        #e4e4e7;       /* zinc-200 */
  --border-md:     #d4d4d8;       /* zinc-300 */
  --border-strong: #a1a1aa;       /* zinc-400 */

  /* Brand */
  --red:         #E63946;
  --red-hover:   #CF2F3C;
  --red-dim:     #9B1C24;
  --red-bg:      rgba(230, 57, 70, 0.07);
  --blue:        #2563EB;
  --blue-bg:     rgba(37, 99, 235, 0.08);

  /* Content */
  --foreground:       #09090b;   /* zinc-950 — was --bone */
  --text-secondary:   #3f3f46;   /* zinc-700 — was --cream */
  --text-muted:       #71717a;   /* zinc-500 — was --muted */

  /* Legacy aliases so inline styles in screens still resolve */
  --bone:  #09090b;
  --cream: #3f3f46;
  --muted: #71717a;
  --denim-bright: #2563EB;
  --denim-glow: rgba(37, 99, 235, 0.12);
  --faint: #f4f4f5;

  /* depth-* → surface-* aliases for any inline styles that use old tokens */
  --void:    #f9f9fb;
  --depth-1: #ffffff;
  --depth-2: #fafafa;
  --depth-3: #f4f4f5;
  --depth-4: #e4e4e7;
  --depth-5: #d4d4d8;

  /* Shorthand semantic color aliases used in stat cards / charts */
  --green:  #16a34a;
  --amber:  #d97706;
  --purple: #6d28d9;

  /* Semantic */
  --success:     #16a34a;
  --success-bg:  rgba(22, 163, 74, 0.08);
  --warning:     #d97706;
  --warning-bg:  rgba(217, 119, 6, 0.08);
  --error:       #dc2626;
  --error-bg:    rgba(220, 38, 38, 0.08);
  --info:        #0284c7;
  --info-bg:     rgba(2, 132, 199, 0.08);

  /* Confidence */
  --conf-high:   #16a34a;
  --conf-med:    #d97706;
  --conf-low:    #dc2626;

  /* Typography */
  --font-heading: 'DM Sans', system-ui, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Spacing */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;

  /* Radius */
  --r1: 4px; --r2: 6px; --r3: 8px; --r4: 12px;

  /* Shadows — light and clean */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h:  56px;
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--foreground);
  background-color: #f9f9fb;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--foreground); }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }
img, svg { display: block; }
ul, ol { list-style: none; }

/* ── ANIMATIONS ────────────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(110%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(110%); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  from { background-position: -200% center; }
  to   { background-position: 200% center; }
}

[data-animate] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── SHELL / LAYOUT ────────────────────────────────────────── */
#app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Auth layout */
body[data-layout="auth"] {
  background: #f4f4f5;
}
body[data-layout="auth"] #app-root {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--s6);
}

/* Portal layout */
body[data-layout="portal"] {
  background: #f9f9fb;
}
body[data-layout="portal"] #app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar content";
  min-height: 100vh;
}

body[data-layout="portal"] #sidebar-slot {
  grid-area: sidebar;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
}
body[data-layout="portal"] #sidebar-slot::-webkit-scrollbar { display: none; }

body[data-layout="portal"] #topbar-slot {
  grid-area: topbar;
  position: sticky;
  top: 0;
  z-index: 100;
}

body[data-layout="portal"] #app-root {
  grid-area: content;
  overflow-y: auto;
  padding: var(--s6) var(--s8);
}

/* ── TOPBAR ────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s6);
  height: var(--topbar-h);
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}
.topbar-brand {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.topbar-brand span { color: var(--red); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.topbar-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--r2);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.topbar-bell:hover { background: var(--surface-3); color: var(--foreground); border-color: var(--border-md); }
.topbar-bell .badge-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid var(--surface-1);
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s1) var(--s3);
  border-radius: var(--r2);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}
.topbar-user:hover { background: var(--surface-3); border-color: var(--border-md); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  display: none;
}
.user-dropdown.is-open { display: block; animation: fadeIn 0.12s ease; }
.user-dropdown a, .user-dropdown button {
  display: flex;
  align-items: center;
  gap: var(--s2);
  width: 100%;
  padding: var(--s2) var(--s4);
  color: var(--text-secondary);
  font-size: 13px;
  background: transparent;
  border: none;
  text-align: left;
  transition: background 0.1s, color 0.1s;
}
.user-dropdown a:hover, .user-dropdown button:hover {
  background: var(--surface-3);
  color: var(--foreground);
}
.user-dropdown hr { border: none; border-top: 1px solid var(--border); }

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--topbar-h) 0 0;
}
.sidebar-section { padding: var(--s3) 0; }
.sidebar-section + .sidebar-section { border-top: 1px solid var(--border); }
.sidebar-label {
  padding: var(--s2) var(--s4);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s4);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  position: relative;
}
.sidebar-item svg { opacity: 0.5; flex-shrink: 0; transition: opacity 0.12s; }
.sidebar-item:hover {
  background: var(--surface-3);
  color: var(--foreground);
}
.sidebar-item:hover svg { opacity: 0.8; }
.sidebar-item.is-active {
  background: var(--red-bg);
  color: var(--red);
  border-left-color: var(--red);
  font-weight: 500;
}
.sidebar-item.is-active svg { opacity: 1; color: var(--red); }
.sidebar-item .sidebar-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
}

/* ── AUTH CARD ──────────────────────────────────────────────── */
.auth-wrap {
  width: 100%;
  max-width: 400px;
}
.auth-logo {
  text-align: center;
  margin-bottom: var(--s8);
}
.auth-logo h1 {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--foreground);
}
.auth-logo h1 em {
  color: var(--red);
  font-style: normal;
}
.auth-logo p {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: var(--s1);
}
.auth-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  padding: var(--s8);
  box-shadow: var(--shadow-md);
}
.auth-card h2 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: var(--s1);
}
.auth-card .auth-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--s6);
}
.auth-footer {
  margin-top: var(--s4);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-footer a { color: var(--blue); }

/* Demo credentials panel */
.demo-creds {
  margin-top: var(--s6);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  overflow: hidden;
}
.demo-creds-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s4);
  background: var(--surface-3);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.12s;
}
.demo-creds-toggle:hover { background: var(--surface-4); color: var(--foreground); }
.demo-creds-body {
  padding: var(--s3) var(--s4);
  background: var(--surface-2);
  display: none;
}
.demo-creds-body.is-open { display: block; }
.demo-cred-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s1) 0;
  font-size: 12px;
}
.demo-cred-row .cred-email { color: var(--foreground); font-family: var(--font-mono); }
.demo-cred-row .cred-pass  { color: var(--text-muted);  font-family: var(--font-mono); }
.demo-cred-row .cred-role  { color: var(--blue); font-size: 11px; }
.demo-cred-fill {
  background: none;
  border: 1px solid var(--border);
  color: var(--blue);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: var(--r2);
  transition: background 0.1s;
}
.demo-cred-fill:hover { background: var(--blue-bg); border-color: var(--blue); }

/* ── FORMS ──────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--s4); }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: var(--s2);
}
.form-input {
  width: 100%;
  padding: var(--s2) var(--s3);
  background: var(--surface-1);
  border: 1px solid var(--border-md);
  border-radius: var(--r2);
  color: var(--foreground);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
  border-color: var(--foreground);
  box-shadow: 0 0 0 3px rgba(9,9,11,0.08);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:disabled { opacity: 0.5; cursor: not-allowed; background: var(--surface-3); }

.form-select {
  width: 100%;
  padding: var(--s2) var(--s3);
  background: var(--surface-1);
  border: 1px solid var(--border-md);
  border-radius: var(--r2);
  color: var(--foreground);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-select:focus {
  border-color: var(--foreground);
  box-shadow: 0 0 0 3px rgba(9,9,11,0.08);
}
.form-select option { background: var(--surface-1); color: var(--foreground); }

.form-error {
  margin-top: var(--s2);
  font-size: 12px;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-hint { margin-top: var(--s2); font-size: 12px; color: var(--text-muted); }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  border-radius: var(--r2);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.08s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--foreground);
  color: #fff;
  border-color: var(--foreground);
}
.btn-primary:hover { background: #27272a; border-color: #27272a; }

.btn-brand {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-brand:hover { background: var(--red-hover); border-color: var(--red-hover); }

.btn-secondary {
  background: var(--surface-1);
  color: var(--foreground);
  border-color: var(--border-md);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-3); color: var(--foreground); }

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border-color: rgba(220, 38, 38, 0.25);
}
.btn-danger:hover { background: var(--error); color: #fff; border-color: var(--error); }

.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.25);
}
.btn-success:hover { background: var(--success); color: #fff; border-color: var(--success); }

.btn-sm { padding: 4px var(--s3); font-size: 12px; }
.btn-lg { padding: var(--s3) var(--s6); font-size: 15px; }
.btn-full { width: 100%; }
.btn-icon { padding: var(--s2); }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  font-family: var(--font-body);
}

.badge-submitted  { background: var(--success-bg); color: var(--success);  border: 1px solid rgba(22,163,74,0.2); }
.badge-draft      { background: var(--warning-bg); color: var(--warning);  border: 1px solid rgba(217,119,6,0.2); }
.badge-overdue    { background: var(--error-bg);   color: var(--error);    border: 1px solid rgba(220,38,38,0.2); animation: pulse 2s infinite; }
.badge-open       { background: var(--info-bg);    color: var(--info);     border: 1px solid rgba(2,132,199,0.2); }
.badge-closed     { background: var(--surface-3);  color: var(--text-muted); border: 1px solid var(--border); }
.badge-configured { background: rgba(124,58,237,0.08); color: #6d28d9; border: 1px solid rgba(124,58,237,0.2); }
.badge-success    { background: var(--success-bg); color: var(--success);  border: 1px solid rgba(22,163,74,0.2); }
.badge-warning    { background: var(--warning-bg); color: var(--warning);  border: 1px solid rgba(217,119,6,0.2); }
.badge-error      { background: var(--error-bg);   color: var(--error);    border: 1px solid rgba(220,38,38,0.2); }
.badge-info       { background: var(--info-bg);    color: var(--info);     border: 1px solid rgba(2,132,199,0.2); }
.badge-high       { background: var(--success-bg); color: var(--success);  border: 1px solid rgba(22,163,74,0.2); }
.badge-medium     { background: var(--warning-bg); color: var(--warning);  border: 1px solid rgba(217,119,6,0.2); }
.badge-low        { background: var(--error-bg);   color: var(--error);    border: 1px solid rgba(220,38,38,0.2); }
.badge-neutral    { background: var(--surface-3);  color: var(--text-secondary); border: 1px solid var(--border); }
.badge-red        { background: var(--red-bg);     color: var(--red);      border: 1px solid rgba(230,57,70,0.2); }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  overflow: hidden;
}
.card-elevated {
  box-shadow: var(--shadow-md);
}
.card-highlight {
  border-left: 3px solid var(--red);
}
.card-body { padding: var(--s6); }
.card-header {
  padding: var(--s4) var(--s6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}
.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}
.card-footer {
  padding: var(--s4) var(--s6);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--s5) var(--s6);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-accent, var(--foreground));
  border-radius: var(--r3) var(--r3) 0 0;
}
.stat-card:hover { border-color: var(--border-md); box-shadow: var(--shadow-md); }
.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s2);
}
.stat-value {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1;
  margin-bottom: var(--s2);
}
.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 500;
}
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--error); }
.stat-icon {
  position: absolute;
  top: var(--s4); right: var(--s4);
  color: var(--text-muted);
  opacity: 0.3;
}

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header {
  margin-bottom: var(--s6);
}
.page-header h1 {
  font-family: var(--font-body);
  font-size: 26px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.2;
}
.page-header h1 em {
  color: var(--red);
  font-style: normal;
}
.page-header p {
  margin-top: var(--s2);
  font-size: 14px;
  color: var(--text-muted);
}
.page-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
}
.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-shrink: 0;
}

/* ── BREADCRUMB ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--s4);
}
.breadcrumb a { color: var(--text-secondary); transition: color 0.12s; }
.breadcrumb a:hover { color: var(--foreground); }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--foreground); font-weight: 500; }

/* ── TABLES ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r3);
  border: 1px solid var(--border);
  background: var(--surface-1);
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table-wrap thead th {
  position: sticky;
  top: 0;
  padding: var(--s3) var(--s4);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.table-wrap thead th.sortable { cursor: pointer; }
.table-wrap thead th.sortable:hover { color: var(--foreground); }
.table-wrap thead th svg { display: inline; vertical-align: middle; margin-left: 4px; }
.table-wrap tbody td {
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.table-wrap tbody tr:last-child td { border-bottom: none; }
.table-wrap tbody tr {
  transition: background 0.08s;
}
.table-wrap tbody tr:hover td { background: var(--surface-2); color: var(--foreground); }
.table-wrap tbody tr.row-overdue td { background: rgba(220,38,38,0.03); }
.table-wrap tbody tr.row-overdue:hover td { background: rgba(220,38,38,0.06); }
.table-wrap tbody tr.row-selected td { background: var(--surface-3); }

/* Mono column for numbers */
.col-num { font-family: var(--font-mono); font-size: 12px; text-align: right; color: var(--foreground); }
.col-code { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

/* ── PLANNING GRID ──────────────────────────────────────────── */
.planning-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: var(--s6);
  align-items: start;
}
.filter-panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--s5);
  position: sticky;
  top: var(--s4);
}
.filter-panel h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--s4);
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.filter-group { margin-bottom: var(--s4); }
.filter-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--s2);
}
.filter-pills { display: flex; flex-wrap: wrap; gap: var(--s1); }
.filter-pill {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.filter-pill:hover { background: var(--surface-3); color: var(--foreground); border-color: var(--border-md); }
.filter-pill.is-active {
  background: var(--foreground);
  color: #fff;
  border-color: var(--foreground);
}

/* Planning grid table */
.grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid-table thead th {
  padding: var(--s3) var(--s3);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: right;
  border-bottom: 1px solid var(--border-md);
  position: sticky;
  top: 0;
  white-space: nowrap;
}
.grid-table thead th:first-child { text-align: left; padding-left: var(--s4); }
.grid-table tbody td {
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  vertical-align: middle;
}
.grid-table tbody td:first-child {
  text-align: left;
  font-family: var(--font-body);
  font-size: 13px;
  padding-left: var(--s4);
}
.grid-table tbody tr:hover td { background: var(--surface-2); }

/* Subtotal rows */
.grid-table tr.subtotal-gencat td {
  background: var(--surface-3);
  color: var(--foreground);
  font-weight: 600;
  font-size: 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.grid-table tr.subtotal-gencat td:first-child { font-family: var(--font-body); font-size: 13px; font-weight: 700; }
.grid-table tr.subtotal-brick td {
  background: var(--surface-2);
  color: var(--foreground);
  font-weight: 500;
}
.grid-table tr.subtotal-brick td:first-child { padding-left: var(--s6); font-weight: 600; color: var(--text-secondary); }
.grid-table tr.item-row td:first-child { padding-left: var(--s8); color: var(--text-secondary); }
.grid-table tr.item-row.is-adjusted td:first-child { color: var(--foreground); }
.grid-table tr.is-highlighted td { background: rgba(217,119,6,0.06) !important; }

/* Editable qty cell */
.qty-input {
  width: 72px;
  padding: 3px 6px;
  background: var(--surface-1);
  border: 1px solid var(--border-md);
  border-radius: var(--r1);
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.qty-input:focus {
  border-color: var(--foreground);
  box-shadow: 0 0 0 2px rgba(9,9,11,0.1);
}
.qty-input.flash-save {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.4);
}

/* Confidence indicator */
.conf-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.conf-high   { background: var(--conf-high); }
.conf-medium { background: var(--conf-med); }
.conf-low    { background: var(--conf-low); }

/* ── UPLOAD ZONE ────────────────────────────────────────────── */
.upload-zone {
  border: 1.5px dashed var(--border-md);
  border-radius: var(--r3);
  padding: var(--s12) var(--s8);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  background: var(--surface-2);
}
.upload-zone:hover, .upload-zone.drag-hover {
  border-color: var(--blue);
  background: var(--blue-bg);
}
.upload-zone.drag-over {
  border-color: var(--red);
  background: var(--red-bg);
}
.upload-zone-icon { color: var(--text-muted); margin: 0 auto var(--s4); opacity: 0.5; }
.upload-zone h3 { font-size: 15px; color: var(--foreground); margin-bottom: var(--s2); font-weight: 600; }
.upload-zone p  { font-size: 13px; color: var(--text-muted); }
.upload-zone .upload-link { color: var(--blue); text-decoration: underline; cursor: pointer; }
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Validation result panel */
.upload-result {
  margin-top: var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  overflow: hidden;
  background: var(--surface-1);
}
.upload-result-header {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.upload-result-stats {
  display: flex;
  gap: var(--s4);
  padding: var(--s3) var(--s4);
  font-size: 13px;
}
.stat-success { color: var(--success); }
.stat-error   { color: var(--error); }
.stat-warning { color: var(--warning); }

/* Validating spinner */
.upload-validating {
  text-align: center;
  padding: var(--s8);
  color: var(--text-muted);
  font-size: 13px;
}
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border-md);
  border-top-color: var(--foreground);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--s3);
}

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s6);
  animation: fadeIn 0.12s ease;
}
.modal {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.18s ease;
}
.modal-lg { max-width: 720px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s5) var(--s6);
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
}
.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--r2);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.modal-close:hover { background: var(--surface-3); color: var(--foreground); }
.modal-body { padding: var(--s6); }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s3);
  padding: var(--s4) var(--s6);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ── TOASTS ─────────────────────────────────────────────────── */
#toast-layer {
  position: fixed;
  bottom: var(--s6);
  right: var(--s6);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r3);
  font-size: 13px;
  font-weight: 500;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  background: var(--surface-1);
  animation: toastIn 0.25s ease;
  pointer-events: all;
}
.toast-success { border-left: 3px solid var(--success); color: var(--foreground); }
.toast-error   { border-left: 3px solid var(--error);   color: var(--foreground); }
.toast-warning { border-left: 3px solid var(--warning); color: var(--foreground); }
.toast-info    { border-left: 3px solid var(--info);    color: var(--foreground); }
.toast-icon    { flex-shrink: 0; }
.toast-icon svg { color: inherit; }
.toast-success .toast-icon { color: var(--success); }
.toast-error   .toast-icon { color: var(--error); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    .toast-icon { color: var(--info); }

/* ── PROGRESS BAR ───────────────────────────────────────────── */
.progress-wrap { margin-bottom: var(--s4); }
.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s2);
  font-size: 13px;
  color: var(--text-secondary);
}
.progress-track {
  height: 6px;
  background: var(--surface-4);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--success);
  transition: width 0.6s ease;
}
.progress-fill.warning { background: var(--warning); }
.progress-fill.brand   { background: var(--red); }

/* ── TABS ────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s6);
}
.tab-btn {
  padding: var(--s3) var(--s4);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.is-active { color: var(--foreground); border-bottom-color: var(--foreground); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ── SEASON TOGGLE ──────────────────────────────────────────── */
.season-toggle {
  display: inline-flex;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
}
.season-btn {
  padding: var(--s2) var(--s4);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.season-btn.is-active {
  background: var(--surface-1);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

/* ── STORE CARDS ────────────────────────────────────────────── */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s4);
}
.store-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--s5);
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  position: relative;
  overflow: hidden;
}
.store-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--store-color, var(--border-md));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.store-card:hover {
  border-color: var(--border-md);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.store-card:hover::after { transform: scaleX(1); }
.store-card.is-submitted { --store-color: var(--success); }
.store-card.is-draft     { --store-color: var(--warning); }
.store-card.is-overdue   { --store-color: var(--error); border-color: rgba(220,38,38,0.25); background: rgba(220,38,38,0.02); }
.store-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.store-card-name { font-size: 14px; font-weight: 600; color: var(--foreground); line-height: 1.3; }
.store-card-city { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.store-card-meta {
  display: flex;
  align-items: center;
  gap: var(--s4);
  margin-top: var(--s3);
  font-size: 12px;
  color: var(--text-muted);
}
.store-card-meta svg { flex-shrink: 0; }
.deadline-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.deadline-pill.ok      { background: var(--success-bg); color: var(--success); border: 1px solid rgba(22,163,74,0.2); }
.deadline-pill.soon    { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(217,119,6,0.2); }
.deadline-pill.overdue { background: var(--error-bg);   color: var(--error);   border: 1px solid rgba(220,38,38,0.2); }

/* ── CHECKLIST ──────────────────────────────────────────────── */
.checklist { display: flex; flex-direction: column; gap: var(--s2); }
.checklist-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r2);
  background: var(--surface-1);
  border: 1px solid var(--border);
  font-size: 13px;
}
.checklist-item.done    { border-color: rgba(22,163,74,0.2); background: rgba(22,163,74,0.02); }
.checklist-item.pending { border-color: rgba(217,119,6,0.2); }
.checklist-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.checklist-check.done    { background: var(--success-bg); color: var(--success); }
.checklist-check.pending { background: var(--warning-bg); color: var(--warning); }
.checklist-label { flex: 1; color: var(--text-secondary); }
.checklist-item.done .checklist-label { color: var(--foreground); }
.checklist-date { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.checklist-action { flex-shrink: 0; }

/* ── NOTIFICATION ITEMS ─────────────────────────────────────── */
.notif-list { display: flex; flex-direction: column; gap: var(--s2); }
.notif-item {
  display: flex;
  gap: var(--s4);
  padding: var(--s4) var(--s5);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  transition: border-color 0.12s;
}
.notif-item.is-unread {
  border-color: rgba(37,99,235,0.2);
  background: rgba(37,99,235,0.02);
}
.notif-item.is-unread::before {
  content: '';
  display: block;
  width: 3px;
  background: var(--blue);
  border-radius: 99px;
  flex-shrink: 0;
  margin: -4px -4px -4px -5px;
  align-self: stretch;
}
.notif-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-icon.override  { background: var(--warning-bg); color: var(--warning); }
.notif-icon.cycle     { background: var(--info-bg);    color: var(--info); }
.notif-icon.deadline  { background: var(--error-bg);   color: var(--error); }
.notif-icon.confirm   { background: var(--success-bg); color: var(--success); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 500; color: var(--foreground); margin-bottom: 3px; }
.notif-text  { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.notif-meta  { display: flex; align-items: center; gap: var(--s4); margin-top: var(--s2); }
.notif-time  { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

/* ── ACTIVITY FEED ──────────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.activity-dot.success { background: var(--success); }
.activity-dot.warning { background: var(--warning); }
.activity-dot.error   { background: var(--error); }
.activity-dot.info    { background: var(--blue); }
.activity-content { flex: 1; color: var(--text-secondary); }
.activity-time { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); flex-shrink: 0; }

/* ── SUMMARY REVIEW ─────────────────────────────────────────── */
.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s4);
  margin-bottom: var(--s6);
}
.summary-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--s4) var(--s5);
  text-align: center;
}
.summary-stat-value {
  font-family: var(--font-body);
  font-size: 26px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1;
  margin-bottom: var(--s1);
}
.summary-stat-label { font-size: 12px; color: var(--text-muted); }

/* ── CALLOUT ────────────────────────────────────────────────── */
.callout {
  display: flex;
  gap: var(--s3);
  padding: var(--s4);
  border-radius: var(--r2);
  border: 1px solid transparent;
  font-size: 13px;
}
.callout-warning { background: var(--warning-bg); border-color: rgba(217,119,6,0.2); color: var(--warning); }
.callout-error   { background: var(--error-bg);   border-color: rgba(220,38,38,0.2); color: var(--error); }
.callout-info    { background: var(--info-bg);     border-color: rgba(2,132,199,0.2); color: var(--info); }
.callout-success { background: var(--success-bg); border-color: rgba(22,163,74,0.2); color: var(--success); }
.callout-icon    { flex-shrink: 0; margin-top: 1px; }
.callout-body    { flex: 1; }
.callout-body p  { margin-top: var(--s1); color: var(--text-secondary); }

/* ── VARIANCE INDICATORS ─────────────────────────────────────── */
.delta-up   { color: var(--success); font-family: var(--font-mono); font-size: 12px; }
.delta-down { color: var(--error);   font-family: var(--font-mono); font-size: 12px; }
.delta-zero { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.delta-high { font-weight: 700; }

/* ── SEARCH BAR ─────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap svg {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  padding-left: 32px;
  background: var(--surface-1);
  border: 1px solid var(--border-md);
  border-radius: var(--r2);
  color: var(--foreground);
  font-size: 13px;
  padding-top: var(--s2);
  padding-bottom: var(--s2);
  padding-right: var(--s4);
  outline: none;
  width: 240px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--foreground);
  box-shadow: 0 0 0 2px rgba(9,9,11,0.08);
}

/* ── DRILL-DOWN GRID (Manager override) ─────────────────────── */
.drill-level {
  border: 1px solid var(--border);
  border-radius: var(--r3);
  overflow: hidden;
  margin-bottom: var(--s3);
  background: var(--surface-1);
}
.drill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s4);
  background: var(--surface-2);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.drill-header:hover { background: var(--surface-3); }
.drill-header h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.drill-body { display: none; padding: var(--s4); }
.drill-body.is-open { display: block; }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s16) var(--s8);
  text-align: center;
  color: var(--text-muted);
}
.empty-state-icon {
  margin-bottom: var(--s4);
  opacity: 0.3;
}
.empty-state h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--s2);
}
.empty-state p { font-size: 13px; max-width: 320px; margin-bottom: var(--s5); }

/* ── PAGINATION ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s4) 0;
  font-size: 13px;
  color: var(--text-muted);
}
.pagination-pages {
  display: flex;
  align-items: center;
  gap: var(--s1);
}
.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--r2);
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.page-btn:hover { background: var(--surface-3); color: var(--foreground); border-color: var(--border-md); }
.page-btn.is-active { background: var(--foreground); color: #fff; border-color: var(--foreground); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── ACCORDION ──────────────────────────────────────────────── */
.accordion-item {
  border-bottom: 1px solid var(--border);
}
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s4);
  cursor: pointer;
  transition: background 0.1s;
  color: var(--text-secondary);
  font-size: 13px;
}
.accordion-header:hover { background: var(--surface-2); color: var(--foreground); }
.accordion-body { display: none; padding: var(--s4); background: var(--surface-2); }
.accordion-body.is-open { display: block; }

/* ── CONFIRMATION SCREEN ────────────────────────────────────── */
.confirm-screen {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--s16) var(--s6);
}
.confirm-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--s6);
}
.confirm-icon.success { background: var(--success-bg); color: var(--success); }
.confirm-screen h1 {
  font-family: var(--font-body);
  font-size: 26px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: var(--s3);
}
.confirm-screen p { font-size: 15px; color: var(--text-muted); line-height: 1.6; margin-bottom: var(--s6); }
.confirm-detail {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--s5);
  text-align: left;
  margin-bottom: var(--s6);
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  padding: var(--s2) 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.confirm-row:last-child { border-bottom: none; }
.confirm-row .label { color: var(--text-muted); }
.confirm-row .value { color: var(--foreground); font-weight: 500; font-family: var(--font-mono); }
.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

/* ── CYCLE STATUS MACHINE ───────────────────────────────────── */
.cycle-states {
  display: flex;
  gap: var(--s3);
  align-items: center;
  margin-bottom: var(--s8);
}
.cycle-state {
  flex: 1;
  padding: var(--s4) var(--s5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  text-align: center;
  opacity: 0.45;
  transition: opacity 0.2s;
}
.cycle-state.is-active {
  opacity: 1;
  border-color: var(--blue);
  background: var(--blue-bg);
}
.cycle-state.is-done {
  opacity: 0.75;
  border-color: rgba(22,163,74,0.3);
  background: rgba(22,163,74,0.04);
}
.cycle-arrow { color: var(--text-muted); flex-shrink: 0; }
.cycle-state-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: var(--s1); }
.cycle-state-name  { font-size: 13px; font-weight: 600; color: var(--foreground); }

/* ── ASSORTMENT SCOPE ───────────────────────────────────────── */
.scope-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s6);
}
.tree-item {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  border-radius: var(--r1);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.08s;
}
.tree-item:hover { background: var(--surface-3); color: var(--foreground); }
.tree-item input[type="checkbox"] { accent-color: var(--foreground); }
.tree-item-children { padding-left: var(--s5); }

/* ── SVG CHARTS ─────────────────────────────────────────────── */
.chart-wrap {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--s5) var(--s6);
  overflow: hidden;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s5);
}
.chart-title { font-size: 13px; font-weight: 600; color: var(--foreground); }
.chart-legend {
  display: flex;
  gap: var(--s4);
  font-size: 11px;
  color: var(--text-secondary);
}
.legend-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.chart-svg-wrap { overflow-x: auto; }
.chart-label { font-family: var(--font-body); font-size: 10px; fill: var(--text-muted); }
.chart-value { font-family: var(--font-mono); font-size: 9px; fill: var(--text-secondary); }

/* ── UTILITIES ──────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--s2); }
.gap-3 { gap: var(--s3); }
.gap-4 { gap: var(--s4); }
.gap-6 { gap: var(--s6); }
.gap-8 { gap: var(--s8); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); }

.mt-1 { margin-top: var(--s1); } .mt-2 { margin-top: var(--s2); }
.mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); }
.mt-6 { margin-top: var(--s6); } .mt-8 { margin-top: var(--s8); }
.mb-2 { margin-bottom: var(--s2); } .mb-3 { margin-bottom: var(--s3); }
.mb-4 { margin-bottom: var(--s4); } .mb-6 { margin-bottom: var(--s6); }
.mb-8 { margin-bottom: var(--s8); }

.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.text-2xl { font-size: 28px; }
.text-heading { font-family: var(--font-body); }
.text-mono { font-family: var(--font-mono); }
.text-muted   { color: var(--text-muted); }
.text-cream   { color: var(--text-secondary); }
.text-bone    { color: var(--foreground); }
.text-red     { color: var(--red); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error   { color: var(--error); }
.text-info    { color: var(--info); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--s6) 0;
}

.section-title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: var(--s4);
}

/* Banner */
.banner {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s5);
  border-radius: var(--r2);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--s5);
}
.banner-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid rgba(2,132,199,0.2); }
.banner-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(217,119,6,0.2); }
.banner-error   { background: var(--error-bg);   color: var(--error);   border: 1px solid rgba(220,38,38,0.2); }
.banner-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(22,163,74,0.2); }

/* Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 34px; height: 34px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* Inline override display */
.override-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  background: var(--warning-bg);
  border: 1px solid rgba(217,119,6,0.25);
  border-radius: 4px;
  font-size: 11px;
  color: var(--warning);
  font-family: var(--font-mono);
}

/* card-elevated alias used by auth card */
.card-elevated {
  box-shadow: var(--shadow-md);
}
