/* ══════════════════════════════════════════════════════════════
   LotShift — Professional Dashboard Stylesheet
   Copyright (c) 2024-2026 Louis Oliver Hepburn. All rights reserved.
   ══════════════════════════════════════════════════════════════ */

/* ── Google Font ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&display=swap');

/* ── Design Tokens ── */
:root {
  --bg:        #0c0e14;
  --surface:   #14171f;
  --card:      #1b1f2a;
  --card-hover:#212636;
  --border:    #262b3a;
  --border-hover: #3a405a;
  --text:      #e8e9ed;
  --text-secondary: #a0a4b8;
  --muted:     #6b7094;
  --accent:    #ff6b35;
  --accent-dim:rgba(255,107,53,.12);
  --accent-glow:rgba(255,107,53,.06);
  --hot:       #ef4444;
  --hot-dim:   rgba(239,68,68,.12);
  --warm:      #f59e0b;
  --warm-dim:  rgba(245,158,11,.12);
  --cold:      #3b82f6;
  --cold-dim:  rgba(59,130,246,.12);
  --green:     #22c55e;
  --green-dim: rgba(34,197,94,.10);
  --purple:    #a855f7;
  --purple-dim:rgba(168,85,247,.12);
  --sidebar-w: 220px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,.25);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

/* ── Base ── */
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Ambient App Background ── */
.main {
  position: relative;
}
.main::before {
  content: '';
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 800px 500px at 15% 5%, rgba(255,107,53,0.07), transparent 70%),
    radial-gradient(ellipse 600px 600px at 85% 85%, rgba(59,130,246,0.06), transparent 70%),
    radial-gradient(ellipse 500px 400px at 50% 50%, rgba(255,107,53,0.03), transparent 70%),
    radial-gradient(ellipse 300px 300px at 70% 20%, rgba(168,85,247,0.04), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.main > * { position: relative; z-index: 1; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #161922 0%, #0f1118 40%, #131620 100%);
  border-right: 1px solid rgba(255,107,53,0.08);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  box-shadow: 4px 0 30px rgba(0,0,0,0.3);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 20;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  cursor: pointer;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 16px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  border-left: 3px solid transparent;
  margin: 1px 0;
}
.nav-item:hover {
  background: var(--accent-glow);
  color: var(--text-secondary);
}
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-item .icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-item .icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.nav-badge {
  background: var(--hot);
  color: #fff;
  font-size: 10px;
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: auto;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}
.nav-badge.pulse {
  animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .7; transform: scale(1.15); }
}

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 36px;
  max-width: 1200px;
  overflow-y: auto;
}

.view { display: none; animation: viewFadeIn .25s ease; }
.view.active { display: block; }
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.view > h1 { text-align: center; margin-bottom: 6px; font-size: 30px; }
.view > .subtitle { text-align: center; margin-bottom: 24px; font-size: 15px; }

h1 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -.4px;
}
h1 .emoji { font-size: 32px; margin-right: 8px; }

.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
}

/* ══════════════════════════════════════════════════════════════
   CARDS & CONTAINERS
   ══════════════════════════════════════════════════════════════ */
.card {
  background: linear-gradient(135deg, rgba(27,31,42,0.9), rgba(27,31,42,0.7));
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color var(--transition);
}
.card {
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

.card-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 10px;
  font-weight: 600;
}

/* ── Grids ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── Stat Boxes ── */
.stat-row {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}
.stat-box {
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  flex: 1;
  min-width: 90px;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition);
  isolation: isolate;
}
.stat-box:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(-2px);
  transform: translateY(-1px);
}
.stat-box .num   { font-size: 28px; font-weight: 700; }
.stat-box .label { font-size: 10px; color: var(--muted); margin-top: 4px; letter-spacing: .8px; font-weight: 600; }
.stat-box.hot .num  { color: var(--hot); }
.stat-box.warm .num { color: var(--warm); }
.stat-box.cold .num { color: var(--cold); }
.stat-box.green .num{ color: var(--green); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,107,53,.25);
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 16px rgba(255,107,53,.35);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger  { background: var(--hot); color: #fff; }
.btn-danger:hover  { filter: brightness(1.1); }
.btn-green   { background: var(--green); color: #fff; }
.btn-green:hover   { filter: brightness(1.1); }
.btn-sold    { background: var(--purple); color: #fff; }
.btn-sold:hover    { filter: brightness(1.1); }
.btn-accent  { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover  { filter: brightness(1.15); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ══════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ══════════════════════════════════════════════════════════════ */
input[type=text], input[type=tel], input[type=email],
input[type=password], textarea, select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,107,53,.1);
}
textarea {
  resize: both;
  min-height: 160px;
  max-height: 600px;
  font-family: 'DM Sans', monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow: auto;
}

/* ══════════════════════════════════════════════════════════════
   TAGS & PILLS
   ══════════════════════════════════════════════════════════════ */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.tag-hot  { background: var(--hot-dim); color: var(--hot); }
.tag-warm { background: var(--warm-dim); color: var(--warm); }
.tag-cold { background: var(--cold-dim); color: var(--cold); }
.tag-sold { background: var(--green-dim); color: var(--green); }
.tag-lost { background: rgba(107,114,128,.15); color: #9ca3af; }
.tag-delivering { background: var(--purple-dim); color: var(--purple); }

/* ── Filter Pills ── */
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
}
.filter-pill:hover { border-color: var(--accent); color: var(--text); }
.filter-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.tab {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ══════════════════════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════════════════════ */
.action-banner {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all var(--transition);
}
.action-banner:hover { border-color: var(--text); transform: translateY(-1px); }
.action-banner .ab-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.action-banner .ab-desc  { font-size: 12px; color: var(--muted); }
.action-banner .ab-count { font-size: 22px; font-weight: 700; color: var(--accent); float: right; margin-top: -4px; }

.quick-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; margin-top: 4px; }
.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  flex: 1;
  min-width: 110px;
}

.qa-btn .qa-icon  { font-size: 24px; }
.qa-btn .qa-label { font-size: 12px; color: var(--muted); font-weight: 500; }

.tip-box {
  background: rgba(255,107,53,.04);
  border: 1px solid rgba(255,107,53,.10); border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 18px;
}
.tip-box .title {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: .8px;
}
.tip-box p { font-size: 13px; line-height: 1.5; color: var(--text); }

.quiet-banner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}
.quiet-banner .icon { font-size: 36px; margin-bottom: 8px; }
.quiet-banner p { color: var(--muted); font-size: 14px; }

/* ══════════════════════════════════════════════════════════════
   LEAD ROWS
   ══════════════════════════════════════════════════════════════ */
.lead-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all var(--transition);
}
.lead-row:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: translateX(2px);
}
.lead-row .lr-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.lead-row .lr-dot.hot  { background: var(--hot); box-shadow: 0 0 8px rgba(239,68,68,.4); }
.lead-row .lr-dot.warm { background: var(--warm); }
.lead-row .lr-dot.cold { background: var(--cold); }
.lead-row .lr-info { flex: 1; min-width: 0; }
.lead-row .lr-name { font-weight: 600; font-size: 14px; }
.lead-row .lr-sub  { font-size: 12px; color: var(--muted); }
.lead-row .lr-score {
  font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 10px; color: #fff; flex-shrink: 0;
}
.lead-row .lr-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Pager ── */
.pager {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  justify-content: space-between;
}
.pager select { width: auto; margin: 0; padding: 5px 8px; font-size: 12px; }
.pager-info { font-size: 12px; color: var(--muted); }
.pager span {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}
.pager span:hover { background: var(--accent); color: white; }

/* ══════════════════════════════════════════════════════════════
   DATABASE
   ══════════════════════════════════════════════════════════════ */
.db-grid { display: flex; flex-direction: column; gap: 4px; }
.db-group { margin-bottom: 18px; }
.db-group-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.db-record {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.db-record:hover {
  border-color: var(--accent);
  background: var(--card-hover);
}
.db-record-top { display: flex; align-items: center; gap: 8px; }
.db-record-name {
  font-size: 15px; font-weight: 600; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-record-vehicle { font-size: 12px; color: var(--muted); padding-left: 18px; }
.db-record-mid {
  display: flex; gap: 16px; font-size: 12px;
  color: var(--muted); padding-left: 18px; flex-wrap: wrap;
}
.db-record-mid a { color: var(--accent); text-decoration: none; }
.db-record-mid a:hover { text-decoration: underline; }
.db-record-bottom {
  display: flex; align-items: center; gap: 8px;
  justify-content: space-between; padding-left: 18px; font-size: 11px; color: var(--muted);
}

.db-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.db-dot.hot  { background: var(--hot); }
.db-dot.warm { background: var(--warm); }
.db-dot.cold { background: var(--cold); }
.db-dot.sold { background: var(--green); }
.db-dot.lost { background: #6b7280; }
.db-dot.delivering { background: var(--purple); }

/* ══════════════════════════════════════════════════════════════
   PIPELINE
   ══════════════════════════════════════════════════════════════ */
.pipe-section { margin-bottom: 10px; }
.pipe-header {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; padding: 12px 16px; margin-bottom: 10px;
  transition: background var(--transition);
}
.pipe-header:hover { background: var(--accent-glow); }
.pipe-header .card-title { margin: 0; font-size: 15px; }
.pipe-toggle { font-size: 14px; color: var(--accent); padding: 2px 6px; }
.pipe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 4px; }

.pipe-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.pipe-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
}
.pipe-card .name { font-weight: 600; font-size: 12px; margin-bottom: 0; }
.pipe-card .sub  { font-size: 10px; color: var(--muted); }
.pipe-card .score-bar { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.score-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }

/* ══════════════════════════════════════════════════════════════
   CUSTOMER DETAIL
   ══════════════════════════════════════════════════════════════ */
#view-customer { max-width: 900px; }

.cust-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); cursor: pointer; margin-bottom: 16px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
  transition: all var(--transition);
}
.cust-back:hover { color: var(--text); background: var(--surface); border-color: var(--accent); }
.cust-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cust-header h2 { font-size: 20px; font-weight: 700; margin: 0; }
.cust-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.cust-section {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px;
}
.cust-section .label {
  font-size: 10px; text-transform: uppercase; color: var(--muted);
  letter-spacing: .5px; font-weight: 600; margin-bottom: 6px;
}
.cust-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.status-actions {
  display: flex; gap: 6px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border); flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════
   DETAIL / SLIDE PANELS
   ══════════════════════════════════════════════════════════════ */
.detail-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 50; display: none;
  backdrop-filter: blur(2px);
}
.detail-overlay.show { display: block; }

.detail-panel {
  position: fixed; top: 0; right: 0;
  width: 500px; height: 100vh; background: var(--surface);
  border-left: 1px solid var(--border); z-index: 51;
  overflow-y: auto; padding: 20px; display: none;
  box-shadow: -4px 0 24px rgba(0,0,0,.3);
}
.detail-panel.show { display: block; }

.detail-close {
  position: absolute; top: 14px; right: 16px;
  font-size: 22px; cursor: pointer; color: var(--muted);
  background: none; border: none;
  transition: color var(--transition);
}
.detail-close:hover { color: var(--text); }

.detail-section { margin-bottom: 16px; }
.detail-section .label {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .6px; margin-bottom: 6px; font-weight: 600;
}
.detail-row {
  display: flex; justify-content: space-between; padding: 5px 0;
  font-size: 13px; border-bottom: 1px solid var(--border);
}
.detail-row .val { color: var(--text); font-weight: 500; text-align: right; max-width: 60%; }

/* ── Update Panel ── */
.update-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 60; display: none;
  backdrop-filter: blur(2px);
}
.update-overlay.show { display: block; }
.update-panel {
  position: fixed; top: 0; right: 0;
  width: 440px; height: 100vh; background: var(--surface);
  border-left: 2px solid var(--accent); z-index: 61;
  overflow-y: auto; padding: 24px;
  transform: translateX(100%); transition: transform .25s ease;
  display: block;
}
.update-panel.show { transform: translateX(0); }

/* ══════════════════════════════════════════════════════════════
   COACHING & INSIGHTS
   ══════════════════════════════════════════════════════════════ */
.coaching-box {
  background: rgba(255,107,53,.06);
  border: 1px solid rgba(255,107,53,.15);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.6;
}
.coaching-box .title {
  color: var(--accent); font-weight: 700;
  font-size: 10px; text-transform: uppercase;
  margin-bottom: 6px; letter-spacing: .5px;
}

.next-action {
  background: rgba(34,197,94,.06);
  border: 1px solid rgba(34,197,94,.2);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.next-action .title {
  color: var(--green); font-weight: 700;
  font-size: 10px; text-transform: uppercase;
  margin-bottom: 6px; letter-spacing: .5px;
}

.metric-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.metric-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  border-radius: 3px 0 0 3px;
}
.metric-card.mc-speed::before { background: var(--green); }
.metric-card.mc-persist::before { background: var(--purple); }
.metric-card.mc-channel::before { background: var(--cold); }
.metric-card.mc-brain::before { background: var(--warm); }

.metric-card h3 {
  font-size: 12px; font-weight: 700; margin-bottom: 10px;
  color: var(--accent); text-transform: uppercase; letter-spacing: 1px;
}
.metric-card.mc-speed h3 { color: var(--green); }
.metric-card.mc-persist h3 { color: var(--purple); }
.metric-card.mc-channel h3 { color: var(--cold); }
.metric-card.mc-brain h3 { color: var(--warm); }

.metric-card .stat { font-size: 13px; margin-bottom: 6px; line-height: 1.5; }
.metric-card .stat b { color: var(--text); font-weight: 700; }
.metric-card .insight {
  color: var(--accent); font-size: 12px; margin-top: 8px;
  font-style: italic; line-height: 1.5;
  padding: 8px 10px;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
}
.metric-card.mc-speed .insight { color: var(--green); background: var(--green-dim); }
.metric-card.mc-persist .insight { color: var(--purple); background: var(--purple-dim); }

/* Progress bar for metric cards */
.mc-bar {
  height: 6px; border-radius: 3px;
  background: var(--bg); margin: 8px 0;
  overflow: hidden;
}
.mc-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.6s ease;
}
.mc-bar-fill.green { background: linear-gradient(90deg, #22c55e, #4ade80); }
.mc-bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.mc-bar-fill.hot { background: linear-gradient(90deg, #ef4444, #f97316); }
.mc-bar-fill.purple { background: linear-gradient(90deg, #a855f7, #c084fc); }
.mc-bar-fill.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }

/* Keystone health indicator on home */
.brain-health {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.brain-pulse {
  width: 12px; height: 12px; border-radius: 50%;
  animation: brainPulse 2s ease infinite;
}
.brain-pulse.active { background: var(--green); box-shadow: 0 0 10px var(--green); }
.brain-pulse.learning { background: var(--warm); box-shadow: 0 0 10px var(--warm); }
.brain-pulse.idle { background: var(--muted); }
@keyframes brainPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* Home stat cards */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.stat-card .stat-value {
  font-size: 24px; font-weight: 800; color: var(--text);
}
.stat-card .stat-label {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1px; margin-top: 4px; font-weight: 600;
}

/* Coaching scorecard */
.coach-score {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.coach-score:hover { border-color: var(--border-hover); }
.coach-score-ring {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  flex-shrink: 0;
}
.coach-score-ring.elite { background: var(--green-dim); color: var(--green); border: 2px solid var(--green); }
.coach-score-ring.good { background: var(--accent-dim); color: var(--accent); border: 2px solid var(--accent); }
.coach-score-ring.needs-work { background: var(--hot-dim); color: var(--hot); border: 2px solid var(--hot); }

/* ══════════════════════════════════════════════════════════════
   MESSAGES / CHAT THREAD
   ══════════════════════════════════════════════════════════════ */
.message-item {
  background: var(--card); border-radius: var(--radius-md);
  padding: 10px 12px; margin-bottom: 6px;
  font-size: 13px; line-height: 1.5;
  border-left: 3px solid var(--cold);
}
.message-item.outbound { border-left-color: var(--green); }
.message-item .meta { color: var(--muted); font-size: 11px; margin-top: 4px; }

.chat-thread {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 280px; overflow-y: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
}
.chat-thread::-webkit-scrollbar { width: 4px; }
.chat-thread::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.chat-show-all {
  text-align: center; padding: 8px 0; cursor: pointer;
  font-size: 12px; color: var(--accent);
  border-top: 1px solid var(--border); margin-top: 4px;
}
.chat-show-all:hover { text-decoration: underline; }
.chat-msg { max-width: 90%; }
.chat-msg.chat-out { align-self: flex-end; }
.chat-msg.chat-in  { align-self: flex-start; }
.chat-bubble {
  padding: 10px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.5; word-wrap: break-word;
}
.chat-out .chat-bubble {
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.2);
  border-bottom-right-radius: 4px;
}
.chat-in .chat-bubble {
  background: rgba(59,130,246,.1);
  border: 1px solid rgba(59,130,246,.2);
  border-bottom-left-radius: 4px;
}
.chat-meta { font-size: 10px; color: var(--muted); margin-top: 3px; padding: 0 4px; }

/* ══════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.6); z-index: 60;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-overlay.show { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 640px; max-height: 85vh;
  overflow-y: auto; padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close {
  font-size: 22px; cursor: pointer; color: var(--muted);
  background: none; border: none; transition: color var(--transition);
}
.modal-close:hover { color: var(--text); }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 14px; flex-wrap: wrap;
}

.draft-body {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: 'DM Sans', monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 12px;
  min-height: 80px;
}

/* ══════════════════════════════════════════════════════════════
   INVENTORY
   ══════════════════════════════════════════════════════════════ */
.inv-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all var(--transition);
}
.inv-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.inv-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inv-card-name { font-weight: 600; font-size: 14px; }
.inv-card-details { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.inv-price { color: var(--green); font-weight: 600; }
.inv-new {
  background: var(--accent); color: white;
  padding: 1px 6px; border-radius: 3px;
  font-size: 10px; font-weight: 700; margin-right: 6px;
}

/* ══════════════════════════════════════════════════════════════
   OUTCOMES
   ══════════════════════════════════════════════════════════════ */
.outcome-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px; margin-bottom: 10px;
}
.outcome-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.outcome-name { font-weight: 600; font-size: 14px; }
.outcome-meta { color: var(--muted); font-size: 12px; }
.outcome-preview { color: var(--muted); font-size: 12px; margin-bottom: 8px; font-style: italic; }
.outcome-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.outcome-btn {
  padding: 5px 10px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); cursor: pointer; font-size: 11px;
  transition: var(--transition); font-family: inherit;
}
.outcome-btn:hover { border-color: var(--accent); }
.outcome-btn.positive { border-color: var(--green); color: var(--green); }
.outcome-btn.negative { border-color: var(--hot); color: var(--hot); }
.outcome-btn.appt     { border-color: var(--purple); color: var(--purple); }

/* ══════════════════════════════════════════════════════════════
   SOLD
   ══════════════════════════════════════════════════════════════ */
.sold-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--green); border-radius: var(--radius-md);
  padding: 14px 18px; cursor: pointer; transition: all var(--transition);
}
.sold-card:hover { border-color: var(--green); transform: translateX(2px); }
.sold-name { font-weight: 600; font-size: 15px; }
.sold-vehicle { color: var(--muted); font-size: 13px; margin-top: 3px; }
.sold-right { text-align: right; }
.sold-date { color: var(--green); font-weight: 600; font-size: 14px; }
.sold-badge { color: var(--green); font-size: 11px; font-weight: 700; margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   REMINDERS
   ══════════════════════════════════════════════════════════════ */
.reminder-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 8px; gap: 10px;
}
.reminder-text { font-size: 14px; flex: 1; }
.reminder-meta { color: var(--muted); font-size: 12px; }

/* ══════════════════════════════════════════════════════════════
   HELP
   ══════════════════════════════════════════════════════════════ */
.help-detail { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.help-detail.show { max-height: 800px; }

/* ══════════════════════════════════════════════════════════════
   LEGAL / PRIVACY
   ══════════════════════════════════════════════════════════════ */
.legal-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px; margin-bottom: 14px;
}
.legal-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; color: var(--accent); }
.legal-section p { font-size: 14px; line-height: 1.7; color: var(--muted); margin-bottom: 6px; }

/* ══════════════════════════════════════════════════════════════
   SETTINGS / DANGER ZONE
   ══════════════════════════════════════════════════════════════ */
.danger-zone {
  border: 1px solid var(--hot); border-radius: var(--radius-md);
  padding: 16px; margin-top: 20px;
}
.danger-zone h3 { color: var(--hot); font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.danger-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); gap: 10px;
}
.danger-item:last-child { border-bottom: none; }
.danger-item .desc { font-size: 12px; color: var(--muted); }

/* ══════════════════════════════════════════════════════════════
   PLAYBOOK
   ══════════════════════════════════════════════════════════════ */
.pb-cat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 10px; overflow: hidden;
}
.pb-cat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; cursor: pointer;
  font-weight: 700; font-size: 15px; color: var(--accent);
  background: rgba(255,107,53,.04);
  transition: background var(--transition);
}
.pb-cat-header:hover { background: rgba(255,107,53,.08); }
.pb-cat-body { display: none; padding: 0 12px 12px; }
.pb-cat.open .pb-cat-body { display: block; }
.pb-cat .pb-arrow { transition: .2s; font-size: 12px; color: var(--muted); }
.pb-cat.open .pb-arrow { transform: rotate(0deg); }
.pb-cat:not(.open) .pb-cat-header .pb-arrow { transform: rotate(-90deg); }

.pb-sub {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-top: 8px; overflow: hidden;
}
.pb-sub-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 13px;
  transition: background var(--transition);
}
.pb-sub-header:hover { background: rgba(255,255,255,.02); }
.pb-sub-body { display: none; padding: 10px 14px 14px; }
.pb-sub.open .pb-sub-body { display: block; }
.pb-sub.open > .pb-sub-header > .pb-arrow { transform: rotate(90deg); }

.pb-ctx { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.pb-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.pb-col { border-radius: var(--radius-md); padding: 10px; }
.pb-col-less { background: rgba(239,68,68,.05); border: 1px solid rgba(239,68,68,.12); }
.pb-col-more { background: rgba(34,197,94,.05); border: 1px solid rgba(34,197,94,.12); }
.pb-col-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 8px; color: var(--muted);
}
.pb-col-less .pb-col-title { color: #ef4444; }
.pb-col-more .pb-col-title { color: #22c55e; }
.pb-item {
  font-size: 12px; line-height: 1.5; padding: 6px 8px;
  margin-bottom: 4px; border-radius: 4px; background: rgba(0,0,0,.15);
}
.pb-tip {
  font-size: 12px; line-height: 1.5; padding: 10px 12px;
  background: rgba(255,107,53,.06); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text);
  margin-bottom: 8px;
}
.pb-header {
  padding: 14px 16px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  transition: var(--transition);
}
.pb-header:hover { background: rgba(255,107,53,.03); }
.pb-header h4 { font-size: 14px; font-weight: 700; color: var(--accent); margin: 0; }
.pb-header .arrow { color: var(--muted); transition: .2s; font-size: 14px; }
.pb-card.open .pb-header .arrow { transform: rotate(180deg); }
.pb-body { display: none; padding: 0 16px 16px; }
.pb-card.open .pb-body { display: block; }
.pb-body p { font-size: 13px; line-height: 1.6; color: var(--muted); margin-bottom: 8px; }
.pb-example {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px; font-size: 12px;
  color: var(--muted); margin-bottom: 6px;
}
.pb-example b { color: var(--text); }

/* ══════════════════════════════════════════════════════════════
   MINI LEAD (dashboard)
   ══════════════════════════════════════════════════════════════ */
.mini-lead {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
}
.mini-lead:hover { background: var(--accent-dim); }
.mini-lead .rank {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.mini-lead .info { flex: 1; min-width: 0; }
.mini-lead .info .n { font-size: 13px; font-weight: 600; }
.mini-lead .info .s { font-size: 11px; color: var(--muted); }

/* ══════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════════════════════════ */


/* ══════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════ */
/* Old toast element (hidden — replaced by toast-container system) */
#toast {
  display: none !important;
}


/* View accent lines — clean solid colors */
#view-dashboard > h1::after  { background: var(--accent); }
#view-pipeline > h1::after   { background: var(--cold); }
#view-coaching > h1::after   { background: var(--warm); }
#view-leads > h1::after      { background: var(--hot); }
#view-database > h1::after   { background: var(--purple); }
#view-paste > h1::after      { background: var(--accent); }
#view-inventory > h1::after  { background: var(--green); }
#view-outcomes > h1::after   { background: var(--green); }
#view-reminders > h1::after  { background: var(--warm); }
#view-sold > h1::after       { background: var(--warm); }
#view-settings > h1::after,
#view-admin > h1::after      { background: var(--muted); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    width: 56px;
  }
  .sidebar .nav-label,
  .sidebar-logo span { display: none; }
  .sidebar-logo {
    font-size: 18px;
    padding: 12px 8px;
    justify-content: center;
  }
  .nav-item {
    justify-content: center;
    padding: 10px 8px;
    border-left: none;
    border-bottom: 2px solid transparent;
  }
  .nav-item.active { border-bottom-color: var(--accent); border-left-color: transparent; }
  .nav-item .icon { margin: 0; }
  .nav-badge { position: absolute; top: 4px; right: 4px; }

  .main { margin-left: 56px; padding: 16px; }
  .detail-panel { width: 100%; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .db-group-list { grid-template-columns: 1fr; }
  .pipe-grid { grid-template-columns: 1fr 1fr; }
  .cust-grid { grid-template-columns: 1fr; }
  .pb-columns { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .main { padding: 12px; }
  .stat-box { min-width: 70px; padding: 10px 8px; }
  .stat-box .num { font-size: 22px; }
  .quick-actions { gap: 6px; }
  .qa-btn { min-width: 80px; padding: 12px 8px; }
}


/* ═══════════════════════════════════════════════════════════
   LOGIN / REGISTER — Split Panel Design
   ═══════════════════════════════════════════════════════════ */
.login-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: #0a0e17;
  overflow-y: auto;
}
.login-screen.hidden { display: none; }

/* Animated background */
.login-bg {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none;
}
.login-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,107,53,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,107,53,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.login-bg-glow {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.15;
  animation: login-drift 20s ease-in-out infinite;
}
.login-bg-glow.g1 { width: 500px; height: 500px; background: #ff6b35; top: -10%; left: -5%; animation-delay: 0s; }
.login-bg-glow.g2 { width: 400px; height: 400px; background: #1a6bff; bottom: -10%; right: -5%; animation-delay: -7s; }
.login-bg-glow.g3 { width: 300px; height: 300px; background: #ff6b35; top: 50%; left: 50%; animation-delay: -14s; }
@keyframes login-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.1); }
  66% { transform: translate(-20px, 30px) scale(0.9); }
}

/* Split layout */
.login-container {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 50px); gap: 60px;
  padding: 40px;
  max-width: 1100px; margin: 0 auto;
}

/* Left hero panel */
.login-hero {
  flex: 1; max-width: 460px;
  animation: login-fadein 0.8s ease-out;
}
.login-hero-badge {
  display: inline-block;
  background: rgba(255,107,53,0.12); color: #ff6b35;
  padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; margin-bottom: 20px;
  border: 1px solid rgba(255,107,53,0.2);
}
.login-hero-title {
  font-size: 56px; font-weight: 800; line-height: 1.05;
  color: #e8eaed; margin: 0 0 16px;
  font-family: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
}
.login-hero-title span { color: #ff6b35; }
.login-hero-sub {
  font-size: 17px; line-height: 1.6; color: #8b95a5;
  margin: 0 0 32px;
}
.login-hero-stats {
  display: flex; gap: 24px;
}
.login-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; padding: 14px 18px;
  flex: 1; text-align: center;
}
.login-stat-num {
  font-size: 22px; font-weight: 700; color: #ff6b35;
  display: block; margin-bottom: 2px;
}
.login-stat-label {
  font-size: 11px; color: #6b7280; text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Right form card */
.login-box {
  width: 400px; flex-shrink: 0;
  background: rgba(17,24,39,0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.03) inset;
  animation: login-slideup 0.6s ease-out;
}
@keyframes login-fadein { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
@keyframes login-slideup { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.login-form-title {
  font-size: 24px; font-weight: 700; color: #e8eaed;
  margin: 0 0 4px;
}
.login-form-sub {
  font-size: 14px; color: #6b7280; margin: 0 0 24px;
}

.login-field { margin-bottom: 16px; }
.login-field label {
  display: block; font-size: 13px; font-weight: 500;
  color: #9ca3af; margin-bottom: 6px;
}
.login-field input,
.login-field select {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: #e8eaed;
  font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.login-field input:focus,
.login-field select:focus {
  border-color: #ff6b35;
  box-shadow: 0 0 0 3px rgba(255,107,53,0.15);
}
.login-field input::placeholder { color: #4b5563; }

.login-row { display: flex; gap: 12px; }
.login-row .login-field { flex: 1; }

.login-hint {
  font-size: 11px; color: #6b7280; margin: 4px 0 0;
}
.login-pin-toggle {
  position: absolute; right: 12px; top: 11px;
  font-size: 12px; color: #ff6b35; cursor: pointer;
  user-select: none;
}

.login-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #ff6b35, #e85d26);
  color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 4px;
}
.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,107,53,0.35);
}
.login-btn:active { transform: translateY(0); }

.login-error {
  color: #ef4444; font-size: 13px; margin-top: 10px;
  display: none;
}

.login-switch {
  text-align: center; margin-top: 20px;
  font-size: 13px; color: #6b7280;
}
.login-switch a {
  color: #ff6b35; font-weight: 600; text-decoration: none;
}
.login-switch a:hover { text-decoration: underline; }

.login-footer {
  position: relative; z-index: 1;
  text-align: center; padding: 16px;
  font-size: 11px; color: #4b5563;
}
.login-footer a { color: #6b7280; text-decoration: none; }
.login-footer a:hover { color: #ff6b35; }

/* Responsive — stack on mobile */
@media (max-width: 860px) {
  .login-container { flex-direction: column; gap: 30px; padding: 24px; }
  .login-hero { max-width: 100%; text-align: center; }
  .login-hero-title { font-size: 40px; }
  .login-hero-stats { justify-content: center; }
  .login-box { width: 100%; max-width: 420px; }
}

/* ── View Header Accent ── */
.view > h1 {
  position: relative;
  padding-bottom: 12px;
}
.view > h1::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 3px;
  background: linear-gradient(90deg, #ff6b35, #ff8f5e);
  border-radius: 2px;
}

/* ── Sidebar Logo Enhancement ── */
.sidebar-logo {
  position: relative;
}
.sidebar-logo::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 16px; right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,107,53,0.3), transparent);
}

/* ── Toast (handled by toast-container system) ── */

/* ── Active Nav Glow ── */
.nav-item.active {
  position: relative;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: linear-gradient(180deg, #ff6b35, #ff8f5e);
  border-radius: 0 2px 2px 0;
}


/* ── Dashboard greeting enhancement ── */
#hub-greeting { font-size: 16px; color: var(--text-secondary); margin-bottom: 20px; }


/* ═══════════════════════════════════════════════════════════════
   VISUAL ENHANCEMENT LAYER — v4.5.1
   ═══════════════════════════════════════════════════════════════ */

/* Stat box type-specific glows */
.stat-box.hot::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(239,68,68,0.08), transparent 70%);
  pointer-events: none;
}
.stat-box.warm::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(245,158,11,0.08), transparent 70%);
  pointer-events: none;
}
.stat-box.cold::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(59,130,246,0.08), transparent 70%);
  pointer-events: none;
}
.stat-box.green::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(34,197,94,0.08), transparent 70%);
  pointer-events: none;
}

/* Stat box hover glow intensify */
.stat-box.hot:hover { border-color: rgba(239,68,68,0.4); box-shadow: 0 4px 25px rgba(239,68,68,0.15); }
.stat-box.warm:hover { border-color: rgba(245,158,11,0.4); box-shadow: 0 4px 25px rgba(245,158,11,0.15); }
.stat-box.cold:hover { border-color: rgba(59,130,246,0.4); box-shadow: 0 4px 25px rgba(59,130,246,0.15); }
.stat-box.green:hover { border-color: rgba(34,197,94,0.4); box-shadow: 0 4px 25px rgba(34,197,94,0.15); }

/* Sales tip banner glow */
#hub-tip .card {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(255,107,53,0.06), transparent 40%);
}

/* Quiet mode banner */
.quiet-banner {
  background: linear-gradient(135deg, rgba(27,31,42,0.8), rgba(20,23,31,0.9)) !important;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

/* Pipeline sections */
.pipe-header {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(255,107,53,0.05), transparent 50%);
}
.pipe-card {
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.pipe-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Coaching tabs glow when active */
.coach-tab.active {
  box-shadow: 0 2px 10px rgba(255,107,53,0.2);
}

/* Draft modal backdrop */
#draft-modal {
  backdrop-filter: blur(8px);
}

/* Inventory cards */
.inv-card {
  transition: transform 0.2s, box-shadow 0.2s;
}
.inv-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Mini lead cards in dashboard */
.mini-lead {
  transition: background 0.15s, transform 0.15s;
  border-radius: 8px;
}
.mini-lead:hover {
  background: rgba(255,107,53,0.06);
  transform: translateX(4px);
}

/* Customer detail panel */
.detail-grid .detail-item {
  transition: background 0.15s;
  border-radius: 6px;
}
.detail-grid .detail-item:hover {
  background: rgba(255,255,255,0.03);
}

/* Toast handled by toast-container system */

/* Sidebar divider line */
.sidebar-divider {
  background: linear-gradient(90deg, transparent, rgba(255,107,53,0.15), transparent);
  height: 1px;
}

/* Badge pulse — more visible */
.nav-badge.pulse {
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,53,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(255,107,53,0); }
}

/* Page titles */
.view > h1 .emoji {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Empty state styling */
.view p[style*="color:var(--muted)"] {
  font-style: italic;
  opacity: 0.7;
}

/* Button improvements */
.btn-primary {
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255,107,53,0.3);
}

/* Scrollbar on sidebar */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,107,53,0.2); border-radius: 3px; }


/* ══════════════════════════════════════════════════════════════
   POLISH LAYER — Toast, Loading, Transitions, Micro-interactions
   ══════════════════════════════════════════════════════════════ */

/* ── Toast Notification System ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 20px 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  transform: translateX(120%);
  opacity: 0;
  transition: all .35s cubic-bezier(.4,0,.2,1);
  max-width: 380px;
  border: 1px solid;
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}
.toast.toast-exit {
  transform: translateX(120%);
  opacity: 0;
}
.toast-success {
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.25);
  color: var(--green);
}
.toast-error {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.25);
  color: var(--hot);
}
.toast-info {
  background: rgba(59,130,246,.12);
  border-color: rgba(59,130,246,.25);
  color: var(--cold);
}
.toast-warning {
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.25);
  color: var(--warm);
}
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }
.toast-close {
  cursor: pointer; opacity: .5; font-size: 16px;
  transition: opacity .15s; flex-shrink: 0;
}
.toast-close:hover { opacity: 1; }
.toast-progress {
  position: absolute; bottom: 0; left: 0; height: 2px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  animation: toastProgress 3.5s linear forwards;
}
.toast-success .toast-progress { background: var(--green); }
.toast-error .toast-progress { background: var(--hot); }
.toast-info .toast-progress { background: var(--cold); }
.toast-warning .toast-progress { background: var(--warm); }
@keyframes toastProgress {
  from { width: 100%; } to { width: 0; }
}

/* ── Loading Spinner ── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Button Loading State ── */
.btn.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  top: 50%; left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.btn-primary.btn-loading::after { border-top-color: #fff; }
.btn-green.btn-loading::after { border-top-color: #fff; }
.btn-danger.btn-loading::after { border-top-color: #fff; }

/* ── View Transitions (defined at line ~199) ── */


/* ── Skeleton Loading Placeholder ── */
.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--card-hover) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Sidebar Active Indicator (handled at line ~1323) ── */

/* ── Import Result Slide-in ── */
.import-result {
  animation: slideUp .35s cubic-bezier(.4,0,.2,1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Badge Bounce on Update ── */
@keyframes badgeBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}
.badge-bounce {
  animation: badgeBounce .3s ease-out;
}

/* ── Modal Backdrop Blur ── */
.modal-overlay {
  backdrop-filter: blur(4px);
  transition: opacity .2s ease;
}

/* ── Action Button Press Effect ── */
.btn:active:not(.btn-loading) {
  transform: scale(.97);
}
.btn {
  transition: all var(--transition);
}

/* ── Customer Action Bar — Sticky Bottom ── */
.cust-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--surface) 70%, transparent);
  padding: 16px 0 8px;
  z-index: 5;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: .5;
}
.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-state-desc {
  font-size: 13px;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

/* ── Success Check Animation ── */
@keyframes checkPop {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.check-pop {
  animation: checkPop .4s cubic-bezier(.4,0,.2,1);
}

/* ── Subtle pulse for urgent items ── */
@keyframes subtlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}
.pulse-gentle {
  animation: subtlePulse 2s ease-in-out infinite;
}

/* ── Stat number count-up effect ── */
.stat-num-animate {
  transition: all .4s cubic-bezier(.4,0,.2,1);
}

/* ── Focus ring for accessibility ── */
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#hub-content { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ══════════════════════════════════════════════════════════════
   DESIGN ENHANCEMENTS — v4.6
   Next Action strips, collapsible sidebar, intelligence drawer,
   empty states, keyboard shortcuts, design polish
   ══════════════════════════════════════════════════════════════ */

/* ── Sidebar Toggle (hamburger) ── */
.sidebar-toggle {
  display: none;
  position: fixed; top: 12px; left: 12px; z-index: 1001;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  color: var(--text); cursor: pointer; font-size: 18px;
  line-height: 1; transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--card-hover); border-color: var(--accent); }

@media (max-width: 1100px) {
  .sidebar-toggle { display: block; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 1000;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.5); }
  .main { margin-left: 0 !important; padding-top: 52px; }
  .sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    z-index: 999; opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
  }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
}

/* ── Next Action Strip on customer cards ── */
.next-action {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; margin-top: 6px;
  background: rgba(255,107,53,.06); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 11px; color: var(--accent); font-weight: 600;
  letter-spacing: 0.3px;
}
.next-action .na-icon { font-size: 13px; flex-shrink: 0; }
.next-action .na-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Intelligence Drawer (inside detail panel) ── */
.intel-drawer {
  margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px;
}
.intel-drawer summary {
  cursor: pointer; font-size: 12px; font-weight: 700;
  color: var(--accent); letter-spacing: 0.5px; text-transform: uppercase;
  padding: 8px 0; user-select: none; list-style: none;
}
.intel-drawer summary::before {
  content: '▸ '; transition: transform .15s;
}
.intel-drawer[open] summary::before { content: '▾ '; }
.intel-drawer .intel-chain {
  padding: 8px 0; font-size: 12px; line-height: 1.7;
}
.intel-chain .intel-step {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 4px 0; border-left: 2px solid var(--border);
  padding-left: 12px; margin-left: 6px;
}
.intel-step .step-icon { flex-shrink: 0; font-size: 14px; }
.intel-step .step-text { color: var(--text-secondary); }
.intel-step .step-score {
  margin-left: auto; font-weight: 700; font-size: 11px;
  padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
}
.intel-step .step-score.positive { color: var(--green); background: var(--green-dim); }
.intel-step .step-score.negative { color: var(--hot); background: var(--hot-dim); }
.intel-step .step-score.neutral { color: var(--muted); background: rgba(107,112,148,.1); }

/* ── Empty States — Give Life to Empty Pages ── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.empty-state .es-title {
  font-size: 16px; font-weight: 700; color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-state .es-sub { font-size: 13px; line-height: 1.6; max-width: 360px; margin: 0 auto; }
.empty-state .es-action {
  margin-top: 16px;
}

/* ── Pipeline Card Next Action ── */
.pipe-card .next-action { margin: 4px -10px -8px; border-radius: 0 0 var(--radius-md) var(--radius-md); }

/* ── Coaching Performance polish ── */
.metric-card {
  border-radius: var(--radius-md); padding: 20px;
  background: var(--card); border: 1px solid var(--border);
  margin-bottom: 12px;
}
.metric-card h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent); font-weight: 700; margin-bottom: 12px;
}
.metric-card .stat { font-size: 14px; color: var(--text); margin: 6px 0; }
.metric-card .stat b { font-size: 18px; }
.metric-card .insight {
  font-size: 12px; color: var(--muted); padding: 8px 12px;
  background: var(--surface); border-radius: var(--radius-sm);
  margin-top: 10px;
}
.mc-bar {
  height: 6px; background: var(--surface); border-radius: 3px;
  margin-top: 8px; overflow: hidden;
}
.mc-bar-fill {
  height: 100%; border-radius: 3px; transition: width .6s ease;
}
.mc-bar-fill.green { background: var(--green); }
.mc-bar-fill.warn { background: var(--warm); }
.mc-bar-fill.hot { background: var(--hot); }
.mc-bar-fill.purple { background: var(--purple); }
.mc-speed { border-left: 3px solid var(--purple); }
.mc-persist { border-left: 3px solid var(--purple); }
.mc-channel { border-left: 3px solid var(--green); }

/* ── Sold page polish ── */
.sold-card {
  border: 1px solid var(--green); border-radius: var(--radius-md);
  padding: 16px 20px; background: var(--card);
  display: flex; align-items: center; justify-content: space-between;
}
.sold-card .sold-name { font-size: 15px; font-weight: 600; color: var(--text); }
.sold-card .sold-date { font-size: 13px; color: var(--green); font-weight: 700; }
.sold-card .sold-badge { font-size: 11px; color: var(--green); opacity: 0.7; }

/* ── Battle plan cards hover ── */
.bp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  transition: background .15s; cursor: pointer;
}
.bp-row:hover { background: var(--card-hover); }
.bp-rank {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0;
}
.bp-rank.r1 { background: var(--hot); }
.bp-rank.r2 { background: var(--warm); }
.bp-rank.r3 { background: var(--accent); }
.bp-rank.r4, .bp-rank.r5 { background: var(--muted); }
.bp-info { flex: 1; min-width: 0; }
.bp-name { font-size: 14px; font-weight: 600; color: var(--text); }
.bp-sub { font-size: 11px; color: var(--muted); }

/* ── Keyboard shortcut hints ── */
.kbd {
  display: inline-block; padding: 2px 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; font-size: 10px; font-family: monospace;
  color: var(--muted); vertical-align: middle;
}

/* ── Keystone Command chips ── */
.cmd-chip{
  padding:4px 10px;border:1px solid var(--border);border-radius:16px;
  background:var(--card);color:var(--muted);font-size:11px;cursor:pointer;
  transition:all 0.15s;white-space:nowrap;
}
.cmd-chip:hover{background:var(--accent);color:#fff;border-color:var(--accent)}

/* ── Sticky Toast (top banner alerts) ── */
.sticky-toast{
  position:fixed;top:0;left:200px;right:0;z-index:10000;
  display:none;align-items:center;justify-content:space-between;
  padding:10px 20px;font-size:13px;color:#fff;
  box-shadow:0 2px 12px rgba(0,0,0,0.3);
  transition:transform 0.3s;transform:translateY(-100%);
}
@media(max-width:768px){.sticky-toast{left:0}}
.sticky-toast.show{display:flex;transform:translateY(0)}
.sticky-toast.warn{background:#c05621}
.sticky-toast.hot{background:#c53030}
.sticky-toast.info{background:#2563eb}
.sticky-toast-content{flex:1;line-height:1.5}
.sticky-toast-content b{font-weight:700}
.sticky-toast-actions{display:flex;gap:6px;margin-left:12px;flex-shrink:0}
.sticky-toast-actions button{font-size:11px;padding:4px 10px}

/* ── Home two-column responsive ── */
@media(max-width:900px){
  #home-screen > div[style*="grid-template-columns"]{grid-template-columns:1fr !important}
}
/* ── Slide-in animation for toast/alerts ── */
@keyframes slideIn{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}

/* ── Academy section collapse/expand ── */
.academy-lessons.collapsed { display: none; }

/* ── LLM Review spinner ── */
.spinner-sm{display:inline-block;width:12px;height:12px;border:2px solid var(--border);border-top-color:var(--warm);border-radius:50%;animation:spin-sm 0.8s linear infinite}
@keyframes spin-sm{to{transform:rotate(360deg)}}
