@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  /* Colors */
  --bg-primary: #f6f5f1;
  --bg-secondary: #f1efe9;
  --bg-white: rgba(255,255,255,0.8);
  --bg-white-solid: #ffffff;
  --bg-white-hover: #ffffff;
  --bg-white-soft: rgba(255,255,255,0.7);
  --bg-white-softer: rgba(255,255,255,0.5);
  --bg-white-subtle: rgba(255,255,255,0.6);
  --bg-dark: #1a1a1a;
  --bg-dark-hover: #000000;
  --bg-dark-gradient: linear-gradient(135deg, #1a1a1a 0%, #2a2825 100%);

  --text-primary: #1a1a1a;
  --text-secondary: #4a4843;
  --text-tertiary: #6e6b64;
  --text-muted: #8a8780;
  --text-faint: #a8a59c;
  --text-separator: #c8c5be;
  --text-inverse: #f6f5f1;

  --accent: #f56b3b;
  --accent-hover: #ff8a4c;
  --accent-dark: #c14a1f;
  --accent-bg: rgba(245,107,59,0.12);

  --green: #2c9a4d;
  --green-dark: #1f7a3a;
  --green-bg: rgba(34,134,58,0.1);
  --green-light: #a8e8b0;
  --green-gradient: linear-gradient(90deg, #4ec371, #2c9a4d);

  --amber: #d4a73e;
  --amber-dark: #8a6b1e;
  --amber-bg: rgba(212,167,62,0.15);
  --amber-gradient: linear-gradient(90deg, #f2c94c, #d4a73e);

  --red: #d63b1d;
  --red-dark: #b8351a;
  --red-bg: rgba(214,59,29,0.1);
  --red-bg-dark: rgba(193,74,31,0.12);
  --red-gradient: linear-gradient(90deg, #ff8a4c, #d63b1d);

  --border-light: rgba(0,0,0,0.04);
  --border-medium: rgba(0,0,0,0.06);
  --border-dark: rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.2);

  /* Typography */
  --font-sans: 'Geist', -apple-system, sans-serif;
  --font-serif: 'Instrument Serif', serif;
  --font-mono: 'Geist Mono', monospace;

  --text-xs: 10.5px;
  --text-sm: 11.5px;
  --text-base: 13px;
  --text-md: 13.5px;
  --text-lg: 14px;
  --text-xl: 16px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --text-4xl: 38px;
  --text-5xl: 56px;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 6px;
  --sp-3: 8px;
  --sp-4: 10px;
  --sp-5: 12px;
  --sp-6: 14px;
  --sp-7: 16px;
  --sp-8: 20px;
  --sp-9: 22px;
  --sp-10: 24px;
  --sp-11: 28px;
  --sp-12: 32px;
  --sp-13: 40px;

  /* Radii */
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.02), 0 4px 18px rgba(0,0,0,0.03);
  --shadow-md: 0 1px 2px rgba(0,0,0,0.06), 0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
  --shadow-btn: 0 1px 2px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.06);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* ============================================
   BASE RESET
   ============================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--text-lg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ============================================
   LAYOUT
   ============================================ */
.app {
  width: 1440px; margin: 0 auto;
  display: flex; min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* SIDEBAR */
.sidebar {
  width: 248px; padding: var(--sp-9) var(--sp-6);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg-white-softer);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-light);
  flex-shrink: 0;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-2) var(--sp-4) var(--sp-11); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--bg-dark);
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0;
}
.brand-mark::after {
  content: ''; position: absolute; inset: 3px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
}
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.brand-tag { font-size: var(--text-xs); color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; }

.nav-group { margin-bottom: var(--sp-2); }
.nav-cap {
  font-size: var(--text-xs); color: var(--text-faint);
  padding: var(--sp-6) var(--sp-4) var(--sp-2);
  font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px var(--sp-4); border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: var(--text-md); font-weight: 450;
  cursor: pointer; margin-bottom: 1px; position: relative;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.nav-item:hover { background: rgba(0,0,0,0.03); }
.nav-item.active {
  background: var(--bg-dark); color: var(--text-inverse);
  box-shadow: var(--shadow-btn);
}
.nav-item svg { width: 16px; height: 16px; stroke-width: 1.6; flex-shrink: 0; }
.nav-item .pill {
  margin-left: auto; font-size: var(--text-xs); padding: 1.5px 6px;
  border-radius: var(--radius-full); font-weight: 500;
  background: var(--accent-bg); color: var(--accent-dark);
}
.nav-item.active .pill { background: rgba(255,255,255,0.15); color: #fff; }

.workspace-card {
  margin-top: auto; padding: var(--sp-6); border-radius: var(--radius-xl);
  background: var(--bg-white-soft); border: 1px solid rgba(0,0,0,0.05);
}
.ws-row { display: flex; align-items: center; gap: var(--sp-4); }
.ws-avatar {
  width: 36px; height: 36px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1a1a1a, #3a3835);
  color: var(--text-inverse); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: var(--text-base); flex-shrink: 0;
}
.ws-name { font-size: var(--text-base); font-weight: 600; }
.ws-role { font-size: 11px; color: var(--text-muted); }
.ws-divider { height: 1px; background: rgba(0,0,0,0.05); margin: var(--sp-5) 0; }
.ws-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.ws-meta strong { color: var(--text-primary); font-weight: 500; }
.ws-logout {
  display: flex; align-items: center; gap: 6px; margin-top: var(--sp-3);
  font-size: 11px; color: var(--text-muted); cursor: pointer; padding: 4px 0;
  transition: color var(--duration-fast);
}
.ws-logout:hover { color: var(--red); }
.ws-logout svg { width: 14px; height: 14px; }

/* MAIN */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 68px; display: flex; align-items: center; gap: var(--sp-6);
  padding: 0 var(--sp-12); position: sticky; top: 0; z-index: 10;
  background: rgba(246,245,241,0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light); flex-shrink: 0;
}
.crumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-muted); font-family: var(--font-mono); }
.crumb .now { color: var(--text-primary); font-weight: 500; }
.crumb-sep { color: var(--text-separator); }

.search { margin-left: var(--sp-11); flex: 1; max-width: 440px; position: relative; }
.search input {
  width: 100%; height: 40px; padding: 0 14px 0 40px;
  border: 1px solid var(--border-medium); border-radius: var(--radius-lg);
  background: var(--bg-white-soft); font-family: inherit; font-size: var(--text-base);
  outline: none; color: var(--text-primary);
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.search input::placeholder { color: var(--text-faint); }
.search input:focus { border-color: var(--border-hover); background: var(--bg-white-solid); }
.search svg { position: absolute; left: 14px; top: 12px; width: 16px; height: 16px; color: var(--text-muted); }
.search .k {
  position: absolute; right: 10px; top: 10px;
  font-size: var(--text-xs); color: var(--text-muted); padding: 3px 7px;
  background: rgba(0,0,0,0.04); border-radius: var(--radius-sm); font-family: var(--font-mono);
}

.top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-lg);
  background: var(--bg-white-subtle); border: 1px solid rgba(0,0,0,0.05);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: background var(--duration-fast);
}
.icon-btn:hover { background: var(--bg-white-solid); }
.icon-btn svg { width: 17px; height: 17px; color: var(--text-secondary); stroke-width: 1.6; }
.icon-btn .ping {
  position: absolute; top: 9px; right: 10px; width: 7px; height: 7px;
  background: var(--accent); border-radius: 50%; border: 2px solid var(--bg-primary);
}

.btn-dark {
  height: 40px; padding: 0 16px;
  background: var(--bg-dark); color: var(--text-inverse);
  border: none; border-radius: var(--radius-lg);
  font-family: inherit; font-size: var(--text-base); font-weight: 500;
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background var(--duration-fast);
}
.btn-dark:hover { background: var(--bg-dark-hover); }

.btn-outline {
  height: 36px; padding: 0 14px;
  background: var(--bg-white-solid); color: var(--text-secondary);
  border: 1px solid var(--border-dark); border-radius: var(--radius-md);
  font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.btn-outline:hover { background: var(--bg-primary); border-color: var(--border-hover); }

.btn-danger {
  height: 36px; padding: 0 14px;
  background: var(--red); color: white;
  border: none; border-radius: var(--radius-md);
  font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  transition: background var(--duration-fast);
}
.btn-danger:hover { background: var(--red-dark); }

/* CONTENT */
.content { padding: var(--sp-12) var(--sp-12) var(--sp-13); }
.hero { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: var(--sp-11); }
.h-title {
  font-family: var(--font-serif); font-size: var(--text-4xl); font-weight: 400;
  letter-spacing: -0.02em; line-height: 1.1;
}
.h-title em { color: var(--accent); font-style: italic; }
.h-sub { font-size: var(--text-md); color: var(--text-tertiary); margin-top: var(--sp-3); max-width: 540px; }
.h-meta { display: flex; gap: var(--sp-3); align-items: center; flex-shrink: 0; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: var(--sp-3) var(--sp-5); background: var(--bg-white-soft);
  border: 1px solid rgba(0,0,0,0.05); border-radius: var(--radius-lg);
  font-size: 12.5px; color: var(--text-secondary); cursor: pointer;
  transition: background var(--duration-fast);
  white-space: nowrap;
}
.chip:hover { background: var(--bg-white-solid); }
.chip svg { width: 14px; height: 14px; color: var(--text-muted); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); margin-bottom: var(--sp-8); }
.kpi {
  position: relative; padding: var(--sp-9); border-radius: var(--radius-2xl);
  background: rgba(255,255,255,0.75); border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm); overflow: hidden; cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast);
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06); }
.kpi.feature { background: var(--bg-dark); color: var(--text-inverse); border-color: var(--bg-dark); }
.kpi-row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.kpi-name { font-size: 12.5px; color: var(--text-tertiary); font-weight: 450; letter-spacing: 0.01em; }
.kpi.feature .kpi-name { color: var(--text-faint); }
.kpi-spark { width: 60px; height: 22px; }
.kpi-num {
  font-family: var(--font-serif); font-size: var(--text-4xl); line-height: 1;
  letter-spacing: -0.02em; font-weight: 400;
}
.kpi-num .unit { font-family: var(--font-sans); font-size: var(--text-xl); color: var(--text-muted); margin-left: 4px; }
.kpi.feature .kpi-num .unit { color: var(--text-muted); }
.kpi-foot { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-5); font-size: 12px; }
.kpi-delta {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: var(--radius-full); font-weight: 500; font-size: var(--text-sm);
}
.delta-up { background: var(--green-bg); color: var(--green-dark); }
.delta-down { background: var(--red-bg-dark); color: var(--accent-dark); }
.delta-flat { background: rgba(0,0,0,0.05); color: var(--text-secondary); }
.kpi.feature .delta-up { background: rgba(255,255,255,0.1); color: var(--green-light); }
.kpi.feature .delta-down { background: rgba(255,138,76,0.18); color: var(--accent-hover); }
.kpi-foot .ft { color: var(--text-muted); }

/* Grid */
.row { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--sp-7); margin-bottom: var(--sp-7); }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-7); }

/* Panel */
.panel {
  background: var(--bg-white); border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl); padding: var(--sp-10);
  box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-8); }
.panel-title { font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.01em; }
.panel-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* Segment control */
.seg { display: inline-flex; padding: 3px; background: rgba(0,0,0,0.04); border-radius: var(--radius-md); }
.seg-item {
  padding: 5px 11px; font-size: 12px; color: var(--text-tertiary);
  border-radius: 6px; cursor: pointer; font-weight: 450;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.seg-item.active { background: white; color: var(--text-primary); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

/* Chart */
.chart-wrap { position: relative; }
.chart-tags { display: flex; gap: 18px; margin-bottom: var(--sp-6); }
.tag { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-secondary); }
.tag-dot { width: 8px; height: 8px; border-radius: 50%; }
.tag-line { width: 16px; height: 2px; }
.chart { height: 260px; }

.tooltip {
  position: absolute; top: 50px; left: 56%;
  background: var(--bg-dark); color: var(--text-inverse);
  padding: var(--sp-4) var(--sp-5); border-radius: var(--radius-lg);
  font-size: var(--text-sm); min-width: 150px; box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.tooltip .tt-date { color: var(--text-faint); margin-bottom: var(--sp-2); font-family: var(--font-mono); font-size: var(--text-xs); }
.tooltip .tt-row { display: flex; justify-content: space-between; margin-bottom: 3px; }
.tooltip .tt-row b { font-weight: 600; }

/* Alerts */
.alert-stream { display: flex; flex-direction: column; gap: 4px; }
.alert-item {
  display: flex; gap: var(--sp-6); padding: var(--sp-6) 0;
  border-bottom: 1px dashed rgba(0,0,0,0.07); align-items: flex-start;
}
.alert-item:last-child { border-bottom: none; }
.alert-mark { width: 4px; align-self: stretch; border-radius: 2px; flex-shrink: 0; }
.mark-crit { background: var(--red); }
.mark-high { background: var(--accent); }
.mark-med { background: var(--amber); }
.mark-low { background: var(--text-faint); }
.alert-body { flex: 1; }
.alert-top { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: 3px; }
.alert-cat { font-size: var(--text-xs); font-family: var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.alert-dot-sep { color: var(--text-separator); }
.alert-time { font-size: var(--text-xs); color: var(--text-faint); }
.alert-h { font-size: var(--text-md); font-weight: 500; color: var(--text-primary); line-height: 1.35; }
.alert-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }
.alert-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.mini-btn {
  padding: 4px 9px; border-radius: 6px; font-size: var(--text-sm);
  border: 1px solid var(--border-dark); background: white;
  cursor: pointer; color: var(--text-secondary); font-family: inherit;
  transition: background var(--duration-fast);
}
.mini-btn:hover { background: var(--bg-primary); }
.mini-btn.solid { background: var(--bg-dark); color: var(--text-inverse); border-color: var(--bg-dark); }
.mini-btn.solid:hover { background: var(--bg-dark-hover); }

/* SKU table */
.sku-list { display: flex; flex-direction: column; }
.sku-row {
  display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr 1fr 0.6fr;
  gap: var(--sp-6); align-items: center; padding: var(--sp-6) 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: background var(--duration-fast);
}
.sku-row:hover:not(.head) { background: rgba(0,0,0,0.01); }
.sku-row.head {
  font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; font-weight: 500; padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border-medium); font-family: var(--font-mono);
  cursor: default;
}
.sku-row:last-child { border-bottom: none; }
.sku-prod { display: flex; align-items: center; gap: var(--sp-5); }
.sku-img {
  width: 38px; height: 38px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ffe8d6, #ffd0b5);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.sku-img.a { background: linear-gradient(135deg, #dcefe2, #b8dec6); }
.sku-img.b { background: linear-gradient(135deg, #e8e0f5, #cfc1ea); }
.sku-img.c { background: linear-gradient(135deg, #fff0d6, #ffdc94); }
.sku-img.d { background: linear-gradient(135deg, #ffd9d2, #ffb5a8); }
.sku-pname { font-size: var(--text-md); font-weight: 500; line-height: 1.2; }
.sku-pid { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 2px; }
.sku-val { font-size: var(--text-md); font-weight: 500; font-variant-numeric: tabular-nums; }
.sku-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.mini-spark { width: 60px; height: 22px; }

/* Status pills */
.tag-status {
  font-size: var(--text-xs); padding: 3px 8px; border-radius: var(--radius-full);
  font-weight: 500; display: inline-flex; align-items: center; gap: 5px;
}
.ts-good { background: var(--green-bg); color: var(--green-dark); }
.ts-watch { background: var(--amber-bg); color: var(--amber-dark); }
.ts-risk { background: var(--red-bg); color: var(--red-dark); }
.ts-neutral { background: rgba(0,0,0,0.05); color: var(--text-secondary); }
.ts-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* Forecast card */
.forecast-card {
  background: var(--bg-dark-gradient); color: var(--text-inverse);
  padding: var(--sp-10); border-radius: var(--radius-2xl);
  position: relative; overflow: hidden;
}
.forecast-card::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,138,76,0.35), transparent 70%);
}
.fc-label { font-size: 12px; color: var(--text-faint); margin-bottom: var(--sp-5); }
.fc-big { font-family: var(--font-serif); font-size: var(--text-5xl); line-height: 1; letter-spacing: -0.02em; }
.fc-big .pct { font-size: var(--text-3xl); color: var(--accent-hover); }
.fc-line { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-6); font-size: 12px; color: var(--text-separator); }
.fc-bars { display: flex; gap: 4px; margin-top: var(--sp-8); align-items: flex-end; height: 60px; }
.fc-bar { flex: 1; background: rgba(255,255,255,0.08); border-radius: 3px; }
.fc-bar.hi { background: linear-gradient(180deg, var(--accent-hover), var(--accent)); }

/* Location list */
.loc-list { display: flex; flex-direction: column; gap: var(--sp-7); }
.loc-item { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-4); row-gap: var(--sp-2); cursor: pointer; }
.loc-item:hover .loc-name { color: var(--accent); }
.loc-name { font-size: var(--text-base); font-weight: 500; transition: color var(--duration-fast); }
.loc-meta { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.loc-score { font-family: var(--font-serif); font-size: var(--text-2xl); line-height: 1; }
.loc-track { grid-column: 1 / -1; height: 6px; background: rgba(0,0,0,0.05); border-radius: var(--radius-full); overflow: hidden; }
.loc-fill { height: 100%; border-radius: var(--radius-full); }
.f-green { background: var(--green-gradient); }
.f-amber { background: var(--amber-gradient); }
.f-red { background: var(--red-gradient); }

/* Footer */
.footer-bar {
  margin-top: var(--sp-11); display: flex; justify-content: space-between;
  align-items: center; padding: var(--sp-7) 0; font-size: var(--text-sm); color: var(--text-muted);
  border-top: 1px solid rgba(0,0,0,0.05);
}
.foot-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 6px; }
.foot-links a { color: var(--text-tertiary); text-decoration: none; margin-left: var(--sp-6); cursor: pointer; }

/* ============================================
   DATA TABLE
   ============================================ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; font-weight: 500; font-family: var(--font-mono);
  padding: var(--sp-3) var(--sp-4); text-align: left; border-bottom: 1px solid var(--border-medium);
  white-space: nowrap;
}
.data-table thead th.sortable { cursor: pointer; user-select: none; }
.data-table thead th.sortable:hover { color: var(--text-primary); }
.data-table thead th .sort-icon { display: inline-flex; margin-left: 4px; opacity: 0.4; }
.data-table thead th.sorted .sort-icon { opacity: 1; color: var(--accent); }
.data-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--duration-fast);
}
.data-table tbody tr:hover { background: rgba(0,0,0,0.015); }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody td { padding: var(--sp-5) var(--sp-4); font-size: var(--text-md); vertical-align: middle; }
.data-table tbody td.mono { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 100;
  min-width: 180px; background: var(--bg-white-solid); border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 4px;
  animation: dropIn var(--duration-fast) var(--ease-out);
}
.dropdown-option {
  padding: var(--sp-3) var(--sp-4); font-size: var(--text-md); color: var(--text-secondary);
  border-radius: 6px; cursor: pointer; transition: background var(--duration-fast);
}
.dropdown-option:hover { background: rgba(0,0,0,0.04); }
.dropdown-option.active { background: var(--bg-dark); color: var(--text-inverse); font-weight: 500; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn var(--duration-normal) var(--ease-out);
}
.modal-box {
  background: var(--bg-white-solid); border-radius: var(--radius-2xl);
  padding: var(--sp-12); width: 520px; max-width: 90%;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18);
  animation: scaleIn var(--duration-normal) var(--ease-out);
}
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: var(--sp-7); }
.modal-body { font-size: var(--text-lg); color: var(--text-secondary); line-height: 1.6; }
.modal-actions { display: flex; gap: var(--sp-3); justify-content: flex-end; margin-top: var(--sp-10); }
.modal-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); cursor: pointer; color: var(--text-muted);
  transition: background var(--duration-fast);
}
.modal-close:hover { background: rgba(0,0,0,0.05); }

/* ============================================
   TOAST
   ============================================ */
#toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 2000;
}
.toast {
  color: white; padding: 12px 20px; border-radius: var(--radius-lg);
  font-size: var(--text-md); font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-10px);
}
.toast-enter { animation: toastIn var(--duration-normal) var(--ease-out) forwards; }
.toast-exit { animation: toastOut var(--duration-normal) var(--ease-in-out) forwards; }

/* ============================================
   LOGIN
   ============================================ */
.login-container {
  width: 1440px; margin: 0 auto; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}
.login-card {
  width: 520px; text-align: center;
}
.login-brand { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); margin-bottom: var(--sp-12); }
.login-title { font-family: var(--font-serif); font-size: var(--text-4xl); margin-bottom: var(--sp-3); }
.login-sub { font-size: var(--text-md); color: var(--text-tertiary); margin-bottom: var(--sp-12); }
.user-cards { display: flex; flex-direction: column; gap: var(--sp-4); margin-bottom: var(--sp-11); }
.user-card {
  display: flex; align-items: center; gap: var(--sp-6); padding: var(--sp-7);
  background: var(--bg-white); border: 2px solid transparent;
  border-radius: var(--radius-xl); cursor: pointer;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast) var(--ease-out);
  text-align: left;
}
.user-card:hover { border-color: var(--border-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.user-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,107,59,0.15); }
.user-card .ws-avatar { width: 44px; height: 44px; font-size: 15px; }
.user-card-info { flex: 1; }
.user-card-name { font-size: var(--text-lg); font-weight: 600; }
.user-card-role { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.user-card-locs { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.login-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.login-form input {
  width: 100%; height: 44px; padding: 0 var(--sp-7);
  border: 1px solid var(--border-medium); border-radius: var(--radius-lg);
  background: var(--bg-white); font-size: var(--text-lg);
  outline: none; color: var(--text-primary);
  transition: border-color var(--duration-fast);
}
.login-form input:focus { border-color: var(--accent); }
.login-form .btn-dark { width: 100%; justify-content: center; height: 44px; margin-top: var(--sp-3); }

/* ============================================
   PAGE STRUCTURES
   ============================================ */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--sp-10); }
.page-title { font-family: var(--font-serif); font-size: var(--text-4xl); letter-spacing: -0.02em; }
.page-subtitle { font-size: var(--text-md); color: var(--text-tertiary); margin-top: var(--sp-2); }
.page-actions { display: flex; gap: var(--sp-3); align-items: center; }

.filter-bar { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-8); flex-wrap: wrap; align-items: center; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; background: var(--bg-white-soft);
  border: 1px solid rgba(0,0,0,0.05); border-radius: var(--radius-lg);
  font-size: 12.5px; color: var(--text-secondary); cursor: pointer;
  position: relative; transition: background var(--duration-fast);
  white-space: nowrap;
}
.filter-chip:hover { background: var(--bg-white-solid); }
.filter-chip svg { width: 14px; height: 14px; flex-shrink: 0; }

.summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); margin-bottom: var(--sp-8); }
.summary-card {
  padding: var(--sp-8); border-radius: var(--radius-2xl);
  background: var(--bg-white); border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}
.summary-card-label { font-size: 12.5px; color: var(--text-tertiary); margin-bottom: var(--sp-3); }
.summary-card-value { font-family: var(--font-serif); font-size: 30px; letter-spacing: -0.02em; }

.pagination {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: var(--sp-7); font-size: 12.5px; color: var(--text-muted);
}
.pagination-btns { display: flex; gap: var(--sp-3); }
.pagination-btn {
  padding: 6px 12px; border: 1px solid var(--border-dark); border-radius: var(--radius-md);
  background: white; font-size: 12.5px; cursor: pointer; color: var(--text-secondary);
  transition: background var(--duration-fast);
}
.pagination-btn:hover { background: var(--bg-primary); }
.pagination-btn.active { background: var(--bg-dark); color: var(--text-inverse); border-color: var(--bg-dark); }
.pagination-btn:disabled { opacity: 0.4; cursor: default; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-md); color: var(--text-muted); cursor: pointer;
  margin-bottom: var(--sp-8); transition: color var(--duration-fast);
}
.back-link:hover { color: var(--text-primary); }
.back-link svg { width: 16px; height: 16px; }

/* Form elements */
.form-group { margin-bottom: var(--sp-7); }
.form-label { font-size: 12.5px; font-weight: 500; margin-bottom: var(--sp-2); display: block; color: var(--text-secondary); }
.form-input {
  width: 100%; height: 40px; padding: 0 var(--sp-5);
  border: 1px solid var(--border-medium); border-radius: var(--radius-md);
  background: var(--bg-white-solid); font-size: var(--text-md);
  outline: none; color: var(--text-primary);
  transition: border-color var(--duration-fast);
}
.form-input:focus { border-color: var(--accent); }
.form-textarea {
  width: 100%; min-height: 80px; padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border-medium); border-radius: var(--radius-md);
  background: var(--bg-white-solid); font-size: var(--text-md); font-family: inherit;
  outline: none; color: var(--text-primary); resize: vertical;
  transition: border-color var(--duration-fast);
}
.form-textarea:focus { border-color: var(--accent); }
.form-select {
  width: 100%; height: 40px; padding: 0 var(--sp-5);
  border: 1px solid var(--border-medium); border-radius: var(--radius-md);
  background: var(--bg-white-solid); font-size: var(--text-md);
  outline: none; color: var(--text-primary); appearance: auto;
}

/* Checkbox */
.checkbox-cell { width: 40px; text-align: center; }
.row-checkbox {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1px solid var(--border-dark); cursor: pointer; accent-color: var(--accent);
}

/* Detail panels */
.detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--sp-7); }
.detail-section { margin-bottom: var(--sp-8); }
.detail-label { font-size: var(--text-xs); font-family: var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--sp-2); }
.detail-value { font-size: var(--text-md); color: var(--text-primary); }

.timeline { display: flex; flex-direction: column; gap: var(--sp-5); }
.timeline-item { display: flex; gap: var(--sp-4); align-items: flex-start; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-dark); margin-top: 5px; flex-shrink: 0; }
.timeline-dot.active { background: var(--green); }
.timeline-content { font-size: var(--text-md); }
.timeline-date { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

/* Accordion */
.accordion-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-7); cursor: pointer; border-radius: var(--radius-xl);
  background: var(--bg-white); border: 1px solid var(--border-light);
  margin-bottom: var(--sp-3); transition: background var(--duration-fast);
}
.accordion-header:hover { background: rgba(255,255,255,0.95); }
.accordion-body { padding: 0 var(--sp-7) var(--sp-7); display: none; }
.accordion-body.open { display: block; }

/* Skeleton loading */
.skeleton { animation: pulse 1.5s ease-in-out infinite; background: rgba(0,0,0,0.06); border-radius: var(--radius-md); }
.skeleton-line { height: 14px; margin-bottom: var(--sp-3); }
.skeleton-block { height: 120px; border-radius: var(--radius-2xl); margin-bottom: var(--sp-6); }
.skeleton-card { height: 100px; border-radius: var(--radius-2xl); }

/* Empty state */
.empty-state { text-align: center; padding: var(--sp-13) var(--sp-12); }
.empty-state svg { width: 48px; height: 48px; color: var(--text-faint); margin-bottom: var(--sp-7); }
.empty-state h3 { font-size: var(--text-xl); font-weight: 600; margin-bottom: var(--sp-3); }
.empty-state p { font-size: var(--text-md); color: var(--text-muted); margin-bottom: var(--sp-7); }

/* Inline link */
.link-accent { color: var(--accent); font-weight: 500; cursor: pointer; font-size: 12px; }
.link-accent:hover { color: var(--accent-dark); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-10px); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.fade-in { animation: fadeIn var(--duration-normal) var(--ease-out); }
.slide-up { animation: slideUp var(--duration-slow) var(--ease-out); }
.stagger-1 { animation-delay: 50ms; animation-fill-mode: both; }
.stagger-2 { animation-delay: 100ms; animation-fill-mode: both; }
.stagger-3 { animation-delay: 150ms; animation-fill-mode: both; }
.stagger-4 { animation-delay: 200ms; animation-fill-mode: both; }

/* View all link */
.view-all { font-size: 12px; color: var(--accent); font-weight: 500; cursor: pointer; }
.view-all:hover { color: var(--accent-dark); }

/* Sortable header */
.sort-header { cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 4px; }
.sort-header:hover { color: var(--text-primary); }
