/* ======================================================================
   AUTOMALL OPERATIONS command center CSS — EXECUTIVE REDESIGN
   Aesthetics: Frosted Glass, HSL Gradients, Glowing Widgets, Stripe Forms
   ====================================================================== */

:root {
  /* Rich, Curated HSL Design Tokens */
  --hsl-bg: 220, 33%, 97%;
  --hsl-surface: 0, 0%, 100%;
  --hsl-subtle: 220, 20%, 94%;
  --hsl-border: 220, 15%, 89%;
  
  --hsl-blue: 224, 86%, 53%;
  --hsl-indigo: 242, 60%, 48%;
  --hsl-emerald: 152, 76%, 42%;
  --hsl-amber: 32, 95%, 44%;
  --hsl-rose: 343, 85%, 52%;
  --hsl-purple: 271, 76%, 53%;

  /* Direct CSS HEX Colors mapped from HSL */
  --bg-body: hsl(var(--hsl-bg));
  --bg-surface: hsl(var(--hsl-surface));
  --bg-subtle: hsl(var(--hsl-subtle));
  --border-subtle: hsl(var(--hsl-border));
  --border-strong: #cbd5e1;

  --text-heading: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Premium Gradients */
  --brand-primary: hsl(var(--hsl-blue));
  --brand-gradient: linear-gradient(135deg, hsl(var(--hsl-blue)) 0%, hsl(var(--hsl-indigo)) 100%);
  --blue-glow: rgba(37, 99, 235, 0.15);
  
  --emerald: hsl(var(--hsl-emerald));
  --emerald-gradient: linear-gradient(135deg, hsl(var(--hsl-emerald)) 0%, #047857 100%);
  --emerald-glow: rgba(5, 150, 105, 0.15);

  --amber: hsl(var(--hsl-amber));
  --amber-gradient: linear-gradient(135deg, hsl(var(--hsl-amber)) 0%, #ea580c 100%);
  --amber-glow: rgba(217, 119, 6, 0.15);

  --rose: hsl(var(--hsl-rose));
  --rose-gradient: linear-gradient(135deg, hsl(var(--hsl-rose)) 0%, #be123c 100%);
  --rose-glow: rgba(225, 29, 72, 0.15);

  --purple: hsl(var(--hsl-purple));
  --purple-gradient: linear-gradient(135deg, hsl(var(--hsl-purple)) 0%, #6d28d9 100%);
  --purple-glow: rgba(124, 58, 237, 0.15);

  /* Modern Fonts */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-brand: 'Outfit', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-urdu: 'Noto Nastaliq Urdu', serif;

  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(15,23,42,0.03), 0 1px 2px rgba(15,23,42,0.02);
  --shadow-md: 0 10px 24px -6px rgba(15,23,42,0.06), 0 2px 6px -2px rgba(15,23,42,0.03);
  --shadow-lg: 0 20px 48px -8px rgba(15,23,42,0.1), 0 4px 12px -4px rgba(15,23,42,0.04);
  --shadow-modal: 0 32px 72px -16px rgba(9,14,26,0.22);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-body);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Background grid styling */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 10% 12%, rgba(37, 99, 235, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 88%, rgba(124, 58, 237, 0.03) 0%, transparent 40%),
    linear-gradient(to right, rgba(226, 232, 240, 0.4) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.4) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}

/* ======================================================================
   STRATEGIC PITCH BANNER & VALUE HIGHLIGHTS
   ====================================================================== */
.pitch-banner {
  background: var(--brand-gradient);
  color: #ffffff;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13.5px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.pitch-banner.hidden { display: none; }

.pitch-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pitch-badge {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pitch-tip-box {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--brand-primary);
  line-height: 1.5;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.pitch-tip-box.hidden { display: none; }
.tip-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.pitch-tip-box strong { font-family: var(--font-display); font-weight: 800; display: block; margin-bottom: 2px; }

/* Dynamic highlighting in Pitch Mode */
.pitch-highlight {
  position: relative;
  outline: 2px solid var(--brand-primary) !important;
  outline-offset: 2px;
}

/* ======================================================================
   MAIN HEADER
   ====================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap: 24px;
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.brand-icon svg { width: 22px; height: 22px; }

.brand-name {
  font-family: var(--font-brand);
  font-size: 20px;
  font-weight: 900;
  color: var(--text-heading);
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.brand-sub { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }

.global-search-container {
  flex: 1;
  max-width: 580px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.global-search-input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 42px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 13.5px;
  background: var(--bg-subtle);
  color: var(--text-heading);
  outline: none;
  transition: all 0.25s ease;
}

.global-search-input:focus {
  border-color: var(--brand-primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3.5px rgba(29, 78, 216, 0.12);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  overflow: hidden;
  max-height: 360px;
  overflow-y: auto;
}

.search-dropdown.hidden { display: none; }

.search-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}

.search-result-row:last-child { border-bottom: none; }
.search-result-row:hover { background: var(--bg-subtle); }

.srr-left { display: flex; align-items: center; gap: 12px; }
.srr-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand-surface);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.srr-icon svg { width: 18px; height: 18px; }

.srr-title { font-family: var(--font-display); font-size: 13.5px; font-weight: 800; color: var(--text-heading); }
.srr-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.live-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-body);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--emerald);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ======================================================================
   TAB NAVIGATION
   ====================================================================== */
.tab-nav {
  display: flex;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
  text-align: left;
}

.tab-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.tab-btn span { font-size: 13.5px; font-weight: 700; display: block; line-height: 1.1; color: var(--text-body); }
.tab-btn em { font-size: 10.5px; font-style: normal; color: var(--text-light); display: block; margin-top: 2px; }

.tab-btn:hover {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.tab-btn.active span { color: var(--brand-primary); }
.tab-btn.active em { color: var(--brand-primary); opacity: 0.7; }

/* Panels */
.tab-panel { display: none; animation: slideIn 0.2s ease; }
.tab-panel.active { display: block; }

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

/* ======================================================================
   SPLIT VIEW INTAKE (TAB 1)
   ====================================================================== */
.split-view {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: calc(100vh - 120px);
}

.split-left {
  padding: 24px;
  border-right: 1px solid var(--border-subtle);
}

.split-right {
  background: linear-gradient(180deg, #ffffff 0%, hsl(var(--hsl-bg)) 100%);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-heading);
  margin: 4px 0 2px;
}

.panel-header p { font-size: 13.5px; color: var(--text-muted); }

/* Badges */
.slip-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.badge-blue { background: var(--brand-surface); color: var(--brand-primary); border: 1px solid var(--brand-border); }
.badge-pink { background: var(--rose-surface); color: var(--rose); border: 1px solid var(--rose-border); }
.badge-amber { background: var(--amber-surface); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-emerald { background: var(--emerald-surface); color: var(--emerald); border: 1px solid var(--emerald-border); }
.badge-purple { background: var(--purple-surface); color: var(--purple); border: 1px solid var(--purple-border); }

/* ======================================================================
   FORMS & CARD SECTIONS
   ====================================================================== */
.card-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.section-title-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.section-title-bar h3 {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-heading);
}

.section-title-bar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title-bar-row .section-title-bar { margin-bottom: 0; }

.step-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--brand-surface);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
}

.field-grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid-1 { display: flex; flex-direction: column; gap: 14px; }

@media(max-width: 900px) {
  .field-grid-2 { grid-template-columns: 1fr; }
  .split-view { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.col-2 { grid-column: span 2; }
@media(max-width: 900px) { .field.col-2 { grid-column: span 1; } }

.lbl { font-size: 11.5px; font-weight: 800; color: var(--text-muted); }
.req { color: var(--rose); }

.inp {
  height: 38px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text-heading);
  background: var(--bg-surface);
  outline: none;
  width: 100%;
  transition: all 0.2s ease;
}

.inp:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.inp.bg-read-only { background: var(--bg-subtle); color: var(--text-muted); cursor: not-allowed; }
.inp.text-area { height: auto; padding: 10px 12px; resize: vertical; }

.fnt-mono { font-family: var(--font-mono); }
.fnt-bold { font-weight: 700; }
.clr-emerald { color: var(--emerald) !important; }
.clr-blue { color: var(--brand-primary) !important; }
.clr-amber { color: var(--amber) !important; }

.optional-separator {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin: 18px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.optional-separator::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }

/* ======================================================================
   HYBRID CUSTOM INPUT DROPDOWN
   ====================================================================== */
.hybrid-input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.custom-text-input {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.btn-input-reset {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  border: none;
  background: var(--bg-subtle);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.btn-input-reset:hover { background: var(--border-strong); color: var(--text-heading); }

.hidden { display: none !important; }

/* ======================================================================
   CNIC / DOCUMENT UPLOADS
   ====================================================================== */
.upload-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-body);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
  min-height: 80px;
}

.upload-dropzone:hover { border-color: var(--brand-primary); background: var(--brand-surface); }

.upload-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.upload-inner svg { width: 22px; height: 22px; color: var(--brand-primary); flex-shrink: 0; }

.attached-document-img {
  width: 100%;
  max-height: 90px;
  object-fit: cover;
  display: block;
}

.upload-status-bar {
  background: var(--emerald-surface);
  border-top: 1px solid var(--emerald-border);
  color: var(--emerald);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hidden-input { display: none !important; }

/* ======================================================================
   6-ANGLE INTAKE PHOTOS
   ====================================================================== */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 600px) { .photo-grid { grid-template-columns: repeat(2, 1fr); } }

.photo-box {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-body);
  height: 110px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
}
.photo-box:hover { border-color: var(--brand-primary); }

.photo-box-preview {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  background-size: cover;
  background-position: center;
}

.photo-box-preview svg { width: 20px; height: 20px; color: var(--brand-primary); margin-bottom: 4px; }
.photo-box-preview strong { font-size: 11px; color: var(--text-body); display: block; }
.photo-box-preview span { font-size: 9.5px; color: var(--text-light); display: block; }

/* ======================================================================
   ACCESSORIES CHECKLIST
   ====================================================================== */
.items-checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.item-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  user-select: none;
  transition: background 0.15s;
}
.item-checkbox:hover { background: #e2e8f0; }
.item-checkbox input { width: 15px; height: 15px; accent-color: var(--emerald); cursor: pointer; }

/* ======================================================================
   DAMAGE SVG MAP
   ====================================================================== */
.interactive-blueprint-container {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #fafafa;
  overflow: hidden;
  margin-bottom: 12px;
}

#svg-body-map { width: 100%; max-height: 380px; display: block; cursor: crosshair; }

.damage-summary-strip { display: flex; flex-wrap: wrap; gap: 6px; }

.placeholder-text { font-size: 12px; color: var(--text-light); }

.tag-damage-pin {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
}

.damage-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  color: var(--text-body);
  transition: all 0.15s;
}

.damage-tool.active {
  background: var(--brand-surface);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.marker-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.marker-dot.scratch { background: var(--amber); }
.marker-dot.dent { background: var(--rose); }
.marker-dot.paint { background: var(--brand-primary); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* ======================================================================
   RECENT LOT OFFLOADS (RIGHT PANEL - TAB 1)
   ====================================================================== */
.recent-intake-header {
  padding: 20px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.5);
}

.recent-intake-header h3 {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.3px;
}

.mini-kpis {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.mini-kpi-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
}
.mini-kpi-chip.blue { background: var(--brand-surface); color: var(--brand-primary); border-color: var(--brand-border); }
.mini-kpi-chip.amber { background: var(--amber-surface); color: var(--amber); border-color: var(--amber-border); }
.mini-kpi-chip.emerald { background: var(--emerald-surface); color: var(--emerald); border-color: var(--emerald-border); }

.mini-search-wrapper {
  position: relative;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.3);
}
.mini-search-wrapper svg {
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}
#mini-stock-search {
  width: 100%;
  height: 38px;
  padding: 0 16px 0 34px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 12.5px;
  outline: none;
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}
#mini-stock-search:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.recent-intakes-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Compact Sidebar Card */
.compact-car-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  padding: 14px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

/* Dynamic Left status border for sidebar cards */
.compact-car-card.border-showroom { border-left: 4.5px solid var(--emerald); }
.compact-car-card.border-display { border-left: 4.5px solid var(--amber); }
.compact-car-card.border-workshop { border-left: 4.5px solid var(--purple); }
.compact-car-card.border-testdrive { border-left: 4.5px solid #ea580c; }
.compact-car-card.border-sold { border-left: 4.5px solid var(--text-light); }

.compact-car-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.ccc-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.compact-car-card:hover .ccc-icon {
  background: var(--brand-surface);
  color: var(--brand-primary);
}

.ccc-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ccc-name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ccc-reg-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ccc-reg {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-primary);
  background: var(--brand-surface);
  padding: 1px 6px;
  border-radius: 4px;
  border: 0.5px solid var(--brand-border);
}
.ccc-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.ccc-loc {
  margin-top: 4px;
}

.status-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  padding: 2.5px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.status-indicator-badge.showroom { background: var(--emerald-surface); color: var(--emerald); }
.status-indicator-badge.display { background: var(--amber-surface); color: var(--amber); }
.status-indicator-badge.workshop { background: var(--purple-surface); color: var(--purple); }
.status-indicator-badge.testdrive { background: #fff7ed; color: #ea580c; }
.status-indicator-badge.sold { background: var(--bg-subtle); color: var(--text-muted); }

/* ======================================================================
   BANNERS & DETAILS CONTAINER
   ====================================================================== */
.executive-banner {
  margin: 20px 24px;
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.banner-blue { background: linear-gradient(135deg, #eff6ff, #dbeafe); border: 1px solid var(--brand-border); }
.banner-pink { background: linear-gradient(135deg, #fff1f2, #ffe4e6); border: 1px solid var(--rose-border); }
.banner-amber { background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid var(--amber-border); }

.eb-left h2 { font-family: var(--font-display); font-size: 22px; font-weight: 900; color: var(--text-heading); margin: 3px 0; }
.eb-left p { font-size: 13.5px; color: var(--text-body); }

/* Unsold stock cards tab 4 */
.kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 0 24px 20px;
}

.kpi-card-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.kpi-card-box.border-blue { border-left: 4.5px solid var(--brand-primary); }
.kpi-card-box.border-emerald { border-left: 4.5px solid var(--emerald); }
.kpi-card-box.border-amber { border-left: 4.5px solid var(--amber); }
.kpi-card-box.border-purple { border-left: 4.5px solid var(--purple); }

.kpi-box-lbl { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.3px; }
.kpi-box-val { font-family: var(--font-display); font-size: 28px; font-weight: 900; color: var(--text-heading); margin: 3px 0 1px; }
.kpi-box-sub { font-size: 11px; color: var(--text-light); }

.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 700;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  color: var(--text-body);
  transition: all 0.15s;
}
.chip.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }

/* Stock Grid layout */
.stock-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin: 0 24px;
}

/* NO IMAGE STOCK CARD DESIGN */
.stock-card-executive {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
}

.stock-card-executive:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-lg);
}

.sce-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.sce-icon-frame {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stock-card-executive:hover .sce-icon-frame { background: var(--brand-surface); color: var(--brand-primary); }

.sce-title-area { flex: 1; min-width: 0; }
.sce-make-model { font-family: var(--font-display); font-size: 15px; font-weight: 900; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sce-reg-no { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--brand-primary); }

.sce-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 14px 0;
  font-size: 12.5px;
}

.sce-spec-item { display: flex; flex-direction: column; gap: 2px; }
.sce-spec-lbl { font-size: 10.5px; color: var(--text-light); font-weight: 700; }
.sce-spec-val { font-weight: 700; color: var(--text-body); }

.sce-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.sce-price { font-family: var(--font-mono); font-size: 17px; font-weight: 900; color: var(--emerald); }

/* ======================================================================
   MOVEMENTS MODULE 3
   ====================================================================== */
.movements-container { padding: 0 24px; }

.operations-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }

.ops-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ops-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.ops-title-group { display: flex; align-items: center; gap: 10px; }
.ops-title-group h3 { font-family: var(--font-display); font-size: 14.5px; font-weight: 900; color: var(--text-heading); }
.ops-title-group svg { width: 18px; height: 18px; }

.clr-amber { color: var(--amber); }
.clr-emerald { color: var(--emerald); }

.table-container { overflow-x: auto; }

.ops-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ops-table th {
  background: var(--bg-subtle);
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1.5px solid var(--border-subtle);
  white-space: nowrap;
}

.ops-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.ops-table tr:last-child td { border-bottom: none; }
.ops-table tr:hover td { background: var(--bg-hover); }

.td-empty-msg { text-align: center; padding: 32px; color: var(--text-light); }

/* ======================================================================
   DELIVERY ORDER COGNITIVE FLOW (TAB 2)
   ====================================================================== */
.do-container { padding: 0 24px; }

.dual-column-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .dual-column-layout { grid-template-columns: 1fr; } }

.price-calculator-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.price-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 140px; }
.price-field label { font-size: 11px; font-weight: 800; color: var(--text-muted); }
.price-inp { font-size: 17px !important; font-weight: 900 !important; font-family: var(--font-mono); }

.price-operator { font-size: 20px; font-weight: 800; color: var(--text-light); padding-bottom: 8px; }

/* Signature Box styles */
.signature-canvas-group { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }

.sig-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-body);
  padding: 14px;
}

.sig-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

.btn-clear-canvas {
  background: var(--bg-subtle);
  border: none;
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.btn-clear-canvas:hover { background: var(--border-strong); }

.signature-canvas {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  width: 100%;
  height: 120px;
  cursor: crosshair;
  display: block;
  touch-action: none;
}

/* Urdu legal display */
.urdu-clause-display {
  background: var(--rose-surface);
  border: 1.5px solid var(--rose-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  text-align: center;
  margin-bottom: 8px;
}
.urdu-clause-display p { font-family: var(--font-urdu); font-size: 15px; font-weight: 700; color: #9f1239; line-height: 2; }

.urdu-clause-translation {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}
.urdu-clause-translation svg { width: 12px; height: 12px; color: var(--rose); margin-top: 2px; flex-shrink: 0; }

.submit-delivery-bar { margin-top: 18px; }

/* ======================================================================
   BUTTON DESIGN SYSTEM
   ====================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-lg { padding: 12px 24px; font-size: 14px; border-radius: var(--radius-md); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11.5px; }

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

.btn-pink { background: var(--rose); color: #ffffff; }
.btn-pink:hover { background: #be123c; }

.btn-amber { background: var(--amber); color: #ffffff; }
.btn-amber:hover { background: #b45309; }

.btn-emerald { background: var(--emerald); color: #ffffff; }
.btn-emerald:hover { background: #047857; }

.btn-ghost { background: transparent; color: var(--text-body); border: 1.5px solid var(--border-strong); }
.btn-ghost:hover { background: var(--bg-subtle); }

.btn-outline-blue { background: var(--bg-surface); border: 1.5px solid var(--brand-primary); color: var(--brand-primary); }
.btn-outline-blue:hover { background: var(--brand-surface); }

.btn-outline-pink { background: var(--bg-surface); border: 1.5px solid var(--rose); color: var(--rose); }
.btn-outline-pink:hover { background: var(--rose-surface); }

/* Inline list buttons */
.btn-grid-action {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-grid-action:hover { background: var(--bg-subtle); border-color: var(--brand-primary); color: var(--brand-primary); }

/* ======================================================================
   MODALS
   ====================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 26, 0.5);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; animation: fade-overlay 0.2s ease; }

@keyframes fade-overlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-window {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scale-modal 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scale-modal {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-window.modal-lg { max-width: 800px; }
.modal-window.modal-xl { max-width: 980px; }

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

.modal-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 900; color: var(--text-heading); }
.modal-header-actions { display: flex; gap: 8px; align-items: center; }

.modal-close {
  width: 26px;
  height: 26px;
  border: none;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--border-strong); }

.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }

.modal-body-scrollable { overflow-y: auto; padding: 24px; }
.modal-body-scrollable.p0 { padding: 0; }

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

/* Dispatch modal extra options */
.test-drive-fields-box {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.extra-field-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.extra-field-title svg { width: 14px; height: 14px; }

/* Return Modal styling */
.ret-vehicle-banner {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--brand-primary);
}

.checks-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checks-box-title { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }

/* ======================================================================
   360° MASTER PROFILE TIMELINE & SPEC DRAWER
   ====================================================================== */
.profile-drawer-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) { .profile-drawer-layout { grid-template-columns: 1fr; } }

.pdl-photos-section { margin-bottom: 20px; }

.pdl-photos-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pdl-gallery-item {
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  cursor: zoom-in;
}
.pdl-gallery-item:first-child { grid-column: span 2; height: 180px; }
.pdl-gallery-item img { width: 100%; height: 100%; object-fit: cover; }

.profile-specs-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 20px;
}

.psl-row { display: flex; flex-direction: column; gap: 2px; }
.psl-lbl { font-size: 10.5px; font-weight: 800; color: var(--text-light); text-transform: uppercase; }
.psl-val { font-size: 13.5px; font-weight: 700; color: var(--text-body); }
.psl-val.mono { font-family: var(--font-mono); }

.pdl-timeline { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.pdl-timeline-step { display: flex; gap: 12px; font-size: 12.5px; align-items: flex-start; }

.pt-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.pt-dot.intake { background: var(--brand-primary); }
.pt-dot.dispatch { background: var(--amber); }
.pt-dot.return { background: var(--emerald); }
.pt-dot.sale { background: var(--rose); }

.pt-body { flex: 1; }
.pt-title { font-weight: 700; color: var(--text-heading); }
.pt-meta { font-size: 11px; color: var(--text-muted); }

.profile-header-meta { display: flex; align-items: center; gap: 10px; }
.reg-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-primary);
  background: var(--brand-surface);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-border);
}

.profile-sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.profile-sidebar-card h4 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.pdoc-preview-box {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-top: 8px;
}
.pdoc-preview-box img { width: 100%; display: block; max-height: 90px; object-fit: cover; }

/* ======================================================================
   CARBON SLIPS (PRINTING STYLES FOR FORMS 100 & 150)
   ====================================================================== */
.carbon-printable-document {
  padding: 30px;
  color: #000000;
  font-family: Arial, sans-serif;
  line-height: 1.4;
}

.carbon-blue-slip { background: #e0f2fe; border: 2.5px solid #0369a1; }
.carbon-pink-slip { background: #ffe4e6; border: 2.5px solid #be123c; }

.cps-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #000;
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.cps-serial { font-family: monospace; font-size: 24px; font-weight: 900; }
.cps-title { font-size: 15px; font-weight: 900; border: 2.5px solid #000; padding: 4px 16px; background: #fff; text-align: center; }
.cps-meta { font-size: 11.5px; text-align: right; line-height: 1.5; }

.cps-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 12px; }
.cps-table td { border: 1px solid #000; padding: 6px 10px; }
.cps-table .td-label { font-weight: 800; background: rgba(255,255,255,0.5); width: 18%; }

.cps-box { border: 1px solid #000; padding: 8px 12px; font-size: 12px; margin-bottom: 10px; background: rgba(255,255,255,0.4); }

.cps-urdu-clause { border: 1.5px solid #000; padding: 10px; text-align: center; background: #fff; margin-bottom: 16px; }
.cps-urdu-text { font-family: var(--font-urdu); font-size: 14.5px; font-weight: 700; color: #881337; line-height: 2.2; }

.cps-signature-area { display: flex; justify-content: space-between; margin-top: 32px; font-size: 11px; text-align: center; }
.cps-sig-block { width: 42%; border-top: 1px solid #000; padding-top: 6px; }

/* ======================================================================
   TOAST STACK
   ====================================================================== */
#toast-alerts-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  padding: 12px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4.5px solid var(--brand-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-heading);
  animation: slide-toast 0.25s ease;
  pointer-events: auto;
}

@keyframes slide-toast {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ======================================================================
   GLOBAL UTILITIES
   ====================================================================== */
.mt-12 { margin-top: 12px !important; }
.mt-8 { margin-top: 8px !important; }
.p0 { padding: 0 !important; }
.w-full { width: 100%; }

@media print {
  body { background: #fff !important; }
  .pitch-banner, .app-header, .tab-nav, .executive-banner, .form-actions,
  .modal-header-actions, #toast-alerts-stack, .submit-delivery-bar,
  .action-btn-row, .btn, .ops-table td button, .sce-footer, .ccc-loc { display: none !important; }
  .modal-overlay { position: static !important; display: block !important; background: none !important; }
  .modal-window { box-shadow: none !important; max-width: 100% !important; border-radius: 0 !important; }
}