/* 
  Jorge Delio Cotizador - Design System (style.css)
  A high-fidelity modern dashboard using Vanilla CSS.
  Theme: Dark Space & Glassmorphism with Neon Accents (Default)
  Supports cascading theme toggle for Light Theme (Day mode).
*/

:root {
  /* Color Palette (Dark Theme Default) */
  --bg-main: #060913;
  --bg-card: rgba(13, 18, 31, 0.65);
  --bg-card-hover: rgba(18, 25, 43, 0.75);
  --border-color: rgba(59, 130, 246, 0.1);
  --border-color-glow: rgba(59, 130, 246, 0.25);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #111827;
  
  --color-primary: #3b82f6;      /* Electric Blue */
  --color-primary-glow: rgba(59, 130, 246, 0.3);
  --color-secondary: #6366f1;    /* Indigo */
  --color-accent: #a855f7;       /* ClickUp Purple */
  --color-accent-glow: rgba(168, 85, 247, 0.25);
  --color-success: #10b981;      /* Emerald Green */
  --color-warning: #f59e0b;      /* Amber Yellow */
  --color-danger: #ef4444;       /* Ruby Red */
  
  --card-bg-solid: #0d121f;
  --input-bg: rgba(17, 24, 39, 0.55);
  --table-header-bg: rgba(17, 24, 39, 0.5);
  --table-border: rgba(255, 255, 255, 0.03);

  /* Shadows & Radius */
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.12);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  
  /* Fonts */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
}

/* Day Mode (Light Theme Overrides) */
body.light-theme {
  --bg-main: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-hover: rgba(255, 255, 255, 0.92);
  --border-color: rgba(59, 130, 246, 0.08);
  --border-color-glow: rgba(59, 130, 246, 0.18);
  
  --text-main: #0f172a;          /* Slate 900 */
  --text-muted: #475569;         /* Slate 600 */
  --text-dark: #f8fafc;
  
  --color-primary: #2563eb;      /* Cobalt Blue */
  --color-primary-glow: rgba(37, 99, 235, 0.12);
  --color-secondary: #4f46e5;    /* Royal Indigo */
  --color-accent: #8b5cf6;       /* Violet */
  --color-accent-glow: rgba(139, 92, 246, 0.15);
  
  --card-bg-solid: #ffffff;
  --input-bg: rgba(248, 250, 252, 0.9);
  --table-header-bg: rgba(241, 245, 249, 0.85);
  --table-border: rgba(0, 0, 0, 0.04);
  
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.08);
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Background Glow Effects */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  transition: opacity 0.5s ease;
}

body.light-theme .bg-glow {
  opacity: 0.15;
}

.glow-1 {
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, rgba(99,102,241,0.05) 70%);
  top: -10vw;
  left: -10vw;
}

.glow-2 {
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(168,85,247,0.2) 0%, rgba(59,130,246,0.05) 70%);
  bottom: -15vw;
  right: -10vw;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

/* Header Styling */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.logo-text h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, var(--text-main), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .logo-text h1 {
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  color: var(--text-main);
}

.logo-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-theme {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-theme:hover {
  color: var(--text-main);
  border-color: var(--border-color-glow);
  transform: scale(1.05);
}

.btn-theme svg {
  transition: transform 0.4s ease;
}

.btn-theme:hover svg {
  transform: rotate(20deg);
}

.connection-status {
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px var(--color-success);
  animation: pulse-green 2s infinite;
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 360px 1fr 410px;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

/* Dashboard Cards (Glassmorphism) */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.card:hover {
  border-color: var(--border-color-glow);
}

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

.card-title-container {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-primary);
}

.card-header h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.card-body {
  padding: 18px;
  flex: 1;
  overflow-y: auto;
}

.flex-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.justify-between {
  justify-content: space-between;
}

.justify-start {
  justify-content: flex-start;
}

.scrollable-y {
  overflow-y: auto;
}

/* Step badges */
.step-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--input-bg);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-glow);
}

.btn-accent {
  background: linear-gradient(135deg, var(--color-accent), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(168, 85, 247, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, var(--color-success), #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--border-color-glow);
}

/* Form Groups & Chained Selector Layout */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.1px;
}

.cascading-car-selectors {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 0.8fr;
  gap: 8px;
  width: 100%;
}

.form-control {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-control:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

textarea.form-control {
  resize: none;
}

.textarea-wrapper {
  position: relative;
  display: flex;
  gap: 8px;
}

.textarea-wrapper textarea {
  flex: 1;
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.6rem;
  color: var(--text-muted);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding-right: 30px;
  cursor: pointer;
}

/* Car Info Card Badge */
.car-info-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(15, 23, 42, 0.3));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.light-theme .car-info-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(241, 245, 249, 0.5));
}

.car-info-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.car-info-title h3 {
  font-size: 1rem;
  font-weight: 600;
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
}

.badge.bg-primary { background: rgba(59, 130, 246, 0.12); color: var(--color-primary); }
.badge.bg-todo { background: rgba(168, 85, 247, 0.12); color: var(--color-accent); }
.badge.bg-specialty { background: rgba(99, 102, 241, 0.12); color: var(--color-secondary); }

/* Solid badges for Stock parts listing */
.badge.bg-success-solid {
  background-color: var(--color-success);
  color: #fff;
}
.badge.bg-warning-solid {
  background-color: var(--color-warning);
  color: var(--text-dark);
}
.badge.bg-danger-solid {
  background-color: var(--color-danger);
  color: #fff;
}

.code-font {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-secondary);
}

.car-info-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
}

.car-info-details strong {
  color: var(--text-muted);
}

/* CLEAN PARTS TABLE & SEARCH */
.inventory-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  border-left: 3px solid var(--color-primary);
  padding-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.search-parts-wrapper {
  width: 100%;
}

.search-parts-wrapper input {
  width: 100%;
  font-size: 0.85rem;
  padding: 8px 12px;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pill {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}

.pill:hover {
  color: var(--text-main);
  border-color: var(--border-color-glow);
}

.pill.active {
  background: var(--color-primary-glow);
  color: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 600;
}

/* CLEAN TABLE */
.clean-table-container {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg-solid);
  overflow-y: auto;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.clean-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.clean-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--table-border);
  color: var(--text-main);
}

.clean-table tr:hover td {
  background: rgba(59, 130, 246, 0.03);
}

.clean-table tr:last-child td {
  border-bottom: none;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.mb-8 { margin-bottom: 8px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }

/* SVG Car Blueprint Styling */
.blueprint-container {
  position: relative;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.light-theme .blueprint-container {
  background: rgba(255, 255, 255, 0.6);
}

.blueprint-hint {
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  pointer-events: none;
}

#car-blueprint {
  max-width: 100%;
  height: auto;
}

/* SVG Interactive Group Styles */
.interactive-part {
  cursor: pointer;
  transition: all 0.3s ease;
}

.car-body-path {
  fill: rgba(30, 41, 59, 0.35);
  stroke: #475569;
  stroke-width: 1.8;
  transition: all 0.3s;
}

body.light-theme .car-body-path {
  fill: rgba(226, 232, 240, 0.6);
  stroke: #64748b;
}

.car-decor-path {
  fill: none;
  stroke: #334155;
  stroke-width: 1.2;
}

body.light-theme .car-decor-path {
  stroke: #94a3b8;
}

.car-engine-path {
  fill: rgba(220, 38, 38, 0.08);
  stroke: rgba(220, 38, 38, 0.3);
  stroke-width: 1.2;
  transition: all 0.3s;
}

.engine-detail {
  stroke: rgba(220, 38, 38, 0.2);
  stroke-width: 1;
}

.car-brake-path {
  fill: none;
  stroke: rgba(245, 158, 11, 0.15);
  stroke-width: 3.5;
  transition: all 0.3s;
}

.car-caliper-path {
  color: var(--color-warning);
  opacity: 0.4;
}

.car-suspension-path {
  stroke: #475569;
  stroke-width: 1.2;
}

.car-wheel-path {
  fill: #090c13;
  stroke: #334155;
  stroke-width: 4.5;
  transition: all 0.3s;
}

body.light-theme .car-wheel-path {
  fill: #1e293b;
  stroke: #475569;
}

.car-rim-path {
  fill: #1e293b;
  stroke: #475569;
  stroke-width: 1.2;
}

body.light-theme .car-rim-path {
  fill: #cbd5e1;
  stroke: #64748b;
}

.car-rim-spoke {
  stroke: #475569;
  stroke-width: 1.2;
}

body.light-theme .car-rim-spoke {
  stroke: #64748b;
}

.car-light-path {
  fill: #f59e0b;
  opacity: 0.5;
}

.car-light-beam {
  fill: url(#light-beam-gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

.cabin-electronics {
  fill: rgba(59, 130, 246, 0.08);
  stroke: rgba(59, 130, 246, 0.25);
  stroke-width: 1;
}

.cabin-electronics-dot {
  fill: var(--color-primary);
  opacity: 0.5;
}

/* SVG Active/Hover Interactive States */
.interactive-part:hover .car-body-path {
  fill: rgba(59, 130, 246, 0.1);
  stroke: var(--color-primary);
  filter: url(#glow);
}

.interactive-part:hover .car-engine-path {
  fill: rgba(239, 68, 68, 0.2);
  stroke: var(--color-danger);
  filter: url(#glow);
}

.interactive-part:hover .car-brake-path {
  stroke: var(--color-warning);
  filter: url(#glow);
}

.interactive-part:hover .car-wheel-path {
  stroke: var(--text-muted);
}

.interactive-part:hover.interactive-part[data-part="electrico"] .car-light-beam {
  opacity: 0.12;
}

/* Active Highlight Visual Blueprint States */
.interactive-part.active-part .car-body-path {
  fill: rgba(59, 130, 246, 0.15);
  stroke: var(--color-primary);
  stroke-width: 2.2;
  filter: url(#glow);
  animation: svg-pulse-blue 2s infinite;
}

.interactive-part.active-part .car-engine-path {
  fill: rgba(239, 68, 68, 0.25);
  stroke: var(--color-danger);
  stroke-width: 1.8;
  filter: url(#glow);
  animation: svg-pulse-red 2s infinite;
}

.interactive-part.active-part .car-brake-path {
  stroke: var(--color-warning);
  stroke-width: 4.5;
  filter: url(#glow);
  animation: svg-pulse-orange 2s infinite;
}

.interactive-part.active-part .car-wheel-path {
  stroke: var(--color-success);
}

/* Wheel Spin Animation if brakes/suspension selected */
.interactive-part.active-part .car-rim-spoke {
  transform-origin: 200px 195px;
  animation: spin 6s linear infinite;
}

#part-frenos-rear.active-part .car-rim-spoke {
  transform-origin: 650px 195px;
  animation: spin 6s linear infinite;
}

/* Preset buttons */
.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-preset {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.btn-preset:hover {
  background: var(--color-primary-glow);
  color: var(--text-main);
  border-color: var(--color-primary);
}

/* TWO-STEP AI DIAGNOSTIC PROPOSAL UI */
.diag-proposal-card {
  border: 1px solid var(--border-color-glow);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.2), rgba(15, 23, 42, 0.2));
  animation: fadeIn 0.4s ease-out;
}

body.light-theme .diag-proposal-card {
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.8), rgba(255, 255, 255, 0.9));
}

.proposal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.proposal-field strong {
  font-size: 0.78rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.proposal-field p {
  line-height: 1.4;
}

.bullets-list {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bullets-list li {
  line-height: 1.4;
  color: var(--text-main);
}

.categories-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.approval-action-block {
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
  margin-top: 8px;
}

/* STOCK TITLES FOR SPLIT PARTS */
.stock-title {
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.stock-title.available { color: var(--color-success); }
.stock-title.order { color: var(--color-warning); }

/* Loading Spinner */
.loading-spinner {
  animation: spin 1s linear infinite;
}

.hidden {
  display: none !important;
}

/* Empty State Results */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  gap: 12px;
  height: 100%;
}

.empty-state-icon {
  color: var(--border-color-glow);
  animation: float 4s ease-in-out infinite;
}

.empty-state p {
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 300px;
}

/* Quote Results Block */
.quote-results-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.4s ease-out;
}

.quote-results-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 8px;
  color: var(--text-muted);
}

.results-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.results-block h4 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.results-block p {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-main);
}

.summary-table td {
  padding: 6px 8px;
}

.table-container.mini-table {
  max-height: 160px;
  flex: none;
}

/* Totals Card */
.totals-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(99, 102, 241, 0.03));
  border: 1px solid var(--border-color-glow);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.light-theme .totals-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(241, 245, 249, 0.8));
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.total-grand {
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-main);
}

.time-estimate {
  font-size: 0.8rem;
  align-items: center;
  margin-top: 2px;
}

.action-buttons-group {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

/* ClickUp Success Card */
.clickup-success-card {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(99, 102, 241, 0.03));
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideUp 0.3s ease-out;
}

body.light-theme .clickup-success-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(255, 255, 255, 0.8));
}

.clickup-success-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clickup-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-accent);
  letter-spacing: 0.5px;
}

.clickup-task-id {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.clickup-success-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}

.success-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.success-row strong {
  color: var(--text-muted);
}

.assignee-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.05);
  padding: 3px 8px;
  border-radius: 50px;
}

.assignee-avatar {
  width: 18px;
  height: 18px;
  background-color: var(--color-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
}

.success-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
  text-align: center;
}

/* Dialog Modal */
dialog {
  margin: auto;
  background: var(--card-bg-solid);
  border: 1px solid var(--border-color-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  color: var(--text-main);
  width: 90%;
  max-width: 530px;
  padding: 0;
  overflow: hidden;
  outline: none;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}

.dialog-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dialog-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: var(--text-main);
}

.dialog-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

fieldset {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

legend {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  padding: 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.routing-table-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.routing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.routing-table th {
  text-align: left;
  padding: 6px;
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.routing-table td {
  padding: 6px;
  border-bottom: 1px solid var(--table-border);
}

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

/* Responsive Grid Adapting */
@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
  }
  .app-container {
    height: auto;
  }
  .table-container {
    max-height: 300px;
  }
}

/* Animations */
@keyframes spin {
  100% { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

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

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes svg-pulse-blue {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.2)); }
  50% { filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.7)); }
}

@keyframes svg-pulse-red {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.2)); }
  50% { filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.7)); }
}

@keyframes svg-pulse-orange {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.2)); }
  50% { filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.7)); }
}

/* Print Logo Header (Hidden on Screen, Visible on Print) */
.print-logo-header {
  display: none;
}
.print-logo-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background-color: #fff;
  object-fit: contain;
  border: 1px solid var(--border-color);
}
.print-workshop-details h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
.print-workshop-details p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

/* Quote Vehicle Info */
.quote-car-info {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.quote-car-info .info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  font-size: 0.85rem;
}
.quote-car-info .info-grid div {
  color: var(--text-main);
}
.quote-car-info .info-grid strong {
  color: var(--text-muted);
  margin-right: 4px;
}

/* Vehicle Status Report */
.status-report-block {
  margin-top: 14px;
  border-top: 1px dashed var(--border-color);
  padding-top: 14px;
}
.status-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.status-report-item {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.status-report-item .status-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
}
.status-report-item .status-val {
  font-size: 0.72rem;
  font-weight: 700;
}

/* Signatures Section */
.signature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px dashed var(--border-color);
}
.signature-col {
  text-align: center;
}
.signature-line {
  border-bottom: 1px solid var(--text-muted);
  width: 80%;
  margin: 0 auto 8px auto;
  height: 40px;
}
.signature-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
.signature-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

/* Print Styles */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .app-container {
    padding: 0;
  }
  .app-header, 
  .panel-inventory, 
  .panel-diagnostics, 
  .action-buttons-group, 
  .clickup-success-card,
  #btn-settings,
  #btn-theme-toggle,
  .blueprint-hint,
  .bg-glow {
    display: none !important;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .panel-results {
    border: none;
    background: none;
    box-shadow: none;
  }
  .totals-card {
    border: 1px solid #ccc;
    background: none;
    color: #000;
  }
  .total-grand {
    color: #000;
    border-top: 1px solid #000;
  }
  .badge {
    border: 1px solid #000;
    color: #000 !important;
    background: none !important;
  }
  .quote-car-info, .status-report-item {
    border: 1px solid #ccc !important;
    background: none !important;
    color: #000 !important;
  }
  .quote-car-info .info-grid div, 
  .quote-car-info .info-grid strong,
  .status-report-item .status-label,
  .signature-title,
  .signature-subtitle {
    color: #000 !important;
  }
  .signature-line {
    border-bottom: 1px solid #000 !important;
  }
  .signature-block {
    border-top: 1px dashed #ccc !important;
    page-break-inside: avoid;
  }
  .status-report-block {
    border-top: 1px dashed #ccc !important;
    page-break-inside: avoid;
  }
  .print-logo-header {
    display: flex !important;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    border-bottom: 1px dashed #ccc !important;
    padding-bottom: 12px;
  }
  .print-logo-img {
    border: 1px solid #ccc !important;
  }
}

/* Linear Gradient for Light Beam inside SVG */
#light-beam-gradient {
  x1: 0%; y1: 50%;
  x2: 100%; y2: 50%;
}
