/* ═══════════════════════════════════════════════
   GrindLeader CRM — Admin Stylesheet
   Design: Clean & minimal with contractor-tough clarity.
   Dark sidebar + topbar. Light, white-card content area.
   ═══════════════════════════════════════════════ */

:root {
  /* Brand */
  --brand:      #1B78FF;
  --brand-lt:   #5BA3FF;
  --brand-dk:   #1258CC;

  /* Sidebar / Topbar (stay dark) */
  --sidebar-bg:   #1A1F2E;
  --topbar-bg:    #1F2438;
  --sidebar-border: rgba(255,255,255,0.08);

  /* Page content area (light) */
  --page-bg:       #F1F5F9;
  --card-bg:       #FFFFFF;
  --card-border:   #E2E8F0;
  --card-shadow:   0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --card-shadow-md: 0 4px 12px rgba(0,0,0,0.09), 0 2px 4px rgba(0,0,0,0.05);

  /* Text */
  --text-primary:   #0F172A;
  --text-secondary: #64748B;
  --text-tertiary:  #94A3B8;

  /* Inputs */
  --input-bg:     #FFFFFF;
  --input-border: #CBD5E1;
  --input-focus:  #1B78FF;

  /* Table */
  --table-header-bg:    #F8FAFC;
  --table-header-color: #475569;
  --table-border:       #E2E8F0;
  --table-row-hover:    #F8FAFC;

  /* Status colors */
  --green:    #16a34a;
  --green-lt: #dcfce7;
  --red:      #dc2626;
  --red-lt:   #fee2e2;
  --orange:   #ea580c;
  --orange-lt:#ffedd5;
  --yellow:   #d97706;
  --yellow-lt:#fef3c7;
  --purple:   #7c3aed;
  --purple-lt:#ede9fe;
  --blue:     #1B78FF;
  --blue-lt:  #dbeafe;

  /* Legacy aliases used by sidebar/topbar */
  --navy:       #1A1F2E;
  --navy-light: #1F2438;
  --navy-dark:  #111623;
  --amber:      #1B78FF;
  --amber-lt:   #5BA3FF;
  --white:      #ffffff;
  --gray-50:    #2a2f3f;
  --gray-100:   #2e3448;
  --gray-200:   #3a4055;
  --gray-400:   #888ea8;
  --gray-600:   #aab2cc;
  --gray-800:   #e8eaf0;
  --border:     #2e3448;
  --surface:    #1F2438;
  --text:       #ffffff;
  --text-off:   #e8eaf0;
  --text-muted: #888ea8;
  --text-muted-color: #888ea8;

  --sidebar-w:  260px;
  --topbar-h:   64px;
  --radius:     10px;
  --radius-sm:  7px;
  --shadow:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg:  0 16px 40px rgba(0,0,0,0.14), 0 4px 8px rgba(0,0,0,0.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--page-bg);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: auto;
}

/* ═══════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo-img {
  width: 44px; height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand-name {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 2px;
  color: #ffffff;
  line-height: 1;
}

.sidebar-brand-sub {
  display: block;
  font-size: 10px;
  color: var(--brand-lt);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 1px 8px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.15s;
  position: relative;
  border-radius: 7px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(27,120,255,0.18);
  color: var(--brand-lt);
}

.nav-icon { width: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-label { flex: 1; }

.nav-badge {
  background: var(--brand);
  color: white;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.nav-badge--red   { background: var(--red);   color: white; }
.nav-badge--green { background: var(--green);  color: white; }
.nav-badge:empty  { display: none; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  min-width: 0;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brand);
}

.user-info { min-width: 0; flex: 1; }

.user-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 8px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}
.logout-btn:hover { background: rgba(220,38,38,0.2); color: #f87171; }

/* ═══════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════ */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--page-bg);
}

/* ═══════════════════════════════════════════════
   TOPBAR
   ═══════════════════════════════════════════════ */
.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: rgba(255,255,255,0.55);
  padding: 4px;
}

.topbar-title {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
   NOTIFICATION BELL
   ═══════════════════════════════════════════════ */
.notif-bell {
  position: relative;
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  padding: 8px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-bell:hover { background: rgba(255,255,255,0.08); color: #ffffff; }

.notif-count {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 900;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ═══════════════════════════════════════════════
   NOTIFICATION PANEL
   ═══════════════════════════════════════════════ */
.notif-overlay {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1099;
}

.notif-panel {
  display: none;
  position: fixed;
  top: var(--topbar-h);
  right: 12px;
  width: 360px;
  max-height: 520px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  flex-direction: column;
  overflow: hidden;
}

.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}

.notif-list { overflow-y: auto; flex: 1; }

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--table-border);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: var(--table-row-hover); }
.notif-item.unread { background: #EFF6FF; }
.notif-item.unread:hover { background: #DBEAFE; }

.notif-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: 13px; color: var(--text-primary); margin-bottom: 2px; }
.notif-body  { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time  { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.notif-empty { padding: 40px 16px; text-align: center; color: var(--text-secondary); font-size: 14px; }

@media (max-width: 480px) {
  .notif-panel { right: 0; left: 0; width: 100%; border-radius: 0 0 12px 12px; }
}

/* ═══════════════════════════════════════════════
   PAGE CONTENT
   ═══════════════════════════════════════════════ */
.page-content {
  flex: 1;
  padding: 24px;
  padding-bottom: 80px;
  color: var(--text-primary);

  /* Re-scope legacy dark vars to light so any inline styles using them
     render correctly against the white page background */
  --gray-50:    #F8FAFC;
  --gray-100:   #F1F5F9;
  --gray-200:   #E2E8F0;
  --border:     #E2E8F0;
  --text-off:   #374151;
  --surface:    #F8FAFC;
  --text-muted: #64748B;
  --text-secondary: #64748B;
}

/* ═══════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.1px;
  color: var(--text-primary);
}

.card-body { padding: 20px; }

/* ═══════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.stat-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px;
  letter-spacing: 1px;
  color: var(--text-primary);
  line-height: 1;
}

.stat-value--amber { color: var(--brand); }
.stat-value--green { color: var(--green); }
.stat-value--blue  { color: var(--brand); }

.stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-icon { font-size: 26px; margin-bottom: 4px; }

/* ═══════════════════════════════════════════════
   GRID LAYOUTS
   ═══════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ═══════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--table-header-color);
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--table-border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--table-border);
  transition: background 0.12s;
  cursor: pointer;
}

tbody tr:hover { background: var(--table-row-hover); }
tbody tr:last-child { border-bottom: none; }

td {
  padding: 13px 16px;
  vertical-align: middle;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   BADGES / STATUS
   ═══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.badge--new       { background: var(--blue-lt);   color: #1e40af; }
.badge--contacted { background: var(--purple-lt);  color: var(--purple); }
.badge--quoted    { background: var(--yellow-lt);  color: var(--yellow); }
.badge--booked    { background: var(--green-lt);   color: var(--green); }
.badge--lost      { background: var(--red-lt);     color: var(--red); }
.badge--scheduled { background: var(--blue-lt);    color: #1e40af; }
.badge--progress  { background: var(--yellow-lt);  color: var(--yellow); }
.badge--complete  { background: var(--green-lt);   color: var(--green); }
.badge--invoiced  { background: var(--purple-lt);  color: var(--purple); }
.badge--paid      { background: var(--green);      color: #ffffff; }
.badge--draft     { background: #F1F5F9;           color: var(--text-secondary); }
.badge--sent      { background: var(--blue-lt);    color: #1e40af; }
.badge--accepted  { background: var(--green-lt);   color: var(--green); }
.badge--expired   { background: var(--red-lt);     color: var(--red); }
.badge--overdue   { background: var(--red-lt);     color: var(--red); }
.badge--awaiting  { background: var(--yellow-lt);  color: var(--yellow); }
.badge--cancelled { background: var(--gray-200);   color: var(--text-secondary); }

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.1px;
}

.btn--primary {
  background: var(--brand);
  color: #ffffff;
}
.btn--primary:hover { background: var(--brand-dk); }

.btn--navy {
  background: var(--sidebar-bg);
  color: #ffffff;
}
.btn--navy:hover { background: var(--navy-dark); }

.btn--outline {
  background: #ffffff;
  color: var(--text-primary);
  border: 1.5px solid var(--card-border);
}
.btn--outline:hover { border-color: var(--brand); color: var(--brand); background: #F0F7FF; }

/* Buttons inside the dark topbar */
.topbar .btn--outline {
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.2);
  background: transparent;
}
.topbar .btn--outline:hover { border-color: var(--brand-lt); color: #ffffff; background: rgba(27,120,255,0.15); }
.topbar .btn--outline.btn--navy,
.topbar .btn--primary {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn--ghost:hover { background: #F1F5F9; color: var(--text-primary); }

.btn--danger { background: var(--red); color: white; }
.btn--danger:hover { background: #b91c1c; }

.btn--green { background: var(--green); color: white; }
.btn--green:hover { background: #15803d; }

.btn--sm { padding: 6px 12px; font-size: 12px; }
.btn--lg { padding: 13px 24px; font-size: 15px; }
.btn--block { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════════
   TOGGLE SWITCH
   ═══════════════════════════════════════════════ */
.toggle-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-wrap input[type="checkbox"] { display: none; }
.toggle-track {
  width: 44px; height: 24px;
  background: #CBD5E1;
  border-radius: 24px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-wrap input:checked + .toggle-track { background: var(--brand); }
.toggle-thumb {
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-wrap input:checked + .toggle-track .toggle-thumb { left: 23px; }

/* ═══════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--input-border);
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--input-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(27,120,255,0.12);
}

.form-input::placeholder { color: var(--text-tertiary); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ═══════════════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════════════ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.search-input-wrap { flex: 1; position: relative; }

.search-input-wrap::before {
  content: '';
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

.search-input {
  width: 100%;
  padding: 9px 14px 9px 34px;
  border: 1.5px solid var(--input-border);
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--input-bg);
  outline: none;
  transition: border-color 0.15s;
}
.search-input::placeholder { color: var(--text-tertiary); }
.search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(27,120,255,0.10); }

/* ═══════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(15,23,42,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  flex-shrink: 0;
  color: var(--text-primary);

  /* Override dark legacy vars inside modals */
  --navy:       #FFFFFF;
  --navy-light: #F8FAFC;
  --navy-dark:  #F1F5F9;
  --gray-50:    #F8FAFC;
  --gray-100:   #F1F5F9;
  --gray-200:   #E2E8F0;
  --border:     #E2E8F0;
  --text-off:   #374151;
  --surface:    #F8FAFC;
  --text-muted: #64748B;
  --text-secondary: #64748B;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 1;
}

.modal-title {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 4px;
  border-radius: 5px;
  transition: all 0.15s;
  line-height: 1;
}
.modal-close:hover { color: var(--red); background: var(--red-lt); }

.modal-body { padding: 20px 24px 24px; color: var(--text-primary); }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--card-border);
}

/* ─ Modal inner elements reset to light ─ */
.modal .form-input,
.modal .form-select,
.modal .form-textarea {
  background: #FFFFFF;
  color: var(--text-primary);
  border-color: var(--input-border);
}
.modal .form-label { color: var(--text-secondary); }

.modal .totals-box { background: #F8FAFC; border: 1px solid var(--card-border); border-radius: 7px; }
.modal .totals-row { color: var(--text-secondary); }
.modal .totals-row--total { color: var(--text-primary); border-top-color: var(--card-border); }

.modal .detail-item span { color: var(--text-primary); }
.modal .detail-item label { color: var(--text-secondary); }

.modal .line-items-table th { color: var(--table-header-color); background: var(--table-header-bg); border-bottom-color: var(--table-border); }
.modal .line-items-table td { color: var(--text-primary); border-bottom-color: var(--table-border); }

/* Quote modal line item polish */
.modal .line-items-table tbody tr {
  border-bottom: 2px solid #f3f4f6;
}

.modal .line-items-table tbody tr:hover td {
  background: #f8fafc;
}

.modal .line-items-table td:first-child {
  padding: 10px 8px 6px;
}

.modal .line-items-table td:nth-child(2),
.modal .line-items-table td:nth-child(3) {
  vertical-align: top;
  padding-top: 10px;
}

.modal .line-items-table td:nth-child(4) {
  vertical-align: middle;
  text-align: right;
  font-size: 15px;
}

.modal .line-desc-input {
  font-size: 11px;
  color: #9ca3af;
  border: none;
  border-top: 1px dashed #e5e7eb;
  border-radius: 0;
  background: transparent;
  padding: 4px 2px;
  margin-top: 4px;
  resize: none;
  width: 100%;
}

.modal .line-desc-input:focus {
  outline: none;
  border-top-color: #93c5fd;
  color: #374151;
}

/* Add-on rows — match requested services styling */
.modal .line-items-table tbody tr.addon-row td:nth-child(1) {
  padding-top: 10px;
}

.modal .line-items-table tbody tr.addon-row td:nth-child(3) {
  vertical-align: top;
  padding-top: 10px;
}

.modal .line-items-table tbody tr.addon-row td:nth-child(5) {
  vertical-align: middle;
  text-align: right;
  font-size: 15px;
}

.modal .invoice-total { color: var(--text-primary); border-top-color: var(--card-border); }

/* ═══════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 80px; right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease;
  min-width: 220px;
}

.toast--success { background: var(--green); color: white; }
.toast--error   { background: var(--red);   color: white; }
.toast--info    { background: var(--sidebar-bg); color: white; }

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

/* ═══════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-tertiary); }
.empty-state-icon  { font-size: 44px; margin-bottom: 14px; }
.empty-state-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state-text  { font-size: 14px; margin-bottom: 20px; }

/* ═══════════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════════ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-secondary);
  font-size: 14px;
  gap: 10px;
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--card-border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   FILTER TABS
   ═══════════════════════════════════════════════ */
.filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 0;
  width: fit-content;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-secondary);
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-tab:hover { border-color: var(--brand); color: var(--brand); background: #F0F7FF; }

.filter-tab.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

/* ═══════════════════════════════════════════════
   DETAIL PANEL
   ═══════════════════════════════════════════════ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-item label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-tertiary);
  margin-bottom: 3px;
}

.detail-item span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   PHOTO UPLOAD
   ═══════════════════════════════════════════════ */
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.photo-upload-zone {
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #F8FAFC;
}

.photo-upload-zone:hover { border-color: var(--brand); background: #F0F7FF; }

.photo-upload-zone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}

/* ═══════════════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════════════ */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.cal-header {
  text-align: center;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}

.cal-day {
  min-height: 80px;
  padding: 6px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: var(--card-bg);
  cursor: pointer;
  transition: background 0.12s;
}

.cal-day:hover { background: #F8FAFC; }
.cal-day--today { border-color: var(--brand); border-width: 2px; }
.cal-day--other-month { opacity: 0.4; }

.cal-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cal-date--today {
  background: var(--brand);
  color: #ffffff;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-job-dot {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--sidebar-bg);
  color: white;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.cal-job-pill {
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 4px;
  color: white;
  margin-bottom: 3px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}
.cal-job-pill[draggable="true"] { cursor: grab; }
.cal-job-pill[draggable="true"]:active { cursor: grabbing; }

.cal-day--drag-over {
  background: #EFF6FF !important;
  border-color: var(--brand) !important;
  border-width: 2px !important;
  box-shadow: 0 0 0 2px rgba(27,120,255,0.15);
}

/* ═══════════════════════════════════════════════
   QUOTE / INVOICE BUILDER
   ═══════════════════════════════════════════════ */
.line-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.line-items-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--table-header-color);
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--table-border);
  background: var(--table-header-bg);
}

.line-items-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--table-border);
  color: var(--text-primary);
}

.line-items-table tbody tr:hover td {
  background: #f0f7ff;
  transition: background 0.15s ease;
}
.line-items-table tbody tr:last-child td {
  border-bottom: none;
}
.line-items-table tbody tr td:first-child {
  padding-left: 4px;
}

.line-item-input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: #ffffff;
  color: var(--text-primary);
}

.totals-box {
  background: #F8FAFC;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: right;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.totals-row--total {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  border-top: 1px solid var(--card-border);
  margin-top: 8px;
  padding-top: 8px;
}

/* ═══════════════════════════════════════════════
   ROUTE MAP
   ═══════════════════════════════════════════════ */
.route-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  height: calc(100vh - 130px);
}

.route-list { overflow-y: auto; }
.route-map { border-radius: var(--radius); overflow: hidden; }
.route-map iframe { width: 100%; height: 100%; border: none; }

.route-job-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--table-border);
  cursor: pointer;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.route-job-card:hover { background: var(--table-row-hover); }
.route-job-card:active { background: var(--table-row-hover); }

.route-job-number {
  width: 32px; height: 32px;
  background: var(--sidebar-bg);
  color: var(--brand-lt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   MOBILE BOTTOM NAV
   ═══════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  z-index: 100;
  padding: 0 0 env(safe-area-inset-bottom);
  box-shadow: 0 -1px 0 var(--card-border);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px 8px;
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  gap: 3px;
  transition: color 0.15s;
  min-height: 56px;
}

.bottom-nav-item span:first-child { font-size: 22px; }
.bottom-nav-item.active { color: var(--brand); }

/* ═══════════════════════════════════════════════
   SIDEBAR BACKDROP
   ═══════════════════════════════════════════════ */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(15,23,42,0.5);
  z-index: 99;
}
.sidebar-backdrop.open { display: block; }

/* ═══════════════════════════════════════════════
   MORE MENU (mobile)
   ═══════════════════════════════════════════════ */
.more-menu-overlay {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(15,23,42,0.45);
  z-index: 150;
}
.more-menu-overlay.open { display: block; }

.more-menu {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card-bg);
  border-radius: 16px 16px 0 0;
  z-index: 151;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
}
.more-menu.open { display: block; }

.more-menu-handle {
  width: 40px; height: 4px;
  background: var(--card-border);
  border-radius: 2px;
  margin: 12px auto 0;
}

.more-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.more-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 12px 20px;
  gap: 4px;
}

.more-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  text-align: center;
}
.more-menu-item:active { background: var(--page-bg); }
.more-menu-item span:first-child { font-size: 30px; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
  .route-container { grid-template-columns: 1fr; }
  .route-map { height: 300px; }
}

@media (max-width: 768px), (max-height: 480px) {
  .sidebar { transform: translateX(-100%); z-index: 200; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar-menu-btn { display: flex; }
  .bottom-nav { display: flex; }
  .topbar { grid-template-columns: auto auto minmax(0, 1fr) auto; padding: 0 12px; gap: 10px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn { padding: 8px 12px; font-size: 12px; }
  .page-content { padding: 12px; padding-bottom: 100px; }

  /* Modal slides up from bottom */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: 100% !important; border-radius: 16px 16px 0 0; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }

  /* Calendar */
  .calendar-grid { grid-template-columns: repeat(7, 1fr); }
  .cal-day { min-height: 48px; padding: 4px; }
  .cal-job-dot { display: none; }
  .cal-job-pill { display: none; }
  .cal-day.has-jobs::after { content: '•'; color: var(--brand); font-size: 18px; display: block; text-align: center; }

  .filter-tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .btn--sm { padding: 8px 12px; font-size: 12px; }

  .route-container { grid-template-columns: 1fr; height: auto; }
  .route-map { height: 260px; }

  .reports-chart-row { grid-template-columns: 1fr !important; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .topbar-title { font-size: 16px; }
}

/* ═══════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════ */
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-muted   { color: var(--text-secondary); font-size: 13px; }
.text-success { color: var(--green); }
.text-danger  { color: var(--red); }
.text-amber   { color: var(--brand); }
.font-mono    { font-family: monospace; }
.mb-0  { margin-bottom: 0 !important; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.flex         { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.divider      { height: 1px; background: var(--card-border); margin: 16px 0; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-bold      { font-weight: 700; }
.w-full       { width: 100%; }

/* ═══════════════════════════════════════════════
   FEEDBACK FAB
   ═══════════════════════════════════════════════ */
.feedback-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--sidebar-bg);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  z-index: 900;
  box-shadow: var(--shadow-md);
  transition: opacity 0.15s, transform 0.15s;
}
.feedback-fab:hover { opacity: 0.85; transform: translateY(-1px); }

@media (max-width: 768px) {
  .feedback-fab { bottom: 72px; right: 12px; font-size: 11px; padding: 6px 10px; }
}

/* ═══════════════════════════════════════════════
   JOB MODAL SECTIONS
   ═══════════════════════════════════════════════ */
.job-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}

.job-action-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.job-meta-pill {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.job-section {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}

.job-section-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  background: #F8FAFC;
}
.job-section-hdr:hover { background: #F1F5F9; }

.job-section-icon { font-size: 15px; }

.job-section-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.1px;
  color: var(--text-primary);
  flex: 1;
}

.job-section-badge {
  font-size: 11px;
  font-weight: 700;
  background: #EFF6FF;
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.job-section-chevron {
  font-size: 18px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
  line-height: 1;
}
.job-section-chevron.open { transform: rotate(90deg); }

.job-section-body {
  padding: 14px 16px;
  border-top: 1px solid var(--card-border);
}
.job-section-body.collapsed { display: none; }

.job-costs-tabs {
  display: flex;
  border-bottom: 1px solid var(--card-border);
  margin: -14px -16px 14px;
  background: #F8FAFC;
}

.job-costs-tab {
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.job-costs-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.job-costs-tab:hover:not(.active) { color: var(--text-primary); }

.job-costs-panel { display: none; }
.job-costs-panel.active { display: block; }

.job-footer-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--card-border);
  padding-top: 14px;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════
   CUSTOMER PROFILE MODAL SECTIONS
   ═══════════════════════════════════════════════ */
.cust-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.cust-action-bar-left { display: flex; align-items: center; gap: 12px; flex: 1; flex-wrap: wrap; }

.cust-spend-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.cust-spend {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  color: var(--brand);
  line-height: 1;
}

.cust-contact-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.cust-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: #EFF6FF;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid #BFDBFE;
}
.cust-pill.gray { color: var(--text-secondary); background: #F1F5F9; border-color: var(--card-border); }

.cust-section { border: 1px solid var(--card-border); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }

.cust-section-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  background: #F8FAFC;
}
.cust-section-hdr:hover { background: #F1F5F9; }

.cust-section-icon { font-size: 16px; line-height: 1; }

.cust-section-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.cust-section-badge {
  font-size: 11px;
  font-weight: 700;
  background: #EFF6FF;
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

.cust-badge-green { background: var(--green-lt) !important; color: var(--green) !important; }
.cust-badge-amber { background: var(--yellow-lt) !important; color: var(--yellow) !important; }
.cust-badge-red   { background: var(--red-lt) !important; color: var(--red) !important; }

.cust-section-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 5px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.cust-section-action:hover { background: #DBEAFE; }

.cust-section-chevron {
  font-size: 18px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
  line-height: 1;
}
.cust-section-chevron.open { transform: rotate(90deg); }

.cust-section-body { padding: 14px 16px; border-top: 1px solid var(--card-border); }
.cust-section-body.collapsed { display: none; }

.cust-comm-tabs {
  display: flex;
  border-bottom: 1px solid var(--card-border);
  margin: -14px -16px 14px;
  background: #F8FAFC;
}

.cust-comm-tab {
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.cust-comm-tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.cust-comm-panel { display: none; }
.cust-comm-panel.active { display: block; }

.cust-footer-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--card-border);
  padding-top: 14px;
  margin-top: 6px;
}

.cust-hist-row { cursor: pointer; }
.cust-hist-row:hover td { background: #F8FAFC; }

/* ═══════════════════════════════════════════════
   AI PANELS (additive — CRM works without these)
   ═══════════════════════════════════════════════ */
.ai-panel {
  margin-top: 10px;
  padding: 14px;
  background: #FAFBFF;
  border: 1px solid #C7D7FA;
  border-radius: var(--radius-sm);
}

.ai-panel-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand);
  margin-bottom: 8px;
}

.ai-panel-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  transition: background 0.15s;
  margin: 4px 4px 0 0;
}
.ai-chip:hover { background: #DBEAFE; }

/* ═══════════════════════════════════════════════
   INFO / HELPER BOXES
   ═══════════════════════════════════════════════ */
.info-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid;
}

.info-box--blue   { background: #EFF6FF; border-color: #BFDBFE; color: #1e40af; }
.info-box--green  { background: var(--green-lt); border-color: #86efac; color: #15803d; }
.info-box--yellow { background: var(--yellow-lt); border-color: #fcd34d; color: #92400e; }
.info-box--red    { background: var(--red-lt); border-color: #fca5a5; color: #991b1b; }

/* ── Line Item Cards (Quote Modals) ── */
.line-item-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.line-item-card--service {
  border-left: 3px solid #22c55e;
}

.line-item-card--addon {
  border-left: 3px solid #f5a623;
}

.line-item-card--declined {
  opacity: 0.5;
  background: #f9fafb;
}

.line-item-card__row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.line-item-card__service {
  flex: 1;
  min-width: 0;
}

.line-item-card__qty {
  width: 60px;
  flex-shrink: 0;
}

.line-item-card__price {
  width: 80px;
  flex-shrink: 0;
}

.line-item-card__total {
  width: 70px;
  flex-shrink: 0;
  text-align: right;
  font-size: 14px;
}

.line-item-card__remove {
  flex-shrink: 0;
}

.line-item-card__service-pill {
  font-size: 10px;
  font-weight: 700;
  color: #16a34a;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.line-item-card__addon-pill {
  font-size: 10px;
  font-weight: 700;
  color: #d97706;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.line-item-card__declined-badge {
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.line-item-card__desc {
  width: 100%;
  margin-top: 8px;
  font-size: 11px;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 4px 6px;
  resize: none;
  display: block;
}

.line-item-card__service-label {
  flex: 1;
  font-size: 14px;
  color: #374151;
}

.line-item-card__qty-label,
.line-item-card__price-label {
  font-size: 14px;
  color: #374151;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .line-item-card__row {
    flex-wrap: wrap;
  }
  .line-item-card__service {
    width: 100%;
    flex: none;
  }
  .line-item-card__qty,
  .line-item-card__price,
  .line-item-card__total {
    flex: 1;
  }
}
