﻿/* =================================================================
   Theme tokens â€” swap when GFT design team hands over brand assets
================================================================= */
:root {
  --bg:          #F5EFE2;
  --bg-panel:   #FBF7EC;
  --bg-card:    #FFFFFF;
  --bg-subtle:  #EDE6D4;
  --bg-inset:   #F0E9D7;

  --ink:        #0F1E3A;
  --ink-soft:   #2A3A58;
  --ink-mute:   #6B7488;
  --ink-faint:  #9AA0B2;

  --line:       #E4DBC6;
  --line-soft:  #EDE6D4;
  --line-ink:   #D6CBB0;

  --accent:     #A83A2F;   /* Texas crimson */
  --accent-ink: #7A2821;
  --accent-soft:#F3D9D5;
  --accent-tint:#FAE8E4;

  --gold:       #B8882A;
  --gold-soft:  #F3E2B8;
  --gold-tint:  #F9EED4;

  --green:      #3C6B4A;
  --green-soft: #D8E6DA;

  --blue:       #2A4A7C;
  --blue-soft:  #D7DFED;

  --violet:     #5A3E7A;
  --violet-soft:#E0D6EC;

  --radius:     6px;
  --radius-lg:  10px;
  --shadow-sm:  0 1px 0 rgba(15,30,58,0.04), 0 1px 2px rgba(15,30,58,0.04);
  --shadow-md:  0 6px 18px -8px rgba(15,30,58,0.18), 0 2px 4px rgba(15,30,58,0.06);
  --shadow-lg:  0 24px 48px -16px rgba(15,30,58,0.24), 0 4px 10px rgba(15,30,58,0.08);

  --font-display: "Fraunces", "Georgia", serif;
  --font-ui:      "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(168,58,47,0.05), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(42,74,124,0.04), transparent 60%);
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: transparent; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* =================================================================
   Layout shell
================================================================= */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 56px 1fr;
  min-height: 100vh;
}

.top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 12px;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink);
  color: var(--bg-panel);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600; font-size: 16px;
  font-style: italic;
  letter-spacing: -0.02em;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: -2px;
}
.brand-wordmark { display: flex; flex-direction: column; line-height: 1.15; }

.top-right {
  display: flex; align-items: center; gap: 16px;
}
.top-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: var(--radius);
  width: 320px;
}
.top-search input {
  border: 0; background: transparent; outline: none;
  width: 100%;
  font-size: 13px;
}
.top-search .kbd {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-faint);
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-inset);
}
.top-user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-card);
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
  color: white;
  display: grid; place-items: center;
  font-weight: 600; font-size: 11px;
  font-family: var(--font-ui);
}
.top-user .who { font-size: 12px; font-weight: 500; }
.top-user .dom { font-size: 11px; color: var(--ink-mute); }

/* Sidebar */
.side {
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  overflow-y: auto;
}
.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  padding: 14px 10px 6px;
  font-weight: 500;
}
.nav {
  display: flex; flex-direction: column;
  gap: 1px;
}
.nav button {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  text-align: left;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  transition: background 120ms ease, color 120ms ease;
}
.nav button:hover { background: var(--bg-inset); color: var(--ink); }
.nav button.active {
  background: var(--ink);
  color: var(--bg-panel);
}
.nav button.active .icon { color: var(--gold-soft); }
.nav .icon {
  width: 16px; height: 16px;
  color: var(--ink-mute);
  flex: 0 0 16px;
}
.nav button.active .icon { color: var(--gold-soft); }
.nav .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--bg-inset);
  color: var(--ink-mute);
}
.nav button.active .count { background: rgba(255,255,255,0.12); color: var(--gold-soft); }
.nav .count.hot {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.side-foot {
  margin-top: 18px; padding: 12px 10px;
  border-top: 1px dashed var(--line);
  font-size: 11px; color: var(--ink-mute);
  line-height: 1.5;
}
.side-foot b { color: var(--ink-soft); }

/* Main content */
.main {
  padding: 28px 36px 48px;
  overflow-x: hidden;
}
.page { display: none; }
.page.active { display: block; animation: fade 220ms ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Page header */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}
.page-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.page-sub {
  margin-top: 8px;
  color: var(--ink-mute);
  font-size: 13px;
  max-width: 60ch;
}
.page-actions { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink);
  transition: all 120ms ease;
}
.btn:hover { background: var(--bg-inset); border-color: var(--line-ink); }
.btn-primary {
  background: var(--ink); color: var(--bg-panel);
  border-color: var(--ink);
}
.btn-primary:hover { background: #1B2E54; color: white; }
.btn-accent {
  background: var(--accent); color: white; border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-mute); }
.btn-ghost:hover { background: var(--bg-inset); color: var(--ink); }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn .icon { width: 14px; height: 14px; }

/* =================================================================
   Dashboard
================================================================= */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  font-weight: 500;
}
.stat .value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 40px;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-top: 8px;
}
.stat .value em { font-style: italic; color: var(--accent); }
.stat .meta {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 4px;
}
.stat.hot {
  background: linear-gradient(180deg, var(--accent-tint) 0%, var(--bg-card) 85%);
  border-color: var(--accent-soft);
}
.stat.hot .value { color: var(--accent-ink); }
.stat-corner {
  position: absolute;
  top: 12px; right: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-inset);
  color: var(--ink-mute);
}
.stat.hot .stat-corner { background: rgba(168,58,47,0.12); color: var(--accent-ink); }

.dash-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}
.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}
.panel-sub {
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.panel-body { padding: 0; }
.panel-body.pad { padding: 16px 18px; }

/* DMA coverage heatmap */
.dma-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dma-table thead th {
  text-align: center;
  padding: 10px 6px;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border-bottom: 1px solid var(--line);
  background: var(--bg-inset);
}
.dma-table thead th:first-child { text-align: left; padding-left: 18px; }
.dma-table tbody td {
  padding: 0;
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
}
.dma-table tbody tr:last-child td { border-bottom: 0; }
.dma-table tbody tr:hover { background: var(--bg-inset); }
.dma-table .dma-name {
  text-align: left;
  padding: 9px 18px;
  font-weight: 500;
  font-size: 13px;
}
.dma-table .dma-name .code {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  margin-right: 8px;
}
.dma-table .cell {
  display: inline-grid; place-items: center;
  width: 42px; height: 28px;
  margin: 4px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
}
.cell-0 { color: var(--ink-faint); background: transparent; }
.cell-1 { background: var(--green-soft); color: #1F4030; }
.cell-2 { background: #B9D4BF; color: #1F4030; }
.cell-3 { background: #8BBA95; color: white; }
.cell-4 { background: #3C6B4A; color: white; }
.cell-gap { background: var(--accent-tint); color: var(--accent-ink); border: 1px dashed var(--accent-soft); }

.heat-legend {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px;
  font-size: 11px;
  color: var(--ink-mute);
  border-top: 1px solid var(--line-soft);
  background: var(--bg-panel);
}
.heat-legend .swatches { display: flex; align-items: center; gap: 4px; }
.heat-legend .sw { width: 14px; height: 14px; border-radius: 3px; }

/* Queue list */
.queue-list { display: flex; flex-direction: column; }
.queue-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 120ms ease;
}
.queue-row:last-child { border-bottom: 0; }
.queue-row:hover { background: var(--bg-inset); }
.queue-row .q-name {
  font-weight: 500;
  font-size: 13px;
}
.queue-row .q-sub {
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 2px;
}
.queue-row .q-action {
  font-size: 11px;
  color: var(--ink);
  font-weight: 500;
  text-align: right;
}
.queue-row .q-action .due {
  color: var(--ink-mute);
  font-weight: 400;
}
.queue-row .q-action .due.overdue { color: var(--accent); }

/* Inline Texas schematic */
.tx-map {
  padding: 8px 12px 16px;
  background: var(--bg-panel);
}
.tx-map svg { width: 100%; height: auto; display: block; }

/* =================================================================
   Allies list / table
================================================================= */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: auto auto auto auto auto 1fr auto;
  gap: 10px;
  align-items: end;
}
.f-group {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.f-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  font-weight: 500;
}
.f-group select, .f-group input {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--ink);
  outline: none;
}
.f-group select:focus, .f-group input:focus { border-color: var(--ink-soft); }

.dma-mode {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
}
.dma-mode button {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-mute);
  border-right: 1px solid var(--line);
}
.dma-mode button:last-child { border-right: 0; }
.dma-mode button.active {
  background: var(--ink);
  color: var(--bg-panel);
}

.result-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 2px 10px;
  font-size: 12px;
  color: var(--ink-mute);
}
.saved-views {
  display: flex; gap: 6px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}
.chip:hover { background: var(--bg-subtle); border-color: var(--line-ink); }
.chip .star { color: var(--gold); }

/* Ally table */
.ally-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 13px;
}
.ally-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ally-table tbody tr {
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 120ms ease;
}
.ally-table tbody tr:last-child { border-bottom: 0; }
.ally-table tbody tr:hover { background: var(--bg-inset); }
.ally-table td {
  padding: 11px 14px;
  vertical-align: middle;
}
.ally-table .id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}
.ally-table .name {
  font-weight: 500;
}
.ally-table .stage {
  font-size: 11px; color: var(--ink-mute); font-style: italic;
}
.ally-table .dma-cell {
  font-family: var(--font-mono);
  font-size: 11px;
}
.ally-table .dma-cell .sec {
  color: var(--ink-faint);
  margin-left: 4px;
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.tier-1 { background: var(--gold-tint); color: #6B4B15; border-color: var(--gold-soft); }
.badge.tier-2 { background: var(--blue-soft); color: #1C3358; border-color: #BCCDE6; }
.badge.tier-3 { background: var(--green-soft); color: #1F4030; border-color: #B9D4BF; }
.badge.tier-4 { background: var(--bg-inset); color: var(--ink-mute); border-color: var(--line); }

.status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px;
  font-weight: 500;
}
.status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-faint);
}
.status.New::before     { background: var(--blue); }
.status.Vetting::before { background: var(--gold); }
.status.Approved::before{ background: var(--green); }
.status.Active::before  { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status.Paused::before  { background: var(--ink-faint); }
.status.Declined::before{ background: var(--accent); }
.status.Do-Not-Engage::before { background: var(--accent); }

.flag {
  font-size: 10px; font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.flag.Clear { background: var(--green-soft); color: #1F4030; }
.flag.Flagged-Review { background: var(--gold-tint); color: #6B4B15; }
.flag.Blocked { background: var(--accent); color: white; }

.category-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 500;
}
.category-tag .dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.cat-Music .dot        { background: var(--accent); }
.cat-Sports .dot       { background: var(--blue); }
.cat-Faith .dot        { background: var(--violet); }
.cat-Digital .dot      { background: var(--gold); }
.cat-Film .dot         { background: #C05E2F; }
.cat-Literary .dot     { background: #7A6B3C; }
.cat-Business .dot     { background: var(--green); }
.cat-Activist .dot     { background: #B73A6B; }
.cat-Other .dot        { background: var(--ink-faint); }

/* =================================================================
   Ally detail drawer
================================================================= */
.drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(15,30,58,0.35);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 40;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(720px, 92vw);
  background: var(--bg-panel);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 50;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--line);
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-card);
  display: flex; flex-direction: column; gap: 6px;
}
.drawer-crumbs {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.drawer-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}
.drawer-stage {
  font-style: italic; color: var(--ink-mute); font-size: 14px;
}
.drawer-meta-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: 6px;
}

.drawer-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-content: start;
}
.drawer-body .full { grid-column: 1 / -1; }

.field {
  display: flex; flex-direction: column;
  gap: 4px;
}
.field label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  font-weight: 500;
}
.field .value {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  min-height: 32px;
  display: flex; align-items: center;
}
.field .value.editable:hover {
  border-color: var(--line-ink);
  background: white;
  cursor: text;
}
.field .value.mono { font-family: var(--font-mono); font-size: 12px; }
.field .value.multi {
  align-items: flex-start;
  flex-direction: column;
  min-height: 64px;
  line-height: 1.55;
}

.conflict-card {
  border: 1px solid var(--gold-soft);
  background: linear-gradient(0deg, var(--gold-tint), var(--bg-card));
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  display: flex; gap: 12px;
  align-items: flex-start;
}
.conflict-card.clear {
  border-color: #B9D4BF;
  background: linear-gradient(0deg, var(--green-soft), var(--bg-card));
}
.conflict-card.blocked {
  border-color: var(--accent-soft);
  background: linear-gradient(0deg, var(--accent-tint), var(--bg-card));
}
.conflict-card .c-icon {
  width: 28px; height: 28px; flex: 0 0 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold);
  color: white;
  font-weight: 600;
}
.conflict-card.clear .c-icon { background: var(--green); }
.conflict-card.blocked .c-icon { background: var(--accent); }
.conflict-card .c-title {
  font-weight: 600; font-size: 13px;
  margin-bottom: 3px;
}
.conflict-card .c-note {
  font-size: 12px; color: var(--ink-soft); line-height: 1.5;
}

/* Activation timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ""; position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--line-ink);
}
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -22px; top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--ink);
}
.tl-item.upcoming::before { border-color: var(--gold); border-style: dashed; }
.tl-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
}
.tl-title { font-weight: 500; font-size: 13px; margin-top: 1px; }
.tl-sub { font-size: 12px; color: var(--ink-mute); margin-top: 2px; }

.drawer-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--bg-card);
  display: flex; justify-content: space-between; gap: 10px;
  align-items: center;
}
.drawer-foot .audit {
  font-size: 11px;
  color: var(--ink-mute);
}
.drawer-foot .audit b { color: var(--ink-soft); }

.close-btn {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-inset);
}
.close-btn:hover { background: var(--line-soft); }

/* =================================================================
   Intake form preview
================================================================= */
.intake-wrap {
  max-width: 640px;
  margin: 0 auto;
}
.intake-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow-sm);
}
.intake-banner {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  padding: 6px 12px;
  border: 1px dashed var(--line-ink);
  border-radius: 4px;
  display: inline-flex;
  gap: 8px;
  margin-bottom: 18px;
  background: var(--bg-inset);
}
.intake-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.1;
}
.intake-title em { font-style: italic; color: var(--accent); }
.intake-lede {
  color: var(--ink-mute);
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.6;
}
.intake-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.intake-grid .full { grid-column: 1 / -1; }
.intake-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 4px;
}
.intake-input, .intake-select, .intake-textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.intake-input:focus, .intake-select:focus, .intake-textarea:focus {
  border-color: var(--ink-soft);
  background: white;
}
.intake-textarea { min-height: 100px; resize: vertical; }
.intake-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
.turnstile {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  color: var(--ink-mute);
  background: var(--bg-inset);
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.turnstile .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Audit log */
.audit-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 12px;
  font-family: var(--font-mono);
}
.audit-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
}
.audit-table tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.audit-table .act {
  font-family: var(--font-ui);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 6px; border-radius: 3px;
  text-transform: uppercase;
}
.act.CREATE { background: var(--green-soft); color: #1F4030; }
.act.UPDATE { background: var(--blue-soft); color: #1C3358; }
.act.DELETE { background: var(--accent-soft); color: var(--accent-ink); }

/* Intake Queue */
.inqueue {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.inqueue-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
}
.inqueue-card .source {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-inset);
  font-weight: 500;
}
.inqueue-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 10px 0 2px;
}
.inqueue-card .byline {
  font-size: 12px; color: var(--ink-mute);
  margin-bottom: 10px;
}
.inqueue-card .quote {
  background: var(--bg-panel);
  border-left: 2px solid var(--line-ink);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 12px;
}
.inqueue-card .actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.inqueue-card .arrived {
  position: absolute; top: 16px; right: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}

/* icons */
.i { width: 16px; height: 16px; display: inline-block; vertical-align: middle; }

/* Smaller screens fallback */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-cols { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .drawer-body { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 20px; }
  .top-search { display: none; }
}
