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

:root {
  /* Core surfaces */
  --bg:       oklch(12% 0.008 240);
  --surface:  oklch(15% 0.009 240);
  --card:     oklch(18% 0.010 240);
  --card2:    oklch(20% 0.010 240);
  --card3:    oklch(22% 0.010 240);

  /* Borders */
  --border:   oklch(100% 0 0 / 0.06);
  --border2:  oklch(100% 0 0 / 0.11);
  --border3:  oklch(100% 0 0 / 0.18);

  /* Text */
  --text:     oklch(92% 0.005 240);
  --muted:    oklch(55% 0.008 240);
  --muted2:   oklch(68% 0.008 240);

  /* Brand accents */
  --green:    oklch(72% 0.19 145);
  --green-dim:oklch(72% 0.19 145 / 0.12);
  --green-ring:oklch(72% 0.19 145 / 0.30);

  --blue:     oklch(70% 0.17 245);
  --blue-dim: oklch(70% 0.17 245 / 0.12);

  --red:      oklch(62% 0.22 25);
  --red-dim:  oklch(62% 0.22 25 / 0.12);

  --orange:   oklch(72% 0.17 55);
  --orange-dim:oklch(72% 0.17 55 / 0.12);

  --purple:   oklch(72% 0.18 295);
  --purple-dim:oklch(72% 0.18 295 / 0.12);

  --teal:     oklch(74% 0.18 165);
  --teal-dim: oklch(74% 0.18 165 / 0.10);

  --yellow:   oklch(78% 0.16 80);
  --yellow-dim:oklch(78% 0.16 80 / 0.12);

  /* Type-specific */
  --sea:      oklch(65% 0.19 250);
  --sea-dim:  oklch(65% 0.19 250 / 0.14);

  --air:      oklch(65% 0.19 295);
  --air-dim:  oklch(65% 0.19 295 / 0.14);

  --road:     oklch(68% 0.17 55);
  --road-dim: oklch(68% 0.17 55 / 0.14);

  --clear:    oklch(66% 0.19 145);
  --clear-dim:oklch(66% 0.19 145 / 0.14);

  --rto:      oklch(68% 0.18 185);
  --rto-dim:  oklch(68% 0.18 185 / 0.14);

  /* Layout */
  --radius:   8px;
  --radius-lg:12px;
  --sidebar:  220px;
  --font:     'Inter', sans-serif;
  --mono:     'IBM Plex Mono', monospace;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── APP SHELL ────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ── SIDEBAR ─────────────────────────────── */
.sidebar {
  width: var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 280ms cubic-bezier(0.34, 1.15, 0.64, 1);
}

.sidebar-logo {
  padding: 14px 12px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.logo-eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--green);
  text-transform: uppercase;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 200ms, max-height 200ms;
}
.logo-wordmark {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}
.logo-pic {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  flex-shrink: 0;
}
.logo-ops {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted2);
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 220ms, max-width 280ms cubic-bezier(0.34, 1.15, 0.64, 1);
  max-width: 120px;
}

/* ── SIDEBAR TOGGLE BUTTON ───────────────── */
.sidebar-toggle {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms, color 140ms, border-color 140ms;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: oklch(100% 0 0 / 0.07); color: var(--text); border-color: var(--border3); }
.sidebar-toggle svg { transition: transform 280ms cubic-bezier(0.34, 1.15, 0.64, 1); }

/* ── COLLAPSED SIDEBAR STATE ─────────────── */
.sidebar.collapsed {
  width: 52px;
}
.sidebar.collapsed .logo-ops,
.sidebar.collapsed .logo-eyebrow,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span:not(.nav-icon),
.sidebar.collapsed .nav-count,
.sidebar.collapsed .sidebar-footer-text { 
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
}
.sidebar.collapsed .logo-eyebrow { max-height: 0; margin: 0; }
.sidebar.collapsed .logo-ops { max-width: 0; }
.sidebar.collapsed .nav-icon { margin: 0 auto; }
.sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.sidebar.collapsed .sidebar-footer { display: none; }

/* Collapsed header: button on top, PIC label below */
.sidebar.collapsed .sidebar-logo {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
}
.sidebar.collapsed .sidebar-toggle { order: 1; }
.sidebar.collapsed .sidebar-logo > div { order: 2; flex: none; text-align: center; }
.sidebar.collapsed .logo-pic { font-size: 11px; color: var(--muted); letter-spacing: .04em; }


.nav-group { padding: 14px 8px 2px; }
.nav-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 0 6px;
  margin-bottom: 3px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  margin: 1px 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted2);
  transition: background 120ms ease, color 120ms ease;
  user-select: none;
  position: relative;
}
.nav-item:hover { background: oklch(100% 0 0 / 0.04); color: var(--text); }
.nav-item.active { background: var(--green-dim); color: var(--green); }
.nav-item.active .nav-icon { color: var(--green); }

.nav-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 120ms;
}
.nav-item:hover .nav-icon { color: var(--muted2); }

.nav-count {
  margin-left: auto;
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--muted);
  background: oklch(100% 0 0 / 0.06);
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 24px;
  text-align: center;
}
.nav-item.active .nav-count {
  background: var(--green-ring);
  color: var(--green);
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 14px 16px;
  border-top: 1px solid var(--border);
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-label { font-size: 10px; color: var(--muted); }
.footer-val {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted2);
  font-family: var(--mono);
}
.footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2.4s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── MAIN ────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ── TOPBAR ──────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.topbar-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--mono);
}
.topbar-actions { display: flex; gap: 6px; align-items: center; }

/* ── CONTENT ─────────────────────────────── */
.content { flex: 1; overflow-y: auto; padding: 20px 24px; overflow-x: hidden; }

/* ── STATS ROW ───────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 160ms;
}
.stat-card:hover { border-color: var(--border2); }
.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ── PIPELINE TYPE CARDS ─────────────────── */
.pipeline-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.type-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: background 140ms, border-color 140ms, transform 120ms;
  position: relative;
  overflow: hidden;
}
.type-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 160ms;
}
.type-card:hover { background: var(--card2); border-color: var(--border2); }
.type-card.sea { border-top: 2px solid var(--sea); }
.type-card.air { border-top: 2px solid var(--air); }
.type-card.road { border-top: 2px solid var(--road); }
.type-card.clear { border-top: 2px solid var(--clear); }
.type-card.importRTO { border-top: 2px solid var(--rto); }

.type-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.type-card-name { font-size: 12px; font-weight: 600; color: var(--muted2); display: flex; align-items: center; gap: 7px; }
.type-card-total { font-size: 28px; font-weight: 700; font-family: var(--mono); line-height: 1; letter-spacing: -.02em; margin-bottom: 10px; }
.type-card-stats { display: flex; gap: 16px; }
.type-stat { font-size: 11px; color: var(--muted); }
.type-stat span { font-weight: 600; color: var(--muted2); margin-left: 3px; }

/* ── FILTER BAR ──────────────────────────── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; opacity: 0.5; }
.search-input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.search-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-ring); }
.search-input::placeholder { color: var(--muted); }

.filter-select {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
  transition: border-color 150ms;
}
.filter-select:focus { border-color: var(--green); }
.filter-select option { background: var(--card2); }

/* ── BUTTONS ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 120ms, box-shadow 120ms, transform 80ms;
  white-space: nowrap;
  letter-spacing: -.005em;
}
.btn:active { transform: scale(0.97); }
.btn-green {
  background: var(--green);
  color: oklch(12% 0.008 240);
}
.btn-green:hover { background: oklch(76% 0.19 145); }
.btn-ghost {
  background: transparent;
  color: var(--muted2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { background: oklch(100% 0 0 / 0.05); color: var(--text); border-color: var(--border3); }
.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid oklch(62% 0.22 25 / 0.22);
}
.btn-danger:hover { background: oklch(62% 0.22 25 / 0.2); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-icon { padding: 6px; border-radius: 6px; }

/* ── TABLE ───────────────────────────────── */
.table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-wrap { overflow-x: auto; overflow-y: auto; max-height: calc(100vh - 236px); }
table { width: 100%; border-collapse: separate; border-spacing: 0 4px; }

th {
  text-align: left;
  padding: 9px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--border2);
}
thead tr { background: var(--card); }

td {
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text);
  vertical-align: middle;
}
tbody tr {
  transition: background 100ms;
  cursor: pointer;
  background: var(--card2);
  box-shadow: 0 1px 0 var(--border);
}
tbody tr:hover { background: var(--card3); }
tbody tr td:first-child { border-radius: 6px 0 0 6px; }
tbody tr td:last-child { border-radius: 0 6px 6px 0; }

.td-mono { font-family: var(--mono); font-size: 11.5px; color: var(--muted2); }
.td-bold { font-weight: 600; }
.td-dim { color: var(--muted2); font-size: 11.5px; }
.td-truncate { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── BADGES ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .02em;
}
.b-green  { background: var(--green-dim);  color: var(--green); }
.b-blue   { background: var(--blue-dim);   color: var(--blue); }
.b-red    { background: var(--red-dim);    color: var(--red); }
.b-orange { background: var(--orange-dim); color: var(--orange); }
.b-purple { background: var(--purple-dim); color: var(--purple); }
.b-yellow { background: var(--yellow-dim); color: var(--yellow); }
.b-gray   { background: oklch(100% 0 0 / 0.07); color: var(--muted2); }
.b-sea    { background: var(--sea-dim);    color: var(--sea); }
.b-air    { background: var(--air-dim);    color: var(--air); }
.b-road   { background: var(--road-dim);   color: var(--road); }
.b-clear  { background: var(--clear-dim);  color: var(--clear); }
.b-rto    { background: var(--rto-dim);    color: var(--rto); }

/* ── MODAL ───────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0% 0 0 / 0.6);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-overlay.closing { opacity: 0; transition-duration: 200ms; }
.modal {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 20px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.88) translateY(24px);
  opacity: 0;
  transition: transform 420ms cubic-bezier(0.34, 1.32, 0.64, 1),
              opacity 240ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 40px 100px oklch(0% 0 0 / 0.65), 0 0 0 1px oklch(100% 0 0 / 0.04);
  will-change: transform, opacity;
}
.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.modal-overlay.closing .modal {
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  transition: transform 200ms cubic-bezier(0.4, 0, 1, 1),
              opacity 160ms ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.modal-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.modal-close {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: oklch(100% 0 0 / 0.06);
  border: none;
  color: var(--muted2);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms, color 120ms;
}
.modal-close:hover { background: oklch(100% 0 0 / 0.12); color: var(--text); }
.modal-body { padding: 18px 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  position: sticky;
  bottom: 0;
  background: var(--card);
}

/* ── FORMS ───────────────────────────────── */
.form-section { margin-bottom: 22px; }
.form-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span2 { grid-column: span 2; }
.form-group.span3 { grid-column: span 3; }

label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .06em;
}
input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-ring);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 70px; }
select option { background: var(--card2); }

/* ── DETAIL PANEL ────────────────────────── */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0% 0 0 / 0.45);
  backdrop-filter: blur(6px) saturate(1.2);
  -webkit-backdrop-filter: blur(6px) saturate(1.2);
  z-index: 89;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter 280ms;
}
.panel-overlay.open { opacity: 1; pointer-events: all; }
.panel-overlay.closing { opacity: 0; transition-duration: 220ms; }
.detail-panel {
  background: var(--card);
  border-left: 1px solid var(--border2);
  border-radius: 0;
  width: 460px;
  max-width: 92vw;
  height: 100%;
  overflow-y: auto;
  transform: translateX(100%);
  opacity: 1;
  transition: transform 380ms cubic-bezier(0.32, 0.92, 0.36, 1);
  box-shadow: -24px 0 80px oklch(0% 0 0 / 0.45), -1px 0 0 var(--border);
  will-change: transform;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.panel-overlay.open .detail-panel {
  transform: translateX(0);
}
.panel-overlay.closing .detail-panel {
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.4, 0, 1, 1);
}
.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
  flex-shrink: 0;
}
.panel-header > .modal-close { flex-shrink: 0; }
.panel-body { padding: 18px 22px; flex: 1; }
.panel-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  margin: 18px 0 8px;
}
.panel-section:first-child { margin-top: 0; }
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: 11px; color: var(--muted); flex-shrink: 0; width: 134px; }
.detail-val { font-size: 12px; color: var(--text); text-align: right; font-family: var(--mono); }

/* ── CONFIRM DIALOG ──────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0% 0 0 / 0.72);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter 240ms;
}
.confirm-overlay.open { opacity: 1; pointer-events: all; }
.confirm-overlay.closing { opacity: 0; transition-duration: 160ms; }
.confirm-box {
  background: oklch(22% 0.008 240 / 0.96);
  border: 1px solid oklch(62% 0.22 25 / 0.28);
  border-radius: 20px;
  padding: 28px 28px 22px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  transform: scale(0.80) translateY(10px);
  opacity: 0;
  transition: transform 380ms cubic-bezier(0.34, 1.45, 0.64, 1),
              opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 32px 80px oklch(0% 0 0 / 0.65);
  will-change: transform, opacity;
}
.confirm-overlay.open .confirm-box { transform: scale(1) translateY(0); opacity: 1; }
.confirm-overlay.closing .confirm-box {
  transform: scale(0.86) translateY(6px);
  opacity: 0;
  transition: transform 160ms cubic-bezier(0.4, 0, 1, 1),
              opacity 130ms ease;
}
.confirm-icon { font-size: 28px; margin-bottom: 12px; }
.confirm-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; letter-spacing: -.01em; }
.confirm-msg { font-size: 12.5px; color: var(--muted2); margin-bottom: 22px; line-height: 1.65; }
.confirm-actions { display: flex; gap: 8px; justify-content: center; }

/* ── TOAST ───────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: oklch(24% 0.010 240 / 0.92);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px oklch(0% 0 0 / 0.45), 0 0 0 1px oklch(100% 0 0 / 0.05);
  animation: toastIn 400ms cubic-bezier(0.34, 1.32, 0.64, 1) forwards;
  max-width: 340px;
  pointer-events: all;
  cursor: pointer;
}
.toast.success { border-color: oklch(72% 0.19 145 / 0.35); }
.toast.error   { border-color: oklch(62% 0.22 25  / 0.35); }
.toast.out { animation: toastOut 240ms cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes toastIn {
  from { transform: translateY(16px) scale(0.88); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateY(0) scale(1); opacity: 1; }
  to   { transform: translateY(10px) scale(0.90); opacity: 0; }
}

/* ── EMPTY & LOADING STATES ──────────────── */
.empty-state { text-align: center; padding: 52px 20px; color: var(--muted); }
.empty-icon  { font-size: 30px; margin-bottom: 10px; }
.empty-title { font-size: 13px; font-weight: 600; color: var(--muted2); margin-bottom: 4px; }

.loading-state { text-align: center; padding: 60px; }
.spinner {
  width: 22px;
  height: 22px;
  margin: 0 auto 12px;
  border: 2px solid var(--border2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.55s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── CONTAINER CARDS ─────────────────────── */
.container-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.container-row { display: flex; gap: 8px; align-items: center; }
.container-row input { flex: 1; }
.container-row .size-input { width: 110px; flex: none; }
.container-row-remove {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--red-dim);
  border: 1px solid oklch(62% 0.22 25 / 0.22);
  color: var(--red);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms;
}
.container-row-remove:hover { background: oklch(62% 0.22 25 / 0.22); }

.add-container-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--green-dim);
  border: 1px solid var(--green-ring);
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms;
}
.add-container-btn:hover { background: oklch(72% 0.19 145 / 0.2); }

.container-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-family: var(--mono);
  margin: 2px;
}

.ctr-card {
  background: var(--surface);
  border-radius: 7px;
  margin-bottom: 6px;
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color 150ms;
}
.ctr-card.expanded { border-color: var(--border2); }
.ctr-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  cursor: pointer;
  user-select: none;
}
.ctr-header:hover .ctr-no { color: var(--blue); }
.ctr-chevron { color: var(--muted); font-size: 10px; transition: transform 150ms; flex-shrink: 0; }
.ctr-card.expanded .ctr-chevron { transform: rotate(90deg); }
.ctr-no { font-family: var(--mono); font-size: 12px; font-weight: 600; flex: 1; }
.ctr-expand { padding: 0 10px; max-height: 0; overflow: hidden; transition: max-height 200ms ease, padding 200ms; }
.ctr-card.expanded .ctr-expand { max-height: 500px; padding: 0 10px 10px; }
.ctr-field-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); }
.ctr-field-row:last-child { border-bottom: none; }
.ctr-field-key { font-size: 11px; color: var(--muted); flex-shrink: 0; width: 130px; }
.ctr-field-val {
  font-size: 12px;
  color: var(--text);
  font-family: var(--mono);
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background 120ms;
  text-align: right;
}
.ctr-field-val:hover { background: oklch(70% 0.17 245 / 0.1); color: var(--blue); }

/* ── ATTACHMENT UI ───────────────────────── */
.att-grid { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.att-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  transition: border-color 150ms;
}
.att-item:hover { border-color: var(--border2); }
.att-icon { font-size: 18px; flex-shrink: 0; width: 26px; text-align: center; }
.att-info { flex: 1; min-width: 0; }
.att-name { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-meta { font-size: 10px; color: var(--muted); margin-top: 1px; }
.att-actions { display: flex; gap: 4px; flex-shrink: 0; }
.att-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 120ms, color 120ms;
  text-decoration: none;
}
.att-btn:hover { border-color: var(--blue); color: var(--blue); }
.att-btn.danger:hover { border-color: var(--red); color: var(--red); }
.att-upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 7px;
  border: 1px dashed oklch(70% 0.17 245 / 0.35);
  background: oklch(70% 0.17 245 / 0.04);
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
  width: 100%;
}
.att-upload-btn:hover { border-color: var(--blue); background: oklch(70% 0.17 245 / 0.1); }
.att-uploading { opacity: 0.5; pointer-events: none; }

/* ── PDF PREVIEW ─────────────────────────── */
.pdf-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0% 0 0 / 0.88);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
}
.pdf-overlay.open { opacity: 1; pointer-events: all; }
.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 90vw;
  max-width: 960px;
  padding: 10px 4px;
  flex-shrink: 0;
}
.pdf-filename { font-size: 13px; font-weight: 600; color: var(--text); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.pdf-toolbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pdf-frame { width: 90vw; max-width: 960px; height: 80vh; border: none; border-radius: 8px; background: oklch(95% 0 0); }

/* ── FREIGHT BANNER ──────────────────────── */
.freight-banner {
  position: relative;
  width: calc(100% + 48px);
  margin: -20px -24px 0;
  height: 420px;
  overflow: hidden;
  flex-shrink: 0;
}
.freight-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  filter: brightness(0.72) saturate(1.1);
  transition: transform 8s ease-out;
  transform: scale(1.04);
}
.freight-banner.loaded img { transform: scale(1); }
.freight-banner-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 30%,
    oklch(12% 0.008 240 / 0.55) 70%,
    oklch(12% 0.008 240 / 1) 100%
  );
  pointer-events: none;
}
body.light .freight-banner-gradient {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 30%,
    oklch(96% 0.004 240 / 0.55) 70%,
    oklch(96% 0.004 240 / 1) 100%
  );
}
.freight-banner-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 24px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.freight-banner-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.freight-banner-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 16px oklch(0% 0 0 / 0.4);
}
body.light .freight-banner-title { color: #fff; }
.freight-banner-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.banner-pill {
  background: oklch(100% 0 0 / 0.12);
  backdrop-filter: blur(12px);
  border: 1px solid oklch(100% 0 0 / 0.18);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.banner-pill.accent { background: var(--green); border-color: transparent; color: oklch(12% 0.008 240); }

/* ── PAGE TRANSITION ─────────────────────── */
#main-content {
  transition: none;
}
#main-content.page-exit {
  animation: pageOut 120ms cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}
#main-content.page-enter {
  animation: pageIn 300ms cubic-bezier(0.34, 1.18, 0.64, 1) forwards;
}
@keyframes pageOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.985); }
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── SAVE PROGRESS BAR ───────────────────── */
.save-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 4px 0;
}
.save-progress-track {
  height: 3px;
  background: var(--border2);
  border-radius: 4px;
  overflow: hidden;
}
.save-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--green), oklch(76% 0.22 165));
  width: 0%;
  transition: width 320ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px var(--green);
}
.save-progress-label {
  font-size: 11px;
  color: var(--muted2);
  text-align: center;
  font-weight: 500;
  letter-spacing: .01em;
}
.save-progress-label.done { color: var(--green); }

/* ── MODAL HEADER ANIMATE ────────────────── */
.modal-header, .panel-header {
  animation: fadeSlideDown 260ms cubic-bezier(0.34, 1.2, 0.64, 1) both;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}


::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: oklch(100% 0 0 / 0.09); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: oklch(100% 0 0 / 0.16); }

/* ── EDITABLE PANEL TITLE ────────────────── */
.panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}
.panel-title-text {
  cursor: pointer;
  border-radius: 5px;
  padding: 3px 6px;
  margin: -3px -6px;
  transition: background 120ms, color 120ms;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-title-text:hover { background: oklch(70% 0.17 245 / 0.12); color: var(--blue); }
.panel-title-edit-hint {
  font-size: 12px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 140ms;
  flex-shrink: 0;
  line-height: 1;
}
.panel-header:hover .panel-title-edit-hint { opacity: 1; }
.panel-title-input {
  background: var(--surface);
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  padding: 4px 9px;
  outline: none;
  box-shadow: 0 0 0 3px oklch(70% 0.17 245 / 0.22);
  flex: 1;
  min-width: 0;
  width: 100%;
  transition: box-shadow 150ms;
}

/* ── INLINE EDIT ─────────────────────────── */
.editable-val {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background 120ms;
  text-align: right;
}
.editable-val:hover { background: oklch(70% 0.17 245 / 0.1); color: var(--blue); }
.editable-val.editing { background: oklch(70% 0.17 245 / 0.08); }
.inline-input {
  background: var(--surface);
  border: 1px solid var(--blue);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 7px;
  width: 100%;
  outline: none;
  text-align: right;
  box-shadow: 0 0 0 2px oklch(70% 0.17 245 / 0.2);
}
.inline-save {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: oklch(72% 0.19 145 / 0.18);
  border: 1px solid oklch(72% 0.19 145 / 0.4);
  color: var(--green);
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inline-cancel {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── CALENDAR ────────────────────────────── */
.cal-popup {
  position: fixed;
  z-index: 500;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: 0 16px 48px oklch(0% 0 0 / 0.55);
  width: 252px;
  user-select: none;
}
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-month-label { font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.cal-nav {
  background: none;
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  width: 26px;
  height: 26px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms;
}
.cal-nav:hover { background: var(--surface); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day-name { font-size: 10px; color: var(--muted); text-align: center; padding: 2px 0; font-weight: 600; }
.cal-day { font-size: 12px; text-align: center; padding: 5px 2px; border-radius: 5px; cursor: pointer; color: var(--text); transition: background 100ms; }
.cal-day:hover { background: var(--card2); }
.cal-day.today { color: var(--blue); font-weight: 700; }
.cal-day.selected { background: var(--blue); color: oklch(98% 0 0); font-weight: 700; }
.cal-day.other-month { color: var(--muted); opacity: 0.4; }
.cal-footer { display: flex; gap: 6px; margin-top: 10px; }
.cal-btn {
  flex: 1;
  padding: 5px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--muted2);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 120ms, color 120ms;
}
.cal-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ── THEME BUTTON ────────────────────────── */
.theme-btn {
  font-size: 15px;
  padding: 5px 8px;
  line-height: 1;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 7px;
  color: var(--muted2);
  transition: background 120ms, color 120ms;
}
.theme-btn:hover { background: oklch(100% 0 0 / 0.07); color: var(--text); }

/* ── SECTION LABEL (pipeline recent) ────── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 900px) {
  .sidebar:not(.collapsed) { --sidebar: 52px; }
  .sidebar:not(.collapsed) .nav-item span:not(.nav-icon),
  .sidebar:not(.collapsed) .nav-count,
  .sidebar:not(.collapsed) .nav-label,
  .sidebar:not(.collapsed) .logo-ops,
  .sidebar:not(.collapsed) .logo-eyebrow,
  .sidebar:not(.collapsed) .sidebar-footer { display: none; }
  .sidebar:not(.collapsed) .nav-icon { margin: 0 auto; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .pipeline-grid { grid-template-columns: 1fr; }
  .freight-banner { height: 160px; }
  .freight-banner-title { font-size: 22px; }
}

/* ── CLIENT TRACKER ─────────────────────── */
.add-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.add-input {
  flex: 1; min-width: 220px; padding: 8px 12px; background: var(--card);
  border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text);
  font-family: var(--font); font-size: 12.5px; outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.add-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-ring); }
.add-input::placeholder { color: var(--muted); }

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 16px; }
.client-tile {
  display: flex; gap: 18px; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms, transform 120ms;
}
.client-tile:hover { border-color: var(--border3); box-shadow: 0 6px 22px oklch(0% 0 0 / 0.18); transform: translateY(-2px); }
.ct-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ct-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--green-dim); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  margin-bottom: 14px; border: 1px solid var(--green-ring);
}
.ct-name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--text); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; }
.ct-desc { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.ct-link { margin-top: auto; font-size: 12.5px; font-weight: 600; color: var(--green); display: inline-flex; align-items: center; gap: 5px; transition: gap 140ms; }
.client-tile:hover .ct-link { gap: 9px; }
.ct-preview { width: 210px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 13px; align-self: flex-start; }
.ct-prev-head { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; }
.ct-prev-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border); }
.ct-prev-row:first-of-type { border-top: none; }
.ct-prev-file { font-family: var(--mono); font-size: 11px; color: var(--muted2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-prev-empty { font-size: 11.5px; color: var(--muted); }
.ct-more { margin-top: 9px; font-size: 10.5px; font-weight: 600; color: var(--muted2); background: var(--card3); border-radius: 20px; padding: 3px 10px; display: inline-block; }
@media (max-width: 560px) { .client-tile { flex-direction: column; } .ct-preview { width: auto; } }

.client-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.client-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 10.5px; font-weight: 600; background: var(--card2); border: 1px solid var(--border); color: var(--muted2); }
.client-pill b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.client-pill.g b { color: var(--green); }
.client-pill.d b { color: var(--muted2); }

.notes-wrap { margin-bottom: 14px; }
.notes-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.client-notes {
  width: 100%; min-height: 54px; resize: vertical; background: var(--card2);
  border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text);
  font-family: var(--font); font-size: 12.5px; padding: 9px 11px; outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.client-notes:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-ring); }
.note-status { font-size: 10px; color: var(--green); font-weight: 600; text-transform: none; letter-spacing: 0; }

.files-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.files-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 12px; }
tbody tr.file-row { transition: background 100ms; background: var(--card2); box-shadow: 0 1px 0 var(--border); }
tbody tr.file-row.clickable { cursor: pointer; }
tbody tr.file-row:hover { background: var(--card3); }
tbody tr.file-row td:first-child { border-radius: 6px 0 0 6px; }
tbody tr.file-row td:last-child { border-radius: 0 6px 6px 0; }
.caret { display: inline-block; margin-right: 6px; color: var(--muted); transition: transform 150ms; font-size: 10px; }
.caret.open { transform: rotate(90deg); }
.ctr-cell { padding: 0 12px 8px !important; }
.ctr-list { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.ctr-item { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 11.5px; }
.ctr-item .lbl { color: var(--muted); font-size: 10px; }
.empty-sub { font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ── LIGHT MODE ──────────────────────────── */
body.light {
  --bg:       oklch(96% 0.004 240);
  --surface:  oklch(100% 0.002 240);
  --card:     oklch(100% 0.002 240);
  --card2:    oklch(95% 0.004 240);
  --card3:    oklch(92% 0.005 240);
  --border:   oklch(0% 0 0 / 0.08);
  --border2:  oklch(0% 0 0 / 0.13);
  --border3:  oklch(0% 0 0 / 0.20);
  --text:     oklch(16% 0.008 240);
  --muted:    oklch(52% 0.008 240);
  --muted2:   oklch(38% 0.008 240);

  --green-dim: oklch(72% 0.19 145 / 0.09);
  --green-ring:oklch(72% 0.19 145 / 0.22);
  --blue-dim:  oklch(70% 0.17 245 / 0.09);
  --red-dim:   oklch(62% 0.22 25  / 0.09);
  --orange-dim:oklch(72% 0.17 55  / 0.09);
  --yellow-dim:oklch(78% 0.16 80  / 0.09);
  --purple-dim:oklch(72% 0.18 295 / 0.09);
  --sea-dim:   oklch(65% 0.19 250 / 0.09);
  --air-dim:   oklch(65% 0.19 295 / 0.09);
  --road-dim:  oklch(68% 0.17 55  / 0.09);
  --clear-dim: oklch(66% 0.19 145 / 0.09);
  --rto-dim:   oklch(68% 0.18 185 / 0.09);
}
body.light .sidebar { box-shadow: 2px 0 14px oklch(0% 0 0 / 0.06); }
body.light th { background: oklch(96% 0.004 240); border-bottom-color: oklch(0% 0 0 / 0.1); }
body.light .modal, body.light .confirm-box { box-shadow: 0 20px 60px oklch(0% 0 0 / 0.12); }
body.light .detail-panel { box-shadow: -12px 0 40px oklch(0% 0 0 / 0.10), -1px 0 0 var(--border); }
body.light input, body.light select, body.light textarea { background: oklch(96% 0.004 240); }
body.light .filter-select { background: oklch(96% 0.004 240); }
body.light .filter-select option, body.light select option { background: oklch(100% 0.002 240); }
body.light .sidebar-logo { border-bottom-color: oklch(0% 0 0 / 0.08); }
