/* ============================================================
   Cars With Fares CRM — Operator Dashboard
   ============================================================ */

:root {
  --bg:      #050506;
  --bg2:     #0e0e10;
  --bg3:     #131518;
  --bg4:     #1a1d22;
  --fg:      #FFFFFF;
  --fg2:     #E0E2E8;
  --fg3:     #8A8F9E;
  --fg4:     #50556A;
  --blue:    #6EAAFF;
  --blue-d:  rgba(110,170,255,.1);
  --green:   #4ade80;
  --green-d: rgba(74,222,128,.1);
  --yellow:  #facc15;
  --yellow-d:rgba(250,204,21,.1);
  --red:     #f87171;
  --red-d:   rgba(248,113,113,.1);
  --purple:  #A78BFA;
  --purple-d:rgba(167,139,250,.1);
  --border:  #1a1a1f;
  --line:    rgba(255,255,255,.07);
  --line2:   rgba(255,255,255,.04);
  --r:       8px;
  --r2:      6px;
  --font:    'Inter', system-ui, sans-serif;
  --shadow:  0 4px 24px rgba(0,0,0,.5);
  --shadow2: 0 8px 40px rgba(0,0,0,.7);
  --sidebar: 220px;
}

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

html { font-size: 14px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); cursor: pointer; }

/* ========================================================
   TOAST SYSTEM
   ======================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  min-width: 280px;
  max-width: 360px;
  pointer-events: all;
  box-shadow: var(--shadow2);
  animation: toastIn .2s cubic-bezier(.22,.68,0,1.2);
  border-left-width: 3px;
}

.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--yellow); }
.toast.info    { border-left-color: var(--blue); }

.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast.success .toast-icon { color: var(--green); }
.toast.error   .toast-icon { color: var(--red); }
.toast.warning .toast-icon { color: var(--yellow); }
.toast.info    .toast-icon { color: var(--blue); }

.toast-msg  { flex: 1; font-size: 13px; font-weight: 500; color: var(--fg); line-height: 1.4; }

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--fg4);
  padding: 0;
  line-height: 0;
  cursor: pointer;
  transition: color .15s;
}
.toast-close:hover { color: var(--fg3); }

.toast.out { animation: toastOut .18s ease forwards; }

@keyframes toastIn  { from { opacity: 0; transform: translateX(20px) scale(.96); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { to   { opacity: 0; transform: translateX(20px); } }

@media (max-width: 768px) {
  .toast-container { top: auto; bottom: 80px; right: 12px; left: 12px; }
  .toast { min-width: unset; max-width: unset; }
}

/* ========================================================
   SKELETON SHIMMER
   ======================================================== */
.skel {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========================================================
   PAGE TRANSITIONS
   ======================================================== */
.page-enter { animation: pageIn .15s ease; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   LOGIN
   ======================================================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at 50% 0%, rgba(110,170,255,.05) 0%, transparent 60%);
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 44px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow2);
}

.login-emblem { margin-bottom: 22px; display: inline-block; }

.login-brand {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 4px;
}
.login-brand span { color: var(--blue); }

.login-tagline {
  color: var(--fg4);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 32px;
}

.login-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  margin-bottom: 12px;
  display: block;
}
.login-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(110,170,255,.1);
}
.login-input::placeholder { color: var(--fg4); }

.login-btn {
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: #000;
  border: none;
  border-radius: var(--r);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  letter-spacing: .2px;
}
.login-btn:hover   { opacity: .9; }
.login-btn:active  { transform: scale(.99); }
.login-btn:disabled { opacity: .5; cursor: not-allowed; }

.login-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}

/* ========================================================
   APP LAYOUT
   ======================================================== */
.app { display: flex; min-height: 100vh; }

/* ========================================================
   SIDEBAR
   ======================================================== */
.sidebar {
  width: var(--sidebar);
  background: #08080a;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-mark {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.3px;
  line-height: 1;
  margin-bottom: 4px;
}
.sidebar-mark span { color: var(--blue); }

.sidebar-name {
  font-size: 10.5px;
  color: var(--fg4);
  font-weight: 500;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

.nav-icon { width: 17px; height: 17px; flex-shrink: 0; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: var(--fg4);
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: color .12s, background .12s;
}

.nav-item:hover {
  color: var(--fg2);
  background: rgba(255,255,255,.03);
}

.nav-item.active {
  color: var(--blue);
  background: rgba(110,170,255,.07);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 7px; bottom: 7px;
  width: 3px;
  background: var(--blue);
  border-radius: 0 2px 2px 0;
}

.sidebar-footer {
  padding: 8px 0 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: var(--fg4);
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: color .12s;
  cursor: pointer;
}
.nav-logout:hover { color: var(--red); }

/* ========================================================
   MAIN CONTENT AREA
   ======================================================== */
.main {
  flex: 1;
  margin-left: var(--sidebar);
  padding: 28px 28px 48px;
  min-width: 0;
  max-width: 1400px;
}

/* ========================================================
   BOTTOM NAV (mobile)
   ======================================================== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
}

.btm-icon { width: 22px; height: 22px; }

.btm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  color: var(--fg4);
  font-size: 10px;
  font-weight: 500;
  border: none;
  background: none;
  transition: color .12s;
  min-width: 48px;
}
.btm-item.active { color: var(--blue); }
.btm-item:hover  { color: var(--fg3); }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px 14px 88px; max-width: none; }
  .bottom-nav { display: block; }
}

/* ========================================================
   COMMON PAGE COMPONENTS
   ======================================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 10px;
}

.page-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.4px;
}

.page-sub {
  font-size: 12.5px;
  color: var(--fg4);
  margin-top: 2px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg4);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 22px 0 10px;
}

/* ========================================================
   CARDS
   ======================================================== */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
}

.card-hover { transition: border-color .2s, box-shadow .2s; }
.card-hover:hover {
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 0 20px rgba(0,0,0,.3);
}

/* ========================================================
   STAT CARDS
   ======================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 1000px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .stat-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  border-left-width: 3px;
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.3); }

.stat-card.a-green  { border-left-color: var(--green); }
.stat-card.a-blue   { border-left-color: var(--blue); }
.stat-card.a-red    { border-left-color: var(--red); }
.stat-card.a-purple { border-left-color: var(--purple); }
.stat-card.a-yellow { border-left-color: var(--yellow); }

.stat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.stat-label.green  { color: var(--green); }
.stat-label.blue   { color: var(--blue); }
.stat-label.red    { color: var(--red); }
.stat-label.purple { color: var(--purple); }
.stat-label.yellow { color: var(--yellow); }

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon.green  { background: var(--green-d);  color: var(--green); }
.stat-icon.blue   { background: var(--blue-d);   color: var(--blue); }
.stat-icon.red    { background: var(--red-d);    color: var(--red); }
.stat-icon.purple { background: var(--purple-d); color: var(--purple); }
.stat-icon.yellow { background: var(--yellow-d); color: var(--yellow); }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-sub {
  font-size: 11.5px;
  color: var(--fg4);
}

/* ========================================================
   PROGRESS BAR
   ======================================================== */
.progress-wrap { margin-bottom: 20px; }

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}
.progress-meta-label { color: var(--fg4); font-weight: 500; }
.progress-meta-val   { color: var(--fg2); font-weight: 600; }

.progress-bar {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .6s cubic-bezier(.22,.68,0,1.2);
}
.progress-fill.green  { background: var(--green); }
.progress-fill.blue   { background: var(--blue); }
.progress-fill.yellow { background: var(--yellow); }
.progress-fill.red    { background: var(--red); }

/* ========================================================
   REVENUE SUMMARY BAR
   ======================================================== */
.rev-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 20px;
}

.rev-bar-item {
  background: var(--bg2);
  padding: 14px 16px;
  text-align: center;
}

.rev-bar-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--fg4);
  margin-bottom: 5px;
}

.rev-bar-value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--green);
}

@media (max-width: 480px) {
  .rev-bar { grid-template-columns: 1fr; }
}

/* ========================================================
   CHART CONTAINERS
   ======================================================== */
.chart-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  margin-bottom: 14px;
}

.chart-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg3);
  margin-bottom: 14px;
}

.chart-canvas {
  width: 100%;
  height: 180px;
  display: block;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 768px) {
  .analytics-grid { grid-template-columns: 1fr; }
}

/* ========================================================
   DASHBOARD TWO-COLUMN
   ======================================================== */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 768px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* ========================================================
   TODAY'S SCHEDULE
   ======================================================== */
.schedule-list { display: flex; flex-direction: column; gap: 7px; }

.schedule-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  cursor: pointer;
  transition: border-color .15s;
}
.schedule-row:hover { border-color: rgba(110,170,255,.3); }

.schedule-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.schedule-info { flex: 1; min-width: 0; }
.schedule-name { font-size: 13.5px; font-weight: 600; }
.schedule-detail { font-size: 12px; color: var(--fg3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.schedule-right { text-align: right; flex-shrink: 0; }
.schedule-amount { font-size: 13px; font-weight: 600; color: var(--green); }
.schedule-time { font-size: 11px; color: var(--fg4); margin-top: 1px; }

/* ========================================================
   ATTENTION + UPCOMING ITEMS
   ======================================================== */
.attn-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  margin-bottom: 7px;
  cursor: pointer;
  transition: border-color .15s;
}
.attn-item:hover { border-color: rgba(110,170,255,.3); }

.attn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.attn-dot.urgent { background: var(--red); }
.attn-dot.warn   { background: var(--yellow); }
.attn-dot.blue   { background: var(--blue); }

.attn-info   { flex: 1; min-width: 0; }
.attn-name   { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-detail { font-size: 12px; color: var(--fg3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-right  { text-align: right; flex-shrink: 0; }
.attn-time   { font-size: 11px; color: var(--fg4); }

/* ========================================================
   ACTIVITY TIMELINE
   ======================================================== */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line2);
}

.activity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-dot.note          { background: var(--blue); }
.activity-dot.status_change { background: var(--yellow); }
.activity-dot.quote_sent    { background: var(--green); }
.activity-dot.call          { background: var(--purple); }
.activity-dot.follow_up     { background: var(--red); }
.activity-dot.default       { background: var(--fg4); }

.activity-content { font-size: 13px; color: var(--fg2); line-height: 1.4; }
.activity-meta    { font-size: 11px; color: var(--fg4); margin-top: 2px; }

/* ========================================================
   KANBAN BOARD
   ======================================================== */
.kanban {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
  min-height: calc(100vh - 120px);
}

.kanban-col {
  min-width: 240px;
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}

.kanban-header {
  padding: 12px 13px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.kanban-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.kanban-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-count {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--fg3);
}

.kanban-col-total {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
}

.kanban-cards {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

.kanban-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 11px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.kanban-card:hover {
  border-color: rgba(110,170,255,.3);
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.kanban-card:last-child { margin-bottom: 0; }

.kc-name    { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.kc-vehicle { font-size: 11.5px; color: var(--fg3); margin-bottom: 3px; }
.kc-services {
  font-size: 11.5px;
  color: var(--fg3);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--fg4);
  margin-bottom: 8px;
}
.kc-amount { color: var(--green); font-weight: 600; font-size: 12.5px; }

/* ONE-TAP ADVANCE BUTTON */
.kc-advance-wrap {
  padding-top: 8px;
  border-top: 1px solid var(--line2);
  display: flex;
  gap: 5px;
}

.btn-advance {
  flex: 1;
  padding: 6px 10px;
  border-radius: 5px;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.btn-advance:active { transform: scale(.98); }

.btn-advance.lead        { background: rgba(250,204,21,.12); color: var(--yellow); }
.btn-advance.lead:hover  { background: rgba(250,204,21,.2); }
.btn-advance.quoted      { background: rgba(110,170,255,.12); color: var(--blue); }
.btn-advance.quoted:hover{ background: rgba(110,170,255,.2); }
.btn-advance.booked      { background: rgba(167,139,250,.12); color: var(--purple); }
.btn-advance.booked:hover{ background: rgba(167,139,250,.2); }
.btn-advance.in_progress { background: rgba(74,222,128,.12); color: var(--green); }
.btn-advance.in_progress:hover { background: rgba(74,222,128,.2); }
.btn-advance.done        { background: rgba(74,222,128,.18); color: var(--green); }
.btn-advance.done:hover  { background: rgba(74,222,128,.28); }

.btn-advance-lost {
  padding: 6px 8px;
  border-radius: 5px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  background: none;
  border: 1px solid var(--border);
  color: var(--fg4);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.btn-advance-lost:hover { border-color: var(--red); color: var(--red); }

@media (max-width: 768px) {
  .kanban { flex-direction: column; min-height: unset; }
  .kanban-col { min-width: unset; max-height: unset; }
}

/* ========================================================
   CUSTOMER CARDS
   ======================================================== */
.cust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.cust-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.cust-card:hover {
  border-color: rgba(110,170,255,.25);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

.cust-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.cust-card-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.cust-card-phone {
  font-size: 12px;
  color: var(--fg3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.cust-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line2);
}

.cust-stat-item { text-align: center; }
.cust-stat-val  { font-size: 15px; font-weight: 700; color: var(--fg); }
.cust-stat-val.money { color: var(--green); }
.cust-stat-lbl  { font-size: 10px; color: var(--fg4); margin-top: 2px; text-transform: uppercase; letter-spacing: .3px; }

@media (max-width: 600px) {
  .cust-grid { grid-template-columns: 1fr; }
}

/* ========================================================
   TABLES
   ======================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); }

.list-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}

.list-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--fg4);
  padding: 11px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.list-table td {
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--line2);
  color: var(--fg2);
}

.list-table tbody tr { cursor: pointer; transition: background .1s; }
.list-table tbody tr:hover { background: rgba(255,255,255,.02); }
.list-table tbody tr:last-child td { border-bottom: none; }

/* ========================================================
   BADGES
   ======================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}

.badge-lead       { background: var(--red-d);    color: var(--red); }
.badge-quoted     { background: var(--yellow-d); color: var(--yellow); }
.badge-booked     { background: var(--blue-d);   color: var(--blue); }
.badge-in_progress{ background: var(--purple-d); color: var(--purple); }
.badge-done       { background: var(--green-d);  color: var(--green); }
.badge-paid       { background: rgba(74,222,128,.18); color: var(--green); }
.badge-lost       { background: rgba(255,255,255,.05); color: var(--fg3); }

.badge-individual { background: var(--blue-d);   color: var(--blue); }
.badge-dealer     { background: var(--yellow-d); color: var(--yellow); }
.badge-fleet      { background: var(--purple-d); color: var(--purple); }
.badge-bodyshop   { background: var(--green-d);  color: var(--green); }

/* ========================================================
   BUTTONS
   ======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary  { background: var(--blue); color: #000; }
.btn-primary:hover { opacity: .88; }
.btn-primary:active { transform: scale(.99); }

.btn-secondary { background: var(--bg3); color: var(--fg2); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: rgba(255,255,255,.14); background: var(--bg4); }

.btn-danger { background: var(--red-d); color: var(--red); border: 1px solid rgba(248,113,113,.2); }
.btn-danger:hover { background: rgba(248,113,113,.2); }

.btn-ghost { background: transparent; color: var(--fg2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg3); }

.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-xs { padding: 4px 9px; font-size: 11.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ========================================================
   ACTION BUTTONS (inline)
   ======================================================== */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--fg3);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  font-family: var(--font);
}
.action-btn:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }

/* ========================================================
   FORMS
   ======================================================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-group { display: flex; flex-direction: column; }
.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--fg4);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(110,170,255,.08);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--fg4); }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2350556A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.form-select option { background: var(--bg2); color: var(--fg); }

.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* ========================================================
   SEARCH BAR
   ======================================================== */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg4);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}
.search-input:focus { border-color: var(--blue); }
.search-input::placeholder { color: var(--fg4); }

/* ========================================================
   SERVICE CHIPS
   ======================================================== */
.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  padding: 5px 11px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg4);
  cursor: pointer;
  transition: all .15s;
}
.chip:hover  { border-color: var(--blue); color: var(--blue); }
.chip.active { background: var(--blue-d); border-color: rgba(110,170,255,.35); color: var(--blue); }

/* ========================================================
   TAGS
   ======================================================== */
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  padding: 2px 8px;
  background: var(--blue-d);
  color: var(--blue);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* ========================================================
   PROFILE PAGE
   ======================================================== */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}
.profile-name { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 6px; }
.profile-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .info-grid { grid-template-columns: 1fr; }
}

.info-field-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--fg4);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 3px;
}
.info-field-value { font-size: 13.5px; color: var(--fg2); }

/* ========================================================
   MODAL
   ======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn .15s ease;
}

.modal {
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--r);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  animation: modalIn .2s cubic-bezier(.22,.68,0,1.2);
  box-shadow: var(--shadow2);
}

.modal-lg { max-width: 720px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--bg2);
  z-index: 1;
}
.modal-title { font-size: 14px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--fg4);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--fg); background: var(--bg3); }

.modal-body { padding: 18px; }
.modal-footer {
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: var(--bg2);
}

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ========================================================
   QUOTE CALCULATOR
   ======================================================== */
.quote-line {
  display: grid;
  grid-template-columns: 2fr 90px 80px 32px;
  gap: 6px;
  margin-bottom: 7px;
  align-items: center;
}
@media (max-width: 580px) {
  .quote-line { grid-template-columns: 1fr; }
}

.quote-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.quote-total-label { font-size: 13px; color: var(--fg3); font-weight: 500; }
.quote-total-value { font-size: 26px; font-weight: 800; color: var(--green); letter-spacing: -.5px; }

/* ========================================================
   LOADING & EMPTY STATES
   ======================================================== */
.empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--fg4);
}
.empty-icon { margin-bottom: 10px; opacity: .35; }
.empty-text { font-size: 13px; }

/* ========================================================
   VEHICLE LIST
   ======================================================== */
.vehicle-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--line2);
}
.vehicle-item:last-child { border-bottom: none; }
.vehicle-name { font-size: 13.5px; font-weight: 600; }
.vehicle-sub  { font-size: 12px; color: var(--fg3); margin-top: 2px; }

/* ========================================================
   FOLLOW UP CARD
   ======================================================== */
.followup-card {
  background: rgba(248,113,113,.06);
  border: 1px solid rgba(248,113,113,.18);
  border-radius: var(--r2);
  padding: 11px 13px;
  margin-top: 12px;
}
.followup-label { font-size: 10.5px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px; }
.followup-note  { font-size: 12.5px; color: var(--fg2); }

/* ========================================================
   HORIZONTAL BAR CHART
   ======================================================== */
.hbar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.hbar-label {
  width: 110px;
  font-size: 12px;
  color: var(--fg2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.hbar-track {
  flex: 1;
  height: 5px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}
.hbar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s ease;
}
.hbar-val { font-size: 11.5px; color: var(--fg4); min-width: 32px; text-align: right; }

/* ========================================================
   SCROLLBAR
   ======================================================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.14); }

/* ========================================================
   UTILITY
   ======================================================== */
.hidden   { display: none !important; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.money  { color: var(--green); font-weight: 600; }
.muted  { color: var(--fg3); }
.dimmer { color: var(--fg4); }
.bold   { font-weight: 700; }
.flex   { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.wrap   { flex-wrap: wrap; }
.text-right { text-align: right; }
