/* ── ALPHA LLC · CRM ────────────────────────────────────────────────
   Colour comes from Alpha LLC Brand Guidelines v1.0, unchanged.
   Shape, type and density follow a shadcn-style system (Sep 2026):

     · containers are 24px cards on hairline borders, nested corners 10px
     · every control is a pill — buttons, inputs, badges at 18px
     · elevation is whisper-quiet: a hairline plus the faintest lift
     · Geist for the interface, Geist Mono for numbers and IDs,
       Montserrat only for the ALPHA LLC lockup
     · headings track tight (−0.025em to −0.05em), captions loose (+0.05em)
     · compact density: 4px grid, 20px card padding, 8px element gap

   THE GOLD RULE still holds: gold is the primary action, the active nav
   item, and links. Everything structural is obsidian, graphite, steel
   navy and iron. The brand runs dark; there is no light mode.
   ------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&family=Montserrat:wght@700;800&display=swap');

:root {
  color-scheme: dark;

  /* Core brand */
  --obsidian:   #070B14;
  --graphite:   #0C111C;
  --steel-navy: #233247;
  --iron:       #4A5670;
  --gold:       #E3B84A;
  --gold-light: #F6D687;
  --off-white:  #F2F5FA;
  --slate:      #93A2BA;

  /* Surface stack: canvas → sidebar → card → input fill */
  --bg:         var(--obsidian);
  --bg2:        #090E18;
  --bg3:        var(--graphite);
  --bg4:        #141C2C;
  --panel:      var(--steel-navy);
  --sidebar:    #101725;   /* a step brighter than the canvas so the rail reads as its own surface */

  /* Hairlines and tonal fills (slate at low alpha, so they sit on any surface) */
  --hairline:   rgba(147,162,186,0.12);
  --hairline2:  rgba(147,162,186,0.22);
  --border:     var(--hairline);
  --border2:    var(--hairline2);
  --soft:       rgba(147,162,186,0.08);
  --soft2:      rgba(147,162,186,0.14);

  --accent:     var(--gold);
  --accent2:    var(--gold-light);
  --accent3:    #C9A03A;
  --text:       var(--off-white);
  --text2:      var(--slate);
  --text3:      var(--iron);

  /* Status semantics. Muted on purpose so nothing out-shouts gold. */
  --green:      #4FA97F;
  --green2:     #3C8A66;
  --red:        #C4645C;
  --yellow:     #C9A03A;
  --purple:     #6E7FA8;
  --cyan:       #5A8CA8;

  /* Type */
  --font-ui:    'Geist', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:  'Geist Mono', ui-monospace, 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --font-brand: 'Montserrat', var(--font-ui);

  /* Shape */
  --r-card:     24px;
  --r-pill:     18px;
  --r-lg:       14px;
  --r-nested:   10px;
  --r-sm:       6px;
  --radius:     var(--r-nested);
  --radius-lg:  var(--r-pill);
  --radius-xl:  var(--r-card);

  /* Elevation */
  --shadow-card: 0 1px 2px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.025);
  --shadow:      0 12px 40px rgba(0,0,0,0.45);
  --glow:        none;

  --sidebar-w:  260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.43;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--gold-light); }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
::selection { background: rgba(227,184,74,0.28); }
:focus-visible { outline: 2px solid rgba(227,184,74,0.55); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: rgba(147,162,186,0.22) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(147,162,186,0.22); border-radius: 18px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── App Shell ───────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--hairline2);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand { padding: 20px 18px 10px; }

.brand-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }

.brand-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 36px;
}
.brand-icon img { width: 100%; height: 100%; display: block; }

.brand-name {
  font-family: var(--font-brand);
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 1.5px;
  line-height: 1.1;
}
.brand-name .llc { color: var(--gold); }

.brand-sub {
  font-family: var(--font-ui);
  font-size: 8.5px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--iron);
  margin-top: 2px;
  padding-left: 46px;
}

.nav-section { padding: 8px 12px; }

.nav-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 10px;
  margin: 8px 0 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-nested);
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
  position: relative;
}
.nav-link:hover { background: var(--soft2); color: var(--text); text-decoration: none; }
.nav-link.active { background: rgba(227,184,74,0.12); color: var(--gold); }

.nav-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.nav-link.active .nav-icon { background: rgba(227,184,74,0.12); }

.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--obsidian);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--r-pill);
}

.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--hairline2); }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-lg);
  background: var(--soft2);
  margin-bottom: 8px;
}

.user-avatar {
  width: 34px; height: 34px;
  background: var(--panel);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; color: var(--off-white);
  flex-shrink: 0;
}

.user-info-name { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.2; }
.user-info-role { font-size: 11.5px; color: var(--text3); text-transform: capitalize; margin-top: 2px; }

/* ── Main Content ─────────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: rgba(7,11,20,0.72);
  border-bottom: 1px solid var(--hairline);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-title { font-size: 14px; font-weight: 500; color: var(--text); }
.topbar-breadcrumb { font-size: 13px; color: var(--text3); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-tagline { font-family: var(--font-brand); font-weight: 700; font-size: 12px; letter-spacing: .02em; color: var(--gold); white-space: nowrap; }
.topbar-avatar { display: block; border-radius: 50%; border: 2px solid var(--gold); padding: 1px; }
.topbar-avatar:hover { border-color: var(--gold-light); }
#theme-toggle { border: none; font-family: inherit; }
@media (max-width: 820px) { .topbar-tagline { display: none; } }
.topbar-right .mono { padding: 4px 10px; border-radius: var(--r-pill); background: var(--soft); line-height: 1.4; }

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text3);
  width: 220px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.topbar-search:hover { background: var(--soft2); color: var(--text2); }

.topbar-action {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  color: var(--text2);
}
.topbar-action:hover { background: var(--soft2); color: var(--text); }

.content { padding: 24px 28px 40px; flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; }

/* ── Hero (page opener) ──────────────────────────────────────────
   No banner, no gradient: a large tight-tracked title on the canvas
   with the page's actions beneath it, closed by a hairline. */
.hero-banner {
  position: relative;
  margin-bottom: 24px;
  height: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
.hero-banner img, .hero-banner-overlay { display: none; }
.hero-content { position: relative; padding: 4px 0 20px; border-bottom: 1px solid var(--hairline); }
.hero-title {
  font-family: var(--font-ui);
  font-size: 30px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.75px;
  line-height: 1.2;
  margin-bottom: 4px;
}
.hero-sub { font-size: 14px; color: var(--text2); max-width: 720px; }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 18px 20px 20px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label icon" "value icon" "sub icon";
  column-gap: 12px;
  align-items: start;
  color: inherit;
  transition: border-color 0.15s;
}
a.stat-card:hover { border-color: var(--hairline2); color: inherit; }

.stat-icon {
  grid-area: icon;
  width: 32px; height: 32px;
  border-radius: var(--r-nested);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  margin: 0;
  background: var(--soft);
}
.stat-icon.blue   { background: rgba(227,184,74,0.12); }
.stat-icon.green  { background: rgba(79,169,127,0.14); }
.stat-icon.yellow { background: rgba(201,160,58,0.14); }
.stat-icon.purple { background: rgba(110,127,168,0.18); }
.stat-icon.red    { background: rgba(196,100,92,0.14); }
.stat-icon.cyan   { background: rgba(90,140,168,0.18); }

.stat-label {
  grid-area: label;
  align-self: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 12px;
  line-height: 1.33;
}
.stat-value {
  grid-area: value;
  font-size: 30px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.75px;
  font-variant-numeric: tabular-nums;
}
.stat-sub { grid-area: sub; font-size: 12px; color: var(--text3); margin-top: 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.stat-trend-up   { color: var(--green); }
.stat-trend-down { color: var(--red); }
.stat-card-glow { display: none; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
}
.card-urgent { border-color: rgba(196,100,92,0.45); background: rgba(196,100,92,0.04); }

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-bottom: 14px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-heading { font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: -0.2px; }

/* Anything boxed inside a card takes the nested corner. */
.card .table-wrap, .card .card, .card .alert { border-radius: var(--r-nested); box-shadow: none; }
.card > .table th:first-child, .card > .table td:first-child { padding-left: 0; }
.card > .table th:last-child,  .card > .table td:last-child  { padding-right: 0; }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  overflow-x: auto;   /* wide tables scroll inside the card instead of crushing columns */
}

.table-toolbar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table { width: 100%; border-collapse: collapse; }
/* A table inside a card (no .table-wrap) scrolls sideways on phones instead of widening the page. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table th {
  background: transparent;
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
  font-size: 14px;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(147,162,186,0.03); }
/* Names, numbers, IDs and small metadata never wrap mid-word; the wrap scrolls instead. */
.table td.mono, .table td > .mono, .table td.text-xs, .table .lead-cell, .table .btn, .table .status-form { white-space: nowrap; }
.table .lead-cell .text-xs { white-space: normal; }
.status-form select.form-input { min-width: 150px; }
.status-form input.form-input { min-width: 170px; }

.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
}

/* ── Lead Name with Avatar ───────────────────────────────────── */
.lead-cell { display: flex; align-items: center; gap: 10px; }
.lead-initials {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--off-white);
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--soft);
  color: var(--text2);
  border: 1px solid transparent;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.7; flex-shrink: 0; }

.badge-new             { background: rgba(100,116,139,0.14); color: #94a3b8; }
.badge-contacted       { background: rgba(227,184,74,0.12);  color: var(--gold-light); }
.badge-interested      { background: rgba(16,185,129,0.12);  color: #34d399; }
.badge-not_interested  { background: rgba(239,68,68,0.12);   color: #f87171; }
.badge-callback        { background: rgba(245,158,11,0.12);  color: #fbbf24; }
.badge-closed_won,
.badge-closed          { background: rgba(16,185,129,0.18);  color: #10b981; }
.badge-closed_lost     { background: rgba(239,68,68,0.18);   color: #ef4444; }
.badge-dnc             { background: rgba(110,127,168,0.16); color: #a78bfa; }
.badge-admin           { background: rgba(239,68,68,0.12);   color: #f87171; }
.badge-manager         { background: rgba(245,158,11,0.12);  color: #fbbf24; }
.badge-agent           { background: rgba(227,184,74,0.12);  color: var(--gold-light); }
.badge-staff           { background: rgba(90,140,168,0.16);  color: #8FB8D0; }
.badge-client          { background: rgba(110,127,168,0.16); color: #A9B6D6; }
.badge-active          { background: rgba(16,185,129,0.12);  color: #34d399; }
.badge-inactive        { background: rgba(100,116,139,0.10); color: #64748b; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid var(--btn-gold-line);
  background: var(--btn-gold-fill);
  color: var(--btn-gold-ink);
  transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s;
  text-decoration: none !important;
  white-space: nowrap;
  letter-spacing: -0.1px;
}
.btn:hover { background: var(--btn-gold-fill2); border-color: var(--btn-gold-line2); color: var(--btn-gold-ink); }
.btn:active { filter: brightness(0.94); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Every button is gold (Yassin, 14 Oct 2026: the grey ones "blended into the background").
   Primary = solid gold; secondary and ghost = gold tint with a gold hairline. Danger and
   success keep their own colours so a destructive action never looks like the rest. */
:root {
  --btn-gold-fill:  rgba(227,184,74,0.16);
  --btn-gold-fill2: rgba(227,184,74,0.28);
  --btn-gold-line:  rgba(227,184,74,0.45);
  --btn-gold-line2: rgba(246,214,135,0.70);
  --btn-gold-ink:   var(--gold-light);
}
html.light {
  --btn-gold-fill:  rgba(227,184,74,0.22);
  --btn-gold-fill2: rgba(227,184,74,0.36);
  --btn-gold-line:  rgba(201,160,58,0.55);
  --btn-gold-line2: rgba(201,160,58,0.85);
  --btn-gold-ink:   #6B4E07;
}
.btn-primary { background: var(--gold); color: var(--obsidian); font-weight: 600; border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-light); color: var(--obsidian); border-color: var(--gold-light); }
.btn-secondary { background: var(--btn-gold-fill); color: var(--btn-gold-ink); border-color: var(--btn-gold-line); }
.btn-secondary:hover { background: var(--btn-gold-fill2); color: var(--btn-gold-ink); border-color: var(--btn-gold-line2); }
.btn-ghost { background: transparent; color: var(--btn-gold-ink); border-color: var(--btn-gold-line); }
.btn-ghost:hover { background: var(--btn-gold-fill); color: var(--btn-gold-ink); border-color: var(--btn-gold-line2); }
.btn-success { background: var(--green); color: var(--obsidian); font-weight: 600; }
.btn-success:hover { background: #63BA92; color: var(--obsidian); }
.btn-danger { background: var(--red); color: var(--off-white); }
.btn-danger:hover { background: #D07870; color: var(--off-white); }
.btn-warning { background: rgba(201,160,58,0.14); color: var(--gold-light); border-color: rgba(227,184,74,0.28); }
.btn-warning:hover { background: rgba(201,160,58,0.22); color: var(--gold-light); }
.btn-lg { min-height: 42px; padding: 0 20px; font-size: 15px; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-xs { min-height: 28px; padding: 0 10px; font-size: 12px; }
.btn.w-full { width: 100%; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.form-group { margin-bottom: 16px; }

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
}

.form-input,
input.form-input,
select.form-input,
textarea.form-input {
  width: 100%;
  min-height: 36px;
  background: var(--soft);
  border: 1px solid transparent;
  color: var(--text);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.form-input:hover { background: rgba(147,162,186,0.11); }
.form-input:focus {
  background: var(--soft);
  border-color: rgba(227,184,74,0.55);
  box-shadow: 0 0 0 3px rgba(227,184,74,0.12);
}
.form-input::placeholder { color: var(--text3); }
textarea.form-input { border-radius: var(--r-lg); padding: 10px 14px; min-height: 84px; resize: vertical; }
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2393A2BA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select.form-input option { background: var(--bg4); color: var(--text); }
input[type="file"].form-input { padding: 4px 6px; cursor: pointer; }
input[type="file"].form-input::file-selector-button {
  font: inherit; font-size: 13px; font-weight: 500;
  min-height: 26px; padding: 0 12px; margin-right: 10px;
  border: 0; border-radius: var(--r-pill);
  background: var(--soft2); color: var(--text); cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer; }
input[type="date"].form-input, input[type="datetime-local"].form-input, input[type="time"].form-input { font-family: var(--font-mono); font-size: 13px; }

.form-help  { font-size: 12.5px; color: var(--text3); margin-top: 5px; line-height: 1.45; }
.form-error { font-size: 12.5px; color: var(--red); margin-top: 5px; }

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title {
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.6px;
  line-height: 1.25;
}

.page-sub { font-size: 14px; color: var(--text2); margin-top: 4px; max-width: 900px; }

/* ── Filter Bar ──────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
  background: var(--bg3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: 12px 14px;
}
.filter-bar .form-input { width: auto; min-width: 140px; }
.filter-bar .form-label { margin-bottom: 4px; font-size: 12px; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-lg);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  border: 1px solid transparent;
}
.alert-success { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.22); color: #34d399; }
.alert-error   { background: rgba(239,68,68,0.08);  border-color: rgba(239,68,68,0.22);  color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.22); color: #fbbf24; }

/* ── Login Page ──────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; background: var(--bg); }

.login-visual {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  /* The one gradient kept: the brand's own Obsidian → Steel Navy. */
  background: linear-gradient(135deg, var(--obsidian) 0%, #0E1626 60%, #182538 100%);
}
.login-visual img, .login-visual-overlay { display: none; }

.login-visual-content { position: relative; z-index: 2; padding: 56px; color: var(--off-white); max-width: 620px; }

.login-visual-title {
  font-family: var(--font-ui);
  font-size: 38px;
  font-weight: 600;
  line-height: 1.12;
  margin-bottom: 14px;
  letter-spacing: -1.2px;
}

.login-visual-sub { font-size: 16px; color: var(--slate); max-width: 400px; line-height: 1.5; }

.login-features { display: flex; flex-direction: column; gap: 8px; margin-top: 32px; }
.login-feature {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.02);
}
.login-feature-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-nested);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  background: var(--soft);
  flex-shrink: 0;
}
.login-feature-text { font-size: 13.5px; color: var(--slate); line-height: 1.4; }
.login-feature-text strong { color: var(--off-white); font-weight: 500; display: block; margin-bottom: 1px; }

.login-panel {
  width: 480px;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  border-left: 1px solid var(--hairline);
}

.login-box { width: 100%; max-width: 360px; }

.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.login-logo .brand-icon { width: 48px; height: 48px; flex: 0 0 48px; }
.login-logo .brand-name { font-size: 18px; letter-spacing: 2px; }
.login-logo .brand-sub { font-size: 9px; letter-spacing: 1.6px; padding-left: 0; }

.login-heading { font-family: var(--font-ui); font-size: 24px; font-weight: 600; color: var(--text); margin-bottom: 4px; letter-spacing: -0.6px; }
.login-sub { font-size: 14px; color: var(--text2); margin-bottom: 28px; }

/* ── Detail Layout ───────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.detail-item .label { font-size: 12px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.detail-item .value { font-size: 14px; color: var(--text); font-weight: 500; }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 1px; background: var(--hairline2); }

.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot { position: absolute; left: -23px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg3); }
.timeline-time { font-size: 12px; color: var(--text3); font-weight: 500; margin-bottom: 3px; }
.timeline-body { font-size: 14px; color: var(--text); }
.timeline-note { font-size: 13px; color: var(--text2); margin-top: 6px; padding: 8px 12px; background: var(--soft); border-radius: var(--r-nested); }

/* ── Agent Profile Card ──────────────────────────────────────── */
.agent-profile-card {
  background: var(--bg3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 24px;
}
.agent-cover, .agent-cover img, .agent-cover-overlay { display: none; }
.agent-profile-body { padding: 20px 24px 22px; }
.agent-avatar-wrap { margin: 0 0 14px; }
.agent-avatar-lg {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--panel);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600; color: var(--off-white);
  border: 0;
  box-shadow: 0 0 0 1px var(--hairline2);
}

/* ── Performance bars ────────────────────────────────────────── */
.perf-bar { margin-bottom: 12px; }
.perf-bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.perf-bar-label span:first-child { color: var(--text2); font-weight: 500; }
.perf-bar-label span:last-child  { color: var(--text3); font-weight: 500; }
.perf-bar-track { height: 6px; background: var(--soft); border-radius: var(--r-pill); overflow: hidden; }
.perf-bar-fill  { height: 100%; border-radius: var(--r-pill); transition: width 0.6s ease; background: var(--slate); }
.perf-bar-fill.green  { background: var(--green); }
.perf-bar-fill.red    { background: var(--red); }
.perf-bar-fill.yellow { background: var(--gold); }
.perf-bar-fill.blue   { background: var(--iron); }
.perf-bar-fill.purple { background: var(--purple); }

/* ── Grid Layout Helpers ─────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-3-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
/* Grid items may shrink below their content (a card holding a wide table scrolls instead of widening the page). */
.grid-2 > *, .grid-3 > *, .grid-3-1 > *, .grid-1-2 > *, .stats-grid > * { min-width: 0; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text3); }
.empty-state-icon {
  width: 48px; height: 48px;
  border-radius: var(--r-lg);
  background: var(--soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin: 0 auto 14px;
}
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text2); margin-bottom: 4px; letter-spacing: -0.2px; }
.empty-state-sub   { font-size: 13.5px; line-height: 1.5; max-width: 320px; margin: 0 auto; }

/* ── Divider / Separator ─────────────────────────────────────── */
.divider { height: 1px; background: var(--hairline); margin: 16px 0; }

/* ── Utils ───────────────────────────────────────────────────── */
.text-muted    { color: var(--text3); }
.text-secondary{ color: var(--text2); }
.text-green    { color: var(--green); }
.text-red      { color: var(--red); }
.text-yellow   { color: var(--yellow); }
.text-accent   { color: var(--accent); }
.text-purple   { color: var(--purple); }
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between{ justify-content: space-between; }
.justify-end   { justify-content: flex-end; }
.gap-8         { gap: 8px; }
.gap-12        { gap: 12px; }
.gap-16        { gap: 16px; }
.gap-20        { gap: 20px; }
.mt-4          { margin-top: 4px; }
.mt-8          { margin-top: 8px; }
.mt-12         { margin-top: 12px; }
.mt-16         { margin-top: 16px; }
.mt-24         { margin-top: 24px; }
.mb-4          { margin-bottom: 4px; }
.mb-8          { margin-bottom: 8px; }
.mb-12         { margin-bottom: 12px; }
.mb-16         { margin-bottom: 16px; }
.mb-24         { margin-bottom: 24px; }
.font-bold     { font-weight: 600; }
.font-semibold { font-weight: 600; }
.font-medium   { font-weight: 500; }
.text-sm       { font-size: 13px; }
.text-xs       { font-size: 12px; }
.rounded       { border-radius: var(--radius); }
.rounded-lg    { border-radius: var(--radius-lg); }
.w-full        { width: 100%; }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Alpha LLC wordmark ──────────────────────────────────────────
   Lockup composition, per brand: ALPHA in off-white, LLC in Signal
   Gold, tagline beneath in small letterspaced uppercase. The tagline
   is never rewritten, shortened, or translated, so it is sized to fit
   the sidebar as written. */
.sidebar .brand-sub { font-size: 7.5px; letter-spacing: 0.4px; white-space: nowrap; }

/* ── Mobile (phones + small tablets) ─────────────────────────────────
   The sidebar becomes a slide-in drawer behind a hamburger button; tables
   scroll sideways instead of crushing; grids stack. Nothing changes ≥901px. */
.menu-btn { display: none; }

@media (max-width: 900px) {
  .menu-btn {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--soft); border: 0;
    color: var(--off-white); font-size: 18px; cursor: pointer; flex: 0 0 38px;
  }
  .sidebar {
    transform: translateX(-105%); transition: transform .22s ease;
    width: 82%; max-width: 300px; z-index: 300;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  .nav-scrim {
    display: none; position: fixed; inset: 0; z-index: 250;
    background: rgba(0,0,0,.55);
  }
  body.nav-open .nav-scrim { display: block; }

  .main { margin-left: 0; }
  .topbar { padding: 8px 14px; gap: 10px; height: auto; min-height: 52px; }
  .topbar-right .mono:first-child { display: none; }
  .content { padding: 16px 14px 48px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 26px; }
  .grid-2, .grid-3, .grid-1-2, .grid-3-1, .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header .flex { flex-wrap: wrap; }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar .form-input { min-width: 0 !important; flex: 1 1 140px; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 640px; }
  .table-scroll .table { min-width: 560px; }

  .hero-title { font-size: 24px; }
  .login-visual { display: none; }          /* phone shows the sign-in card only */
  .login-panel { width: 100%; padding: 32px 22px; border-left: 0; }
  .portal { padding: 0 14px 40px; }
  .portal-top { flex-wrap: wrap; gap: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .outcome-grid { grid-template-columns: 1fr !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}


/* ── Light mode (Yassin, 24 Sep 2026) ────────────────────────────────
   The same brand palette on paper: the variables flip, nothing else. */
html.light {
  color-scheme: light;
  --obsidian:   #F5F7FB;
  --graphite:   #FFFFFF;
  --steel-navy: #E4E9F2;
  --iron:       #7B879C;
  --off-white:  #101828;
  --slate:      #5B6880;
  --bg:         #F5F7FB;
  --bg2:        #EEF1F6;
  --bg3:        #FFFFFF;
  --bg4:        #E9EDF4;
  --panel:      #E4E9F2;
  --sidebar:    #FFFFFF;
  --hairline:   rgba(16,24,40,0.10);
  --hairline2:  rgba(16,24,40,0.18);
  --soft:       rgba(16,24,40,0.05);
  --soft2:      rgba(16,24,40,0.09);
  --accent3:    #B8901F;
  --text:       #101828;
  --text2:      #5B6880;
  --text3:      #7B879C;
  --shadow-card: 0 1px 2px rgba(16,24,40,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
  --shadow:      0 12px 40px rgba(16,24,40,0.14);
}
html.light a:hover { color: var(--accent3); }
html.light .user-avatar, html.light .lead-initials { color: #101828; }
html.light .btn-primary { color: #101828; }
html.light ::selection { background: rgba(227,184,74,0.35); }
html.light * { scrollbar-color: rgba(16,24,40,0.22) transparent; }
html.light ::-webkit-scrollbar-thumb { background: rgba(16,24,40,0.22); }


/* ── Booking Board (24 Sep 2026) ─────────────────────────────────────
   Ported from the claude.ai "ALPHA Booking Board" onto the CRM palette. */
:root {
  --st-closed: #4FA97F; --st-ran: #5A8CA8; --st-up: #4F7FD1; --st-up-soft: rgba(79,127,209,0.18);
  --st-wait: #6B778C; --st-noshow: #C9A03A; --st-bad: #C4645C;
  --bb-good-ink: #6FCF97; --bb-good-bg: rgba(79,169,127,0.16);
  --bb-warn-ink: #E3B84A; --bb-warn-bg: rgba(201,160,58,0.16);
  --bb-bad-ink: #E08A84;  --bb-bad-bg: rgba(196,100,92,0.18);
  --bb-info-ink: #8FB3FF; --bb-info-bg: rgba(79,127,209,0.16);
}
html.light {
  --bb-good-ink: #0B6B2E; --bb-warn-ink: #865400; --bb-bad-ink: #A8262A; --bb-info-ink: #1B3A8F;
}
.st-closed { background: var(--st-closed); } .st-ran { background: var(--st-ran); } .st-up { background: var(--st-up); }
.st-wait { background: var(--st-wait); } .st-noshow { background: var(--st-noshow); } .st-bad { background: var(--st-bad); }

.bb-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text2); padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg3); }
.bb-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text3); flex: none; }
.bb-status.live .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(79,169,127,0.22); }
.bb-status.stale .dot { background: var(--yellow); }

.bb-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.bb-lbl { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text3); margin-right: 4px; }
.bb-chipbtn { font-size: 13px; font-weight: 500; color: var(--text2); background: var(--bg3); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; text-decoration: none; }
.bb-chipbtn:hover { border-color: var(--border2); color: var(--text); }
.bb-chipbtn.on { background: var(--text); color: var(--bg); border-color: var(--text); }

.bb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; margin-bottom: 24px; }
.bb-kpi { background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 13px; display: flex; flex-direction: column; gap: 7px; min-width: 0; box-shadow: var(--shadow-card); }
.bb-kpi-label { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text2); }
.bb-kpi-value { font-size: 36px; font-weight: 600; line-height: 1; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bb-kpi-value small { font-size: 15px; font-weight: 500; color: var(--text3); }
.bb-kpi-sub { font-size: 12.5px; color: var(--text2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.bb-meter { height: 6px; border-radius: 0 3px 3px 0; background: var(--st-up-soft); overflow: hidden; }
.bb-meter i { display: block; height: 100%; background: var(--st-up); border-radius: 0 3px 3px 0; }

.bb-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text2); }
.bb-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.bb-h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text2); }

.bb-client { display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) minmax(236px, 276px); gap: 8px 22px; align-items: center; padding: 15px 0; border-top: 1px solid var(--border); }
.bb-client-name { font-size: 17px; font-weight: 600; line-height: 1.15; }
.bb-client-meta { font-size: 12px; color: var(--text3); margin-top: 2px; }
.bb-bar { display: flex; gap: 2px; height: 14px; border-radius: 0 4px 4px 0; }
.bb-bar i { display: block; height: 100%; min-width: 3px; flex: none; }
.bb-bar i:last-child { border-radius: 0 4px 4px 0; }
.bb-counts { display: flex; flex-wrap: wrap; gap: 3px 13px; margin-top: 8px; font-size: 12.5px; color: var(--text2); font-variant-numeric: tabular-nums; }
.bb-counts b { font-weight: 600; color: var(--text); margin-right: 3px; }
.bb-client-stats { display: grid; grid-template-columns: auto auto auto; gap: 4px 18px; justify-content: start; }
.bb-stat .k { display: block; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text3); white-space: nowrap; }
.bb-stat .v { font-weight: 600; font-size: 20px; line-height: 1.2; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.bb-stat .v small { font-size: 13px; color: var(--text3); font-weight: 500; }
.bb-stat .bb-meter { margin-top: 4px; width: 78px; }
.bb-client-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; color: var(--text3); }
.bb-client-foot a { font-weight: 600; text-decoration: none; }
.bb-edit summary { list-style: none; cursor: pointer; display: inline-block; }
.bb-edit summary::-webkit-details-marker { display: none; }
.bb-iconbtn { color: var(--gold); font-size: 13px; padding: 0 4px; border-radius: 5px; }
.bb-iconbtn:hover { background: var(--soft); }
.bb-tgt { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-weight: 400; }
.bb-tgt input { width: 70px; padding: 4px 6px; border: 1px solid var(--border2); border-radius: 6px; background: var(--bg4); color: var(--text); font-size: 13px; font-family: inherit; }

.bb-split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px 28px; margin-top: 16px; padding-top: 18px; border-top: 1px solid var(--border); }
.bb-day-h { font-size: 12px; font-weight: 600; color: var(--text3); margin: 14px 0 4px; padding-left: 10px; }
.bb-appt { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: inherit; border: 1px solid transparent; }
.bb-appt:hover { background: var(--soft); border-color: var(--border); color: inherit; }
.bb-appt .t { font-weight: 600; font-size: 16px; line-height: 1.2; white-space: nowrap; }
.bb-appt .z { font-family: var(--font-mono); font-size: 11px; color: var(--text3); margin-left: 4px; }
.bb-appt .cairo { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--text3); }
.bb-appt .who { font-weight: 600; line-height: 1.3; }
.bb-appt .meta { font-size: 12.5px; color: var(--text2); }
.bb-appt .when { font-size: 12px; color: var(--text3); }
.bb-flags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 210px; }
.bb-empty { padding: 12px 10px; color: var(--text3); font-size: 13.5px; }
.bb-watch { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bb-watch li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 9px; padding: 10px 12px; border-radius: 9px; background: var(--soft); font-size: 13.5px; }
.bb-watch .ic { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--text3); }
.bb-watch li.warn .ic { background: var(--bb-warn-ink); } .bb-watch li.bad .ic { background: var(--bb-bad-ink); }
.bb-watch li.good .ic { background: var(--bb-good-ink); } .bb-watch li.info .ic { background: var(--bb-info-ink); }
.bb-watch .t { font-weight: 600; line-height: 1.3; }
.bb-watch .d { display: block; color: var(--text2); font-size: 12.5px; margin-top: 2px; }

.bb-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; line-height: 1; padding: 4px 7px; border-radius: 999px; white-space: nowrap; }
.bb-chip.bad { color: var(--bb-bad-ink); background: var(--bb-bad-bg); }
.bb-chip.warn { color: var(--bb-warn-ink); background: var(--bb-warn-bg); }
.bb-chip.good { color: var(--bb-good-ink); background: var(--bb-good-bg); }
.bb-chip.info { color: var(--bb-info-ink); background: var(--bb-info-bg); }
.bb-chip.mute { color: var(--text2); background: var(--soft); box-shadow: inset 0 0 0 1px var(--border); }
.bb-sample { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--purple); border: 1px dotted var(--purple); border-radius: 4px; padding: 2px 5px 1px; line-height: 1.2; vertical-align: 2px; }

.bb-seg { display: inline-flex; border: 1px solid var(--border2); border-radius: 9px; padding: 2px; background: var(--bg4); }
.bb-seg a { color: var(--text2); font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 7px; text-decoration: none; }
.bb-seg a.on { background: var(--bg3); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.bb-st { min-width: 900px; }
.bb-st .num { text-align: right; font-variant-numeric: tabular-nums; }
.bb-st td:first-child { min-width: 160px; }
.bb-st tr.quiet td { color: var(--text3); }
.bb-sname { font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.bb-posted { display: flex; align-items: center; gap: 10px; }
.bb-posted .pv { font-weight: 600; font-size: 20px; min-width: 2.2ch; text-align: right; font-variant-numeric: tabular-nums; }
.bb-pbar { position: relative; width: 110px; height: 8px; background: var(--st-up-soft); border-radius: 0 4px 4px 0; flex: none; }
.bb-pbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--st-up); border-radius: 0 4px 4px 0; }
.bb-pbar b { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--text2); opacity: .6; }
.bb-mini { display: flex; gap: 2px; height: 8px; width: 140px; }
.bb-mini i { display: block; height: 100%; flex: none; min-width: 2px; }
.bb-mini i:last-child { border-radius: 0 3px 3px 0; }
.bb-st .hv { font-weight: 600; font-size: 17px; }

.bb-task-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.bb-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bb-task { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--border); }
.bb-task:first-child { border-top: 0; }
.bb-task a { color: var(--text); font-weight: 600; text-decoration: none; }
.bb-task a:hover { text-decoration: underline; }
.bb-task .tm { font-size: 12.5px; color: var(--text3); margin-top: 2px; }
.bb-task .tf { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.bb-notes { margin-top: 18px; color: var(--text2); font-size: 12.5px; display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 8px 26px; }
.bb-notes p { margin: 0; max-width: 62ch; }
.bb-notes b { color: var(--text); font-weight: 600; }

@media (max-width: 980px) { .bb-split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 800px) { .bb-client { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 540px) {
  .bb-appt { grid-template-columns: 86px minmax(0, 1fr); }
  .bb-flags { grid-column: 2; justify-content: flex-start; max-width: none; }
  .bb-kpi-value { font-size: 30px; }
  .bb-task { grid-template-columns: minmax(0, 1fr); }
  .bb-task .tf { justify-content: flex-start; }
}


/* ── Client portal (27 Sep 2026) ─────────────────────────────────────
   Shell moved out of client_base.html, the Board tab (.cb-*) and the
   Zillow-style card detail page (.cd-*). Tokens only below this line:
   the four --cb-ov-* values are the ONE documented exception - inks
   painted over a photograph must not follow the surface palette. */
:root { --gold-soft: rgba(227,184,74,0.08); --cb-ov-ink: #F2F5FA; --cb-ov-ink2: rgba(242,245,250,0.72); --cb-ov-cap: rgba(7,11,20,0.86); --cb-ov-chip: rgba(7,11,20,0.55); }

/* ── Client portal shell (moved from client_base.html 27 Sep 2026) ── */
.portal { max-width: 1240px; margin: 0 auto; padding: 0 28px 56px; }
.portal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 0 20px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.portal-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.portal-brand:hover { color: inherit; }
.portal-brand img { width: 42px; height: 42px; display: block; }
.portal-wordmark { font-family: var(--font-brand); font-weight: 800; font-size: 17px; letter-spacing: 1.6px; color: var(--text); }
.portal-wordmark .llc { color: var(--gold); }
.portal-tag { font-size: 8px; letter-spacing: 0.9px; text-transform: uppercase; color: var(--text3); margin-top: 3px; }
.portal-who { text-align: right; }
.portal-company { font-family: var(--font-brand); font-weight: 700; font-size: 14px; color: var(--text); }
.portal-meta { font-size: 11.5px; color: var(--text3); margin-top: 3px; }
.portal-tabs { display: flex; gap: 8px; margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.portal-tabs::-webkit-scrollbar { display: none; }
.portal-tab { flex: none; padding: 7px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; border: 1px solid var(--border2); color: var(--text2); background: var(--bg3); text-decoration: none; white-space: nowrap; }
.portal-tab:hover { color: var(--text); border-color: var(--text3); }
.portal-tab.active { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.portal-tab .n { margin-left: 6px; font: 600 11px var(--font-mono); color: var(--text2); }
.portal-tab.active .n { color: var(--gold); }
.freshness { font-size: 11.5px; color: var(--text3); }
.freshness .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: middle; }
.freshness.stale .dot { background: var(--yellow); }
.logout-btn { background: none; border: 1px solid var(--border2); color: var(--text2); border-radius: var(--r-pill); padding: 5px 12px; font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; margin-top: 8px; }
.logout-btn:hover { color: var(--text); border-color: var(--text3); }
.portal-foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; color: var(--text3); }
.portal .table-wrap thead th { position: sticky; top: 0; z-index: 1; background: var(--bg3); }
.portal .cell-actions { white-space: nowrap; }
.portal .cell-actions .btn { vertical-align: middle; }
@media (max-width: 640px) {
  .portal { padding: 0 16px 40px; }
  .portal-top { flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 0 12px; margin-bottom: 16px; }
  .portal-brand img { width: 36px; height: 36px; }
  .portal-who { flex: 1 1 100%; text-align: left; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
  .portal-who form { flex: 1 1 100%; }
  .logout-btn { margin-top: 2px; }
}

/* ── Client Board (.cb-*) ─────────────────────────────────────────── */
.cb-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; font-size: 12.5px; color: var(--text2); }
.cb-status .cb-live b { color: var(--text); font-weight: 600; }
.cb-status .cb-open { font-weight: 600; }
.cb-hero { margin-bottom: 12px; }
.cb-toolbar { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.cb-toolbar .form-input { font-size: 16px; flex: 1 1 220px; min-width: 0; }
.cb-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
.cb-chips::-webkit-scrollbar { display: none; }
.cb-chips .bb-chipbtn { flex: none; white-space: nowrap; }
.cb-chips .cb-clear { color: var(--gold); border-color: var(--gold); }
.cb-toolbar .bb-seg { flex: none; }
.bb-seg .n, .bb-chipbtn .n { margin-left: 5px; font: 600 11px var(--font-mono); color: var(--text3); }
.bb-chipbtn.on .n { color: var(--bg); }
.cb-switch { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.cb-switch::-webkit-scrollbar { display: none; }
.cb-switch .bb-chipbtn { flex: none; white-space: nowrap; display: inline-flex; align-items: center; }
.cb-switch .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; flex: none; }
.cb-board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding: 4px 0 16px; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.cb-col { position: relative; flex: 0 0 296px; min-width: 0; scroll-snap-align: start; display: flex; flex-direction: column; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg); scroll-margin-top: 64px; }
.cb-anchor { position: absolute; top: -64px; }
.cb-col-h { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--bg2); border-bottom: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.cb-col-h .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cb-col-h h3 { flex: 1; min-width: 0; margin: 0; font: 600 12px/1 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-count { font: 600 12px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); background: var(--soft2); border-radius: var(--r-pill); padding: 4px 8px; }
.cb-arch { font-size: 11px; color: var(--text3); text-decoration: underline dotted; text-underline-offset: 2px; white-space: nowrap; }
.cb-list { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
.cb-empty { padding: 14px; font-size: 12.5px; color: var(--text3); text-align: center; }
.cb-card { flex: none; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; transition: border-color .15s, transform .15s; scroll-margin: 80px 16px; }
.cb-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.cb-card.attn { box-shadow: inset 3px 0 0 var(--st-noshow), var(--shadow-card); }
.cb-card.archived { opacity: .62; }
.cb-card[hidden] { display: none; }
.cb-card.flash { animation: cb-flash 1.8s ease-out; }
@keyframes cb-flash { 0% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: var(--shadow-card); } }
.cb-link { display: block; color: inherit; text-decoration: none; }
.cb-link:hover { color: inherit; }
.cb-strip { height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; font: 600 11px/1 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--cb-ov-ink); }
.cb-strip .cb-roof { opacity: .55; flex: none; }
.cb-media { position: relative; aspect-ratio: 2 / 1; background: linear-gradient(160deg, var(--panel), var(--bg4)); overflow: hidden; }
.cb-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.9); }
.cb-media .cb-ini { position: absolute; left: 16px; top: 14px; font: 600 22px/1 var(--font-ui); color: var(--text2); }
.cb-media .cb-roof { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--gold); opacity: .22; }
.cb-pin { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid var(--gold); box-shadow: 0 0 0 1px var(--bg); }
.cb-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; background: linear-gradient(180deg, transparent, var(--cb-ov-cap)); }
.cb-cap b { display: block; font: 600 15px/1.2 var(--font-ui); color: var(--cb-ov-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-cap span { font-size: 12px; color: var(--cb-ov-ink2); }
.cb-media.ph .cb-cap { background: linear-gradient(180deg, transparent, var(--bg3)); }
.cb-media.ph .cb-cap b { color: var(--text); } .cb-media.ph .cb-cap span { color: var(--text2); }
.cb-chip { position: absolute; top: 10px; padding: 5px 8px; border-radius: var(--r-pill); font: 600 10.5px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; background: var(--cb-ov-chip); backdrop-filter: blur(6px); color: var(--cb-ov-ink); white-space: nowrap; }
.cb-chip.l { left: 10px; } .cb-chip.r { right: 10px; }
.cb-chip.info { color: var(--bb-info-ink); } .cb-chip.warn { color: var(--bb-warn-ink); } .cb-chip.bad { color: var(--bb-bad-ink); }
.cb-body { padding: 11px 12px 12px; display: grid; gap: 6px; }
.cb-when { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.cb-when .t { font: 600 20px/1.1 var(--font-ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.cb-when .z { font: 500 11px var(--font-mono); color: var(--text3); }
.cb-when .rel { font-size: 12px; font-weight: 600; color: var(--text2); }
.cb-when .rel.today { color: var(--gold); }
.cb-when.raw { font: 500 12px var(--font-mono); color: var(--text2); overflow-wrap: anywhere; }
.cb-who { display: flex; align-items: center; gap: 8px; font: 600 15px/1.3 var(--font-ui); min-width: 0; }
.cb-who .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-tag { padding: 3px 8px; border-radius: var(--r-pill); font: 500 11.5px/1 var(--font-ui); white-space: nowrap; flex: none; }
.cb-tag.ok { background: var(--bb-good-bg); color: var(--bb-good-ink); } .cb-tag.warn { background: var(--bb-warn-bg); color: var(--bb-warn-ink); } .cb-tag.bad { background: var(--bb-bad-bg); color: var(--bb-bad-ink); }
.cb-addr { font-size: 13px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-facts { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.cb-fact { padding: 3px 8px; border-radius: var(--r-pill); background: var(--soft); color: var(--text2); }
.cb-fact.ok { background: var(--bb-good-bg); color: var(--bb-good-ink); } .cb-fact.warn { background: var(--bb-warn-bg); color: var(--bb-warn-ink); }
.cb-fact.mute { color: var(--text3); box-shadow: inset 0 0 0 1px var(--border); background: transparent; }
.cb-attn { display: inline-flex; align-self: flex-start; padding: 4px 8px; border-radius: var(--r-pill); font: 600 11.5px/1 var(--font-ui); background: var(--bb-warn-bg); color: var(--bb-warn-ink); }
.cb-attn.bad { background: var(--bb-bad-bg); color: var(--bb-bad-ink); }
.cb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 12px 0; border-top: 1px solid var(--border); }
.cb-actions .cb-act, .cb-actions .btn { min-height: 44px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.cb-act .ic { width: 16px; height: 16px; flex: none; }
.cb-act-cell { display: flex; min-width: 0; }
.cb-act-cell .text-muted { flex: 1; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text3); border: 1px dashed var(--border); border-radius: var(--r-pill); }
.cb-foot { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--text3); padding: 8px 12px 12px; }
.cb-foot .idle.warn { color: var(--yellow); } .cb-foot .idle.bad { color: var(--red); }
.cb-upnext { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 18px; margin-bottom: 12px; text-decoration: none; color: inherit; }
.cb-upnext:hover { color: inherit; border-color: var(--border2); }
.cb-upnext-when { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.cb-upnext-when .lbl { width: 100%; font: 600 10.5px/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.cb-upnext .t { font: 600 22px/1 var(--font-ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cb-upnext .t.raw { font: 500 13px var(--font-mono); }
.cb-upnext .z { font: 500 11px var(--font-mono); color: var(--text3); }
.cb-upnext .rel { font-size: 12px; font-weight: 600; color: var(--text2); } .cb-upnext .rel.today { color: var(--gold); }
.cb-upnext-who { min-width: 0; }
.cb-upnext .who { font-weight: 600; font-size: 15px; line-height: 1.3; }
.cb-upnext .meta { font-size: 12.5px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-upnext-go { font-size: 18px; color: var(--text3); }
.cb-footer { margin-top: 16px; font-size: 11.5px; color: var(--text3); display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; }
.cb-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.cb-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 0; }
.cb-attrib { flex-basis: 100%; }
@media (min-width: 900px) { .cb-col { max-height: calc(100vh - 220px); } .cb-list { overflow-y: auto; } }
@media (max-width: 900px) {
  .cb-board { margin: 0 -16px; padding: 4px 16px 16px; scroll-padding-inline: 16px; gap: 10px; }
  .cb-col { flex-basis: 86vw; max-width: 340px; }
  .cb-toolbar { top: 0; }
  .cb-chips { flex-basis: 100%; }
  .cb-upnext { grid-template-columns: minmax(0, 1fr) auto; }
  .cb-upnext-when { grid-column: 1 / -1; }
}
@media (hover: none) { .cb-card:hover { transform: none; border-color: var(--border); } }
@media (prefers-reduced-motion: reduce) { .cb-card { transition: none; } .cb-card.flash { animation: none; } }

/* ── Card detail page (.cd-*) - "like Zillow" (27 Sep 2026) ───────── */
.cd { max-width: 980px; margin: 0 auto; }
.cd-back { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 4px; }
.cd-back:hover { color: var(--text); }
.cd-hero { position: relative; aspect-ratio: 16 / 9; max-height: 460px; border-radius: var(--r-card); overflow: hidden; background: linear-gradient(160deg, var(--panel), var(--bg4)); border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.cd-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.9); }
.cd-hero .cd-ini { position: absolute; left: 22px; top: 18px; font: 600 34px/1 var(--font-ui); color: var(--text2); }
.cd-hero .cd-roof { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--gold); opacity: .22; }
.cd-hero .cd-pin { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid var(--gold); box-shadow: 0 0 0 2px var(--bg); }
.cd-hero .cb-chip { top: 14px; } .cd-hero .cb-chip.l { left: 14px; } .cd-hero .cb-chip.r { right: 14px; }
.cd-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 44px 18px 16px; background: linear-gradient(180deg, transparent, var(--cb-ov-cap)); }
.cd-cap b { display: block; font: 600 22px/1.2 var(--font-ui); letter-spacing: -.02em; color: var(--cb-ov-ink); }
.cd-cap span { font-size: 13.5px; color: var(--cb-ov-ink2); }
.cd-hero.ph .cd-cap { background: linear-gradient(180deg, transparent, var(--bg3)); }
.cd-hero.ph .cd-cap b { color: var(--text); } .cd-hero.ph .cd-cap span { color: var(--text2); }
.cd-head { display: grid; gap: 6px; margin: 18px 0 12px; }
.cd-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-title h1 { margin: 0; font: 600 24px/1.15 var(--font-ui); letter-spacing: -.025em; overflow-wrap: anywhere; }
.cd-when .t { font-size: 26px; }
.cd-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text2); }
.cd-list { display: inline-flex; align-items: center; gap: 6px; }
.cd-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 10px; }
.cd-fact { background: var(--bg3); padding: 12px 14px; min-width: 0; }
.cd-fact .k { display: block; font: 600 10.5px/1 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--text3); margin-bottom: 6px; }
.cd-fact .v { display: block; font: 600 15px/1.25 var(--font-ui); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-chips { margin-bottom: 12px; }
.cd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 18px; }
.cd-actions .cb-act, .cd-actions .btn { min-height: 44px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.cd-grid { display: grid; gap: 14px; }
.cd-audio .card-header { margin-bottom: 8px; }
.cd-player { width: 100%; display: block; margin-top: 4px; border-radius: var(--r-pill); }
.cd-dl { margin: 0; }
.cd-dl > div { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.cd-dl > div:first-child { border-top: 0; }
.cd-dl dt { color: var(--text3); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding-top: 3px; }
.cd-dl dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.cd-notes { white-space: pre-line; color: var(--text2); }
.cd-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.cd-tl { list-style: none; margin: 0; padding: 0; }
.cd-tl li { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 2px 10px; padding: 8px 0; }
.cd-tl li::before { content: ''; position: absolute; left: 5px; top: 24px; bottom: -8px; width: 2px; background: var(--border2); }
.cd-tl li:last-child::before { display: none; }
.cd-tl-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gold); background: var(--bg3); margin-top: 4px; }
.cd-tl-label { font-weight: 600; font-size: 13.5px; }
.cd-tl-when { grid-column: 2; font-size: 12px; color: var(--text2); }
.cd-tl-empty { color: var(--text3); font-size: 13px; }
@media (min-width: 720px) {
  .cd-facts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cd-actions { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) { .cd-grid { grid-template-columns: 1fr 1fr; } .cd-audio { grid-column: 1 / -1; } }
