/* ============================================================
   PainterPro — Design System
   ============================================================ */

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

:root {
  /* Brand */
  --navy:         #0F1E38;
  --navy-mid:     #1A3358;
  --navy-light:   #243F6B;
  --gold:         #C9973A;
  --gold-hover:   #E8B04A;

  /* Neutrals */
  --white:        #FFFFFF;
  --off-white:    #F4F6FA;
  --surface:      #FFFFFF;
  --border:       #E2E6EC;
  --text:         #1A1A2E;
  --muted:        #6B7280;

  /* Status */
  --draft:        #6B7280;
  --sent:         #2563EB;
  --accepted:     #16A34A;
  --declined:     #DC2626;

  /* Functional */
  --danger:       #DC2626;
  --danger-bg:    #FEF2F2;
  --success:      #16A34A;
  --success-bg:   #F0FDF4;
  --warning:      #D97706;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.14);

  /* Layout */
  --header-h: 56px;
  --nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--off-white);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============================================================
   App Shell
   ============================================================ */

.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.app-header-left { display: flex; align-items: center; gap: var(--space-sm); }
.app-header-right { display: flex; align-items: center; gap: var(--space-sm); }

.app-logo {
  width: 34px; height: 34px;
  background: var(--gold);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  flex-shrink: 0;
}

.app-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
}

.header-back-btn {
  background: none; border: none; cursor: pointer;
  color: var(--white); padding: var(--space-xs);
  border-radius: var(--r-sm);
  display: flex; align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.install-btn {
  background: rgba(201,151,58,0.15);
  border: 1px solid rgba(201,151,58,0.4);
  color: var(--gold);
  font-family: inherit; font-size: 0.8rem; font-weight: 600;
  padding: 0.35rem 0.75rem; border-radius: 20px;
  cursor: pointer; display: flex; align-items: center; gap: 4px;
  -webkit-tap-highlight-color: transparent;
}

.offline-banner {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--warning);
  color: var(--white);
  font-size: 0.82rem; font-weight: 600;
  padding: 0.5rem var(--space-md);
  display: flex; align-items: center; gap: var(--space-xs);
  z-index: 99;
  text-align: center; justify-content: center;
}

.app-content {
  padding-top: var(--header-h);
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
  min-height: 100vh;
}

.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--navy);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  padding: 10px 4px 4px;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}
.nav-item svg { transition: color 0.15s; }
.nav-item.active { color: var(--gold); }
.nav-item.active svg { color: var(--gold); }

/* ============================================================
   Loading
   ============================================================ */

.loading-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--header-h) - var(--nav-h));
}

.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ============================================================
   Views / Screens
   ============================================================ */

.view { padding: var(--space-md); max-width: 680px; margin: 0 auto; }
.view-wide { padding: var(--space-md); max-width: 860px; margin: 0 auto; }

.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
}

.view-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.view-subtitle { font-size: 0.88rem; color: var(--muted); margin-top: 2px; }

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  background: var(--navy);
  color: var(--white);
  padding: var(--space-md) var(--space-lg);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.card-body { padding: var(--space-lg); }
.card-body-sm { padding: var(--space-md); }

/* ============================================================
   Stat Cards
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--space-md) var(--space-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--navy);
}

.stat-card.gold-accent { border-top-color: var(--gold); }
.stat-card.green-accent { border-top-color: var(--accepted); }
.stat-card.blue-accent { border-top-color: var(--sent); }

.stat-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.stat-value { font-size: 1.65rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* ============================================================
   List Items (quotes, customers, materials)
   ============================================================ */

.list-container { display: flex; flex-direction: column; gap: var(--space-sm); }

.list-item {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--space-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.list-item:active { box-shadow: var(--shadow-md); border-color: var(--navy-light); }

.list-item-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-sub { font-size: 0.82rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.list-item-amount { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.list-item-date { font-size: 0.75rem; color: var(--muted); }

/* ============================================================
   Status Badges
   ============================================================ */

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-draft    { background: #F3F4F6; color: var(--draft); }
.badge-sent     { background: #EFF6FF; color: var(--sent); }
.badge-accepted { background: #F0FDF4; color: var(--accepted); }
.badge-declined { background: #FEF2F2; color: var(--declined); }
.badge-paint    { background: #EFF6FF; color: #1D4ED8; }
.badge-materials { background: #F0FDF4; color: #166534; }
.badge-labour   { background: #FFF7ED; color: #9A3412; }
.badge-other    { background: #F3F4F6; color: var(--muted); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-xs);
  padding: 0.65rem 1.25rem;
  border-radius: var(--r-md);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  border: none; cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-mid); }

.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: var(--gold-hover); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { opacity: 0.9; }

.btn-danger-ghost {
  background: transparent; color: var(--danger);
  border: 1.5px solid var(--danger);
}

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 0.5rem; border-radius: var(--r-sm); }

/* FAB */
.fab {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--space-md));
  right: var(--space-md);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--white);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(201,151,58,0.5);
  z-index: 90;
  font-size: 1.5rem;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, box-shadow 0.15s;
}
.fab:active { transform: scale(0.93); }

/* ============================================================
   Forms
   ============================================================ */

.form-group { margin-bottom: var(--space-md); }

.form-label {
  display: block;
  font-size: 0.85rem; font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  display: block; width: 100%;
  padding: 0.7rem var(--space-md);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: inherit; font-size: 16px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15,30,56,0.1);
}

.form-control.error { border-color: var(--danger); }

textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.5; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-hint { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 4px; display: none; }
.form-control.error + .form-error { display: block; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.form-section-title {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) 0;
}
.toggle-label { font-size: 0.9rem; font-weight: 500; }
.toggle-sub { font-size: 0.78rem; color: var(--muted); }

/* Toggle switch */
.toggle {
  position: relative; width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 12px;
  cursor: pointer; transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: white; border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--accepted); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Checkbox */
.checkbox-row { display: flex; align-items: center; gap: var(--space-sm); cursor: pointer; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--navy); }

/* ============================================================
   Search / Filter Bar
   ============================================================ */

.search-bar {
  position: relative; margin-bottom: var(--space-md);
}
.search-bar svg {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.search-bar input {
  width: 100%;
  padding: 0.65rem 0.75rem 0.65rem 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: inherit; font-size: 16px;
  background: var(--white);
}
.search-bar input:focus { outline: none; border-color: var(--navy); }

.filter-tabs {
  display: flex; gap: var(--space-xs); overflow-x: auto;
  padding-bottom: 2px; margin-bottom: var(--space-md);
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem; font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--white); color: var(--muted);
  cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}
.filter-tab.active {
  background: var(--navy); color: var(--white); border-color: var(--navy);
}

/* ============================================================
   Empty State
   ============================================================ */

.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}
.empty-state-icon {
  width: 64px; height: 64px;
  background: var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-md);
  color: var(--muted);
}
.empty-state h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: var(--space-sm); }
.empty-state p { font-size: 0.9rem; color: var(--muted); margin-bottom: var(--space-lg); line-height: 1.6; }

/* ============================================================
   Modals
   ============================================================ */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex; align-items: flex-end;
  padding: 0;
}

@media (min-width: 540px) {
  .modal-overlay { align-items: center; justify-content: center; padding: var(--space-md); }
}

.modal {
  background: var(--white);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  width: 100%; max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}

@media (min-width: 540px) {
  .modal { border-radius: var(--r-lg); }
}

@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer; padding: var(--space-xs);
  color: var(--muted); border-radius: var(--r-sm);
  -webkit-tap-highlight-color: transparent;
}
.modal-body { padding: var(--space-lg); }
.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex; gap: var(--space-sm); justify-content: flex-end;
  position: sticky; bottom: 0; background: var(--white);
}

/* ============================================================
   Toasts
   ============================================================ */

.toast-container {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--space-md));
  left: var(--space-md); right: var(--space-md);
  display: flex; flex-direction: column-reverse; gap: var(--space-sm);
  z-index: 300; pointer-events: none;
  max-width: 400px;
  margin: 0 auto;
}

.toast {
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem var(--space-md);
  border-radius: var(--r-md);
  font-size: 0.88rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: var(--space-sm);
  animation: toastIn 0.25s ease;
  pointer-events: all;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes toastIn { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============================================================
   Detail Views
   ============================================================ */

.detail-section { margin-bottom: var(--space-lg); }
.detail-section-title {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted);
  margin-bottom: var(--space-sm);
}

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
@media (max-width: 360px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-field { }
.detail-field-label { font-size: 0.75rem; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.detail-field-value { font-size: 0.92rem; font-weight: 500; color: var(--text); white-space: pre-line; }

.action-bar {
  display: flex; flex-wrap: wrap; gap: var(--space-sm);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-md);
}

/* ============================================================
   Quote-specific
   ============================================================ */

.quote-totals {
  background: var(--navy);
  border-radius: var(--r-md);
  padding: var(--space-md);
  color: var(--white);
}

.totals-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 0.9rem;
}
.totals-row.total-row {
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: var(--space-sm); margin-top: var(--space-sm);
  font-size: 1.1rem; font-weight: 700;
}

.room-section {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.room-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md);
  cursor: pointer;
  background: var(--off-white);
  -webkit-tap-highlight-color: transparent;
}

.room-header-left { display: flex; align-items: center; gap: var(--space-sm); }
.room-name { font-weight: 700; font-size: 0.95rem; }
.room-subtotal { font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.room-chevron { color: var(--muted); transition: transform 0.2s; }
.room-section.open .room-chevron { transform: rotate(180deg); }
.room-body { display: none; }
.room-section.open .room-body { display: block; }

.items-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.items-table th {
  text-align: left; padding: var(--space-sm) var(--space-md);
  background: var(--navy); color: rgba(255,255,255,0.8);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700;
}
.items-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.items-table tr:last-child td { border-bottom: none; }
.items-table .desc-col { min-width: 120px; }
.items-table .num-col { text-align: right; white-space: nowrap; }
.items-table .vat-tag { font-size: 0.7rem; color: var(--muted); }

/* Quote Builder Steps */
.stepper {
  display: flex; align-items: center; gap: 0;
  margin-bottom: var(--space-lg);
  overflow: hidden;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.step {
  flex: 1; padding: 0.65rem var(--space-sm);
  text-align: center; font-size: 0.78rem; font-weight: 600;
  color: var(--muted); background: var(--white);
  border-right: 1px solid var(--border);
  transition: all 0.2s;
}
.step:last-child { border-right: none; }
.step.active { background: var(--navy); color: var(--white); }
.step.done { background: var(--off-white); color: var(--success); }

/* Line item builder row */
.line-item-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: var(--space-sm);
  align-items: start;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}
.line-item-row:last-child { border-bottom: none; }
@media (max-width: 540px) {
  .line-item-row { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .line-item-desc { grid-column: 1 / -1; }
  .line-item-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
}

/* Customer typeahead */
.typeahead-wrap { position: relative; }
.typeahead-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid var(--navy);
  border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  max-height: 220px; overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-md);
}
.typeahead-item {
  padding: var(--space-sm) var(--space-md);
  cursor: pointer; font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.typeahead-item:last-child { border-bottom: none; }
.typeahead-item:hover, .typeahead-item.highlighted { background: var(--off-white); }

/* ============================================================
   Settings
   ============================================================ */

.settings-section {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.logo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: var(--space-lg);
  text-align: center; cursor: pointer;
  transition: border-color 0.2s;
}
.logo-upload-area:hover { border-color: var(--navy); }
.logo-upload-area.dragover { border-color: var(--gold); background: rgba(201,151,58,0.05); }
.logo-preview { max-width: 200px; max-height: 80px; object-fit: contain; margin: 0 auto var(--space-sm); display: block; }

/* ============================================================
   Dashboard Recent Quotes
   ============================================================ */

.recent-list { display: flex; flex-direction: column; gap: var(--space-sm); }

.recent-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--off-white);
  border-radius: var(--r-sm);
  gap: var(--space-md);
  text-decoration: none; color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.recent-item-left { flex: 1; min-width: 0; }
.recent-ref { font-size: 0.8rem; font-weight: 700; font-family: monospace; color: var(--navy); }
.recent-customer { font-size: 0.85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item-right { display: flex; align-items: center; gap: var(--space-sm); flex-shrink: 0; }
.recent-amount { font-weight: 700; font-size: 0.9rem; }

/* ============================================================
   Divider / Section Headers
   ============================================================ */

.section-divider {
  display: flex; align-items: center; gap: var(--space-md);
  margin: var(--space-lg) 0 var(--space-md);
}
.section-divider::before, .section-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.section-divider span { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }

/* Horizontal scroll fix */
html, body { overflow-x: hidden; max-width: 100vw; }

/* ============================================================
   Photo Grid
   ============================================================ */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--off-white);
  border: 1px solid var(--border);
}

.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.15s;
  display: block;
}
.photo-thumb img:hover { opacity: 0.85; }

.photo-delete {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.photo-delete:hover { background: var(--danger); }

/* ============================================================
   Lightbox
   ============================================================ */

.lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.88);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-img {
  max-width: 94vw; max-height: 88vh;
  border-radius: var(--r-sm);
  object-fit: contain;
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* ============================================================
   Client Response Banner
   ============================================================ */

.client-banner {
  border-radius: var(--r-md);
  padding: var(--space-md);
  font-size: 0.9rem;
}
.client-banner-accepted {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #bbf7d0;
}
.client-banner-declined {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}
.client-banner-comment {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #bfdbfe;
}
