/* ============================================================
   AV Ops — cinematic dark internal ops platform
   Design tokens + base styles
   ============================================================ */

:root {
  /* Font stacks */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-display: 'Instrument Serif', 'Times New Roman', serif;

  /* Dark theme (default) — deep near-black with slight warm cast */
  --bg: oklch(0.16 0.008 280);
  --bg-1: oklch(0.195 0.008 280);   /* elevated surface 1 */
  --bg-2: oklch(0.225 0.008 280);   /* elevated surface 2 */
  --bg-3: oklch(0.26 0.008 280);    /* hover */
  --bg-inset: oklch(0.13 0.008 280); /* inset wells */
  --bg-active: oklch(0.32 0.012 280);  /* active/selected state bg — clearly distinct from hover */
  --fg-active: oklch(0.99 0.003 280);  /* text on active elements */

  --border: oklch(0.30 0.008 280 / 0.7);
  --border-soft: oklch(0.30 0.008 280 / 0.35);
  --border-strong: oklch(0.42 0.012 280 / 0.9);

  --fg: oklch(0.97 0.005 280);
  --fg-1: oklch(0.86 0.006 280);    /* secondary */
  --fg-2: oklch(0.68 0.008 280);    /* tertiary */
  --fg-3: oklch(0.52 0.008 280);    /* muted */
  --fg-4: oklch(0.40 0.008 280);    /* subtle */

  /* Film-grade accents */
  --accent: oklch(0.70 0.22 340);              /* magenta */
  --accent-hover: oklch(0.75 0.22 340);
  --accent-soft: oklch(0.70 0.22 340 / 0.14);
  --accent-line: oklch(0.70 0.22 340 / 0.35);

  --amber: oklch(0.82 0.16 75);
  --amber-soft: oklch(0.82 0.16 75 / 0.14);
  --amber-line: oklch(0.82 0.16 75 / 0.35);

  /* Semantic */
  --ok: oklch(0.78 0.16 150);
  --ok-soft: oklch(0.78 0.16 150 / 0.14);
  --warn: oklch(0.82 0.16 75);
  --warn-soft: oklch(0.82 0.16 75 / 0.14);
  --err: oklch(0.70 0.20 22);
  --err-soft: oklch(0.70 0.20 22 / 0.14);
  --info: oklch(0.76 0.12 230);
  --info-soft: oklch(0.76 0.12 230 / 0.14);

  /* Status palette for bookings */
  --s-inquiry: oklch(0.72 0.05 260);
  --s-hold: oklch(0.82 0.16 75);
  --s-softhold: oklch(0.85 0.11 55);
  --s-booked: oklch(0.70 0.22 340);
  --s-released: oklch(0.52 0.008 280);
  --s-completed: oklch(0.78 0.16 150);

  /* Shape */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.5);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.02);

  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-line);

  /* Layout */
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 60px;
  --topbar-h: 52px;

  /* Density */
  --row-h: 40px;
  --pad-x: 24px;
}

/* Light theme */
[data-theme="light"] {
  --bg: oklch(0.985 0.003 80);
  --bg-1: oklch(1 0 0);
  --bg-2: oklch(0.975 0.003 80);
  --bg-3: oklch(0.955 0.003 80);
  --bg-inset: oklch(0.96 0.003 80);
  --bg-active: oklch(0.88 0.007 80);   /* active/selected state bg — light mode */
  --fg-active: oklch(0.10 0.010 280);  /* text on active elements — light mode */

  --border: oklch(0.88 0.004 80 / 0.9);
  --border-soft: oklch(0.90 0.004 80 / 0.6);
  --border-strong: oklch(0.80 0.004 80 / 0.9);

  --fg: oklch(0.20 0.008 280);
  --fg-1: oklch(0.30 0.008 280);
  --fg-2: oklch(0.45 0.008 280);
  --fg-3: oklch(0.58 0.008 280);
  --fg-4: oklch(0.72 0.008 280);

  --shadow-sm: 0 1px 2px rgba(16,16,24,0.05);
  --shadow-md: 0 4px 16px rgba(16,16,24,0.06), 0 1px 2px rgba(16,16,24,0.04);
  --shadow-lg: 0 24px 64px rgba(16,16,24,0.10), 0 2px 8px rgba(16,16,24,0.06);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.5);
}

/* Accent color variants */
[data-accent="amber"] {
  --accent: oklch(0.82 0.16 75);
  --accent-hover: oklch(0.85 0.16 75);
  --accent-soft: oklch(0.82 0.16 75 / 0.16);
  --accent-line: oklch(0.82 0.16 75 / 0.4);
}
[data-accent="emerald"] {
  --accent: oklch(0.76 0.16 160);
  --accent-hover: oklch(0.80 0.16 160);
  --accent-soft: oklch(0.76 0.16 160 / 0.16);
  --accent-line: oklch(0.76 0.16 160 / 0.4);
}
[data-accent="ice"] {
  --accent: oklch(0.78 0.12 220);
  --accent-hover: oklch(0.82 0.12 220);
  --accent-soft: oklch(0.78 0.12 220 / 0.16);
  --accent-line: oklch(0.78 0.12 220 / 0.4);
}

/* Density */
[data-density="compact"] {
  --row-h: 34px;
  --pad-x: 18px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { background: transparent; border: 0; outline: 0; width: 100%; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: oklch(0.45 0.008 280 / 0.3); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: oklch(0.55 0.008 280 / 0.5); background-clip: padding-box; border: 2px solid transparent; }

/* ============================================================
   Shell
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 100vh;
  background: var(--bg);
  transition: grid-template-columns 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.app[data-sidebar="collapsed"] { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* Sidebar */
.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  gap: 4px;
  overflow: hidden;
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 14px;
  min-height: 44px;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), oklch(from var(--accent) calc(l - 0.15) c calc(h + 30)));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 12px var(--accent-soft);
  flex-shrink: 0;
}
.brand-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.brand-name em {
  font-style: normal;
  color: var(--fg-3);
  font-weight: 400;
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-left: 2px;
}

.nav-section {
  padding: 10px 10px 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 450;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
  text-align: left;
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.nav-item:hover { background: var(--bg-2); color: var(--fg); }
.nav-item[aria-current="true"] {
  background: var(--bg-active);
  color: var(--fg-active);
  font-weight: 600;
}
.nav-item[aria-current="true"]::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--fg-2); }
.nav-item[aria-current="true"] svg { color: var(--accent); }
.nav-item[aria-current="true"] .count { color: var(--fg-active); opacity: 0.65; }
.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}
.nav-item .kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-1);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--r-md);
  white-space: nowrap;
  overflow: hidden;
}
.user-card:hover { background: var(--bg-2); }
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.55 0.12 280), oklch(0.70 0.18 340));
  color: #fff;
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar.lg { width: 36px; height: 36px; font-size: 12px; }
.user-card .u-meta { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.user-card .u-name { font-size: 12.5px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
.user-card .u-role { font-size: 11px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; }

[data-sidebar="collapsed"] .brand-name,
[data-sidebar="collapsed"] .nav-section,
[data-sidebar="collapsed"] .nav-item .label,
[data-sidebar="collapsed"] .nav-item .count,
[data-sidebar="collapsed"] .nav-item .kbd,
[data-sidebar="collapsed"] .u-meta {
  opacity: 0;
  pointer-events: none;
  width: 0;
}
[data-sidebar="collapsed"] .nav-item { justify-content: center; padding: 7px; }
[data-sidebar="collapsed"] .user-card { justify-content: center; padding: 7px; }

/* Main */
.main {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  border-top-left-radius: 12px;
  margin-top: 8px;
  margin-bottom: 8px;
  margin-right: 8px;
  border-bottom-left-radius: 12px;
  box-shadow: var(--shadow-lg);
}
[data-theme="light"] .main { background: #fff; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-1);
  border-top-left-radius: 12px;
}
[data-theme="light"] .topbar { background: #fff; }
.topbar .crumb {
  display: flex; align-items: center; gap: 8px;
  color: var(--fg-2);
  font-size: 13px;
}
.topbar .crumb strong { color: var(--fg); font-weight: 500; }
.topbar .crumb-link { background: none; border: none; padding: 0; cursor: pointer; color: var(--fg-2); font-size: 13px; font-family: inherit; }
.topbar .crumb-link:hover { color: var(--fg); }
.topbar .crumb svg { width: 12px; height: 12px; color: var(--fg-3); }

.search {
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  color: var(--fg-2);
  transition: border-color 0.15s;
  cursor: text;
}
.search:hover { border-color: var(--border); }
.search svg { width: 14px; height: 14px; color: var(--fg-3); }
.search input { font-size: 13px; color: var(--fg); }
.search input::placeholder { color: var(--fg-3); }
.search .kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-1);
}

.topbar-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.iconbtn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--fg-2);
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.iconbtn:hover { background: var(--bg-2); color: var(--fg); }
.iconbtn svg { width: 15px; height: 15px; }
.iconbtn .dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  border: 1.5px solid var(--bg-1);
}

/* Content */
.view {
  overflow: auto;
  scroll-behavior: smooth;
}

/* ============================================================
   Primitives
   ============================================================ */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 32px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-1);
  background: var(--bg-2);
  border: 1px solid var(--border);
  transition: all 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-3); color: var(--fg); border-color: var(--border-strong); }
.btn svg { width: 14px; height: 14px; }
.btn.primary {
  background: var(--accent);
  color: oklch(0.15 0.008 280);
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 4px 12px var(--accent-soft);
  font-weight: 550;
}
[data-theme="light"] .btn.primary { color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: var(--r-sm); }
.btn.xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: var(--r-sm); }
.btn.lg { height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.danger { color: var(--err); border-color: oklch(0.70 0.20 22 / 0.3); }
.btn.danger:hover { background: var(--err-soft); }

/* Standalone filter/toggle buttons (not in a btn-group) */
.btn[aria-pressed="true"]:not(.btn-group .btn) {
  background: var(--bg-active);
  color: var(--fg-active);
  border-color: var(--border-strong);
  font-weight: 600;
}

/* Trash button on bid-row in sidebar — subtle until hover */
.bid-row-del:hover { color: var(--err) !important; background: var(--err-soft); }

.btn-group { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 2px; }
.btn-group .btn {
  background: transparent; border: 0; height: 26px; padding: 0 10px; font-size: 12px;
  color: var(--fg-2);
}
.btn-group .btn:hover { background: var(--bg-3); color: var(--fg); }
.btn-group .btn[aria-pressed="true"] { background: var(--bg-active); color: var(--fg-active); box-shadow: var(--shadow-sm); font-weight: 600; }

/* Inputs */
.input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:hover { border-color: var(--border-strong); }
.input:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.input input { font-size: 13px; }
.input input::placeholder { color: var(--fg-3); }
.input svg { width: 14px; height: 14px; color: var(--fg-3); }
.input.sm { height: 28px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field label {
  font-size: 11px;
  color: var(--fg-2);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.field .input { width: 100%; }
.field textarea.input { height: auto; min-height: 60px; padding: 8px 10px; resize: vertical; line-height: 1.5; }

/* Cards */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}
[data-theme="light"] .card { background: #fff; border-color: var(--border); }

.card-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.card-h h3 {
  font-size: 13px;
  font-weight: 550;
  margin: 0;
  letter-spacing: -0.005em;
}
.card-h .sub { font-size: 11.5px; color: var(--fg-3); }
.card-h .spacer { flex: 1; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg-1);
  border: 1px solid var(--border-soft);
  line-height: 1.5;
  letter-spacing: 0.002em;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.accent { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.badge.amber { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-line); }
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: oklch(0.78 0.16 150 / 0.3); }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: oklch(0.82 0.16 75 / 0.3); }
.badge.err { color: var(--err); background: var(--err-soft); border-color: oklch(0.70 0.20 22 / 0.3); }
.badge.info { color: var(--info); background: var(--info-soft); border-color: oklch(0.76 0.12 230 / 0.3); }
.badge.muted { color: var(--fg-2); background: var(--bg-2); }

/* Stat (KPI card) */
.stat {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: var(--r-lg);
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
}
.stat .label {
  font-size: 11.5px;
  color: var(--fg-2);
  font-weight: 500;
  letter-spacing: 0.004em;
  display: flex; align-items: center; gap: 6px;
}
.stat .label svg { width: 12px; height: 12px; color: var(--fg-3); }
.stat .val {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.022em;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  line-height: 1;
}
.stat .val small { font-size: 15px; color: var(--fg-2); font-weight: 400; margin-left: 2px; }
.stat .delta { font-size: 11.5px; color: var(--fg-2); display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.stat .delta.up { color: var(--ok); }
.stat .delta.down { color: var(--err); }
.stat .delta svg { width: 12px; height: 12px; }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-3);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--bg-1);
  position: sticky;
  top: 0;
}
[data-theme="light"] .table thead th { background: #fff; }
.table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--fg-1);
  vertical-align: middle;
  white-space: nowrap;
}
.table tbody tr:hover td { background: var(--bg-2); }
.table tbody tr[aria-selected="true"] td { background: var(--bg-active); color: var(--fg-active); font-weight: 500; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .mono { font-family: var(--font-mono); font-size: 12px; }
.table .muted { color: var(--fg-3); }
.table.compact tbody td { padding: 7px 10px; font-size: 12.5px; }
.table.compact thead th { padding: 6px 10px; }

/* Progress */
.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
  position: relative;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.bar.thin { height: 4px; }

/* Divider */
.hr { height: 1px; background: var(--border-soft); border: 0; margin: 0; }

/* Layout helpers */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--fg-3); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   View: Page headers
   ============================================================ */
.page { padding: 24px 28px 48px; max-width: 1600px; }
.page.wide { max-width: none; }

.page-h {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}
.page-h h1 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
}
.page-h .sub { font-size: 13px; color: var(--fg-2); }
.page-h .spacer { flex: 1; }
.page-h .actions { display: flex; align-items: center; gap: 8px; }
.page-section-head { border-bottom: 1px solid var(--border-soft); padding-bottom: 8px; }
.page-section-head .section-title { font-size: 13px; font-weight: 500; color: var(--fg); margin-bottom: 2px; }
.page-section-head .section-sub { font-size: 12px; color: var(--fg-3); }

/* Dashboard */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.dash-grid .col-3 { grid-column: span 3; }
.dash-grid .col-4 { grid-column: span 4; }
.dash-grid .col-6 { grid-column: span 6; }
.dash-grid .col-8 { grid-column: span 8; }
.dash-grid .col-12 { grid-column: span 12; }

/* Schedule card rows */
.slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
  background: var(--bg);
}
[data-theme="light"] .slot { background: var(--bg-2); }
.slot + .slot { margin-top: 6px; }
.slot .time { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-2); width: 82px; flex-shrink: 0; }
.slot .title { font-size: 13px; color: var(--fg); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.slot .who { font-size: 11.5px; color: var(--fg-3); }

/* Alert strip */
.alert-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
  border: 1px solid var(--border-soft);
}
[data-theme="light"] .alert-strip { background: var(--bg-2); }
.alert-strip .ico {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.alert-strip .ico svg { width: 14px; height: 14px; }
.alert-strip .ico.warn { background: var(--warn-soft); color: var(--warn); }
.alert-strip .ico.ok { background: var(--ok-soft); color: var(--ok); }
.alert-strip .ico.info { background: var(--info-soft); color: var(--info); }
.alert-strip .ico.accent { background: var(--accent-soft); color: var(--accent); }
.alert-strip .body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.alert-strip .body .t { font-size: 12.5px; color: var(--fg); }
.alert-strip .body .s { font-size: 11.5px; color: var(--fg-3); }

/* ============================================================
   Bid Builder
   ============================================================ */
.bid-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 304px;
  height: 100%;
  min-height: 0;
  gap: 0;
}
/* Tighten at mid-narrow widths */
@media (max-width: 1320px) {
  .bid-grid { grid-template-columns: 240px minmax(0, 1fr) 260px; }
}
/* Collapse left sidebar at narrow widths — keep right (group + duplicate) which is more actively used */
@media (max-width: 1120px) {
  .bid-grid { grid-template-columns: minmax(0, 1fr) 240px; }
  .bid-side:not(.right) { display: none; }
}
@media (max-width: 820px) {
  .bid-grid { grid-template-columns: minmax(0, 1fr); }
  .bid-side.right { display: none; }
}
.bid-main { min-width: 0; }
.bid-items { overflow-x: auto; }
.cat-head, .item-row { min-width: 720px; }
.bid-side {
  border-right: 1px solid var(--border-soft);
  padding: 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.bid-side.right { border-right: 0; border-left: 1px solid var(--border-soft); }
.bid-main { overflow: auto; display: flex; flex-direction: column; min-width: 0; }

.kind-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-2);
}
.kind-toggle button {
  background: transparent;
  border: 0;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--fg-3);
  cursor: pointer;
  font-family: var(--font-mono);
  line-height: 1.4;
  min-width: 18px;
}
.kind-toggle button + button { border-left: 1px solid var(--border); }
.kind-toggle button.active {
  background: var(--fg-active);
  color: var(--bg);
  font-weight: 600;
}
.kind-toggle button:hover:not(.active) { color: var(--fg-1); }

.discount-row .k { flex-wrap: wrap; row-gap: 4px; }

.bid-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 14px;
}
.bid-head .num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-3);
}
.bid-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.bid-head .rev { font-size: 11.5px; color: var(--fg-3); }

.bid-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-1);
  position: sticky;
  top: 0;
  z-index: 2;
}
[data-theme="light"] .bid-toolbar { background: #fff; }

.bid-items { padding: 0; flex: 1; }

.cat-group { border-bottom: 1px solid var(--border-soft); }
.cat-group:last-child { border-bottom: 0; }
.cat-head {
  display: grid;
  grid-template-columns: 28px 120px 90px 1fr 64px 72px 90px 90px 28px;
  align-items: center;
  gap: 8px;
  padding: 6px 24px;
  background: var(--bg);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-2);
  font-weight: 500;
  font-family: var(--font-mono);
  user-select: none;
  cursor: pointer;
}
[data-theme="light"] .cat-head { background: var(--bg-2); }
.cat-head .chev { transition: transform 0.15s; color: var(--fg-3); }
.cat-head[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.cat-head .name { display: flex; align-items: center; gap: 8px; grid-column: 2 / 6; }
.cat-head .name .swatch { width: 8px; height: 8px; border-radius: 2px; }
.cat-head .subt {
  grid-column: 8 / 9;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.cat-head .count-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--fg-2);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}

.item-row {
  display: grid;
  grid-template-columns: 28px 120px 90px 1fr 64px 72px 90px 90px 28px;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--border-soft);
  min-height: var(--row-h);
  transition: background 0.1s;
  position: relative;
}
.item-row:hover { background: oklch(0.20 0.008 280 / 0.5); }
[data-theme="light"] .item-row:hover { background: var(--bg-2); }
.item-row:last-child { border-bottom: 0; }
.item-row.dragging { opacity: 0.4; }

.item-cell {
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--fg);
  border-right: 1px solid var(--border-soft);
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.item-cell:last-child { border-right: 0; }
.item-cell.num { justify-content: flex-end; font-family: var(--font-mono); font-size: 12px; }
.item-cell.handle {
  justify-content: center;
  color: var(--fg-4);
  cursor: grab;
  font-size: 11px;
  font-family: var(--font-mono);
  border-right: 1px solid var(--border-soft);
  padding: 0 4px;
}
.item-cell.handle:hover { color: var(--fg-2); background: var(--bg-2); }
.item-cell.code { color: var(--fg-2); font-family: var(--font-mono); font-size: 11.5px; }
.item-cell.actions { justify-content: center; }
.item-cell input {
  width: 100%;
  padding: 6px 0;
  font-size: 13px;
  background: transparent;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.item-cell input:focus { outline: none; }
.item-cell:focus-within {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.item-cell.num input { text-align: right; font-family: var(--font-mono); font-size: 12px; }

.add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  color: var(--fg-3);
  font-size: 12.5px;
  width: 100%;
  text-align: left;
}
.add-row:hover { background: var(--bg-2); color: var(--fg); }
.add-row svg { width: 14px; height: 14px; }

/* Totals panel */
.totals {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  background: var(--bg);
}
[data-theme="light"] .totals { background: var(--bg-2); }
.totals-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.totals-row .k { color: var(--fg-2); }
.totals-row .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--fg); }
.totals-row.grand { padding-top: 10px; border-top: 1px solid var(--border); margin-top: 6px; }
.totals-row.grand .k { font-size: 13px; color: var(--fg); font-weight: 500; }
.totals-row.grand .v {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--fg);
}

.side-group { display: flex; flex-direction: column; gap: 10px; }
.side-group h4 {
  margin: 0 0 2px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-soft);
  padding: 0 28px;
  background: var(--bg-1);
  position: sticky; top: 0;
  z-index: 1;
}
[data-theme="light"] .tabs { background: #fff; }
.tab {
  padding: 10px 14px 11px;
  font-size: 13px;
  color: var(--fg-2);
  font-weight: 450;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg-active); border-bottom-color: var(--accent); font-weight: 600; }
.tab .count {
  font-size: 10.5px;
  background: var(--bg-2);
  color: var(--fg-2);
  padding: 1px 6px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* Schedule calendar */
.schedule-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-1);
}
[data-theme="light"] .schedule-top { background: #fff; }
.week-label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.week-label small { color: var(--fg-3); font-weight: 400; margin-left: 8px; }

.cal-grid {
  display: grid;
  grid-template-columns: 160px repeat(7, 1fr);
  border-bottom: 1px solid var(--border-soft);
  font-size: 11.5px;
  color: var(--fg-2);
}
.cal-grid .hcell {
  padding: 10px 12px;
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-grid .hcell:last-child { border-right: 0; }
.cal-grid .hcell.today { background: var(--accent-soft); color: var(--accent); }
.cal-grid .hcell .dow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-3); }
.cal-grid .hcell.today .dow { color: var(--accent); }
.cal-grid .hcell .d { font-size: 16px; font-weight: 500; color: var(--fg); letter-spacing: -0.01em; }
.cal-grid .hcell.today .d { color: var(--accent); }

.res-grid {
  display: grid;
  grid-template-columns: 160px repeat(7, 1fr);
}
.res-row-label {
  padding: 12px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-1);
  position: sticky; left: 0;
}
[data-theme="light"] .res-row-label { background: #fff; }
.res-row-label .name { font-size: 12.5px; color: var(--fg); font-weight: 500; }
.res-row-label .role { font-size: 11px; color: var(--fg-3); }
.res-row-group {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
}
.res-group-label {
  padding: 8px 12px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
  font-size: 10px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  display: flex; align-items: center;
  grid-column: 1 / -1;
}
[data-theme="light"] .res-group-label { background: var(--bg-2); }

.day-cell {
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  position: relative;
  min-height: 44px;
  padding: 4px;
  background-image:
    linear-gradient(to right, var(--border-soft) 1px, transparent 1px);
  background-size: 25% 100%;
  background-repeat: repeat-x;
  background-position: 0 50%;
  background-size: 50% 1px;
  background: none;
}
.day-cell:last-child { border-right: 0; }
.day-cell.weekend { background: oklch(0.18 0.008 280 / 0.5); }
[data-theme="light"] .day-cell.weekend { background: oklch(0.97 0.003 80); }
.day-cell.today { background: var(--accent-soft); }

.booking {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.25;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
  border: 1px solid;
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 1;
}
.booking:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); z-index: 2; }
.booking .bk-title { color: var(--fg); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking .bk-sub { color: var(--fg-2); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.booking.status-inquiry { background: oklch(0.72 0.05 260 / 0.12); border-color: oklch(0.72 0.05 260 / 0.35); }
.booking.status-hold { background: var(--amber-soft); border-color: var(--amber-line); border-style: dashed; }
.booking.status-softhold { background: oklch(0.85 0.11 55 / 0.10); border-color: oklch(0.85 0.11 55 / 0.30); border-style: dashed; }
.booking.status-booked { background: var(--accent-soft); border-color: var(--accent-line); }
.booking.status-booked .bk-title { color: var(--accent); }
.booking.status-released { background: oklch(0.52 0.008 280 / 0.12); border-color: var(--border); opacity: 0.55; text-decoration: line-through; }
.booking.status-completed { background: var(--ok-soft); border-color: oklch(0.78 0.16 150 / 0.3); opacity: 0.85; }

/* Charts */
.chart {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chart svg { width: 100%; display: block; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--fg-2); }
.chart-legend .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; }

/* Freelancer card */
.fl-card {
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
[data-theme="light"] .fl-card { background: #fff; }

/* Phone frame */
.phone {
  width: 390px;
  height: 780px;
  background: #000;
  border-radius: 48px;
  padding: 11px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 0 2px oklch(0.30 0.008 280), inset 0 0 0 1.5px oklch(0.42 0.008 280);
  position: relative;
  flex-shrink: 0;
}
.phone-screen {
  background: var(--bg);
  border-radius: 38px;
  overflow: hidden;
  height: 100%;
  width: 100%;
  position: relative;
}
.phone .notch {
  position: absolute;
  top: 22px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 32px;
  background: #000;
  border-radius: 999px;
  z-index: 10;
}
.status-bar {
  height: 42px;
  padding: 14px 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  font-family: var(--font-sans);
}

/* Tweaks panel */
.tweaks {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 280px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 100;
  backdrop-filter: blur(24px);
}
.tweaks-h {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.tweaks-h h4 { margin: 0; font-size: 12.5px; font-weight: 500; }
.tweaks-h .spacer { flex: 1; }
.tweaks-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }
.tweak { display: flex; flex-direction: column; gap: 6px; }
.tweak-label { font-size: 10.5px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.seg {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.seg button {
  flex: 1;
  padding: 5px 8px;
  font-size: 11.5px;
  color: var(--fg-2);
  border-radius: 4px;
  white-space: nowrap;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.seg button[aria-pressed="true"] { background: var(--bg-active); color: var(--fg-active); box-shadow: var(--shadow-sm); font-weight: 600; }
.seg button svg { width: 12px; height: 12px; }
.swatches { display: flex; gap: 6px; }
.swatch-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: transform 0.15s;
}
.swatch-btn[aria-pressed="true"] { border-color: var(--fg); transform: scale(1.1); }

/* Sparkline */
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.spark .fill { fill: var(--accent-soft); stroke: none; }
.spark .axis { stroke: var(--border); stroke-width: 1; }
.spark .dot { fill: var(--accent); }

/* Tag list */
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }

/* Bar chart (report) */
.barchart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 6px; padding: 12px 16px; height: 180px; }
.barchart .bar-group { display: flex; align-items: end; gap: 3px; height: 100%; position: relative; }
.barchart .bar-group .b { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; transition: opacity 0.15s; }
.barchart .bar-group .b.b2 { background: var(--amber); }
.barchart .bar-group:hover .b { opacity: 0.8; }
.barchart .labels { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 6px 16px 14px; font-size: 10.5px; color: var(--fg-3); text-align: center; font-family: var(--font-mono); }

/* Donut */
.donut { display: flex; align-items: center; gap: 20px; padding: 16px; }
.donut svg { flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 12px; flex: 1; }
.donut-legend .li { display: flex; align-items: center; gap: 8px; }
.donut-legend .li .sw { width: 10px; height: 10px; border-radius: 2px; }
.donut-legend .li .pct { margin-left: auto; color: var(--fg-2); font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 11.5px; }

/* Timeline */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 90px 16px 1fr; gap: 10px; align-items: flex-start; padding: 10px 0; }
.tl-item .tl-t { font-size: 11.5px; color: var(--fg-3); font-family: var(--font-mono); padding-top: 2px; }
.tl-item .tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; position: relative; background: var(--accent); justify-self: center; }
.tl-item .tl-dot::after { content: ''; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 1px; height: 40px; background: var(--border-soft); }
.tl-item:last-child .tl-dot::after { display: none; }
.tl-item .tl-body { display: flex; flex-direction: column; gap: 2px; }
.tl-item .tl-title { font-size: 13px; color: var(--fg); }
.tl-item .tl-sub { font-size: 11.5px; color: var(--fg-3); }

/* Misc utils */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

/* Scroll containers */
.scroll-x { overflow-x: auto; }

/* File list */
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
  background: var(--bg);
}
[data-theme="light"] .file-item { background: var(--bg-1); }
.file-item + .file-item { margin-top: 6px; }
.file-item .ft {
  width: 32px; height: 40px;
  background: var(--bg-2);
  border-radius: 4px;
  display: grid; place-items: center;
  font-size: 9.5px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Scrollshadow masks */
.mask-b {
  mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent);
}

/* Big display numerals */
.display-num {
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* ============ Bid tabs ============ */
.bid-tabs {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-1);
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 42px;
}
[data-theme="light"] .bid-tabs { background: #fff; }
.bid-tablist {
  display: flex;
  align-items: stretch;
  gap: 2px;
}
.bid-tab {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--fg-3);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  letter-spacing: -0.005em;
  border-bottom: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.bid-tab:hover { color: var(--fg-1); }
.bid-tab.active {
  color: var(--fg-active);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.bid-tab .count-badge {
  background: var(--bg-2);
  color: var(--fg-3);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
}
.bid-tab.active .count-badge {
  background: var(--accent-soft);
  color: var(--accent);
}
.bid-tab-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============ Panels (team, deliverables, activity) ============ */
.bid-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  overflow: auto;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.panel-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg-1);
}
.panel-sub {
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 2px;
  max-width: 520px;
  line-height: 1.5;
}
.empty-panel {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: var(--fg-3);
  background: var(--bg);
}
.empty-panel .empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-1);
  margin-top: 6px;
}
.empty-panel .empty-sub {
  font-size: 12px;
  max-width: 360px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.preset-chip {
  appearance: none;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  color: var(--fg-2);
  padding: 6px 10px;
  border-radius: 16px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 120ms ease;
}
.preset-chip:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Team table */
.team-table, .deliv-table {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-1);
}
.team-head, .team-row, .team-foot {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 100px 80px 120px 130px 36px;
  align-items: center;
  gap: 0;
}
.team-head {
  padding: 10px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  font-weight: 500;
}
.team-row {
  padding: 4px 8px 4px 12px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.team-row:last-of-type { border-bottom: 0; }
.team-foot {
  padding: 10px 12px;
  background: var(--bg);
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
}

/* Deliverables table */
.deliv-table { overflow-x: auto; }
.deliv-head, .deliv-row, .deliv-section-head {
  min-width: 720px;
}
.deliv-head, .deliv-row {
  display: grid;
  grid-template-columns: 1.6fr 80px 70px 1fr 1.3fr 52px 32px;
  align-items: center;
  gap: 0;
}
.deliv-head {
  padding: 10px 10px 10px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  font-weight: 500;
}
.deliv-section-head {
  padding: 9px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  border-top: 1px solid var(--border-soft);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--fg-2);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.deliv-section-head:first-child { border-top: 0; }
.deliv-row {
  padding: 3px 6px 3px 12px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.deliv-row:last-child { border-bottom: 0; }
.deliv-row.preview { background: color-mix(in oklab, var(--accent) 4%, transparent); }

/* Aspect-ratio multi-select chips inside a row */
.ratio-chip {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.3;
  transition: all 0.12s;
}
.ratio-chip:hover { color: var(--fg-1); border-color: var(--fg-3); }
.ratio-chip.on {
  background: var(--fg-1);
  color: var(--bg);
  border-color: var(--fg-1);
}

/* Computed Qty — read-only display */
.qty-computed {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  color: var(--fg-1);
  font-size: 12.5px;
  text-align: right;
  cursor: help;
}

/* Deliverables parse panel */
.deliv-parse {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--bg-1);
  padding: 12px;
  margin-bottom: 14px;
}
.deliv-parse textarea {
  width: 100%;
  min-height: 120px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  color: var(--fg-1);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  resize: vertical;
}
.deliv-parse textarea:focus { outline: none; border-color: var(--fg-3); }
.deliv-parse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.deliv-parse-head .title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-1);
  display: flex;
  align-items: center;
  gap: 6px;
}
.deliv-parse-head .sub {
  font-size: 11.5px;
  color: var(--fg-3);
  margin-top: 2px;
}
.deliv-parse-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

/* Totals strip */
.deliv-totals {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 10px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  font-size: 11.5px;
  color: var(--fg-3);
}
.deliv-totals .grand {
  color: var(--fg-1);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
}
.deliv-totals .cat-pill {
  color: var(--fg-2);
}
.deliv-totals .cat-pill b {
  color: var(--fg-1);
  font-weight: 600;
  font-family: var(--font-mono);
  margin-right: 2px;
}
.deliv-totals .warn {
  color: var(--warn, #c99a3a);
  margin-left: auto;
  font-size: 11px;
}

/* Source text card */
.deliv-source {
  margin-top: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--bg-1);
}
.deliv-source-head {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: var(--fg-2);
}
.deliv-source-head:hover { color: var(--fg-1); }
.deliv-source-body {
  padding: 0 12px 12px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-2);
  white-space: pre-wrap;
  line-height: 1.5;
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
}

/* Ghost input — borderless inline editor */
.ghost-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-1);
  font-family: inherit;
  font-size: 12.5px;
  padding: 6px 8px;
  border-radius: 4px;
  outline: none;
  transition: background 100ms ease, border-color 100ms ease;
}
.ghost-input:hover { background: var(--bg-2); }
.ghost-input:focus {
  background: var(--bg-2);
  border-color: var(--accent-line);
}
.ghost-input.mono { font-family: var(--font-mono); font-size: 12px; }
select.ghost-input {
  appearance: none;
  cursor: pointer;
  padding-right: 20px;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%), linear-gradient(135deg, var(--fg-3) 50%, transparent 50%);
  background-position: calc(100% - 10px) 50%, calc(100% - 6px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

.team-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.team-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.team-section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-1);
  letter-spacing: -0.005em;
}
.team-section-sub {
  font-size: 11.5px;
  color: var(--fg-3);
  margin-top: 2px;
}
.client-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.field-custom-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.field-custom-label .label-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg-2);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0;
  flex: 1;
  min-width: 0;
}
.field-custom-label .label-input::placeholder {
  color: var(--fg-4);
  font-weight: 400;
  letter-spacing: 0;
}
.field-custom .field-remove {
  opacity: 0;
  transition: opacity 120ms ease;
  padding: 2px 4px;
}
.field-custom:hover .field-remove,
.field-custom:focus-within .field-remove {
  opacity: 1;
}
