:root {
  --navy: #0c2340;        /* Notre Dame / Observer navy */
  --navy-700: #14304f;
  --navy-600: #1d4068;
  --gold: #c99700;
  --gold-soft: #e8c84d;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a2433;
  --muted: #64748b;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --blue: #2563eb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(12,35,64,.08), 0 1px 2px rgba(12,35,64,.06);
  --shadow-lg: 0 10px 30px rgba(12,35,64,.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; background: var(--navy); color: #cdd9e8;
  display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 22px 22px 16px; display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--gold);
  color: var(--navy); font-weight: 700; display: grid; place-items: center; font-size: 18px;
}
.brand .mark-logo {
  width: 36px; height: 36px; border-radius: 6px; background: #fff;
  object-fit: contain; padding: 2px; flex-shrink: 0;
}
.brand h1 { font-size: 16px; color: #fff; font-weight: 700; line-height: 1.1; }
.brand small { display: block; color: var(--gold-soft); font-weight: 500; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.nav { padding: 8px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 8px;
  color: #b8c6d9; font-weight: 500; margin-bottom: 2px; text-decoration: none; transition: .12s;
}
.nav a:hover { background: var(--navy-600); color: #fff; text-decoration: none; }
.nav a.active { background: var(--navy-700); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--navy-600); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 600; flex-shrink: 0; }
.user-chip .who { font-size: 13px; color: #fff; font-weight: 500; overflow: hidden; }
.user-chip .who small { display: block; color: #93a4ba; font-size: 11px; }
.logout { background: none; border: none; color: #93a4ba; margin-left: auto; padding: 4px; }
.logout:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 18px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.content { padding: 26px; flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 500; font-size: 13.5px; transition: .12s;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 600; }
.btn-gold:hover { background: var(--gold-soft); border-color: var(--gold-soft); }
.btn-danger { color: var(--red); border-color: #f1d4d4; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #eef2f7; }

/* ---------- Cards & grid ---------- */
.cards { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.cards .card { flex: 1 1 180px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 28px; font-weight: 700; margin-top: 4px; color: var(--navy); }
.stat .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
@media (max-width: 1000px){ .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fafbfc; }
td { padding: 13px 16px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: .1s; }
tbody tr.clickable:hover { background: #f7f9fc; cursor: pointer; }
.t-strong { font-weight: 600; color: var(--navy); }
.t-muted { color: var(--muted); font-size: 13px; }

/* ---------- Status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content:''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-prospect { background: #eef2f7; color: #475569; }
.st-contacted { background: #e0edff; color: #1d4ed8; }
.st-proposal { background: #fef3c7; color: #b45309; }
.st-negotiating { background: #ffedd5; color: #c2410c; }
.st-won { background: #dcfce7; color: #15803d; }
.st-lost { background: #fee2e2; color: #b91c1c; }
.tag { display: inline-block; background: #eef2f7; color: #475569; font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 6px; margin: 2px 4px 2px 0; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: #475569; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 14px; color: var(--text); background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(29,64,104,.1); }
.field textarea { resize: vertical; min-height: 70px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.search {
  position: relative; display: flex; align-items: center;
}
.search input { padding: 9px 11px 9px 34px; border: 1px solid var(--border); border-radius: 8px; width: 280px; font-size: 14px; }
.search svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters select { padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 13.5px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(12,35,64,.45); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; animation: pop .14s ease; }
.modal.wide { max-width: 820px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { font-size: 17px; font-weight: 600; }
.modal-head .x { margin-left: auto; background: none; border: none; font-size: 22px; color: var(--muted); line-height: 1; padding: 0 4px; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy) 0%, #081a30 100%); padding: 20px; }
.auth-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 410px; padding: 36px 34px; }
.auth-card .brand { padding: 0 0 20px; }
.auth-card h2 { font-size: 21px; margin-bottom: 4px; }
.auth-card p.sub { color: var(--muted); margin-bottom: 22px; }
.auth-toggle { text-align: center; margin-top: 16px; color: var(--muted); font-size: 13.5px; }
.auth-error { background: #fef2f2; color: var(--red); padding: 10px 13px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; border: 1px solid #fecaca; }

/* ---------- Detail page ---------- */
.detail-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.detail-head .big-avatar { width: 56px; height: 56px; border-radius: 12px; background: var(--navy); color: var(--gold-soft); display: grid; place-items: center; font-size: 24px; font-weight: 700; flex-shrink: 0; }
.detail-head h2 { font-size: 23px; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.detail-meta span { display: inline-flex; align-items: center; gap: 5px; }
.detail-meta svg { width: 15px; height: 15px; flex-shrink: 0; }
.ti-icon svg { width: 16px; height: 16px; }
.section-title svg { width: 17px; height: 17px; }
.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 950px){ .detail-grid { grid-template-columns: 1fr; } }
.timeline-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eef1f5; }
.timeline-item:last-child { border-bottom: none; }
.ti-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.ti-call { background: var(--green); } .ti-email { background: var(--blue); } .ti-meeting { background: var(--amber); } .ti-note { background: #64748b; }
.ti-body { flex: 1; min-width: 0; }
.ti-body .ti-top { display: flex; align-items: baseline; gap: 8px; }
.ti-body .ti-when { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.contact-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eef1f5; }
.contact-row:last-child { border-bottom: none; }
.contact-row .c-name { font-weight: 600; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef1f5; }
.task-row:last-child { border-bottom: none; }
.task-row.done .t-title { text-decoration: line-through; color: var(--muted); }
.task-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--navy); cursor: pointer; }
.due { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #eef2f7; color: var(--muted); margin-left: auto; }
.due.overdue { background: #fee2e2; color: var(--red); font-weight: 600; }
.due.soon { background: #fef3c7; color: var(--amber); }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; margin-bottom: 12px; opacity: .4; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button { background: none; border: none; padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--navy); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500; animation: slidein .2s ease; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- Period tabs ---------- */
.period-tabs { display: flex; gap: 4px; }
.period-btn {
  background: var(--surface); border: 1px solid var(--border); padding: 8px 15px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--muted); transition: .12s; cursor: pointer;
}
.period-btn:hover { background: #f0f4f8; color: var(--text); }
.period-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Ads flat table ---------- */
.ad-row td { font-size: 13px; }
.ad-cancelled td { text-decoration: line-through; color: var(--muted); opacity: .65; }
.ad-cancelled .t-strong { color: var(--muted); }
.ad-row-expanded td:first-child { border-left: 3px solid var(--gold-soft); padding-left: 9px; }

/* ---------- Artwork status badge ---------- */
.art-badge {
  border: none; border-radius: 20px; padding: 3px 10px; font-size: 11.5px;
  font-weight: 600; cursor: pointer; transition: opacity .12s; white-space: nowrap;
}
.art-badge:hover { opacity: .8; }
.art-ok      { background: #dcfce7; color: #15803d; }
.art-pending { background: #fef3c7; color: #92400e; }

/* ---------- Artwork pending count chip ---------- */
.art-count-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fef3c7; border: 1px solid #fde68a; color: #92400e;
  border-radius: 20px; padding: 5px 12px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: background .12s;
}
.art-count-chip:hover { background: #fde68a; }

/* ---------- Filter badge ---------- */
.filter-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 10px; padding: 0 5px; margin-left: 4px;
}

/* ---------- Filter panel (slide-out) ---------- */
.filter-backdrop {
  position: fixed; inset: 0; background: rgba(12,35,64,.35); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.filter-backdrop.open { opacity: 1; pointer-events: all; }

.filter-panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: 300px;
  background: var(--surface); box-shadow: -6px 0 28px rgba(12,35,64,.18);
  z-index: 95; transform: translateX(100%); transition: transform .22s ease;
  display: flex; flex-direction: column; overflow: hidden;
}
.filter-panel.open { transform: translateX(0); }

.filter-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.filter-panel-close {
  background: none; border: none; font-size: 24px; color: var(--muted);
  line-height: 1; cursor: pointer; padding: 0 4px;
}
.filter-panel-close:hover { color: var(--text); }

.filter-panel-body { flex: 1; overflow-y: auto; padding: 18px 20px; }

.filter-section { margin-bottom: 22px; }
.filter-section-label {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin-bottom: 10px;
}

.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.fpill {
  border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px;
  background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text);
  cursor: pointer; transition: .12s;
}
.fpill:hover { border-color: var(--navy-600); background: #eef2f7; }
.fpill.fpill-on { background: var(--navy); border-color: var(--navy); color: #fff; }

.filter-panel-foot {
  padding: 16px 20px; border-top: 1px solid var(--border); flex-shrink: 0;
}

.help { background: #f0f6ff; border: 1px solid #d6e4ff; color: #1e40af; padding: 12px 15px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.mono { font-family: ui-monospace, 'Cascadia Code', monospace; font-size: 12.5px; }
.import-map { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }

/* ========== Inbox ========== */
.inbox-layout {
  display: grid; grid-template-columns: 300px 1fr; gap: 0;
  height: calc(100vh - 130px); overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.inbox-sidebar {
  border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden;
}
.inbox-toolbar {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap;
}
.inbox-gmail-note {
  display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted);
}
.inbox-gmail-note svg { width: 14px; height: 14px; }
.coming-soon {
  background: #f1f5f9; border: 1px solid var(--border); border-radius: 10px;
  padding: 1px 7px; font-size: 11px; font-weight: 600; color: var(--muted);
}
#email-list { flex: 1; overflow-y: auto; }
.inbox-no-emails {
  padding: 40px 20px; text-align: center; color: var(--muted);
}
.inbox-no-emails svg { width: 36px; height: 36px; opacity: .3; margin-bottom: 10px; }

/* Email row in list */
.email-row {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s;
}
.email-row:hover { background: #f8fafc; }
.email-row-active { background: #eef4ff !important; }
.email-row-unread .email-from { font-weight: 700; }
.email-row-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.email-from { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.email-date { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.email-subject { font-size: 13px; color: var(--text); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-summary { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }

/* Email intent / action badges */
.ebadge {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
  border: 1px solid transparent; white-space: nowrap;
}
.intent-ad       { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.intent-question { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.intent-payment  { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.intent-other    { background: #f1f5f9; color: var(--muted); border-color: var(--border); }
.action-new      { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.action-change   { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.action-cancel   { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.action-followup { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.action-unknown  { background: #f1f5f9; color: var(--muted); border-color: var(--border); }
.status-reviewed { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.status-dismissed{ background: #f1f5f9; color: var(--muted); }
.status-linked   { background: #fef3c7; color: #92400e; border-color: #fde68a; }

/* Email detail pane */
.inbox-main { overflow-y: auto; }
.inbox-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: var(--muted); gap: 12px;
}
.inbox-empty-state svg { width: 40px; height: 40px; opacity: .25; }

.email-detail { display: flex; flex-direction: column; height: 100%; }
.email-detail-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; gap: 12px;
}
.email-detail-subject { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.email-detail-from { font-size: 13px; color: var(--muted); }
.email-detail-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.email-split { display: grid; grid-template-columns: 1fr 1fr; flex: 1; overflow: hidden; }
.email-raw {
  border-right: 1px solid var(--border); padding: 16px 18px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.email-raw-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.email-body {
  font-family: ui-monospace, 'Cascadia Code', monospace; font-size: 12px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word; color: var(--text); flex: 1;
}
.email-body-sm { font-size: 11.5px; max-height: 340px; overflow-y: auto; }

.email-ai-panel { padding: 16px 18px; overflow-y: auto; }
.ai-prompt-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; text-align: center; color: var(--muted); gap: 14px; padding: 30px;
}
.ai-prompt-state svg { width: 32px; height: 32px; opacity: .4; }
.ai-prompt-state p { font-size: 13.5px; line-height: 1.6; max-width: 280px; }

.ai-result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ai-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.ai-summary-text { font-size: 13.5px; color: var(--text); margin-bottom: 14px; line-height: 1.5; }
.ai-non-ad { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; font-size: 13.5px; }

/* Extracted fields */
.ext-fields-panel { font-size: 13px; }
.ext-fields-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between;
}
.conf-legend { display: flex; align-items: center; gap: 6px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.ext-field {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 7px; margin-bottom: 4px; border: 1px solid transparent;
}
.ext-field.conf-high   { background: #f0fdf4; border-color: #bbf7d0; }
.ext-field.conf-med    { background: #fffbeb; border-color: #fde68a; }
.ext-field.conf-low    { background: #fff1f2; border-color: #fecdd3; }
.ext-field.conf-unknown{ background: #f8fafc; border-color: var(--border); }
.ext-field.ext-empty   { opacity: .5; }
.ext-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; min-width: 80px; }
.ext-val { flex: 1; color: var(--text); font-weight: 500; }
.conf-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.conf-high .conf-dot, .conf-dot.conf-high { background: #16a34a; }
.conf-med  .conf-dot, .conf-dot.conf-med  { background: #d97706; }
.conf-low  .conf-dot, .conf-dot.conf-low  { background: #dc2626; }
.ext-fields-note { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* Create-Ad-from-email split modal */
.email-ad-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; min-height: 420px; margin: -4px; }
.email-ad-left { border-right: 1px solid var(--border); padding: 16px; overflow-y: auto; }
.email-ad-right { padding: 16px; overflow-y: auto; }
.email-ad-from { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.email-ad-subject { font-size: 13.5px; margin-bottom: 10px; }

/* Inbox action panel */
.email-action-panel { padding: 16px 18px; overflow-y: auto; border-left: 1px solid var(--border); }
.inbox-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.inbox-action-btn {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 10px; text-align: left;
  border: 1.5px solid var(--border); background: #fff; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.inbox-action-btn:hover { border-color: var(--navy); background: #f5f8ff; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.inbox-action-btn .iab-icon { flex-shrink: 0; width: 32px; height: 32px; color: var(--navy); display: flex; align-items: center; justify-content: center; }
.inbox-action-btn .iab-icon svg { width: 20px; height: 20px; }
.iab-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; color: var(--text); }
.iab-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.inbox-action-complete:hover { border-color: #16a34a; background: #f0fdf4; }
.inbox-action-complete:hover .iab-icon { color: #16a34a; }
.inbox-action-complete:hover .iab-title { color: #15803d; }
.inbox-action-done { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 10px; border: 1.5px solid #d1fae5; background: #f0fdf4; color: #15803d; font-size: 13px; font-weight: 500; }
.inbox-action-done svg { width: 16px; height: 16px; }

/* Inbox list footer toggle */
.inbox-show-handled { padding: 10px 12px; border-top: 1px solid var(--border); text-align: center; }
.coming-soon { font-size: 10px; background: #e5e7eb; color: var(--muted); border-radius: 4px; padding: 1px 5px; vertical-align: middle; }

/* Task type badges */
.task-type-badge { display: inline-block; margin-left: 7px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 20px; background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; vertical-align: middle; }
.task-outreach td { background: #fafcff; }

/* Searchable select combobox */
.ss-wrap { position: relative; }
.ss-input { width: 100%; }
.ss-dropdown {
  display: none;
  position: fixed;
  background: var(--bg);
  border: 1.5px solid var(--gold);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 9999;
  box-shadow: 0 6px 20px rgba(0,0,0,.13);
}
.ss-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13.5px;
}
.ss-option:first-child { border-radius: 8px 8px 0 0; }
.ss-option:last-child  { border-radius: 0 0 8px 8px; }
.ss-option:only-child  { border-radius: 8px; }
.ss-option:hover,
.ss-option.highlighted { background: var(--bg2); }
.ss-empty {
  padding: 9px 12px;
  color: var(--text2);
  font-size: 13px;
  font-style: italic;
}

/* ── Campaign wizard overlay ──────────────────────────────────── */
.campaign-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.campaign-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  margin: 28px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
  min-height: 0;
}
.campaign-header {
  display: flex;
  align-items: center;
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-shrink: 0;
}
.campaign-steps {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0;
}
.campaign-step {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
}
.cs-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.cs-active .cs-num  { background: var(--navy); color: #fff; }
.cs-done   .cs-num  { background: var(--green,#16a34a); color: #fff; }
.cs-future .cs-num  { background: var(--bg2); color: var(--text2); }
.cs-active .cs-label { color: var(--navy); font-weight: 700; }
.cs-future .cs-label { color: var(--text2); }
.cs-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 10px;
}
.campaign-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text2);
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
}
.campaign-close:hover { background: var(--bg2); color: var(--text); }
.campaign-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  min-height: 0;
}
.campaign-footer {
  display: flex;
  align-items: center;
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  gap: 10px;
  flex-shrink: 0;
}
.cw-section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.cw-summary-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.cw-pill {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.cw-pill-green { background: #dcfce7; color: #166534; }
.cw-pill-red   { background: #fee2e2; color: #991b1b; }
.cw-pill-yellow{ background: #fef9c3; color: #854d0e; }
.cw-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.cw-badge-red    { background: #fee2e2; color: #991b1b; }
.cw-badge-yellow { background: #fef9c3; color: #854d0e; }
.cw-row-dim td   { opacity: .45; }
.cw-warn {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}
.cw-warn-yellow { background: #fefce8; border: 1px solid #fde68a; color: #78350f; }
.cw-warn-blue   { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a5f; }
.cw-warn-green  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.cw-chip {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--navy);
}
.cw-chip:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.cw-preview-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.cw-preview-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg2);
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.cw-preview-subject {
  padding: 7px 14px;
  font-size: 12px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.cw-preview-frame {
  width: 100%;
  min-height: 120px;
  border: none;
  display: block;
}
.cw-summary-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.cws-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.cws-row:last-child { border-bottom: none; }
.cws-row span:first-child { color: var(--text2); font-size: 13px; }

/* ── Inbox Gmail bar ─────────────────────────────────────────── */
.inbox-gmail-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  min-height: 40px;
  font-size: 12px;
}
.inbox-gmail-connected {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* ── Role badges ─────────────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.role-admin  { background: #dbeafe; color: #1e40af; }
.role-editor { background: #dcfce7; color: #166534; }
.role-viewer { background: #f3f4f6; color: #4b5563; }

/* In the sidebar user chip */
.who small { display: block; font-size: 11px; color: var(--text2); }
.who .role-badge { margin-top: 2px; }

/* ── Admin page ───────────────────────────────────────────────── */
.admin-wrap { max-width: 860px; }
.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.admin-section-head h3 { margin: 0; font-size: 16px; }
.role-select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg);
  cursor: pointer;
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.dot-green { background: var(--green, #16a34a); }
.dot-red   { background: var(--red,   #dc2626); }

/* ── Outline button ──────────────────────────────────────────── */
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--navy);
}
.btn-outline:hover {
  border-color: var(--navy);
  background: var(--bg2);
}
