﻿/* ============================================================
   Static Trader - Admin Panel Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #1a2e4a;
  --navy-dark:  #0f1e32;
  --orange:     #C9A84C;
  --gold:       #C9A84C;
  --green:      #16a34a;
  --red:        #dc2626;
  --yellow:     #d97706;
  --text:       #1e293b;
  --text-muted: #64748b;
  --border:     #e2e8f0;
  --bg:         #f8fafc;
  --white:      #ffffff;
  --sidebar-w:  240px;
  --sidebar-cw: 64px;
  --topbar-h:   60px;
  --font:       'Inter', system-ui, sans-serif;
  --radius:     8px;
  --transition: all .15s ease;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,.1);
}

html, body { height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea, button { font-family: var(--font); }

/* ---- Layout ---- */
.admin-layout { display: flex; min-height: 100vh; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.admin-sidebar {
  width: var(--sidebar-w); background: var(--navy-dark);
  display: flex; flex-direction: column; flex-shrink: 0;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  transition: width .22s ease, transform .25s ease;
  overflow-y: auto; overflow-x: hidden;
}
.sidebar-brand {
  padding: 16px 14px; border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.brand-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand-icon { width: 34px; height: 34px; background: var(--orange); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .875rem; color: var(--navy); flex-shrink: 0; }
.brand-name { font-weight: 700; color: #fff; font-size: .9375rem; white-space: nowrap; overflow: hidden; transition: opacity .15s, width .22s; }

/* Collapse toggle button */
.sidebar-collapse-btn {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 6px;
  background: none; border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.4); cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-collapse-btn svg { transition: transform .22s; }

.sidebar-nav { flex: 1; padding: 16px 10px; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sidebar-toggle-all,
.sidebar-arrange-btn {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 6px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.65);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar-toggle-all:hover,
.sidebar-arrange-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: rgba(255,255,255,.22);
}
.sidebar-arrange-done {
  background: rgba(201, 168, 76, .18);
  border-color: rgba(201, 168, 76, .4);
  color: #e8d48a;
}
.sidebar-arrange-done:hover {
  background: rgba(201, 168, 76, .28);
  border-color: rgba(201, 168, 76, .55);
  color: #fff;
}
.sidebar-arrange-hint {
  flex: 1 0 100%;
  margin: 2px 0 0;
  padding: 0 2px;
  font-size: .7rem;
  line-height: 1.35;
  color: rgba(255,255,255,.45);
}
.nav-drag-handle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 22px;
  margin: 0 -2px 0 -4px;
  color: rgba(255,255,255,.35);
  cursor: grab;
  touch-action: none;
}
.nav-drag-handle:active { cursor: grabbing; }
.admin-sidebar.is-arranging .nav-drag-handle { display: inline-flex; }
.admin-sidebar.is-arranging .nav-pin-btn { display: none !important; }
.admin-sidebar.is-arranging .nav-item,
.admin-sidebar.is-arranging .nav-section-toggle { cursor: grab; }
.admin-sidebar.is-arranging .nav-item { user-select: none; }
.admin-sidebar.is-arranging .nav-section.is-dragging,
.admin-sidebar.is-arranging .nav-item.is-dragging { opacity: .45; }
.admin-sidebar.is-arranging .nav-section.is-drag-over {
  outline: 1px dashed rgba(201, 168, 76, .55);
  outline-offset: 2px;
  border-radius: 8px;
}
.admin-sidebar.is-arranging .nav-item.is-drag-over {
  background: rgba(201, 168, 76, .16);
  color: #fff;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.nav-section { margin-bottom: 20px; }
.nav-label {
  font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.35); font-weight: 600; padding: 0 8px; margin-bottom: 6px;
  display: block; white-space: nowrap; overflow: hidden; transition: opacity .15s;
}
.nav-section-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; margin-bottom: 6px; padding: 4px 8px; border: none; border-radius: 6px;
  background: transparent; cursor: pointer; text-align: left;
  transition: background .15s;
}
.nav-section-toggle:hover { background: rgba(255,255,255,.06); }
.nav-section-toggle .nav-label { margin-bottom: 0; pointer-events: none; }
.nav-section-chevron {
  flex-shrink: 0; color: rgba(255,255,255,.35);
  transition: transform .2s ease;
}
.nav-section.is-collapsed .nav-section-chevron { transform: rotate(-90deg); }
.nav-section.is-collapsed .nav-section-body { display: none; }
.nav-section--always-expanded .nav-section-chevron { opacity: .25; transform: none !important; }
.nav-section--always-expanded .nav-section-toggle { cursor: default; }
.nav-section--always-expanded .nav-section-toggle:hover { background: transparent; }
.nav-pin-btn {
  flex-shrink: 0; margin-left: auto; width: 26px; height: 26px; padding: 0;
  border: none; border-radius: 5px; background: transparent;
  color: rgba(255,255,255,.35); cursor: pointer; opacity: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity .15s, background .15s, color .15s;
}
.nav-item:hover .nav-pin-btn,
.nav-pin-btn.is-pinned,
.nav-pin-btn:focus-visible { opacity: 1; }
.nav-pin-btn:hover { background: rgba(255,255,255,.1); color: var(--orange); }
.nav-pin-btn.is-pinned { color: var(--orange); opacity: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 7px; font-size: .875rem; font-weight: 500; color: rgba(255,255,255,.65);
  transition: background .15s, color .15s; margin-bottom: 2px; position: relative;
  white-space: nowrap; overflow: hidden;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(201,168,76,.15); color: var(--orange); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }
.nav-text { flex: 1; min-width: 0; overflow: hidden; transition: opacity .15s; }
.nav-badge { flex-shrink: 0; background: rgba(255,255,255,.15); color: rgba(255,255,255,.8); font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.nav-badge.alert { background: var(--red); color: #fff; }

.sidebar-footer { padding: 14px 10px; border-top: 1px solid rgba(255,255,255,.07); flex-shrink: 0; }
.view-site { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: rgba(255,255,255,.45); transition: color .2s; white-space: nowrap; overflow: hidden; }
.view-site:hover { color: rgba(255,255,255,.8); }

/* â”€â”€ Collapsed sidebar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.admin-sidebar.collapsed { width: var(--sidebar-cw); overflow: visible; }
/* sidebar-nav is scrollable; tooltips are rendered via JS (position:fixed) so overflow doesn't clip them */
.admin-sidebar.collapsed .sidebar-brand { overflow: hidden; padding: 14px 0; justify-content: center; }
.admin-sidebar.collapsed .brand-link { justify-content: center; }
.admin-sidebar.collapsed .brand-name { opacity: 0; width: 0; }
.admin-sidebar.collapsed .sidebar-collapse-btn { margin: 0; }
.admin-sidebar.collapsed .sidebar-nav { padding: 10px 6px; overflow-y: auto; overflow-x: hidden; }
.admin-sidebar.collapsed .nav-section { margin-bottom: 0; }
/* Collapsed sections: no icons in rail mode â€” hide section entirely (no empty divider lines) */
.admin-sidebar.collapsed .nav-section.is-collapsed { display: none; }
.admin-sidebar.collapsed .nav-section:not(.is-collapsed) + .nav-section:not(.is-collapsed) {
  margin-top: 2px;
  padding-top: 2px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.admin-sidebar.collapsed .nav-label { display: none; }
.admin-sidebar.collapsed .nav-section-toggle { display: none !important; }
.admin-sidebar.collapsed .sidebar-nav-actions { display: none; }
.admin-sidebar.collapsed .nav-drag-handle { display: none !important; }
/* Icon-only rows: no flex gap after the icon (hidden label/pin used to reserve width) */
.admin-sidebar.collapsed .nav-item {
  position: relative;
  display: block;
  padding: 6px 0;
  margin-bottom: 0;
  min-height: 36px;
  text-align: center;
}
.admin-sidebar.collapsed .nav-item > svg {
  display: block;
  margin: 0 auto;
}
.admin-sidebar.collapsed .nav-text,
.admin-sidebar.collapsed .nav-pin-btn {
  display: none !important;
}
.admin-sidebar.collapsed .nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  margin: 0;
  font-size: .5rem;
  padding: 0 3px;
  min-width: 12px;
  line-height: 1.2;
  text-align: center;
}
.admin-sidebar.collapsed .sidebar-footer { padding: 14px 8px; }
.admin-sidebar.collapsed .view-site { justify-content: center; gap: 0; }
.admin-sidebar.collapsed .view-site .nav-text { opacity: 0; width: 0; overflow: hidden; }
.admin-sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

/* Tooltip in collapsed mode - rendered via JS fixed-position element (#sidebar-tooltip) */
#sidebar-tooltip {
  position: fixed;
  background: rgba(10,20,40,.96); color: #fff;
  padding: 5px 11px; border-radius: 6px; font-size: .8rem;
  white-space: nowrap; pointer-events: none; z-index: 9999;
  opacity: 0; transition: opacity .12s;
}

/* Main content adjusts width */
.admin-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; transition: margin-left .22s ease; }
.admin-layout.sidebar-collapsed .admin-main { margin-left: var(--sidebar-cw); }
@media (max-width: 900px) { .admin-main { margin-left: 0; } }

/* Mobile sidebar */
@media (max-width: 900px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
}

/* ============================================================
   MAIN AREA
   ============================================================ */
.admin-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
@media (max-width: 900px) { .admin-main { margin-left: 0; } }

.admin-topbar {
  height: var(--topbar-h); background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
}
.sidebar-toggle { display: none; background: none; border: none; color: var(--text); padding: 6px; border-radius: 6px; }
.sidebar-toggle:hover { background: var(--bg); }
@media (max-width: 900px) { .sidebar-toggle { display: flex; } }
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--navy); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.admin-user-name { font-size: .875rem; color: var(--text-muted); }
.btn-logout { font-size: .8125rem; color: var(--text-muted); padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); transition: var(--transition); }
.btn-logout:hover { background: var(--red); color: #fff; border-color: var(--red); }
@media (max-width: 640px) {
  .admin-user-name { display: none; }
  .admin-topbar { padding: 0 14px; gap: 10px; }
  .topbar-title { font-size: .9rem; }
}

.admin-content { flex: 1; padding: 28px 24px; max-width: 1400px; width: 100%; box-sizing: border-box; }
@media (max-width: 640px) { .admin-content { padding: 20px 16px; } }

/* Leads table list â€” full width of main panel (matches kanban/map intent) */
.admin-content.leads-list-page {
    max-width: none;
    width: 100%;
}

/* ============================================================
   ADMIN COMPONENTS
   ============================================================ */

/* Stat cards */
.stat-grid { display: grid; gap: 16px; margin-bottom: 28px; }
@media (min-width: 640px)  { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-label { font-size: .8125rem; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-value.green { color: var(--green); }
.stat-value.red   { color: var(--red); }
.stat-value.orange { color: var(--orange); }
.stat-sub  { font-size: .8125rem; color: var(--text-muted); margin-top: 4px; }

/* Data table */
.data-table-wrap { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.data-table-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 12px; }
.data-table-title { font-weight: 600; font-size: .9375rem; color: var(--navy); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: var(--bg); padding: 10px 16px; font-size: .8rem; font-weight: 600; text-align: left; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 16px; font-size: .875rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.data-table-overflow { overflow-x: auto; }

/* Status pills */
.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; text-transform: capitalize; white-space: nowrap; }
.status-pill.new        { background: #eff6ff; color: #1e40af; }
.status-pill.contacted  { background: #fefce8; color: #854d0e; }
.status-pill.offer_made { background: #fff7ed; color: #c2410c; }
.status-pill.accepted   { background: #f0fdf4; color: #166534; }
.status-pill.purchased  { background: #ecfdf5; color: #065f46; }
.status-pill.sold       { background: #f0fdf4; color: #15803d; }
.status-pill.complete   { background: #eef2ff; color: #4f46e5; }
.status-pill.rejected   { background: #fef2f2; color: #991b1b; }
.status-pill.archived    { background: var(--bg); color: var(--text-muted); }
.status-pill.steve_talk { background: #f5f3ff; color: #7c3aed; }
.status-pill.to_sell    { background: #ecfeff; color: #0891b2; }
.status-pill.available  { background: #f0fdf4; color: #166534; }
.status-pill.reserved   { background: #fefce8; color: #854d0e; }
.status-pill.draft      { background: var(--bg); color: var(--text-muted); }
.status-pill.published  { background: #f0fdf4; color: #166534; }
.status-pill.scheduled  { background: #eff6ff; color: #1e40af; }
.status-pill.sent       { background: #eff6ff; color: #1e40af; }
.status-pill.overdue    { background: #fef2f2; color: #991b1b; font-weight: 700; }
.status-pill.paid       { background: #f0fdf4; color: #166534; }
.status-pill.part_paid  { background: #fff7ed; color: #c2410c; }
.status-pill.cancelled  { background: #fef2f2; color: #991b1b; }

.lead-origin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  line-height: 1.3;
}
.lead-origin-pill.lead-origin-website {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.lead-origin-pill.lead-origin-manual {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.lead-origin-pill.lead-origin-scb {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.lead-origin-pill.lead-origin-sister {
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}
.lead-origin-detail {
  font-weight: 500;
  opacity: .85;
}
.lead-origin-detail::before {
  content: 'Â·';
  margin-right: 4px;
  opacity: .6;
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius); font-size: .875rem; font-weight: 600; transition: var(--transition); border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.btn-primary    { background: var(--orange); color: var(--navy); border-color: var(--orange); }
.btn-primary:hover { background: #A8872A; border-color: #A8872A; }
.btn-secondary  { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger     { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #b91c1c; }
.btn-success    { background: var(--green); color: #fff; border-color: var(--green); }
.btn-sm { padding: 6px 12px; font-size: .8125rem; }
.btn-icon { padding: 7px; border-radius: 6px; }

/* Form elements */
.form-section { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.form-section-title { font-weight: 600; color: var(--navy); margin-bottom: 18px; font-size: 1rem; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 16px; }
@media (min-width: 640px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 640px) { .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }
@media (min-width: 640px) { .form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; } }
label { display: block; font-size: .8125rem; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=url], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: .875rem; color: var(--text); background: var(--white); transition: border-color .15s;
  appearance: none; -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--orange); cursor: pointer; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: .875rem; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 1.125rem; font-weight: 700; color: var(--navy); }

/* Toolbar */
.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }

/* Tab filters */
.tab-filter { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; flex-wrap: wrap; }
.tab-filter a { padding: 8px 16px; font-size: .8125rem; font-weight: 600; color: var(--text-muted); border-right: 1px solid var(--border); white-space: nowrap; }
.tab-filter a:last-child { border-right: none; }
.tab-filter a:hover { background: var(--bg); color: var(--navy); }
.tab-filter a.active { background: var(--navy); color: #fff; }

/* Image upload area */
/* Feature suggestion chips */
.feature-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.feature-suggestion-chip {
  display: inline-flex; align-items: center;
  padding: 5px 12px; border-radius: 20px; font-size: .8125rem; font-weight: 500;
  background: var(--bg); border: 1.5px solid var(--border);
  color: var(--navy); cursor: pointer; transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.feature-suggestion-chip:hover:not(:disabled) { background: var(--orange); border-color: var(--orange); color: #fff; }
.feature-suggestion-chip.added { opacity: .4; cursor: default; }

.image-upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; background: var(--bg); cursor: pointer; transition: border-color .2s; }
.image-upload-area:hover { border-color: var(--orange); }
.image-upload-area input { display: none; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }
.image-item { position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 4/3; background: var(--bg); }
.image-item img { width: 100%; height: 100%; object-fit: cover; }
.image-item .img-actions { position: absolute; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; gap: 6px; opacity: 0; transition: opacity .2s; }
.image-item:hover .img-actions { opacity: 1; }
.image-item .img-badge { position: absolute; top: 4px; left: 4px; background: var(--orange); color: #fff; font-size: .65rem; font-weight: 700; padding: 2px 6px; border-radius: 3px; }
.vid-thumb-wrap { position: relative; width: 100%; height: 100%; background: #111; display: flex; align-items: center; justify-content: center; }
.vid-play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 32px; height: 32px; background: rgba(255,255,255,.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #1a2e4a; pointer-events: none; }

/* Drag-and-drop reorder */
.sortable-grid { user-select: none; }
.image-item[draggable="true"] { cursor: grab; }
.image-item.dragging { opacity: .4; cursor: grabbing; }
.image-item.drag-over { outline: 2px dashed var(--orange); outline-offset: 2px; }
.drag-handle {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  background: rgba(0,0,0,.55); color: #fff;
  border-radius: 3px; font-size: 14px; line-height: 1;
  padding: 2px 4px; cursor: grab;
  opacity: 0; transition: opacity .15s;
}
.image-item:hover .drag-handle { opacity: 1; }

/* Touch screens - always-visible controls on image items */
@media (hover: none) and (pointer: coarse) {

  /* Drag handle: always visible and finger-sized */
  .drag-handle {
    opacity: 1 !important;
    padding: 6px 8px;
    font-size: 18px;
    top: 4px; right: 4px;
    background: rgba(0,0,0,.6);
    border-radius: 5px;
  }

  /* Action buttons: always-visible strip at the bottom of each image */
  .image-item .img-actions {
    opacity: 1 !important;
    /* Override full-overlay â†’ bottom strip only */
    inset: auto 0 0 0 !important;
    height: auto !important;
    background: rgba(0,0,0,.60) !important;
    padding: 5px 6px !important;
    gap: 5px !important;
    justify-content: center !important;
    border-radius: 0 0 6px 6px;
  }

  .image-item .img-actions .btn {
    padding: 5px 10px;
    font-size: .8rem;
    min-height: 30px;
    min-width: 36px;
  }
}

/* Lead detail */
.lead-detail-grid { display: grid; gap: 24px; }
@media (min-width: 960px) { .lead-detail-grid { grid-template-columns: 1fr 320px; } }
.info-block { margin-bottom: 20px; }
.info-block h4 { font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 12px; }
.info-row { display: grid; grid-template-columns: 140px 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.info-row:last-child { border-bottom: none; }
.info-key { color: var(--text-muted); font-weight: 500; }
.info-val { font-weight: 600; color: var(--navy); }
@media (max-width: 480px) {
  .info-row { grid-template-columns: 1fr; gap: 2px; }
  .info-val { color: var(--navy); }
}

.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: .8125rem; }
.activity-item:last-child { border-bottom: none; }
.activity-action { font-weight: 600; color: var(--navy); }
.activity-meta   { color: var(--text-muted); margin-top: 2px; }
.activity-note   { background: var(--bg); border-radius: 5px; padding: 8px 10px; margin-top: 6px; color: var(--text); }

/* Chart container */
.chart-wrap { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.chart-title { font-weight: 600; font-size: .9375rem; color: var(--navy); margin-bottom: 16px; }

/* Login page */
.admin-login-page { min-height: 100vh; background: var(--navy-dark); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--white); border-radius: 14px; padding: 48px 40px; width: 100%; max-width: 420px; }
.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand .brand-icon { width: 52px; height: 52px; font-size: 1.125rem; margin: 0 auto 12px; }
.login-brand h1 { font-size: 1.5rem; color: var(--navy); margin-bottom: 4px; }
.login-brand p { font-size: .9rem; color: var(--text-muted); }
.login-card .form-group { margin-bottom: 18px; }
.login-card label { font-size: .875rem; }
.login-card .btn { margin-top: 8px; width: 100%; justify-content: center; padding: 12px; font-size: 1rem; }

/* ============================================================
   TABLE / CARD VIEW TOGGLE
   Desktop: table by default; .view-grid on .admin-content shows cards.
   Mobile (.has-card-view): cards shown, table hidden.
   Mobile (no .has-card-view): table scrolls horizontally.
   The .has-card-view class is added by admin.js when .admin-cards
   elements are detected on the page.
   ============================================================ */
.admin-cards { display: none; }

/* Desktop grid mode (toggled via JS) */
.view-grid .data-table-wrap { display: none !important; }
.view-grid .admin-cards {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

/* Toggle button */
#btn-view-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: .8125rem;
}

/* â”€â”€ Mobile â”€â”€ */
@media (max-width: 768px) {
  /* Pages WITH card fallbacks: hide table, show cards */
  .has-card-view .data-table-wrap { display: none !important; }
  .has-card-view .admin-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 4px;
  }

  /* Pages WITHOUT card fallbacks: make table scroll */
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Hide the toggle button on mobile */
  #btn-view-toggle { display: none !important; }

  /* Compact toolbar */
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar form { flex-direction: column; gap: 8px; }
  .toolbar form input,
  .toolbar form select,
  .toolbar > input,
  .toolbar > select { width: 100%; min-width: 0; }
  .toolbar > .btn { align-self: flex-start; }

  /* Page header wraps nicely */
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header > div:last-child,
  .page-header > a,
  .page-header > form { align-self: stretch; }

  /* Tab filter scrollable */
  .tab-filter { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; padding-bottom: 4px; flex-wrap: nowrap; }

  /* All data-table-overflow always scrolls */
  .data-table-overflow { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Very small screens - single column cards */
@media (max-width: 480px) {
  .has-card-view .admin-cards { grid-template-columns: 1fr !important; }
  .admin-content { padding: 16px 12px; }
}

/* Card shell */
.admin-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.admin-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.admin-card-header strong { font-size: .9375rem; color: var(--navy); line-height: 1.3; }
.admin-card-body {
  padding: 10px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.admin-card-row {
  display: flex; flex-direction: column; gap: 1px;
}
.admin-card-row span:first-child {
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
}
.admin-card-row span:last-child { font-size: .875rem; color: var(--text); font-weight: 500; }
.admin-card-row.full { grid-column: 1 / -1; }
.admin-card-footer {
  display: flex; gap: 8px; padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.admin-card-img {
  width: 100%; height: 160px; object-fit: cover; display: block;
}

/* â”€â”€ Confirmation modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#confirm-modal {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
}
.confirm-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  animation: cfOverlayIn .15s ease;
}
.confirm-box {
  position: relative; z-index: 1;
  background: var(--white);
  border-radius: 14px;
  padding: 32px 28px 24px;
  max-width: 380px; width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  text-align: center;
  animation: cfBoxIn .18s cubic-bezier(.34,1.56,.64,1);
}
.confirm-icon {
  width: 56px; height: 56px;
  background: #fef2f2; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: #dc2626;
}
#confirm-modal-msg {
  font-size: .9375rem; color: var(--navy);
  font-weight: 500; line-height: 1.5;
  margin: 0 0 24px;
}
.confirm-actions {
  display: flex; gap: 10px; justify-content: center;
}
.confirm-actions .btn { min-width: 100px; justify-content: center; }
#transfer-sister-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; }
#transfer-sister-modal .transfer-sister-icon { background: #eff6ff; color: #1d4ed8; }
.transfer-sister-archive {
  display: flex; align-items: flex-start; gap: 10px;
  text-align: left; margin: 0 0 22px;
  padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px;
  font-size: .875rem; color: var(--navy); font-weight: 500; cursor: pointer;
}
.transfer-sister-archive input { margin-top: 3px; accent-color: var(--navy); }
#transfer-sister-dup-modal { position: fixed; inset: 0; z-index: 9010; display: flex; align-items: center; justify-content: center; }
#transfer-sister-dup-modal .transfer-sister-dup-icon { background: #fff7ed; color: #c2410c; }
.transfer-sister-dup-box { max-width: 560px; text-align: left; }
.transfer-sister-dup-box #transfer-sister-dup-msg { text-align: left; margin: 0 0 14px; }
.transfer-sister-dup-list { max-height: 280px; overflow: auto; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.transfer-sister-dup-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px;
  cursor: pointer; background: #fff;
}
.transfer-sister-dup-item.is-selected { border-color: var(--navy); background: #f8fafc; }
.transfer-sister-dup-item input { margin-top: 3px; accent-color: var(--navy); }
.transfer-sister-dup-meta { font-size: .8rem; color: #64748b; margin-top: 2px; }
.transfer-sister-dup-match { display: inline-block; margin: 6px 6px 0 0; padding: 2px 8px; border-radius: 999px; background: #fff7ed; color: #9a3412; font-size: .72rem; font-weight: 600; }
.transfer-sister-dup-actions { flex-wrap: wrap; justify-content: flex-end; }
@keyframes cfOverlayIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes cfBoxIn { from { opacity: 0; transform: scale(.88) } to { opacity: 1; transform: scale(1) } }

/* â”€â”€ Email choice modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#email-choice-modal {
  position: fixed; inset: 0; z-index: 9100;
  display: flex; align-items: center; justify-content: center;
}
#email-choice-modal .email-choice-box {
  max-width: 520px; width: calc(100% - 32px);
  text-align: left; padding: 28px 24px 22px;
  max-height: 90vh; overflow-y: auto;
}
.email-choice-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--text-muted);
  padding: 0 4px;
}
.email-choice-title {
  font-size: 1.15rem; font-weight: 800; color: var(--navy);
  margin: 0 0 6px; padding-right: 28px;
}
.email-choice-recipient {
  font-size: .875rem; color: var(--text-muted);
  margin: 0 0 20px; word-break: break-all;
}
.email-choice-options {
  display: flex; flex-direction: column; gap: 10px;
}
.email-choice-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--white); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.email-choice-option:hover {
  border-color: var(--orange); background: #fffbeb;
}
.email-choice-option-icon { font-size: 1.25rem; line-height: 1; }
.email-choice-option-label {
  font-size: .9375rem; font-weight: 700; color: var(--navy);
}
.email-choice-option-desc {
  font-size: .8rem; color: var(--text-muted); line-height: 1.4;
}
.email-choice-label {
  display: block; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); margin: 0 0 6px;
}
.email-choice-select { width: 100%; margin-bottom: 16px; }
.email-choice-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 16px; flex-wrap: wrap;
}
.email-choice-preview {
  border: 1px solid var(--border); border-radius: 8px;
  max-height: 220px; overflow: auto; background: #f9fafb;
  font-size: .8rem;
}
.email-choice-preview iframe {
  width: 100%; min-height: 200px; border: 0; display: block;
}
.email-choice-merge-hint {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.email-choice-merge-desc {
  font-size: .8rem; color: var(--text-muted);
  margin: 0 0 8px; line-height: 1.45;
}
.email-choice-merge-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.email-choice-merge-tags code {
  font-size: .75rem; background: #f1f5f9;
  padding: 3px 7px; border-radius: 4px;
  color: #1a2e4a; cursor: pointer;
}
.email-choice-merge-tags code:hover {
  background: #e2e8f0;
}

/* â”€â”€ Banned postcode alert modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#banned-pc-modal {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
}
#banned-pc-modal .confirm-box {
  max-width: 480px; text-align: left;
}
#banned-pc-modal .banned-pc-icon {
  background: #fffbeb; color: #b45309;
}
#banned-pc-modal .banned-pc-title {
  font-size: 1.1rem; font-weight: 800; color: var(--navy);
  margin: 0 0 8px; text-align: center;
}
#banned-pc-modal .banned-pc-context {
  font-size: .875rem; color: #475569; margin: 0 0 14px; text-align: center;
}
#banned-pc-modal .banned-pc-list {
  margin: 0 0 20px; padding: 12px 14px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  list-style: none; font-size: .85rem; color: #78350f;
}
#banned-pc-modal .banned-pc-list li { padding: 6px 0; border-bottom: 1px solid #fef3c7; }
#banned-pc-modal .banned-pc-list li:last-child { border-bottom: none; padding-bottom: 0; }
#banned-pc-modal .banned-pc-list strong { color: #92400e; }
#banned-pc-modal .banned-pc-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}

/* â”€â”€ Topbar notification button hover â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.topbar-notif-btn:hover { background: var(--bg) !important; }

/* â”€â”€ Forced 2FA setup - lock sidebar and topbar nav â”€â”€â”€â”€â”€â”€â”€ */
.sidebar--locked .sidebar-nav,
.sidebar--locked .sidebar-footer {
  filter: blur(3px);
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}
.topbar-btn--locked {
  filter: blur(2px);
  opacity: 0.3;
  pointer-events: none;
  cursor: default;
}

/* â”€â”€ Generic form split layout (main column + sidebar) â”€â”€â”€â”€ */
.form-layout-split {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 320px;
  align-items: start;
}
@media (max-width: 900px) {
  .form-layout-split { grid-template-columns: 1fr; }
}

/* â”€â”€ Invoice show / split layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 900px) {
  .inv-split-layout { flex-direction: column !important; }
  .inv-split-left, .inv-split-right { width: 100% !important; }
  .inv-payments-panel { margin-top: 0 !important; }
}

/* â”€â”€ Invoice form: line items table on mobile â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 768px) {
  .inv-items-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .inv-items-table { min-width: 600px; }
}

/* â”€â”€ Bulk action toolbar on mobile â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 640px) {
  .bulk-toolbar { flex-direction: column; gap: 8px; align-items: flex-start !important; }
  .bulk-toolbar select,
  .bulk-toolbar .btn { width: 100%; justify-content: center; }
}

/* â”€â”€ Reports page header buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 640px) {
  .page-header > div:has(.btn) { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
  .page-header > div > .btn { flex: 1; justify-content: center; min-width: 120px; }
}

/* â”€â”€ Settings tabs â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 640px) {
  .settings-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; }
  .settings-tabs button { white-space: nowrap; }
}

/* â”€â”€ Stat grid single column on very small screens â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* â”€â”€ Login card padding on small screens â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 480px) {
  .login-card { padding: 32px 24px; }
}

/* â”€â”€ Form rows collapse to 1 column on small screens â”€â”€â”€â”€ */
@media (max-width: 480px) {
  .form-row.cols-2,
  .form-row.cols-3,
  .form-row.cols-4 { grid-template-columns: 1fr !important; }
}

/* â”€â”€ Sticky save bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#sticky-save-bar {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  background: var(--white);
  border-top: 2px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  z-index: 150;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  transform: translateY(100%);
  transition: transform .2s ease;
}
#sticky-save-bar.visible { transform: translateY(0); }
#sticky-save-bar .sticky-save-label {
  font-size: .82rem;
  color: var(--text-muted);
}
.admin-layout.sidebar-collapsed #sticky-save-bar { left: var(--sidebar-cw); }
@media (max-width: 900px) { #sticky-save-bar { left: 0; padding: 10px 16px; } }

/* ============================================================
   Buyer Intelligence - Smart Buyer Recommendations
   ============================================================ */
.bi-panel { margin-bottom: 20px; }
.bi-recs { border-left: 3px solid var(--navy); }
.bi-recs__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.bi-recs__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
}
.bi-recs__sub {
  margin: 4px 0 0;
  font-size: .82rem;
  color: var(--text-muted);
}
.bi-recs__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bi-recs__banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: #0f3d4c;
  color: #e8f4f8;
  border-radius: 8px;
  font-size: .85rem;
}
.bi-recs__banner strong { color: #fff; }
.bi-recs__banner-sep { opacity: .5; }
.bi-recs__empty,
.bi-recs__empty-text {
  font-size: .85rem;
  color: var(--text-muted);
  margin: 0;
}
.bi-recs__empty-box {
  text-align: center;
  padding: 28px 16px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.bi-recs__empty-title {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--navy);
}
.bi-recs__empty-text { margin: 0 0 14px; }

.bi-rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.bi-rec-card {
  background: var(--white, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.bi-rec-card--top {
  border-color: #0f766e;
  box-shadow: 0 0 0 1px rgba(15,118,110,.2);
}
.bi-rec-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.bi-rec-card__rank {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.bi-rec-card__score-wrap { text-align: right; }
.bi-rec-card__score {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  color: #0f766e;
}
.bi-rec-card__score-lbl {
  display: block;
  font-size: .62rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}
.bi-rec-card__vip {
  display: inline-block;
  margin-top: 4px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fef3c7;
  color: #b45309;
}
.bi-rec-card__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
}
.bi-rec-card__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bi-rec-stat {
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
}
.bi-rec-stat--wide { grid-column: 1 / -1; }
.bi-rec-stat__n {
  display: block;
  font-size: .95rem;
  font-weight: 800;
  color: var(--navy);
}
.bi-rec-stat__l {
  display: block;
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.bi-rec-card__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: .78rem;
  color: var(--text-muted);
}
.bi-rec-card__meta strong { color: var(--text); }
.bi-rec-card__pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bi-rec-price {
  border-radius: 8px;
  padding: 8px 10px;
}
.bi-rec-price span {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 2px;
}
.bi-rec-price strong {
  font-size: 1.05rem;
  font-weight: 800;
}
.bi-rec-price--ask {
  background: #ecfdf5;
  color: #047857;
}
.bi-rec-price--ask span { color: #059669; }
.bi-rec-price--offer {
  background: #fff7ed;
  color: #c2410c;
}
.bi-rec-price--offer span { color: #ea580c; }
.bi-rec-why__title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.bi-rec-why ul {
  margin: 0;
  padding-left: 16px;
  font-size: .8rem;
  color: var(--text);
  line-height: 1.45;
}
.bi-rec-card__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}
.bi-rec-cta-call { flex: 1; justify-content: center; min-width: 110px; }
.bi-rec-cta-email { flex: 1; justify-content: center; min-width: 110px; border-color: #059669; color: #047857; }
.bi-rec-cta-email:hover { background: #ecfdf5; }

.bi-insights {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-top: 4px;
}
.bi-insights__title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.bi-insights__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 700px) {
  .bi-insights__grid { grid-template-columns: 1fr; }
}
.bi-insights__lbl {
  display: block;
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.bi-insights__val {
  font-size: 1.05rem;
  font-weight: 800;
}
.bi-insights__val--blue { color: #1d4ed8; }
.bi-insights__val--green { color: #047857; }
.bi-insights__val--amber { color: #c2410c; }
.bi-match-list { display: flex; flex-direction: column; gap: 12px; }
.bi-match-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.bi-match-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.bi-match-card__name { display: block; font-size: .9rem; color: var(--navy); }
.bi-match-card__contact { display: block; font-size: .78rem; color: var(--text-muted); }
.bi-match-card__type {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}
.bi-match-card__scores { text-align: right; flex-shrink: 0; }
.bi-score {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  color: var(--navy);
}
.bi-match-card__price { font-size: .8rem; margin: 0 0 8px; color: var(--text-muted); }
.bi-match-card__price strong { color: var(--text); }
.bi-reasons {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.bi-match-card__action {
  font-size: .75rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 10px;
}
.bi-match-card__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.bi-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
}
.bi-badge--active { background: #dcfce7; color: #14532d; }
.bi-badge--inactive { background: #f3f4f6; color: #6b7280; }
.bi-conf--high { background: #dcfce7; color: #14532d; }
.bi-conf--medium { background: #fef3c7; color: #92400e; }
.bi-conf--low { background: #fee2e2; color: #991b1b; }

.bi-stock-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: .8rem;
}
.bi-stock-summary--high { border-left: 3px solid #16a34a; }
.bi-stock-summary--medium { border-left: 3px solid #d97706; }
.bi-stock-summary--low { border-left: 3px solid #94a3b8; }
.bi-stock-summary--none { border-left: 3px solid var(--border); }
.bi-stock-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  align-items: baseline;
}
.bi-stock-summary__row + .bi-stock-summary__row { margin-top: 6px; }
.bi-stock-summary__label { font-weight: 600; color: var(--navy); }

.bi-appetite { margin: 0 0 10px; }
.bi-appetite__label {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.bi-appetite__pct { color: var(--navy); }
.bi-appetite__track {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.bi-appetite__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a2e4a, #C9A84C);
  transition: width .35s ease;
}

.bi-match-card__window {
  font-size: .78rem;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.bi-match-card__window strong { color: var(--navy); }

.bi-heat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.bi-heat-tag {
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e8f0fe;
  color: #1a56db;
}
.bi-heat-tag:nth-child(odd) { background: #fef3c7; color: #92400e; }

.bi-why {
  margin: 0 0 10px;
  padding: 8px 10px;
  background: var(--white);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.bi-why__title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--navy);
  margin-bottom: 6px;
}

.bi-margin {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f8fafc 100%);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.bi-margin--negative {
  background: linear-gradient(135deg, #fef2f2, #f8fafc);
  border-color: #fecaca;
}
.bi-margin--neutral {
  background: var(--bg);
  border-color: var(--border);
}
.bi-margin__title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #065f46;
  margin-bottom: 10px;
}
.bi-margin--negative .bi-margin__title { color: #991b1b; }
.bi-margin__table {
  width: 100%;
  font-size: .82rem;
  border-collapse: collapse;
}
.bi-margin__table td {
  padding: 4px 0;
  vertical-align: top;
}
.bi-margin__table td:first-child {
  color: var(--text-muted);
  width: 55%;
}
.bi-margin__table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--navy);
}
.bi-margin__total td {
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,.08);
  font-size: .88rem;
}
.bi-margin--strong .bi-margin__total strong { color: #15803d; font-size: 1rem; }
.bi-margin--positive .bi-margin__total strong { color: #16a34a; }
.bi-margin--negative .bi-margin__total strong { color: #dc2626; }
.bi-margin__notes {
  margin: 8px 0 0;
  padding-left: 16px;
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.bi-stock-summary__row--urgent {
  color: #1a56db;
  font-size: .82rem;
}
.bi-wanted-item[open] { background: var(--white); }
.bi-heat-tag.bi-heat-tag { background: #fef3c7; color: #b45309; }

/* ============================================================
   SEARCH EVERYWHERE (Ctrl+K / Cmd+K) â€” global admin
   ============================================================ */
.admin-se-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--border, #d1d5db); border-radius: 8px;
  background: #f8fafc; color: #64748b; font-size: .8rem; font-weight: 500;
  cursor: pointer; transition: border-color .12s, background .12s, color .12s;
  text-decoration: none; font-family: inherit;
}
.admin-se-btn:hover {
  border-color: #94a3b8; background: #fff; color: #0f172a;
}
.admin-se-btn kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .68rem; font-weight: 600; color: #64748b;
  background: #fff; border: 1px solid #e2e8f0; border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 5px; line-height: 1.3;
}
#admin-se-backdrop {
  display: none; position: fixed; inset: 0; z-index: 13000;
  background: rgba(15, 23, 42, .45); align-items: flex-start; justify-content: center;
  padding: 12vh 16px 24px;
}
#admin-se-backdrop.admin-se-open { display: flex; }
#admin-se-modal {
  width: 100%; max-width: 640px; background: #fff; border-radius: 12px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .28); overflow: hidden;
  border: 1px solid #e2e8f0; display: flex; flex-direction: column;
  max-height: min(72vh, 560px);
}
#admin-se-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid #eef2f7;
}
#admin-se-input-wrap svg { flex-shrink: 0; color: #94a3b8; }
#admin-se-input {
  flex: 1; border: 0; outline: none; font-size: 1.05rem; color: #0f172a;
  background: transparent; min-width: 0; font-family: inherit;
}
#admin-se-input::placeholder { color: #94a3b8; }
#admin-se-spinner {
  width: 16px; height: 16px; border: 2px solid #e2e8f0; border-top-color: #64748b;
  border-radius: 50%; animation: admin-se-spin .6s linear infinite;
  display: none; flex-shrink: 0;
}
#admin-se-spinner.admin-se-spinning { display: block; }
@keyframes admin-se-spin { to { transform: rotate(360deg); } }
#admin-se-results {
  overflow-y: auto; flex: 1; padding: 6px; min-height: 80px;
}
.admin-se-empty, .admin-se-hint {
  padding: 28px 18px; text-align: center; color: #94a3b8; font-size: .88rem; line-height: 1.5;
}
.admin-se-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem; background: #f1f5f9; color: #475569;
  padding: 2px 6px; border-radius: 4px;
}
.admin-se-item {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 10px 12px; border-radius: 8px; cursor: pointer; color: inherit;
  font-family: inherit;
}
.admin-se-item:hover, .admin-se-item.admin-se-active { background: #f1f5f9; }
.admin-se-item-main { flex: 1; min-width: 0; }
.admin-se-item-title {
  font-weight: 650; font-size: .92rem; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-se-item-sub {
  margin-top: 2px; font-size: .78rem; color: #64748b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-se-item-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0;
}
.admin-se-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .68rem; font-weight: 700; color: #475569;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 999px;
  padding: 2px 8px; white-space: nowrap;
}
.admin-se-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.admin-se-ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .68rem; font-weight: 700; color: #64748b;
}
#admin-se-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 14px; border-top: 1px solid #eef2f7; background: #f8fafc;
  font-size: .72rem; color: #94a3b8;
}
#admin-se-footer kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .65rem; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 4px; padding: 1px 4px; color: #64748b;
}
.admin-se-footer-keys { display: flex; gap: 12px; flex-wrap: wrap; }
.kb-card.admin-se-flash, .kb-list-row.admin-se-flash {
  outline: 2px solid #3b82f6; outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .2);
  transition: outline-color .2s, box-shadow .2s;
}
.admin-se-btn:disabled {
  opacity: .45; cursor: not-allowed;
}
.admin-se-btn:disabled:hover {
  border-color: var(--border, #d1d5db); background: #f8fafc; color: #64748b;
}
.admin-la-open-btn.is-ready {
  border-color: #93c5fd; background: #eff6ff; color: #1e40af;
}
.admin-la-open-btn.is-ready kbd {
  border-color: #bfdbfe; color: #1d4ed8;
}
@media (hover: none), (pointer: coarse) {
  .admin-la-shortcut-hint { display: none !important; }
  .admin-se-btn .admin-se-btn-label { display: inline; }
}

/* ============================================================
   LEAD ACTION PALETTE (Space) â€” global admin
   ============================================================ */
.lead-ctx-active {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .18);
}
#admin-la-backdrop {
  display: none; position: fixed; inset: 0; z-index: 13100;
  background: rgba(15, 23, 42, .45); align-items: flex-start; justify-content: center;
  padding: 12vh 16px 24px;
}
#admin-la-backdrop.admin-la-open { display: flex; }
#admin-la-modal {
  width: 100%; max-width: 560px; background: #fff; border-radius: 12px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .28); overflow: hidden;
  border: 1px solid #e2e8f0; display: flex; flex-direction: column;
  max-height: min(78vh, 620px);
}
#admin-la-header {
  padding: 12px 16px 0; border-bottom: 1px solid #eef2f7;
}
#admin-la-lead {
  font-size: .78rem; color: #64748b; margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#admin-la-lead strong { color: #0f172a; font-weight: 650; }
#admin-la-input-wrap {
  display: flex; align-items: center; gap: 10px; padding: 0 0 12px;
}
#admin-la-input-wrap svg { flex-shrink: 0; color: #94a3b8; }
#admin-la-input {
  flex: 1; border: 0; outline: none; font-size: 1.02rem; color: #0f172a;
  background: transparent; min-width: 0; font-family: inherit;
}
#admin-la-input::placeholder { color: #94a3b8; }
#admin-la-results {
  overflow-y: auto; flex: 1; padding: 6px; min-height: 120px;
}
.admin-la-empty {
  padding: 28px 18px; text-align: center; color: #94a3b8; font-size: .88rem;
}
.admin-la-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 12px; border-radius: 8px; cursor: pointer; color: inherit;
  font-family: inherit; font-size: .9rem;
}
.admin-la-item:hover, .admin-la-item.admin-la-active { background: #f1f5f9; }
.admin-la-item-label { flex: 1; min-width: 0; font-weight: 550; color: #0f172a; }
.admin-la-item-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
}
.admin-la-item-main .admin-la-item-label { flex: none; width: 100%; }
.admin-la-item-sub {
  font-size: .76rem; color: #64748b; font-weight: 450;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.admin-la-item-muted { opacity: .55; }
.admin-la-group-label {
  padding: 10px 12px 4px; font-size: .68rem; font-weight: 700;
  color: #94a3b8; text-transform: uppercase; letter-spacing: .05em;
}
.admin-la-check {
  width: 16px; flex-shrink: 0; text-align: center;
  font-size: .85rem; font-weight: 700; color: #4f46e5;
}
.admin-la-item-checked .admin-la-item-label { color: #312e81; }
.admin-la-item-hint {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .68rem; font-weight: 600; color: #94a3b8;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px;
  padding: 1px 6px; flex-shrink: 0;
}
.admin-la-item-danger .admin-la-item-label { color: #b91c1c; }
.admin-la-item-highlight {
  background: #fff7ed;
}
.admin-la-item-highlight .admin-la-item-label { color: #c2410c; font-weight: 700; }
.admin-la-item-highlight:hover,
.admin-la-item-highlight.admin-la-active { background: #ffedd5; }
#admin-la-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 14px; border-top: 1px solid #eef2f7; background: #f8fafc;
  font-size: .72rem; color: #94a3b8;
}
#admin-la-footer kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .65rem; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 4px; padding: 1px 4px; color: #64748b;
}
.admin-la-footer-keys { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-la-nested-form { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.admin-la-nested-form label { font-size: .75rem; font-weight: 700; color: #64748b; }
.admin-la-nested-form input,
.admin-la-nested-form textarea {
  width: 100%; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 10px 12px; font-size: .92rem; font-family: inherit; color: #0f172a;
  box-sizing: border-box;
}
.admin-la-nested-form textarea { min-height: 110px; resize: vertical; }
.admin-la-nested-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.admin-la-btn {
  border: 1px solid #e2e8f0; background: #fff; border-radius: 8px;
  padding: 8px 12px; font-size: .82rem; font-weight: 600; cursor: pointer;
  font-family: inherit; color: #0f172a;
}
.admin-la-btn-primary { background: #0f172a; color: #fff; border-color: #0f172a; }
.admin-la-btn-ghost { background: transparent; }
.admin-la-timeline-item {
  padding: 10px 12px; border-bottom: 1px solid #f1f5f9;
}
.admin-la-timeline-item:last-child { border-bottom: 0; }
.admin-la-timeline-title { font-size: .86rem; font-weight: 600; color: #0f172a; }
.admin-la-timeline-meta { font-size: .72rem; color: #94a3b8; margin-top: 2px; }
.admin-la-timeline-body { font-size: .8rem; color: #475569; margin-top: 4px; white-space: pre-wrap; }
.admin-la-share-msg {
  font-size: .8rem; color: #64748b; padding: 4px 12px 8px; line-height: 1.4;
}
@media (max-width: 640px) {
  #admin-la-backdrop { padding: 8vh 10px 16px; }
}

/* ── Lead notes modal ───────────────────────────────────────── */
#lead-notes-backdrop {
  display: none; position: fixed; inset: 0; z-index: 10300;
  background: rgba(15, 23, 42, .5); align-items: center; justify-content: center;
  padding: 24px 16px;
}
#lead-notes-backdrop.lead-notes-open { display: flex; }
#lead-notes-modal {
  width: 100%; max-width: 520px; max-height: min(80vh, 640px);
  background: #fff; border-radius: 14px; border: 1px solid #e2e8f0;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .3);
  display: flex; flex-direction: column; overflow: hidden;
  animation: cfBoxIn .18s cubic-bezier(.34, 1.56, .64, 1);
}
#lead-notes-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid #eef2f7;
}
#lead-notes-title {
  font-size: 1.05rem; font-weight: 800; color: #0f172a; line-height: 1.2;
}
#lead-notes-subtitle {
  font-size: .8rem; color: #64748b; margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px;
}
#lead-notes-close {
  background: none; border: none; cursor: pointer; font-size: 1.15rem;
  line-height: 1; color: #94a3b8; padding: 2px 6px; border-radius: 6px;
}
#lead-notes-close:hover { color: #0f172a; background: #f1f5f9; }
#lead-notes-body {
  flex: 1; overflow-y: auto; padding: 12px 8px 12px 12px;
  min-height: 120px;
}
.lead-notes-loading,
.lead-notes-empty,
.lead-notes-error {
  padding: 28px 16px; text-align: center; font-size: .875rem; color: #64748b;
}
.lead-notes-error { color: #dc2626; }
.lead-notes-admin {
  margin: 0 8px 12px 4px; padding: 12px 14px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
}
.lead-notes-admin-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: #b45309; margin-bottom: 6px;
}
.lead-notes-admin-text {
  font-size: .875rem; color: #78350f; white-space: pre-wrap; line-height: 1.45;
}
.lead-notes-item {
  padding: 12px 12px 12px 14px; border-bottom: 1px solid #f1f5f9;
}
.lead-notes-item:last-child { border-bottom: 0; }
.lead-notes-item-tagged {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 10px;
  margin: 4px 4px 8px;
  border-bottom: 1px solid #fdba74;
  padding: 12px 14px;
}
.lead-notes-tagged-badge {
  display: inline-block;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: #c2410c;
  background: #ffedd5; border-radius: 999px;
  padding: 2px 8px; margin-bottom: 6px;
}
.lead-notes-mention {
  color: var(--orange, #ea580c); font-weight: 700;
}
.lead-notes-meta {
  font-size: .72rem; color: #94a3b8; margin-bottom: 4px;
}
.lead-notes-text {
  font-size: .875rem; color: #0f172a; white-space: pre-wrap; line-height: 1.45;
}
#lead-notes-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid #eef2f7; background: #fafbfc;
}
@media (max-width: 640px) {
  #lead-notes-modal { max-height: 85vh; }
  #lead-notes-subtitle { max-width: 220px; }
}
