/* Metis - futuristic AI theme. Plain CSS, no frameworks.
   Deep-space sidebar, electric cyan accent (#00d4ff), Greek gold (#e3b341).
   "Greek temple meets sci-fi HUD." */

:root {
  --space: #060a17;
  --navy: #0b1126;
  --navy-2: #111a36;
  --navy-3: #1a2547;
  --accent: #00d4ff;
  --accent-dark: #0ea5e9;
  --gold: #e3b341;
  --gold-soft: #f2d57e;
  --gold-deep: #9a6b1a;
  --bg: #080d1c;
  --card: #0f1730;
  --card-2: #131c3a;
  --ink: #e9eefb;
  --muted: #93a0c4;
  --border: #1f2c52;
  --hot: #ff6b6b;
  --warm: #f0a832;
  --cold: #38bdf8;
  --dead: #64748b;
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, .13);
  --yellow: #f2c94c;
  --yellow-bg: rgba(242, 201, 76, .13);
  --red: #ff6b6b;
  --red-bg: rgba(255, 107, 107, .13);
  --gray-bg: rgba(148, 163, 184, .10);
  --radius: 10px;
  --sidebar-w: 232px;
  --glow: 0 0 14px rgba(0, 212, 255, .35);
  --glow-gold: 0 0 14px rgba(227, 179, 65, .45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(0, 212, 255, .07), transparent 60%),
    radial-gradient(1000px 600px at -10% 110%, rgba(124, 58, 237, .10), transparent 60%),
    radial-gradient(700px 420px at 50% 55%, rgba(227, 179, 65, .028), transparent 65%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
/* Metis owl watermark — subtle, always present */
body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(115vmin, 1000px);
  height: min(115vmin, 1000px);
  transform: translate(-50%, -50%);
  background: url("assets/metis-owl-head.webp") center / contain no-repeat;
  opacity: .2;
  pointer-events: none;
  z-index: 1;
  filter: brightness(1.45) saturate(1.3) drop-shadow(0 0 40px rgba(227, 179, 65, .26));
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, black 62%, transparent 72%);
  mask-image: radial-gradient(circle, black 62%, transparent 72%);
}
/* Deep-space nebula: crisp photographic background, lightly dimmed, BEHIND all content */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 7, 18, .30), rgba(4, 7, 18, .36)),
    url("assets/nebula-bg.webp") center / cover no-repeat;
  pointer-events: none;
  z-index: -1;
}

/* Text legibility over the nebula: subtle shadow lifts every glyph off the background */
body {
  text-shadow: 0 1px 3px rgba(0, 0, 0, .65);
}
input, textarea, select, button { text-shadow: none; }
/* Links: brighter cyan with glow so they read clearly over the nebula */
a { color: #5ee7ff; }
a:hover { color: #a5f3ff; text-shadow: 0 0 8px rgba(0, 212, 255, .55), 0 1px 3px rgba(0, 0, 0, .65); }

/* ================= Shell: sidebar + top bar ================= */

body.has-shell { background: var(--bg); }

.shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0d1430 0%, #070c1d 100%);
  border-right: 1px solid rgba(0, 212, 255, .14);
  box-shadow: 4px 0 28px rgba(0, 0, 0, .5);
  color: #d1d5db;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid rgba(227, 179, 65, .28);
}
.side-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f2d57e 0%, #e3b341 45%, #9a6b1a 100%);
  color: #231603;
  font-weight: 800;
  font-size: 17px;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: 0 0 14px rgba(227, 179, 65, .55);
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-foot { padding: 10px 8px; border-top: 1px solid rgba(227, 179, 65, .22); }

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #c3ccd9;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.side-link:hover { background: var(--navy-2); color: #fff; }
.side-link.active { background: linear-gradient(90deg, rgba(0,212,255,.24), rgba(0,212,255,.07)); color: #fff; border: 1px solid rgba(0,212,255,.38); box-shadow: var(--glow); }
.side-ico { width: 20px; text-align: center; font-size: 15px; flex: none; }

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(11, 17, 38, .86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 212, 255, .12);
}

.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-size: 18px;
  padding: 4px 10px;
}

.top-search { flex: 1; max-width: 480px; }
.top-search input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  background: var(--bg);
}
.top-search input:focus { outline: 2px solid var(--accent); background: var(--navy-2); box-shadow: var(--glow); }

.top-bell {
  position: relative;
  font-size: 20px;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--ink);
}
.top-bell:hover { background: var(--bg); }
.bell-count {
  position: absolute; top: 0; right: 0;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; min-width: 17px; height: 17px; line-height: 17px;
  text-align: center; padding: 0 4px;
}

.user-menu { position: relative; margin-left: auto; }
.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px 5px 5px;
  cursor: pointer;
  color: var(--ink);
}
.user-btn:hover { background: var(--bg); }
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.user-name { font-size: 14px; font-weight: 600; }
.user-caret { font-size: 11px; color: var(--muted); }
.user-drop {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 180px;
  overflow: hidden;
  z-index: 70;
  box-shadow: 0 12px 32px rgba(0,0,0,.55), 0 0 14px rgba(0,212,255,.10);
}
.user-drop.open { display: block; }
.user-drop a {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
}
.user-drop a:hover { background: var(--bg); }

.content { flex: 1; padding: 0; }

.side-scrim { display: none; }

/* ================= Page scaffolding ================= */

.wrap { max-width: 1160px; margin: 0 auto; padding: 20px 20px 56px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 18px;
}
.page-title { margin: 0; font-size: 24px; }
.page-sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ================= Cards / stats ================= */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .38);
  background-image: linear-gradient(180deg, rgba(255,255,255,.025), transparent 30%);
}
.card h2 { margin: 0 0 12px; font-size: 17px; }
.card h3 { margin: 0 0 8px; font-size: 15px; }
.card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  display: block;
}
a.kpi:hover { border-color: var(--accent); box-shadow: var(--glow); }
.kpi .num { font-size: 30px; font-weight: 800; line-height: 1.1; }
.kpi .label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.kpi.kpi-green { border-left-color: var(--green); }
.kpi.kpi-red { border-left-color: var(--red); }
.kpi.kpi-yellow { border-left-color: var(--yellow); }
.kpi.kpi-gray { border-left-color: var(--dead); }

/* legacy stat cards (dashboard compat) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat .num { font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat.hot { border-top: 4px solid var(--hot); }
.stat.warm { border-top: 4px solid var(--warm); }
.stat.cold { border-top: 4px solid var(--cold); }
.stat.dead { border-top: 4px solid var(--dead); }

/* ================= Badges ================= */

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge.hot { background: rgba(255,107,107,.14); color: #ff8f8f; }
.badge.warm { background: rgba(240,168,50,.14); color: var(--warm); }
.badge.cold { background: rgba(56,189,248,.14); color: #7dd3fc; }
.badge.dead { background: var(--gray-bg); color: #94a3b8; }
.badge.tag { background: var(--gray-bg); color: #c3ccd9; text-transform: none; font-weight: 500; }
.badge.status { background: rgba(99,102,241,.16); color: #a5b4fc; }
.badge.incomplete { background: var(--yellow-bg); color: var(--yellow); }
.badge.dnc { background: var(--red-bg); color: var(--hot); }

.badge.score-high { background: var(--green-bg); color: #6ee7b7; }
.badge.score-mid { background: var(--yellow-bg); color: var(--yellow); }
.badge.score-low { background: var(--red-bg); color: #ff9a9a; }
.badge.score-none { background: var(--gray-bg); color: var(--muted); }

.badge.grade-a { background: var(--green-bg); color: #6ee7b7; }
.badge.grade-b { background: rgba(56,189,248,.14); color: #7dd3fc; }
.badge.grade-c { background: var(--yellow-bg); color: var(--yellow); }
.badge.grade-d { background: rgba(240,168,50,.14); color: #fdba74; }
.badge.grade-dq { background: var(--red-bg); color: #ff9a9a; }

/* ================= Tables ================= */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
tbody tr:hover td { background: rgba(0, 212, 255, .05); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgba(0, 212, 255, .10); }
.table-scroll { overflow-x: auto; }

/* ================= Forms / buttons ================= */

label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
input[type="text"], input[type="password"], input[type="date"], input[type="email"], input[type="tel"],
input[type="number"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #0a1128;
  color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

button, .btn {
  background: linear-gradient(135deg, #00d4ff, #0ea5e9);
  color: #04121c;
  box-shadow: 0 0 12px rgba(0, 212, 255, .30);
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: linear-gradient(135deg, #4fe0ff, #38bdf8); box-shadow: 0 0 20px rgba(0, 212, 255, .55); }
button.secondary, .btn.secondary { background: rgba(148, 163, 184, .14); color: var(--ink); border: 1px solid var(--border); box-shadow: none; }
button.secondary:hover, .btn.secondary:hover { background: rgba(148, 163, 184, .26); box-shadow: none; }
button.danger { background: var(--hot); }
button.danger:hover { background: #e05252; box-shadow: 0 0 14px rgba(255,107,107,.4); }
button.approve { background: linear-gradient(135deg, #34d399, #10b981); color: #04150e; }
button.approve:hover { background: linear-gradient(135deg, #5eeab0, #34d399); box-shadow: 0 0 16px rgba(52,211,153,.5); }
button:disabled { opacity: 0.6; cursor: default; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > div { flex: 1 1 200px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

/* ================= Pills / toolbar / tabs ================= */

.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pill {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.pill:hover { border-color: var(--accent); }
.pill.active { background: linear-gradient(135deg, rgba(0,212,255,.28), rgba(0,212,255,.10)); color: #fff; border-color: rgba(0,212,255,.55); box-shadow: var(--glow); }
.pill .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 14px;
}
.toolbar > div { flex: 1 1 160px; }
.toolbar .search { flex: 2 1 240px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  background: rgba(10, 16, 34, .72);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #dbe4ff;
}
.tab:hover { border-color: var(--accent); }
.tab.active { background: linear-gradient(135deg, rgba(0,212,255,.28), rgba(0,212,255,.10)); color: #fff; border-color: rgba(0,212,255,.55); box-shadow: var(--glow); }

/* ================= Lead cards (list) ================= */

.lead-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.lead-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: box-shadow .12s ease, transform .12s ease;
}
.lead-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 16px rgba(0,212,255,.18); transform: translateY(-1px); border-color: rgba(0,212,255,.4); }
.lead-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0b1126 0%, #14306b 55%, #0e7490 135%);
  color: #fff;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: .02em;
}
.lead-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lead-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lead-addr { font-weight: 700; font-size: 15px; }
.lead-name { color: var(--muted); font-size: 13px; }
.lead-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.lead-meta { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lead-meta strong { color: var(--ink); }

/* ================= Modal ================= */

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .5);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 28px rgba(0,212,255,.12);
}
.modal h2 { margin: 0 0 12px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ================= Drip timeline ================= */

.drip-timeline {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0 4px;
}
.drip-day {
  flex: 1 1 0;
  min-width: 96px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 12px 10px;
  text-align: center;
  position: relative;
}
.drip-day:first-child { border-radius: 8px 0 0 8px; }
.drip-day:last-child { border-radius: 0 8px 8px 0; }
.drip-day + .drip-day { border-left: none; }
.drip-day .dnum { font-weight: 800; font-size: 16px; }
.drip-day .dlab { font-size: 12px; color: var(--muted); margin-top: 4px; }
.drip-day.done { background: var(--green-bg); border-color: #86efac; }
.drip-day.current { background: rgba(0,212,255,.12); border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,212,255,.45) inset, 0 0 14px rgba(0,212,255,.25); }
.drip-day.current .dnum { color: var(--accent); text-shadow: 0 0 10px rgba(0,212,255,.6); }

/* ================= Warnings / states ================= */

.warning-banner {
  background: var(--red-bg);
  border: 1px solid rgba(255,107,107,.45);
  color: #ff9a9a;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  font-weight: 600;
}
.info-banner {
  background: rgba(56,189,248,.10);
  border: 1px solid rgba(56,189,248,.35);
  color: #7dd3fc;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
}
.prospect-banner {
  background: linear-gradient(90deg, rgba(227,179,65,.18), rgba(227,179,65,.05));
  border: 1px solid rgba(227,179,65,.45);
  box-shadow: var(--glow-gold);
  color: var(--gold-soft);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.loading { padding: 40px 20px; text-align: center; color: var(--muted); }
.error-box {
  background: var(--red-bg);
  border: 1px solid rgba(255,107,107,.45);
  color: #ff9a9a;
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.empty { color: var(--muted); padding: 24px; text-align: center; }
.success-box {
  background: var(--green-bg);
  border: 1px solid rgba(52,211,153,.45);
  color: #6ee7b7;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 12px 0;
}

/* ================= Lead detail ================= */

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; word-break: break-word; }

.score-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.score-cell {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.score-cell .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.score-cell .v { font-size: 17px; font-weight: 700; margin-top: 2px; }

.flag-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(56,189,248,.12);
  color: #7dd3fc;
  border: 1px solid rgba(56,189,248,.35);
}

/* ================= Tasks ================= */

.task-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: none; }
.task-row input[type="checkbox"] { margin-top: 4px; }
.task-title.done { text-decoration: line-through; color: var(--muted); }
.task-meta { font-size: 13px; color: var(--muted); }
.due-overdue { color: var(--hot); font-weight: 700; }
.due-today { color: var(--yellow); font-weight: 700; }

/* ================= Approvals ================= */

.approval-card { border-left: 4px solid var(--accent); }
.approval-card.decided-approved { border-left-color: var(--green); }
.approval-card.decided-denied { border-left-color: var(--hot); }
.approval-actions { display: flex; gap: 10px; margin-top: 12px; }
.draft-box {
  background: rgba(148,163,184,.07);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  white-space: pre-wrap;
  font-size: 14px;
}

/* ================= Notes ================= */

.note-item { border-bottom: 1px solid var(--border); padding: 10px 0; font-size: 14px; }
.note-item:last-child { border-bottom: none; }

/* ================= Notifications ================= */

.notif-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px;
  background: var(--card);
}
.notif-row.unread { border-left: 4px solid var(--accent); }
.notif-row.read { opacity: 0.65; }
.notif-title { font-weight: 600; font-size: 15px; }

/* ================= Buyer cards ================= */

.buyer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.buyer-card { display: flex; flex-direction: column; }
.buyer-card .card-head { margin-bottom: 4px; }

/* ================= Interview ================= */

.interview-qa { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.qa-item { margin-bottom: 10px; }
.qa-item .q { font-weight: 600; font-size: 13px; }
.qa-item .a { font-size: 14px; color: var(--ink); white-space: pre-wrap; }

/* ================= Underwriting (page-local overrides) ================= */

.verdict { display: inline-block; padding: 6px 14px; border-radius: 6px; font-weight: 700; font-size: 1.1em; }
.verdict-buy { background: var(--green-bg); color: #6ee7b7; border: 1px solid rgba(52,211,153,.55); }
.verdict-renegotiate { background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(242,201,76,.55); }
.verdict-walk { background: var(--red-bg); color: #ff9a9a; border: 1px solid rgba(255,107,107,.55); }
.flag { border-left: 4px solid #475569; padding: 6px 10px; margin: 6px 0; background: rgba(148,163,184,.07); }
.flag-high { border-color: #ff6b6b; }
.flag-medium { border-color: var(--yellow); }
.flag-low { border-color: var(--cold); }
.sec-title { margin-bottom: 4px; }
.sec-lines p { margin: 2px 0; }
.num-table td { padding: 2px 8px 2px 0; }
.comp-row { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; align-items: flex-end; }
.comp-row > div { min-width: 130px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.saved-note { color: #6ee7b7; font-weight: 600; }
.src-tag { font-size: 0.8em; color: var(--muted); }

/* ================= Utility ================= */

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 16px; }
.right { text-align: right; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }

/* ================= Responsive ================= */

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    width: 240px;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .side-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(16,24,40,.45);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  body.sidebar-open .side-scrim { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .hamburger { display: inline-block; }
  .user-name { display: none; }
}

@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 120px 1fr; }
  th.hide-m, td.hide-m { display: none; }
  .stat .num, .kpi .num { font-size: 24px; }
  .grid2 { grid-template-columns: 1fr; }
  .wrap { padding: 16px 12px 48px; }
  .topbar { padding: 10px 12px; }
  .lead-grid { grid-template-columns: 1fr; }
}

/* ================= Metis: futuristic flourishes ================= */
/* Greek temple meets sci-fi HUD. Deep space, electric cyan, temple gold. */

.side-brand-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  flex: none;
  box-shadow: 0 0 16px rgba(227, 179, 65, .5);
}
.side-brand-logo-wide {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 12px rgba(227, 179, 65, .35));
}
.side-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.side-brand .side-label {
  font-size: 17px;
  letter-spacing: .04em;
  font-weight: 800;
  background: linear-gradient(90deg, #ffffff, #a9c6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.side-brand-sub {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: .14em;
  font-weight: 600;
}

/* Gold premium accents: scores, badges, money. */
.gold { color: var(--gold-soft); }
.badge.gold {
  background: rgba(227, 179, 65, .15);
  color: var(--gold-soft);
  border: 1px solid rgba(227, 179, 65, .45);
}
.score-glow { text-shadow: 0 0 14px rgba(0, 212, 255, .65); }
.score-gold { color: var(--gold-soft); text-shadow: 0 0 14px rgba(227, 179, 65, .65); }

/* Glowing focus ring for the whole app. */
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 10px rgba(0, 212, 255, .25);
}

/* KPI numbers get a faint cyan aura. */
.kpi .num { text-shadow: 0 0 18px rgba(0, 212, 255, .28); }

/* Top search pill glows on the dark topbar. */
.top-search input {
  background: rgba(0, 212, 255, .06);
  border-color: rgba(0, 212, 255, .18);
  color: var(--ink);
}
.top-search input::placeholder { color: var(--muted); }

::selection { background: rgba(0, 212, 255, .35); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--space); }
::-webkit-scrollbar-thumb { background: var(--navy-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, .4); }

/* ---- Task calendar ---- */
.cal-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 14px 0 10px; }
.cal-title { margin: 0; font-size: 19px; flex: 1 1 auto; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.cal-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cal-toggle button { border: 0; border-radius: 0; background: transparent; color: var(--muted); padding: 6px 14px; margin: 0; }
.cal-toggle button.active { background: var(--navy-3); color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0; font-weight: 600; }
.cal-day { min-height: 104px; background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-day.other { opacity: .42; }
.cal-day.today { border-color: var(--accent); box-shadow: var(--glow); }
.cal-day.drop-hover, .cal-undated.drop-hover { border-color: var(--accent); background: var(--navy-2); }
.cal-num { font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-day.today .cal-num { color: var(--accent); }
.cal-chips { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; max-height: 224px; }
.tchip { border-left: 3px solid var(--border); background: var(--navy-2); border-radius: 6px;
  padding: 4px 7px; font-size: 12px; line-height: 1.35; cursor: grab; }
.tchip:active { cursor: grabbing; }
.tchip.dragging { opacity: .4; }
.tchip .tchip-title { font-weight: 600; color: var(--ink); }
.tchip .tchip-lead { color: var(--muted); font-size: 11px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; display: block; }
.tchip.t-hot { border-left-color: var(--hot); }
.tchip.t-warm { border-left-color: var(--warm); }
.tchip.t-cold { border-left-color: var(--cold); }
.tchip.t-dead { border-left-color: var(--dead); }
.tchip.overdue-chip .tchip-title { color: var(--hot); }
.cal-undated { padding: 10px; border: 1px dashed var(--border); border-radius: 8px; min-height: 56px; }
.cal-undated.has-chips { flex-direction: row; flex-wrap: wrap; }
.cal-undated.has-chips .tchip { flex: 1 1 200px; max-width: 280px; }
@media (max-width: 760px) {
  .cal-day { min-height: 76px; }
  .cal-chips { max-height: 120px; }
}

/* ================= Lead texting thread (Texts tab) ================= */
.txt-thread { display: flex; flex-direction: column; gap: 10px; max-height: 380px;
  overflow-y: auto; padding: 6px 2px; margin-bottom: 12px; }
.txt-msg { display: flex; flex-direction: column; max-width: 78%; }
.txt-in { align-self: flex-start; align-items: flex-start; }
.txt-out { align-self: flex-end; align-items: flex-end; }
.txt-bubble { padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45;
  white-space: pre-wrap; word-wrap: break-word; }
.txt-in .txt-bubble { background: rgba(148,163,184,.14); border: 1px solid var(--border);
  border-bottom-left-radius: 4px; }
.txt-out .txt-bubble { background: linear-gradient(135deg, rgba(0,212,255,.26), rgba(0,212,255,.10));
  border: 1px solid rgba(0,212,255,.4); border-bottom-right-radius: 4px; }
.txt-time { margin-top: 3px; }
.txt-empty { text-align: center; padding: 24px 0; }
.txt-compose { display: flex; gap: 8px; align-items: flex-end; }
.txt-compose textarea { flex: 1; resize: vertical; }
.txt-compose textarea:disabled { opacity: .55; cursor: not-allowed; }

/* ================= Drip enrollment modal ================= */
.drip-seq { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.drip-seq:hover { border-color: var(--accent); }
.drip-seq input { margin-top: 3px; }
