/* Buckla PWA — Mobile-first styles */

:root {
  --blue: #1a56db;
  --blue-dark: #1444a8;
  --blue-light: #e8eefb;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  
  /* Error and warning states */
  --error: #dc2626;
  --error-bg: #fee2e2;
  --error-text: #991b1b;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --nav-bar-height: 48px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  min-height: 100dvh;
}

.hidden { display: none !important; }

/* Header */
.header {
  background: var(--blue);
  color: #fff;
  height: 46px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.dev-mode .header {
  background: var(--red);
}
.header h1 {
  font-size: 16px;
  flex: 0 1 auto;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}
.header h1.hidden { display: none !important; }
.header-center-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 56vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.header-right-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  flex: 0 0 auto;
  flex-shrink: 0;
  gap: 8px;
  min-width: 0;
}
.header-reg-input {
  width: 96px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 1px;
  text-transform: uppercase;
  outline: none;
}
.header-reg-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}
.header-reg-input:focus {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.24);
}
.header-reg-input.is-clickable {
  cursor: pointer;
}
.damage-header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.damage-header-offering-buttons {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}
.damage-header-offering-btn {
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 0 10px;
  min-height: 34px;
  white-space: nowrap;
}
.damage-header-offering-btn:last-child {
  border-right: 0;
}
.damage-header-offering-btn.active {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.damage-header-offering-btn:disabled {
  opacity: 0.7;
}
.damage-header-offering-select {
  width: min(180px, 100%);
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 0 32px 0 10px;
}
.damage-header-offering-select option {
  color: var(--gray-900);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.header-status {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--orange);
  color: #111827;
  border: 1px solid #d97706;
  border-radius: 999px;
  padding: 2px 10px;
  pointer-events: none;
}
.header-active-order-menu-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.12));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.header-active-order-menu-btn:hover,
.header-active-order-menu-btn:focus-visible {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.16));
  border-color: rgba(255, 255, 255, 0.78);
}
.header-active-order-menu-btn:active {
  transform: translateY(1px);
}
.header-active-order-menu-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.86);
  outline-offset: 1px;
}
.header-active-order-menu-icon {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-1px);
}

.active-order-menu-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.active-order-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.54);
  backdrop-filter: blur(1.5px);
}

.active-order-menu-panel {
  position: relative;
  width: min(420px, 100%);
  max-height: min(76vh, 620px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: 0 22px 40px rgba(17, 24, 39, 0.28);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.active-order-menu-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--gray-900);
}

.active-order-menu-subtitle {
  font-size: 13px;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 8px;
}

.active-order-menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.active-order-menu-item {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: #fff;
  color: var(--gray-900);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.active-order-menu-item.is-active {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue-dark);
}

.active-order-menu-empty {
  border: 1px dashed var(--gray-300);
  border-radius: 10px;
  color: var(--gray-500);
  font-size: 13px;
  padding: 10px 12px;
}

.active-order-menu-close {
  align-self: flex-end;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  background: #fff;
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}
.btn-icon {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}

/* Unsaved-state lamp */
.unsaved-lamp {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e; /* green = no unsaved work */
  flex-shrink: 0;
  transition: background 0.2s;
}
.unsaved-lamp.dirty {
  background: #ef4444; /* red = unsaved work in memory */
}

/* Upgrade banner */
.upgrade-banner {
  background: #1a56db;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Main */
main {
  padding: 16px;
  padding-bottom: 80px;
  max-width: 480px;
  margin: 0 auto;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: var(--nav-bar-height);
  background: #fff;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-around;
  padding: 3px 0;
  padding-bottom: max(3px, env(safe-area-inset-bottom));
  z-index: 90;
}
.bottom-nav button {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 14px;
  font-size: 10px;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: 8px;
}
.bottom-nav button.active {
  color: var(--blue);
  font-weight: 600;
}
.bottom-nav button[data-view="new-order"].active {
  color: var(--gray-500);
  font-weight: 400;
}
.nav-icon { font-size: 20px; }

/* Attention blink — used for support alerts */
@keyframes blink-attention {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}
.blink-attention {
  animation: blink-attention 1s ease-in-out infinite;
}
.btn-attention {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--warning-bg);
  animation: blink-attention 1s ease-in-out infinite;
}
.history-item.support-waiting {
  background: var(--warning-bg);
  border-left: 4px solid var(--orange);
  padding-left: 12px;
}

/* Cards */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gray-800);
}

.pricing-model-top-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  margin: 0 0 12px;
  padding: 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}

#offering-picker.pricing-model-top-tabs {
  margin: -16px -16px 12px;
  top: 46px;
  border-top: 0;
}

.pricing-model-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  min-height: var(--nav-bar-height);
}

.pricing-model-tabs .btn {
  border-radius: 0;
  border: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  min-height: var(--nav-bar-height);
  padding: 0 12px;
  width: auto;
}

#offering-picker .pricing-model-tabs .btn {
  flex: 1 1 0;
  margin: 0;
  border-right: 1px solid var(--gray-200);
}

#offering-picker .pricing-model-tabs .btn:last-child {
  border-right: 0;
}

.profile-tabs-bar {
  position: sticky;
  top: 46px;
  margin: -16px -16px 12px;
  border-top: 0;
}

.profile-tabs-bar .pricing-model-tabs .btn {
  flex: 1 1 0;
  margin: 0;
  border-right: 1px solid var(--gray-200);
}

.profile-tabs-bar .pricing-model-tabs .btn:last-child {
  border-right: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:active { background: var(--blue-dark); }
.btn-success {
  background: var(--green);
  color: #fff;
}
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-outline {
  background: #fff;
  color: var(--blue);
  border: 2px solid var(--blue);
}
.btn-sm {
  padding: 8px 14px;
  font-size: 14px;
}
.btn + .btn { margin-top: 8px; }

/* Forms */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 16px;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--blue);
}
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* Toggle */
.toggle-group {
  display: flex;
  gap: 8px;
}
.toggle-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  text-align: center;
}
.toggle-btn.active {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}

/* Slider */
.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.slider-container input[type="range"] {
  flex: 1;
  height: 8px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--gray-200);
  border-radius: 4px;
  outline: none;
}
.slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
}
.slider-value {
  font-size: 20px;
  font-weight: 700;
  min-width: 60px;
  text-align: center;
  color: var(--blue);
}

/* Price display */
.price-display {
  text-align: center;
  padding: 18px;
  background: linear-gradient(180deg, #f7faff 0%, #edf4ff 100%);
  border: 1px solid #d7e5ff;
  border-radius: calc(var(--radius) + 2px);
  margin: 12px 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}
.price-label {
  font-size: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.price-amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.03em;
}
.price-based {
  display: none;
}
.price-vat { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

.price-display.price-display--inline-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
}

.price-display.price-display--inline-compact .price-label {
  display: none;
}

.price-display.price-display--inline-compact .price-amount,
.price-display.price-display--inline-compact .price-vat,
.price-display.price-display--inline-compact .price-based {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--gray-600);
  margin: 0;
}

.price-display.price-display--inline-compact .price-based {
  display: block;
  flex: 1 1 auto;
  text-align: center;
}

.price-display.price-display--inline-compact .price-vat {
  text-align: right;
  margin-left: auto;
}

.damage-intro {
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbe7fb;
}

.damage-intro-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}

.damage-intro-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--gray-900);
}

.damage-intro-text {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-600);
}

.damage-form-card {
  border: 1px solid #e7eef8;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.damage-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 8px;
}

.damage-section-bar .section-heading {
  margin: 0;
}

.damage-section-count {
  min-width: 28px;
  height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.damage-dent-list {
  display: grid;
  gap: 10px;
}

/* Dent list */
.dent-item {
  display: flex;
  align-items: center;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border: 1px solid #e8edf5;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 0;
}
.dent-info { flex: 1; }
.dent-zone { font-weight: 700; font-size: 15px; color: var(--gray-900); }
.dent-details { font-size: 12px; color: var(--gray-500); margin-top: 3px; line-height: 1.45; }
.dent-price {
  font-weight: 800;
  color: var(--blue);
  font-size: 16px;
  padding-left: 10px;
  white-space: nowrap;
}
.dent-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 18px;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  margin-left: 10px;
}
.dent-remove:hover,
.dent-remove:focus-visible {
  background: #fef2f2;
  outline: none;
}

/* Car diagram */
#zone-selector {
  padding: 12px 12px 10px;
  border: 1px solid #e8edf5;
}

#zone-selector .card-title {
  margin-bottom: 6px;
}

.car-diagram {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 8px;
}
.car-diagram svg {
  width: 100%;
  height: auto;
}
.car-diagram .zone {
  fill: var(--gray-100);
  stroke: var(--gray-400);
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill 0.15s;
}
.car-diagram .zone:hover,
.car-diagram .zone.active {
  fill: var(--blue-light);
  stroke: var(--blue);
  stroke-width: 2;
}
.car-diagram .zone.selected {
  fill: var(--blue);
  stroke: var(--blue-dark);
}
.car-diagram .zone-label {
  font-size: 7px;
  fill: var(--gray-700);
  pointer-events: none;
  text-anchor: middle;
  font-weight: 600;
}

.car-diagram.lf-premium-diagram {
  max-width: 250px;
  margin-bottom: 10px;
}

.car-diagram.panel-exploded-diagram {
  max-width: 280px;
}

@media (max-width: 430px) {
  .car-diagram.panel-exploded-diagram {
    max-width: 240px;
  }
}

.car-diagram.lf-premium-diagram .zone {
  fill: #e2e8f0;
  stroke: #64748b;
  stroke-width: 1.4;
}

.car-diagram.lf-premium-diagram .zone:hover,
.car-diagram.lf-premium-diagram .zone.active {
  fill: #dbeafe;
  stroke: #1d4ed8;
}

.car-diagram.lf-premium-diagram .zone.selected {
  fill: #1d4ed8;
  stroke: #1e3a8a;
}

.car-diagram .t3-map-wrap {
  position: relative;
  width: 100%;
  max-width: 600px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.car-diagram .t3-map-image {
  display: block;
  width: 100%;
  height: auto;
}

.car-diagram .t3-map-hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.car-diagram .t3-map-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.car-diagram .t3-zone-label {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 5px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 0 0 3px #fff;
  color: #111827;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.car-diagram .t3-zone-label--side {
  min-width: 40px;
  min-height: 18px;
}

.car-diagram .t3-zone-label--rear {
  min-width: 56px;
  min-height: 20px;
}

.car-diagram .t3-map-click-surface {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  z-index: 3;
}

.car-diagram .t3-zone-hotspot {
  position: absolute;
  transform: none;
  border: 1px solid transparent;
  background: transparent;
  color: transparent;
  border-radius: 6px;
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.car-diagram .t3-zone-hotspot:hover,
.car-diagram .t3-zone-hotspot:focus-visible {
  border-color: rgba(29, 78, 216, 0.55);
  background: rgba(59, 130, 246, 0.12);
  outline: none;
}

.car-diagram .t3-zone-hotspot.selected {
  background: rgba(37, 99, 235, 0.24);
  border-color: #1d4ed8;
}

@media (max-width: 430px) {
  .car-diagram.lf-premium-diagram {
    max-width: 220px;
    margin-bottom: 8px;
  }
}

.app-build-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gray-500);
}

body.dev-mode .app-build-footer {
  color: var(--red);
}

.app-debug-footer {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  margin-bottom: 8px;
  padding: 6px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.3;
  background: #111827;
  color: #f9fafb;
  border: 1px solid #374151;
  border-radius: 8px;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

/* Quote */
.quote-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quote-header {
  text-align: center;
  margin-bottom: 2px;
  padding-bottom: 2px;
}
.quote-header h2 { font-size: 18px; margin-bottom: 2px; }
.quote-customer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 16px;
  margin-bottom: 2px;
  font-size: 13px;
  color: var(--gray-600);
}
.quote-customer-column {
  min-width: 0;
}
.quote-customer-column-right {
  text-align: left;
}
.quote-customer-row {
  margin-bottom: 2px;
}
.quote-customer-missing {
  color: var(--gray-500);
}
.quote-customer-missing-link {
  background: none;
  border: 0;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font: inherit;
}
@media (max-width: 390px) {
  .quote-customer {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
.quote-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 4px;
  font-size: 13px;
}
.quote-table th {
  text-align: left;
  padding: 6px 4px;
  border-bottom: 2px solid var(--gray-200);
  font-size: 11px;
  color: var(--gray-500);
  text-transform: uppercase;
}
.quote-table td {
  padding: 4px 4px 2px;
}
.quote-table .text-right { text-align: right; }
.quote-totals {
  margin-top: 2px;
  padding-top: 4px;
  border-top: 2px solid var(--gray-200);
}
.quote-total-line {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 13px;
  color: var(--gray-600);
}
.quote-total-line.total {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
  padding-top: 4px;
}

/* History list */
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  cursor: pointer;
}
.history-info { flex: 1; }
.history-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 4px;
  min-width: max-content;
}
.history-side .badge {
  display: block;
  text-align: right;
  padding-left: 0;
  padding-right: 0;
}
.history-name { font-weight: 600; font-size: 15px; }
.history-meta { font-size: 12px; color: var(--gray-500); }
.history-amount { font-weight: 700; color: var(--blue); font-size: 16px; }

/* Login page */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80dvh;
  text-align: center;
  padding: 32px 16px;
}
.login-logo {
  font-size: 48px;
  margin-bottom: 8px;
}
.login-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 4px;
}
.login-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 32px;
}
.login-form {
  width: 100%;
  max-width: 320px;
}
.install-instructions {
  margin-top: 24px;
  padding: 16px;
  background: var(--blue-light);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--gray-700);
  text-align: left;
  max-width: 320px;
}
.install-instructions h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--blue);
}
.install-instructions ol {
  margin-left: 20px;
}
.install-instructions li {
  margin-bottom: 4px;
}

.ios-share-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

/* Section heading */
.section-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 20px 0 8px;
}

/* Status badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.badge-demo { background: #fef3c7; color: #92400e; }
.badge-draft { background: var(--gray-100); color: var(--gray-600); }
.badge-quoted { background: var(--blue-light); color: var(--blue); }
.badge-completed { background: #dcfce7; color: #166534; }

/* Checkbox toggle */
.checkbox-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
}
.checkbox-toggle input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--blue);
}
.checkbox-toggle.compact {
  padding: 8px 0;
}
.checkbox-toggle.compact span {
  font-size: 14px;
}

.multi-select {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
}
.multi-select > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
}
.multi-select > summary::-webkit-details-marker {
  display: none;
}
.multi-select > summary::after {
  content: '▾';
  float: right;
  color: var(--gray-500);
}
.multi-select[open] > summary::after {
  content: '▴';
}
.multi-select-options {
  border-top: 1px solid var(--gray-200);
  padding: 0 12px 8px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 34px 18px;
  color: var(--gray-500);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
  border: 1px dashed #d9e3f2;
  border-radius: var(--radius);
}
.empty-state .icon { font-size: 48px; margin-bottom: 8px; }
.empty-state p { font-size: 14px; line-height: 1.5; }

.damage-total-card {
  margin-top: 14px;
  box-shadow: 0 12px 28px rgba(26, 86, 219, 0.12);
}

.damage-total-card--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 16px 12px;
  background: linear-gradient(180deg, #f7faff 0%, #edf4ff 100%);
  border: 1px solid #d7e5ff;
  border-radius: calc(var(--radius) + 2px);
  text-align: center;
}
.damage-total-col {
  min-width: 0;
}
.damage-total-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.02em;
  line-height: 1.1;
  word-break: break-word;
}
.damage-total-caption {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* Order page action stack (Phase 3) */
.order-actions-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.order-actions-stack > button {
  width: 100%;
}

/* Customer link row inside the Order summary card */
.quote-customer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 0 0;
  padding-top: 6px;
  border-top: 1px dashed var(--gray-200);
  font-size: 13px;
}
.quote-customer-link-label {
  font-weight: 600;
  color: var(--gray-700);
  flex-shrink: 0;
}
.quote-customer-link-url {
  flex: 0 0 auto;
  min-width: auto;
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
}
.quote-customer-link-copy {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  padding: 4px 10px;
  min-height: 28px;
}

/* F1 VAT toggle link */
.f1-vat-toggle {
  display: inline-block;
  margin-left: 6px;
  font-size: 13px;
  color: var(--blue);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
}
.f1-vat-toggle:hover,
.f1-vat-toggle:focus {
  color: var(--blue-dark);
}

/* iPhone / narrow viewport adjustments */
@media (max-width: 420px) {
  .damage-total-value {
    font-size: 20px;
  }
  .header h1 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
}

.hagel-form {
  display: grid;
  gap: 10px;
}

.hagel-form .form-group {
  margin-bottom: 0;
}

.hagel-form .form-label {
  margin-bottom: 4px;
  font-size: 13px;
}

.hagel-form .form-input {
  padding: 10px 12px;
  font-size: 15px;
}

.hagel-form .checkbox-toggle {
  padding: 6px 0;
}

.hagel-form .checkbox-toggle span {
  font-size: 14px;
}

.hagel-form .checkbox-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

.hagel-orientation-toggle .toggle-btn {
  padding: 9px 10px;
  font-size: 14px;
}

@media (max-width: 390px) {
  .damage-form-card {
    padding: 14px;
  }

  .hagel-form {
    gap: 8px;
  }

  .hagel-form .form-input {
    padding: 9px 11px;
    font-size: 14px;
  }

  .hagel-orientation-toggle .toggle-btn {
    padding: 8px;
    font-size: 13px;
  }
}

/* Hard update modal */
.update-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}
.update-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 20px;
}
.update-card h2 {
  font-size: 20px;
  margin-bottom: 8px;
}
.update-card p {
  color: var(--gray-600);
  margin-bottom: 16px;
  line-height: 1.4;
}
