/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #1D4ED8;
  --blue-light: #EFF6FF;
  --blue-mid: #3B82F6;
  --green: #16A34A;
  --yellow: #D97706;
  --red: #DC2626;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-400: #94A3B8;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-900: #0F172A;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  color: var(--gray-900);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Screen layout ────────────────────────────────────────────── */
.screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: white;
  position: relative;
}

.screen--plate {
  background: var(--gray-50);
}

.screen--center {
  justify-content: center;
  align-items: center;
  padding: 24px 20px;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 120px;
}

.content--capture {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 100px;
}

.content--plate {
  padding: 8px 14px 104px;
  gap: 8px;
}

/* ── Progress bar ─────────────────────────────────────────────── */
.progress-bar {
  height: 3px;
  background: var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 10;
}

.progress-fill {
  height: 100%;
  background: var(--blue);
  transition: width .4s ease;
}

/* ── Topbar ───────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  background: white;
  position: sticky;
  top: 3px;
  z-index: 9;
}

.topbar--report { top: 0; }

.topbar--compact {
  padding: 8px 12px;
  min-height: 48px;
  border-bottom-color: var(--gray-100);
}

.topbar--compact .back-btn {
  width: 34px;
  height: 34px;
}

.topbar--compact .topbar-section {
  font-size: 11px;
}

.topbar--compact .topbar-step {
  font-size: 12px;
}

.topbar--compact .step-dots {
  max-width: 68px;
  gap: 2px;
}

.topbar--compact .step-dot {
  width: 5px;
  height: 5px;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--gray-600);
  transition: background .15s;
}
.back-btn:active { background: var(--gray-100); }

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

.topbar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.topbar-section { font-size: 12px; color: var(--gray-600); }
.topbar-step { font-size: 13px; font-weight: 600; color: var(--blue); }

.step-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  max-width: 80px;
  justify-content: flex-end;
}
.step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-200);
  transition: background .2s;
}
.step-dot.active { background: var(--blue); }
.step-dot.done { background: var(--green); }

.pdf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--blue);
}

/* ── Brand ───────────────────────────────────────────────────── */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-symbol {
  display: block;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 18px rgba(15,23,42,.14));
}

.brand-wordmark {
  color: var(--gray-900);
  font-size: 23px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
}

.brand-mark--dashboard .brand-wordmark {
  font-size: 22px;
}

.brand-mark--finished,
.brand-mark--report {
  justify-content: center;
}

.brand-mark--hero {
  flex-direction: column;
  gap: 10px;
}

.brand-mark--hero .brand-wordmark {
  font-size: 30px;
}

.brand-mark--start {
  justify-content: center;
}

.brand-mark--start .brand-wordmark {
  font-size: 26px;
}

/* ── Inspection Start ─────────────────────────────────────────── */
.screen--start {
  background:
    linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 54%, #EEFDF3 100%);
}

.screen--start-prep {
  background:
    linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 34%, #F0FDF4 100%);
}

.start-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 18px calc(22px + var(--safe-bottom));
}

.start-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.start-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.start-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22,163,74,.10);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.start-copy h1 {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 850;
  color: var(--gray-900);
}

.start-copy p {
  max-width: 250px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--gray-600);
}

.start-client-prompt {
  position: relative;
  width: min(320px, 86%);
  min-height: 106px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 9px;
  padding: 16px 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 84% 16%, rgba(34,197,94,.18), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,250,252,.90)),
    rgba(255,255,255,.90);
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: 0 16px 34px rgba(15,23,42,.08);
  text-align: left;
  overflow: hidden;
  animation: prompt-in .52s cubic-bezier(.22,.68,0,1.2) both;
}

.start-client-prompt::before {
  content: '';
  position: absolute;
  right: -24px;
  bottom: -28px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(22,163,74,.08);
}

.start-prompt-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22,163,74,.10);
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
}

.start-prompt-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: dot-pulse 2.2s ease infinite;
}

.start-client-prompt strong {
  max-width: 100%;
  color: var(--gray-900);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.02;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.start-prompt-rotator {
  min-height: 22px;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  transition: opacity .18s ease, transform .18s ease;
}

.start-prompt-rotator.is-changing {
  opacity: 0;
  transform: translateY(4px);
}

.start-client-vehicle {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.06);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .2px;
}

.start-first-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(280px, 84%);
  padding: 12px 14px 12px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: 0 6px 20px rgba(15,23,42,.07);
  animation: step-in .56s cubic-bezier(.22,.68,0,1.2) .18s both;
}

.start-step-badge {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: badge-pulse 2.4s ease .9s infinite;
}

.start-step-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.start-step-copy span {
  font-size: 10px;
  font-weight: 800;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.start-step-copy strong {
  font-size: 14px;
  font-weight: 900;
  color: var(--gray-900);
}

.start-step-cam {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(22,163,74,.12);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.start-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 66dvh;
  position: relative;
}

.start-stage[hidden] {
  display: none;
}

.start-stage--intro {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
  padding: 4px 0 8px;
  justify-items: center;
  align-items: center;
  min-height: 0;
}

.start-stage--intro .start-circle {
  margin: auto 0;
}

.start-stage--prep {
  gap: 14px;
  justify-content: center;
  animation: start-panel-in .28s ease both;
}

.start-viewfinder {
  position: relative;
  width: min(100%, 370px);
  height: clamp(230px, 38dvh, 330px);
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 72% 46% at 50% 53%, rgba(34,197,94,.18), transparent 64%),
    linear-gradient(180deg, rgba(15,23,42,.92), rgba(30,41,59,.96));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 14px 30px rgba(15,23,42,.10);
}

.screen--start-prep .start-shell {
  gap: 8px;
  padding: 14px 14px calc(14px + var(--safe-bottom));
}

.screen--start-prep .start-hero {
  gap: 5px;
}

.screen--start-prep .brand-symbol {
  width: 36px;
  height: 36px;
}

.screen--start-prep .brand-wordmark {
  font-size: 21px;
}

.screen--start-prep .start-kicker,
.screen--start-prep .start-checkpoint,
.screen--start-prep .start-progress {
  display: none;
}

.screen--start-prep .start-stage {
  min-height: calc(100dvh - 76px - var(--safe-bottom));
  gap: 0;
}

.screen--start-prep .start-viewfinder {
  width: min(100%, 430px);
  height: clamp(500px, calc(100dvh - 104px - var(--safe-bottom)), 720px);
}

.screen--start-prep .start-car-frame {
  width: min(90%, 390px);
}

.screen--start-prep .start-camera-label {
  bottom: 18px;
}

.start-viewfinder > video,
.start-viewfinder > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .2s ease;
}

.start-viewfinder img[hidden] {
  display: none;
}

.start-viewfinder video {
  opacity: .95;
}

.start-viewfinder video[srcObject] {
  background: #000;
}

.start-viewfinder::before,
.start-viewfinder::after,
.start-car-frame,
.start-corner,
.start-camera-label,
.start-countdown-card {
  z-index: 2;
}

.start-viewfinder::before,
.start-viewfinder::after {
  display: none;
}

.start-camera-label {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  min-width: 158px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(22,163,74,.90);
  color: white;
  font-size: 12px;
  font-weight: 850;
  backdrop-filter: blur(10px);
  z-index: 3;
  box-shadow: 0 8px 20px rgba(22,163,74,.22);
  transition: opacity .18s ease, transform .18s ease;
}

.start-camera-label[hidden] {
  display: none;
}

.start-camera-label[data-mode="warn"] {
  background: rgba(217,119,6,.92);
}

.start-camera-label[data-mode="error"] {
  background: rgba(220,38,38,.92);
}

.start-camera-label[data-mode="ok"] {
  background: rgba(22,163,74,.92);
}

.start-prep-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.start-prep-copy span {
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
}

.start-prep-copy strong {
  color: var(--gray-900);
  font-size: 24px;
  font-weight: 850;
  line-height: 1.12;
}

.start-car-frame {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(90%, 390px);
  aspect-ratio: 1.18;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(34,197,94,.22));
  transition: opacity .2s ease, transform .2s ease;
}

.start-car-frame-box {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 30px;
  background: transparent;
  box-shadow:
    0 0 0 999px rgba(15,23,42,.14),
    inset 0 0 0 1px rgba(34,197,94,.12);
}

.frame-mark {
  position: absolute;
  width: 52px;
  height: 52px;
  border-color: rgba(34,197,94,.98);
  border-style: solid;
  filter: drop-shadow(0 0 8px rgba(34,197,94,.32));
}

.frame-mark--tl {
  left: -2px;
  top: -2px;
  border-width: 4px 0 0 4px;
  border-radius: 20px 0 0 0;
}

.frame-mark--tr {
  right: -2px;
  top: -2px;
  border-width: 4px 4px 0 0;
  border-radius: 0 20px 0 0;
}

.frame-mark--bl {
  left: -2px;
  bottom: -2px;
  border-width: 0 0 4px 4px;
  border-radius: 0 0 0 20px;
}

.frame-mark--br {
  right: -2px;
  bottom: -2px;
  border-width: 0 4px 4px 0;
  border-radius: 0 0 20px 0;
}

.frame-car-icon {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 94%;
  height: 88%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  opacity: .96;
  filter: drop-shadow(0 0 10px rgba(34,197,94,.30));
}

.start-frame-count {
  position: absolute;
  left: 50%;
  top: 22px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--green);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 14px 30px rgba(15,23,42,.18), inset 0 0 0 1px rgba(34,197,94,.18);
  z-index: 4;
  font-variant-numeric: tabular-nums;
}

.start-frame-count[hidden] {
  display: none;
}

.start-circle {
  width: clamp(190px, 54vw, 236px);
  height: clamp(190px, 54vw, 236px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,.34), transparent 28%),
    #16A34A;
  color: white;
  box-shadow:
    0 22px 44px rgba(22,163,74,.28),
    0 0 0 12px rgba(22,163,74,.09),
    inset 0 -10px 22px rgba(15,118,52,.22);
  font-size: 25px;
  font-weight: 850;
  line-height: 1.08;
  text-align: center;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
  -webkit-tap-highlight-color: transparent;
}

.start-circle:active {
  transform: scale(.97);
}

.start-circle:disabled {
  cursor: default;
}

.start-circle--loading {
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,.22), transparent 28%),
    var(--gray-900);
  box-shadow:
    0 22px 44px rgba(15,23,42,.20),
    0 0 0 12px rgba(15,23,42,.08),
    inset 0 -10px 22px rgba(0,0,0,.18);
  font-size: 23px;
}

.start-circle-text {
  display: block;
  max-width: 138px;
}

.start-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: rgba(34,197,94,.96);
  border-style: solid;
  filter: drop-shadow(0 0 9px rgba(34,197,94,.30));
}

.start-corner--tl {
  left: 18px;
  top: 18px;
  border-width: 3px 0 0 3px;
  border-radius: 8px 0 0 0;
}

.start-corner--tr {
  right: 18px;
  top: 18px;
  border-width: 3px 3px 0 0;
  border-radius: 0 8px 0 0;
}

.start-corner--bl {
  left: 18px;
  bottom: 18px;
  border-width: 0 0 3px 3px;
  border-radius: 0 0 0 8px;
}

.start-corner--br {
  right: 18px;
  bottom: 18px;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 8px 0;
}

.start-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(250px, 76%);
  font-size: 12px;
  font-weight: 800;
  color: var(--gray-600);
}

.start-progress--intro {
  width: min(320px, 88%);
  align-self: end;
  margin-top: -4px;
}

.start-progress div {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--gray-200);
}

.start-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.start-photo-actions {
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
  position: relative;
  z-index: 5;
}

.start-photo-actions[hidden] {
  display: none;
}

.screen--start-prep .start-photo-actions {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(14px + var(--safe-bottom));
  width: auto;
}

.start-secondary-btn,
.start-next-btn {
  min-height: 52px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 12px 24px rgba(15,23,42,.12);
}

.start-secondary-btn {
  background: rgba(255,255,255,.92);
  color: var(--gray-700);
  border: 1px solid rgba(226,232,240,.95);
  backdrop-filter: blur(12px);
}

.start-next-btn {
  background: var(--green);
  color: white;
}

.start-secondary-btn:active,
.start-next-btn:active {
  transform: scale(.98);
}

.start-secondary-btn:disabled,
.start-next-btn:disabled {
  opacity: .62;
  cursor: default;
  transform: none;
}

.start-checkpoint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: var(--gray-600);
  font-size: 12px;
  box-shadow: 0 8px 20px rgba(15,23,42,.05);
}

.start-checkpoint strong {
  min-width: 0;
  color: var(--gray-900);
  font-size: 13px;
  text-align: right;
}

.start-countdown-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(374px, 94%);
  min-height: 390px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 24px 18px 22px;
  border-radius: 28px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: 0 18px 42px rgba(15,23,42,.14);
  backdrop-filter: blur(14px);
  z-index: 4;
}

.start-countdown-card[hidden] {
  display: none;
}

.front-guide-step,
.countdown-step {
  width: 100%;
  min-height: 344px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.front-guide-step[hidden],
.countdown-step[hidden] {
  display: none;
}

.start-countdown-card span {
  color: var(--gray-500, #64748B);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  max-width: 260px;
  line-height: 1.35;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15,23,42,.05);
}

.start-countdown-card .count-title {
  color: var(--gray-900);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.count-guide-image {
  width: min(270px, 90%);
  height: 150px;
  object-fit: contain;
  display: block;
  margin: 4px auto 0;
  filter: drop-shadow(0 10px 14px rgba(15,23,42,.12));
}

.front-guide-step .count-guide-image {
  width: min(250px, 86%);
  height: 190px;
  margin-top: 10px;
}

.countdown-step .count-guide-image {
  width: min(230px, 82%);
  height: 176px;
}

.front-guide-next {
  width: min(240px, 100%);
  min-height: 52px;
  margin-top: auto;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(22,163,74,.24);
}

.front-guide-next:active {
  transform: scale(.98);
}

.start-countdown-card #start-count {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(22,163,74,.10);
  color: var(--green);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  margin-top: auto;
  box-shadow: inset 0 0 0 1px rgba(22,163,74,.18);
}

.start-viewfinder--modal-counting .start-car-frame {
  opacity: 0;
}

.start-viewfinder--guide-open .start-camera-label,
.start-viewfinder--counting .start-camera-label {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

.start-viewfinder--framing-count .start-car-frame {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.01);
}

.screen--start-captured .start-camera-label {
  display: none;
}

.screen--finished {
  background:
    radial-gradient(circle at 50% 20%, rgba(34,197,94,.10), transparent 34%),
    #fff;
}

.finished-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 20px calc(28px + var(--safe-bottom));
}

.finished-card {
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 20px;
  border: 1px solid rgba(226,232,240,.95);
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 18px 44px rgba(15,23,42,.08);
  text-align: center;
}

.finished-check {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  box-shadow: 0 16px 30px rgba(22,163,74,.24);
}

.finished-check--muted {
  background: var(--gray-700);
  box-shadow: 0 16px 30px rgba(15,23,42,.18);
}

.finished-kicker {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.finished-card h1 {
  color: var(--gray-900);
  font-size: 28px;
  line-height: 1.05;
}

.finished-card p,
.finished-note {
  color: var(--gray-600);
  font-size: 14px;
  line-height: 1.45;
}

.finished-summary,
.simple-report-grid {
  width: min(100%, 360px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.finished-summary div,
.simple-report-grid div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 14px;
  background: rgba(248,250,252,.88);
}

.finished-summary span,
.simple-report-grid span {
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 750;
}

.finished-summary strong,
.simple-report-grid strong {
  min-width: 0;
  color: var(--gray-900);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.finished-note {
  width: min(100%, 320px);
  font-size: 12px;
  text-align: center;
}

.screen--report-simple {
  background: #fff;
}

.simple-report-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 18px calc(28px + var(--safe-bottom));
}

.simple-report-hero {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(22,163,74,.10), rgba(248,250,252,.96));
  border: 1px solid rgba(226,232,240,.95);
}

.simple-report-hero span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.simple-report-hero h1 {
  margin-top: 6px;
  color: var(--gray-900);
  font-size: 32px;
  line-height: 1;
}

.simple-report-hero p {
  margin-top: 6px;
  color: var(--gray-600);
  font-size: 14px;
}

.simple-report-grid {
  width: 100%;
}

.simple-photo-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.simple-photo-section h2 {
  color: var(--gray-900);
  font-size: 16px;
}

.simple-photo-section img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(226,232,240,.95);
  box-shadow: 0 12px 28px rgba(15,23,42,.08);
}

.simple-photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.simple-photo-grid figure {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.simple-photo-grid figcaption {
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 800;
}

.screen--scan-flow {
  background: #fff;
  overflow: hidden;
}

.scan-flow-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px calc(14px + var(--safe-bottom));
}

.scan-flow-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark--scan .brand-symbol {
  width: 34px;
  height: 34px;
}

.brand-mark--scan .brand-wordmark {
  font-size: 20px;
}

.scan-viewfinder {
  position: relative;
  flex: 1;
  min-height: 500px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(15,23,42,.92), rgba(30,41,59,.96));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 14px 30px rgba(15,23,42,.10);
}

.scan-viewfinder > video,
.scan-viewfinder > #scan-snap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .2s ease;
}

.scan-viewfinder > #scan-snap[hidden] {
  display: none;
}

.scan-car-frame,
.scan-status,
.scan-count-card,
.scan-frame-count,
.scan-orbit-hud {
  z-index: 2;
}

.scan-car-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(97%, 470px);
  height: min(64%, 520px);
  min-height: 350px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(34,197,94,.22));
  transition: opacity .2s ease, transform .2s ease;
}

.scan-car-frame-box {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 30px;
  background: transparent;
  box-shadow:
    0 0 0 999px rgba(15,23,42,.14),
    inset 0 0 0 1px rgba(34,197,94,.12);
}

.scan-car-frame-box::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 36px;
  border: 1px solid rgba(34,197,94,.28);
  background:
    linear-gradient(90deg, transparent, rgba(34,197,94,.34), transparent) 0 18% / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(34,197,94,.22), transparent) 0 82% / 100% 1px no-repeat;
  opacity: .85;
}

.scan-car-outline {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 96%;
  height: 96%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  opacity: .96;
  filter: drop-shadow(0 0 10px rgba(34,197,94,.30));
}

.scan-car-outline[data-frame="front"] {
  width: 88%;
  height: 98%;
  opacity: .96;
}

.scan-car-outline[data-frame*="diagonal"] {
  width: 102%;
  height: 98%;
  opacity: .94;
}

.scan-car-outline[data-frame*="side"] {
  width: 108%;
  height: 92%;
  opacity: .94;
}

.scan-car-outline[data-frame="rear"] {
  width: 90%;
  height: 98%;
  opacity: .94;
}

.scan-frame-count {
  position: absolute;
  left: 50%;
  top: 22px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--green);
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(15,23,42,.18), inset 0 0 0 1px rgba(34,197,94,.18);
  z-index: 5;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.scan-frame-count[hidden] {
  display: none;
}

.scan-status {
  position: absolute;
  left: 50%;
  bottom: 18px;
  min-width: 154px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(22,163,74,.92);
  color: white;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(22,163,74,.22);
}

.scan-status[hidden] {
  display: none;
}

.scan-status[data-mode="warn"] { background: rgba(217,119,6,.92); }
.scan-status[data-mode="error"] { background: rgba(220,38,38,.92); }
.scan-status[data-mode="ok"] { background: rgba(22,163,74,.92); }

.scan-photo-actions {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(14px + var(--safe-bottom));
  width: auto;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
  z-index: 3;
}

.scan-photo-actions[hidden] {
  display: none;
}

.scan-viewfinder--captured .scan-status {
  bottom: calc(78px + var(--safe-bottom));
}

.scan-orbit-hud {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.90);
  color: var(--gray-900);
  box-shadow: 0 14px 30px rgba(15,23,42,.16);
  backdrop-filter: blur(16px);
}

.scan-orbit-hud[hidden] {
  display: none;
}

.scan-orbit-hud > div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scan-orbit-hud strong {
  font-size: 13px;
  font-weight: 900;
}

.scan-orbit-hud small {
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

.scan-orbit-mini {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: radial-gradient(circle, rgba(34,197,94,.10), rgba(248,250,252,.92));
}

.scan-orbit-mini b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 9px 9px 6px 6px;
  background: var(--gray-900);
}

.scan-orbit-mini i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 26px;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%);
  background: linear-gradient(180deg, rgba(34,197,94,.95), rgba(34,197,94,0));
  transition: transform .28s ease;
}

.scan-orbit-mini span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(148,163,184,.68);
}

.scan-orbit-mini span.is-active,
.scan-orbit-mini span.is-done {
  background: var(--green);
}

.scan-orbit-mini span.is-active {
  box-shadow: 0 0 0 5px rgba(34,197,94,.14);
}

.scan-orbit-mini span:nth-of-type(1) { left: 50%; top: 4px; transform: translateX(-50%); }
.scan-orbit-mini span:nth-of-type(2) { right: 10px; top: 10px; }
.scan-orbit-mini span:nth-of-type(3) { right: 4px; top: 50%; transform: translateY(-50%); }
.scan-orbit-mini span:nth-of-type(4) { right: 10px; bottom: 10px; }
.scan-orbit-mini span:nth-of-type(5) { left: 50%; bottom: 4px; transform: translateX(-50%); }
.scan-orbit-mini span:nth-of-type(6) { left: 10px; bottom: 10px; }
.scan-orbit-mini span:nth-of-type(7) { left: 4px; top: 50%; transform: translateY(-50%); }
.scan-orbit-mini span:nth-of-type(8) { left: 10px; top: 10px; }

.scan-count-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(374px, 94%);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 24px 18px 22px;
  border-radius: 28px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: 0 18px 42px rgba(15,23,42,.14);
  backdrop-filter: blur(14px);
}

.scan-count-card[hidden] {
  display: none;
}

.scan-card-step,
.scan-card-count {
  width: 100%;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.scan-card-step[hidden],
.scan-card-count[hidden] {
  display: none;
}

.scan-card-step strong,
.scan-card-count > strong:first-child {
  color: var(--gray-900);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.scan-card-step > span,
.scan-card-count span {
  color: var(--gray-500, #64748B);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  max-width: 270px;
  line-height: 1.35;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15,23,42,.05);
}

.scan-orbit {
  position: relative;
  width: min(342px, 98%);
  height: 246px;
  display: grid;
  place-items: center;
  margin-top: 4px;
}

.scan-orbit img {
  width: 236px;
  height: 182px;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(34,197,94,.10));
  transition: opacity .18s ease, transform .18s ease;
}

.scan-orbit img[data-frame="front"],
.scan-orbit img[data-frame="rear"] {
  width: 188px;
  height: 188px;
}

.scan-orbit img[data-frame*="diagonal"] {
  width: 232px;
  height: 180px;
}

.scan-orbit img[data-frame*="side"] {
  width: 244px;
  height: 170px;
}

.scan-orbit-dot {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gray-200);
  box-shadow: inset 0 0 0 2px white;
}

.scan-orbit-dot.is-active,
.scan-orbit-dot.is-demo-active {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(34,197,94,.12);
}

.scan-orbit-dot.is-done,
.scan-orbit-dot.is-demo-done {
  background: var(--green);
}

.scan-orbit-dot:nth-of-type(1) { left: 50%; bottom: 18px; transform: translateX(-50%); }
.scan-orbit-dot:nth-of-type(2) { right: 36px; bottom: 38px; }
.scan-orbit-dot:nth-of-type(3) { right: 16px; top: 50%; transform: translateY(-50%); }
.scan-orbit-dot:nth-of-type(4) { right: 36px; top: 26px; }
.scan-orbit-dot:nth-of-type(5) { left: 50%; top: 4px; transform: translateX(-50%); }
.scan-orbit-dot:nth-of-type(6) { left: 36px; top: 26px; }
.scan-orbit-dot:nth-of-type(7) { left: 16px; top: 50%; transform: translateY(-50%); }
.scan-orbit-dot:nth-of-type(8) { left: 36px; bottom: 38px; }

.scan-walk-guide {
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: min(222px, 80%);
  height: 52px;
  --walk-step: 0;
  --turn-dash: 14;
  --turn-head-x: 30px;
  --turn-head-y: 18px;
  --turn-head-rotate: 22deg;
  transform: translateX(-50%);
}

.scan-walk-guide svg {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.scan-walk-guide path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scan-walk-guide .turn-rail {
  stroke: rgba(15,23,42,.10);
  stroke-width: 9;
}

.scan-walk-guide .turn-progress {
  stroke: var(--green);
  stroke-width: 8;
  stroke-dasharray: var(--turn-dash) 100;
  filter: drop-shadow(0 8px 10px rgba(34,197,94,.20));
  opacity: .96;
  transition: stroke-dasharray .42s ease;
}

.scan-walk-guide .turn-head {
  fill: var(--green);
  stroke: rgba(255,255,255,.78);
  stroke-width: 1.25;
  transform-box: fill-box;
  transform-origin: center;
  transform:
    translate(var(--turn-head-x), var(--turn-head-y))
    rotate(var(--turn-head-rotate))
    scale(1.06);
  filter: drop-shadow(0 8px 10px rgba(34,197,94,.24));
  transition: transform .42s ease;
}

.scan-walk-guide.is-stepping .turn-head {
  animation: scan-turn-head .52s ease;
}

.scan-walk-guide.is-stepping .turn-progress {
  animation: scan-turn-glow .52s ease;
}

.scan-count-motion {
  position: relative;
  width: min(348px, 98%);
  height: 230px;
  display: grid;
  place-items: center;
  margin-top: 4px;
}

.scan-count-motion .count-guide-image {
  width: min(250px, 82%);
  height: 182px;
  margin: 0;
  object-fit: contain;
  transition: opacity .18s ease, transform .18s ease;
}

.scan-count-motion .count-guide-image[data-frame="front"],
.scan-count-motion .count-guide-image[data-frame="rear"] {
  width: min(188px, 68%);
  height: 190px;
}

.scan-count-motion .count-guide-image[data-frame*="diagonal"] {
  width: min(238px, 80%);
  height: 184px;
}

.scan-count-motion .count-guide-image[data-frame*="side"] {
  width: min(252px, 84%);
  height: 168px;
}

.scan-card-count #scan-count {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(22,163,74,.10);
  color: var(--green);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  margin-top: auto;
  box-shadow: inset 0 0 0 1px rgba(22,163,74,.18);
}

.scan-viewfinder--counting .scan-car-frame {
  opacity: 0;
}

.scan-viewfinder--framing .scan-car-frame {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.01);
}

.scan-progress-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.scan-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--gray-200);
}

.scan-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width .2s ease;
}

.scan-progress-dots {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}

.scan-progress-dots span {
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 900;
}

.scan-progress-dots span.is-active {
  background: rgba(34,197,94,.12);
  color: var(--green);
}

.scan-progress-dots span.is-done {
  background: var(--green);
  color: white;
}

@keyframes prompt-in {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

@keyframes step-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(22,163,74,.15); }
  50%       { box-shadow: 0 0 0 9px rgba(22,163,74,.06); }
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); }
  60%       { box-shadow: 0 0 0 7px rgba(22,163,74,.0); }
}

@keyframes scan-car-float {
  0%, 100% { transform: translateX(-4px) scale(.99); }
  50% { transform: translateX(4px) scale(1.02); }
}

@keyframes scan-turn-head {
  0% { opacity: .45; }
  45% { opacity: 1; filter: drop-shadow(0 10px 14px rgba(34,197,94,.34)); }
  100% { opacity: 1; }
}

@keyframes scan-turn-glow {
  0% { opacity: .58; }
  50% { opacity: 1; }
  100% { opacity: .96; }
}

@keyframes start-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  transition: all .15s;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary {
  background: var(--blue);
  color: white;
}
.btn--primary:active { background: #1E40AF; transform: scale(.98); }
.btn--primary:disabled { background: var(--gray-200); color: var(--gray-400); }
.btn--primary.btn--ready { background: var(--green); }

.btn--outline {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
}
.btn--outline:active { background: var(--blue-light); }

.btn--camera {
  background: var(--gray-100);
  color: var(--gray-700);
  flex: 1;
}
.btn--camera:active { background: var(--gray-200); }

.btn--full { width: 100%; }

/* ── Home ─────────────────────────────────────────────────────── */
.screen--dashboard {
  background: var(--gray-50);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
  background: white;
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 12;
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.dashboard-brand-copy {
  min-width: 0;
}

.dashboard-sub {
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 600;
}

.dashboard-eyebrow {
  color: var(--gray-900);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  margin-left: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.dashboard-logout {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  padding: 8px 10px;
}

.dashboard-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 420px);
  background: #0C4A6E;
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(12,74,110,.28);
  z-index: 50;
}

.dashboard-header h1 {
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.dashboard-new-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--blue);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(29,78,216,.22);
  flex: 0 0 auto;
}

.dashboard-content {
  padding: 14px 14px 110px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat-pill {
  min-width: 0;
  border: 1px solid var(--gray-200);
  background: white;
  border-radius: 10px;
  padding: 9px 7px;
}

.stat-pill span {
  display: block;
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-pill strong {
  display: block;
  margin-top: 4px;
  color: var(--gray-900);
  font-size: 18px;
  line-height: 1;
}

.dashboard-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: white;
  color: var(--gray-400);
}

.dashboard-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--gray-900);
  font-size: 14px;
  background: transparent;
}

.dashboard-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 1px;
}

.filter-chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.filter-chip.active {
  color: var(--blue);
  background: var(--blue-light);
  border-color: #BFDBFE;
}

.inspection-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inspection-table-head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) .72fr auto;
  gap: 8px;
  padding: 0 10px;
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.inspection-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.inspection-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) .72fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: white;
}

.inspection-main {
  min-width: 0;
}

.inspection-plate {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--gray-900);
  color: white;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  max-width: 100%;
}

.inspection-meta {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  color: var(--gray-400);
  font-size: 11px;
  line-height: 1.2;
}

.inspection-state {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge--completed {
  color: #15803D;
  background: #DCFCE7;
}

.status-badge--requested {
  color: var(--gray-700);
  background: var(--gray-100);
}

.status-badge--active {
  color: var(--blue);
  background: var(--blue-light);
}

.status-badge--analyzing {
  color: #A16207;
  background: #FEF3C7;
}

.status-badge--expired {
  color: #991B1B;
  background: #FEE2E2;
}

.status-badge--incomplete {
  color: #9A3412;
  background: #FFEDD5;
}

.mini-progress {
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--gray-100);
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.inspection-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.row-action {
  min-height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  background: white;
  font-size: 12px;
  font-weight: 800;
}

.row-action--primary {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
}

@media (min-width: 860px) {
  .screen--dashboard {
    max-width: none;
    width: 100%;
    min-height: 100dvh;
    background: var(--gray-50);
  }

  .screen--dashboard .dashboard-header {
    padding: 20px 32px;
  }

  .screen--dashboard .dashboard-header,
  .screen--dashboard .dashboard-content {
    width: 100%;
  }

  .screen--dashboard .dashboard-header > *,
  .screen--dashboard .dashboard-content {
    max-width: 1180px;
  }

  .screen--dashboard .dashboard-header {
    justify-content: center;
  }

  .screen--dashboard .dashboard-header .dashboard-brand,
  .screen--dashboard .dashboard-header .dashboard-new-btn {
    position: relative;
  }

  .screen--dashboard .dashboard-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
  }

  .screen--dashboard .dashboard-content {
    margin: 0 auto;
    padding: 22px 32px 56px;
    gap: 16px;
  }

  .screen--dashboard .dashboard-stats {
    gap: 12px;
  }

  .screen--dashboard .stat-pill {
    padding: 14px 16px;
  }

  .screen--dashboard .stat-pill span {
    font-size: 12px;
  }

  .screen--dashboard .stat-pill strong {
    font-size: 26px;
  }

  .screen--dashboard .dashboard-tools {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    align-items: center;
    gap: 14px;
  }

  .screen--dashboard .dashboard-filters {
    justify-content: flex-end;
    overflow: visible;
    flex-wrap: wrap;
  }

  .screen--dashboard .inspection-table {
    gap: 8px;
  }

  .screen--dashboard .inspection-table-head,
  .screen--dashboard .inspection-row {
    grid-template-columns: minmax(260px, 1.7fr) minmax(160px, .75fr) minmax(180px, auto);
    gap: 14px;
  }

  .screen--dashboard .inspection-row {
    padding: 14px 16px;
  }

  .screen--dashboard .inspection-plate {
    font-size: 13px;
    min-height: 28px;
    padding: 4px 10px;
  }

  .screen--dashboard .inspection-meta {
    font-size: 12px;
    gap: 5px 10px;
  }

  .screen--dashboard .status-badge {
    width: fit-content;
    min-height: 28px;
    padding: 4px 10px;
    font-size: 12px;
  }

  .screen--dashboard .inspection-actions {
    gap: 8px;
  }

  .screen--dashboard .row-action {
    min-height: 38px;
    min-width: 38px;
    padding: 0 13px;
    border-radius: 10px;
    font-size: 13px;
  }
}

.row-action--copied {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

.row-action--disabled {
  color: var(--gray-400);
  background: var(--gray-100);
}

.empty-dashboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 34px 18px;
  border: 1px dashed var(--gray-200);
  border-radius: 12px;
  background: white;
  text-align: center;
}

.empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--blue);
  background: var(--blue-light);
}

.empty-dashboard h2 {
  font-size: 17px;
}

.empty-dashboard p {
  color: var(--gray-600);
  font-size: 13px;
  line-height: 1.45;
}

.home-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.home-logo { margin-bottom: 4px; }

.home-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
}

.home-sub {
  font-size: 15px;
  color: var(--gray-600);
  text-align: center;
  line-height: 1.5;
}

.home-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  color: var(--gray-400);
  font-size: 13px;
}
.home-divider::before, .home-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.token-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-features {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}
.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gray-600);
}
.feature-icon { font-size: 22px; }

/* ── Forms ────────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--gray-900);
  background: white;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .1);
}

.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.required { color: var(--red); }
.optional { color: var(--gray-400); font-weight: 400; }

.form-group { display: flex; flex-direction: column; margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 14px; color: var(--gray-600); margin-bottom: 20px; line-height: 1.5; }

.divider-line {
  height: 1px;
  background: var(--gray-200);
  margin: 8px 0 16px;
}

/* ── Bottom bars ──────────────────────────────────────────────── */
.bottom-action {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: 16px 20px;
  padding-bottom: calc(16px + var(--safe-bottom));
  background: white;
  border-top: 1px solid var(--gray-100);
}

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  padding-bottom: calc(14px + var(--safe-bottom));
  background: white;
  border-top: 1px solid var(--gray-100);
}

.bottom-bar--plate .btn--retake {
  flex: 0 0 auto;
  min-width: 120px;
  background: var(--gray-100);
  color: var(--gray-600);
}

.bottom-bar--plate .btn--retake:disabled {
  opacity: .42;
  cursor: default;
}

.bottom-bar--plate .btn--primary {
  flex: 1;
}

.btn--ready {
  background: var(--green);
  color: white;
}

.btn--ready:active {
  background: #15803D;
}

/* ── Capture ──────────────────────────────────────────────────── */
.car-diagram-wrap {
  width: 100%;
  max-width: 260px;
  margin-bottom: 8px;
}
.car-diagram { width: 100%; height: auto; }

.cam-active-ring {
  animation: cam-pulse 1.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes cam-pulse {
  0%, 100% { opacity: .15; transform: scale(1); }
  50%       { opacity: .35; transform: scale(1.25); }
}

.section-illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.illus-icon { font-size: 52px; }
.illus-hint {
  font-size: 13px;
  color: var(--gray-600);
  text-align: center;
  max-width: 260px;
  line-height: 1.5;
}

.capture-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: 16px;
}

.capture-guide {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-50);
}

.capture-guide--plate {
  gap: 10px;
  min-height: 42px;
  margin-bottom: 0;
  padding: 7px 10px;
  border-color: rgba(226,232,240,.9);
  background: rgba(255,255,255,.82);
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

.capture-guide-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--gray-900);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  flex: 0 0 auto;
}

.capture-guide-icon span {
  width: 13px;
  height: 9px;
  border: 1.8px solid white;
  border-radius: 3px;
  position: relative;
}

.capture-guide-icon span::before,
.capture-guide-icon span::after {
  content: '';
  position: absolute;
  top: 2px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: white;
}

.capture-guide-icon span::before { left: -4px; }
.capture-guide-icon span::after { right: -4px; }

.capture-guide-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.capture-guide-copy strong {
  font-size: 13px;
  line-height: 1.2;
  color: var(--gray-900);
}

.capture-guide-copy span {
  font-size: 11px;
  line-height: 1.25;
  color: var(--gray-600);
}

.capture-area { width: 100%; position: relative; }
.captured-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--green);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
}

.photo-preview {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--gray-100);
  border-radius: var(--radius);
  border: 2px dashed var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s;
}
.photo-preview:active { border-color: var(--blue); }

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--gray-400);
  font-size: 14px;
}

.capture-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 10px;
  text-align: center;
}

/* ── Processing ───────────────────────────────────────────────── */
.processing-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.processing-anim {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--blue);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0% { transform: scale(.9); opacity: .7; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(.9); opacity: .7; }
}

.pulse-icon { font-size: 42px; }

.processing-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.processing-sub {
  font-size: 14px;
  color: var(--gray-600);
  text-align: center;
  line-height: 1.5;
}

.analysis-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.astep {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-100);
  transition: all .3s;
}
.astep.active { border-color: var(--blue); background: var(--blue-light); }
.astep.done { border-color: var(--green); background: #F0FFF4; }

.astep-icon { font-size: 20px; width: 24px; text-align: center; }
.astep-text { flex: 1; }
.astep-text strong { display: block; font-size: 13px; font-weight: 600; }
.astep-text span { font-size: 12px; color: var(--gray-400); }

.processing-note {
  font-size: 12px;
  color: var(--gray-400);
  text-align: center;
}

/* ── Report ───────────────────────────────────────────────────── */
.score-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  margin-bottom: 16px;
}

.score-ring { width: 90px; height: 90px; flex-shrink: 0; }
.score-svg { width: 90px; height: 90px; }

.score-condition {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}
.score-vehicle { font-size: 14px; color: var(--gray-600); margin-top: 2px; }
.score-plate {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  background: var(--gray-900);
  color: white;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.info-section {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  padding: 4px 0;
  margin-bottom: 16px;
  overflow: hidden;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--gray-400); }
.info-row strong { color: var(--gray-900); }

.section-card {
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  padding: 14px;
  margin-bottom: 10px;
}
.section-card-title {
  font-size: 14px; font-weight: 700; margin-bottom: 6px;
  display: flex; align-items: center; gap: 7px;
}
.section-card--summary { background: var(--blue-light); border: 1px solid #BFDBFE; }
.section-card-text { font-size: 13px; color: var(--gray-600); line-height: 1.6; }

.list-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 16px 0 10px;
}

.finding {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  margin-bottom: 8px;
}
.finding--severe { border-left: 3px solid var(--red); background: #FFF5F5; }
.finding--moderate { border-left: 3px solid var(--yellow); background: #FFFBEB; }
.finding--minor { border-left: 3px solid var(--green); background: #F0FFF4; }

.finding-sev { font-size: 11px; font-weight: 700; color: var(--gray-600); white-space: nowrap; }
.finding-cat { font-size: 11px; color: var(--gray-400); }
.finding-desc { font-size: 13px; color: var(--gray-900); margin-top: 2px; }

.alert-box {
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
}
.alert-box--warn     { background: #FFFBEB; border: 1px solid #FDE68A; }
.alert-box--info     { background: #F0FFF4; border: 1px solid #A7F3D0; }
.alert-box--critical { background: #FFF1F2; border: 1px solid #FECDD3; }
.alert-title {
  font-size: 13px; font-weight: 700; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.alert-item { font-size: 13px; color: var(--gray-700); line-height: 1.6; padding: 2px 0; }

/* ── Photo grid ───────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.photo-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  position: relative;
  background: var(--gray-100);
}
.photo-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.photo-card-label {
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-700);
  background: white;
}
.photo-card-cond {
  padding: 2px 8px 6px;
  font-size: 11px;
  font-weight: 600;
  background: white;
}
.photo-card-cond--good { color: var(--green); }
.photo-card-cond--fair { color: var(--yellow); }
.photo-card-cond--poor, .photo-card-cond--critical { color: var(--red); }
.photo-card-cond--warning { color: var(--yellow); }

/* ── Modal ────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: white;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 20px;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-info h4 { font-size: 15px; font-weight: 700; margin: 12px 0 8px; }
.modal-damages { list-style: none; }
.modal-damages li { font-size: 13px; color: var(--gray-700); padding: 3px 0; }
.dmg-severe { color: var(--red); }
.dmg-moderate { color: var(--yellow); }
.modal-obs { font-size: 13px; color: var(--gray-600); margin-top: 8px; line-height: 1.5; }

/* ── Overlay ──────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.overlay-card {
  background: white;
  border-radius: var(--radius);
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Misc ─────────────────────────────────────────────────────── */
.footer-note {
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
  margin-bottom: 32px;
}

/* ── Scan 360° ───────────────────────────────────────────────── */
.scan360-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.scan-ring-wrap { width: 80px; height: 80px; }
.scan-ring { width: 80px; height: 80px; }
.ring-progress { transition: stroke-dasharray .6s ease; }

.car3d-wrap {
  width: 100%;
  max-width: 300px;
}
.car3d-svg { width: 100%; height: auto; }

.vehicle-skeleton {
  display: block;
  overflow: visible;
}

.vehicle-skeleton--capture {
  width: min(58vw, 178px);
  height: auto;
}

.vehicle-skeleton--guide {
  width: 40px;
  height: auto;
  flex: 0 0 auto;
}

.vehicle-marker-pulse {
  animation: vehicle-marker-pulse 1.35s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes vehicle-marker-pulse {
  0%, 100% { opacity: .12; transform: scale(1); }
  50% { opacity: .34; transform: scale(1.28); }
}

.cam-active-ring {
  animation: cam-pulse 1.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes cam-pulse {
  0%,100% { opacity:.15; transform:scale(1); }
  50%      { opacity:.35; transform:scale(1.3); }
}

.scan-position-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  padding: 6px 14px;
  border-radius: 20px;
}
.scan-pos-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue);
  animation: cam-pulse 1.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* ── Plate section ───────────────────────────────────────────── */
.plate-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--blue);
  background: var(--blue-light);
  padding: 6px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
}

.plate-detected {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--green);
  background: #F0FFF4;
  border: 1px solid #BBF7D0;
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 10px;
  font-weight: 500;
}

/* ── Illustration blocks ─────────────────────────────────────── */
.illus-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.illus-hint {
  font-size: 13px;
  color: var(--gray-600);
  text-align: center;
  max-width: 280px;
  line-height: 1.55;
}

/* ── Front car SVG illustration ──────────────────────────────── */
.front-car-svg {
  width: 100%;
  max-width: 280px;
  height: auto;
}

/* ── Remove old car-diagram styles ──────────────────────────── */
.car-diagram-wrap { display: none; }
.section-illustration { display: none; }

/* ── Scan360 fullscreen camera screen ───────────────────────── */
.scan360-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

#cam-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Top bar */
.s360-topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  background: linear-gradient(to bottom, rgba(0,0,0,.65) 0%, transparent 100%);
  color: white;
}
.s360-back {
  color: white;
  padding: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
}
.s360-topbar-center {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}
.s360-counter {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  background: rgba(29,78,216,.7);
  padding: 4px 10px;
  border-radius: 20px;
}

/* Instruction banner */
.s360-instruction {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 16px;
  padding: 12px 16px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  color: white;
  border: 1px solid rgba(255,255,255,.12);
}
.s360-arrow {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(29,78,216,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .5s ease;
}
#instruction-text {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
}

/* Spacer to push bottom panel down */
.scan360-screen > .s360-instruction {
  margin-top: 12px;
}

/* Bottom panel */
.s360-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 14px 16px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.6) 70%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── 2-column main row ── */
.s360-main-row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
}
.s360-car-col {
  flex-shrink: 0;
  width: 96px;
}
.s360-car-svg {
  width: 96px;
  height: auto;          /* 260×380 viewBox → ~140px tall */
  filter: drop-shadow(0 2px 12px rgba(0,0,0,.55));
}
.s360-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.pos-ring-anim {
  animation: pos-pulse 1.3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes pos-pulse {
  0%,100% { opacity: .15; transform: scale(1); }
  50%      { opacity: .45; transform: scale(1.5); }
}

/* Progress row */
.s360-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.s360-progress-bg {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,.2);
  border-radius: 10px;
  overflow: hidden;
}
.s360-progress-fill {
  height: 100%;
  background: #1D4ED8;
  border-radius: 10px;
  transition: width .5s ease;
}
.s360-prog-label {
  font-size: 12px;
  color: rgba(255,255,255,.8);
  white-space: nowrap;
  font-weight: 600;
}

.s360-scan-state {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.88);
  font-size: 12px;
  font-weight: 650;
}

.s360-state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  flex: 0 0 auto;
}

.s360-scan-state--ready .s360-state-dot { background: #93C5FD; }
.s360-scan-state--scanning .s360-state-dot {
  background: #FACC15;
  animation: state-pulse 1s ease-in-out infinite;
}
.s360-scan-state--ok {
  background: rgba(22,163,74,.22);
  color: white;
}
.s360-scan-state--ok .s360-state-dot { background: #22C55E; }
.s360-scan-state--error {
  background: rgba(220,38,38,.22);
  color: white;
}
.s360-scan-state--error .s360-state-dot { background: #EF4444; }

@keyframes state-pulse {
  0%, 100% { transform: scale(1); opacity: .75; }
  50% { transform: scale(1.45); opacity: 1; }
}

/* Thumbnails strip — 4 across, 2 rows */
.s360-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.s360-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.5);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  transition: border-color .3s;
}
.s360-thumb.capturing {
  border-color: #3B82F6;
  animation: thumb-flash .4s ease;
}
.s360-thumb.captured {
  border-color: #16A34A;
  color: transparent;
}
@keyframes thumb-flash {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}

/* Capture button */
.s360-capture-btn {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  background: #1D4ED8;
  color: white;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.s360-capture-btn:active { transform: scale(.97); }
.s360-capture-btn:disabled { background: rgba(255,255,255,.2); color: rgba(255,255,255,.5); cursor: not-allowed; }

/* Done overlay */
.s360-done-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
}
.s360-done-card {
  background: white;
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.s360-done-card h3 { font-size: 20px; font-weight: 700; }
.s360-done-card p  { font-size: 14px; color: #64748B; }

/* getUserMedia live viewfinder in capture.html (plate/trunk/engine) */
.live-camera-wrap {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 4/3;
  position: relative;
}

.content--plate .live-camera-wrap {
  height: clamp(360px, calc(100dvh - 154px), 560px);
  aspect-ratio: auto;
}
.live-camera-wrap--plate {
  border-radius: 16px;
  flex: 1 1 auto;
  min-height: 310px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.live-camera-wrap--captured {
  box-shadow: 0 0 0 3px rgba(22,163,74,.85), 0 14px 32px rgba(22,163,74,.20);
}
.live-camera-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.live-cam-overlay {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(29,78,216,.5);
  border-radius: 14px;
  pointer-events: none;
}
.live-cam-corners::before,
.live-cam-corners::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: #1D4ED8;
  border-style: solid;
}
.live-cam-corners::before { top: 8px; left: 8px; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.live-cam-corners::after  { bottom: 8px; right: 8px; border-width: 0 3px 3px 0; border-radius: 0 0 4px 4px; }

.plate-cv-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.plate-cv-mask {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 74% 57% at 50% 45%, transparent 0 56%, rgba(0,0,0,.48) 58% 100%),
    linear-gradient(to bottom, rgba(0,0,0,.18), rgba(0,0,0,0) 38%, rgba(0,0,0,.18));
}

.plate-scan-frame {
  position: absolute;
  left: 50%;
  top: 45%;
  width: min(88%, 390px);
  height: min(68%, 360px);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 34px 34px 24px 24px;
  box-shadow: 0 0 0 999px rgba(0,0,0,.10), 0 0 26px rgba(29,78,216,.18);
}

.live-camera-wrap--captured .plate-scan-frame {
  border-color: rgba(34,197,94,.95);
  box-shadow: 0 0 0 999px rgba(0,0,0,.10), 0 0 26px rgba(34,197,94,.38);
}

.plate-scan-frame::before,
.plate-scan-frame::after,
.plate-frame-line::before,
.plate-frame-line::after {
  content: '';
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: rgba(96,165,250,.95);
  border-style: solid;
}

.live-camera-wrap--captured .plate-scan-frame::before,
.live-camera-wrap--captured .plate-scan-frame::after,
.live-camera-wrap--captured .plate-frame-line::before,
.live-camera-wrap--captured .plate-frame-line::after {
  border-color: #22C55E;
}

.plate-scan-frame::before {
  top: -1px;
  left: -1px;
  border-width: 4px 0 0 4px;
  border-radius: 22px 0 0 0;
}

.plate-scan-frame::after {
  right: -1px;
  top: -1px;
  border-width: 4px 4px 0 0;
  border-radius: 0 22px 0 0;
}

.plate-frame-line--bottom::before {
  left: -1px;
  bottom: -1px;
  border-width: 0 0 4px 4px;
  border-radius: 0 0 0 22px;
}

.plate-frame-line--bottom::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 4px 4px 0;
  border-radius: 0 0 22px 0;
}

.plate-frame-line {
  position: absolute;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.58), transparent);
}

.plate-frame-line--top { top: 24%; }
.plate-frame-line--bottom { bottom: 23%; }

.plate-car-silhouette,
.plate-car-roof,
.plate-car-glass,
.plate-car-hood,
.plate-car-light {
  position: absolute;
  display: block;
}

.plate-car-silhouette {
  inset: 0;
}

.plate-car-roof {
  left: 23%;
  right: 23%;
  top: -13%;
  height: 35%;
  border: 2px solid rgba(147,197,253,.72);
  border-bottom: 0;
  border-radius: 52px 52px 0 0;
}

.plate-car-glass {
  left: 24%;
  right: 24%;
  top: 18%;
  height: 25%;
  border: 2px solid rgba(255,255,255,.34);
  border-radius: 15px 15px 7px 7px;
  background: rgba(96,165,250,.07);
}

.plate-car-hood {
  left: 14%;
  right: 14%;
  top: 52%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.46), transparent);
}

.plate-car-light {
  bottom: 20%;
  width: 16%;
  height: 7%;
  border-radius: 999px;
  background: rgba(255,255,255,.56);
}

.plate-car-light--left { left: 13%; }
.plate-car-light--right { right: 13%; }

.plate-target-box {
  position: absolute;
  left: 34%;
  right: 34%;
  bottom: 12%;
  height: 12%;
  border: 2px solid #22C55E;
  border-radius: 6px;
  background: rgba(22,163,74,.10);
  box-shadow: 0 0 0 1px rgba(255,255,255,.38), 0 0 14px rgba(34,197,94,.28);
}

.live-camera-wrap--captured .plate-target-box {
  border-color: #22C55E;
  background: rgba(22,163,74,.18);
  box-shadow: 0 0 0 1px rgba(255,255,255,.45), 0 0 18px rgba(34,197,94,.48);
}

.plate-target-box::after {
  content: 'PATENTE';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255,255,255,.85);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
}

.plate-cv-status {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 8px 12px;
  color: white;
  background: rgba(15,23,42,.72);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 700;
}

.plate-cv-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FACC15;
  flex: 0 0 auto;
}

.plate-cv-status--ok {
  background: rgba(22,163,74,.82);
}
.plate-cv-status--ok .plate-cv-dot { background: white; }
.plate-cv-status--warn .plate-cv-dot {
  background: #FACC15;
  animation: state-pulse 1s ease-in-out infinite;
}
.plate-cv-status--error {
  background: rgba(220,38,38,.82);
}
.plate-cv-status--error .plate-cv-dot { background: white; }

/* ════════════════════════════════════════════════════════════
   App Shell — Panel autenticado (mobile SaaS layout)
   ════════════════════════════════════════════════════════════ */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--gray-50);
}

/* ── Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: white;
  border-bottom: 1px solid var(--gray-100);
  flex: 0 0 auto;
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 54px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.brand-mark--app .brand-wordmark {
  font-size: 20px;
}

/* ── Hamburger button ── */
.app-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 10px;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}

.app-hamburger:active { background: var(--gray-100); }

.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--gray-700);
  transition: transform .22s ease, opacity .18s ease;
  transform-origin: center;
}

.app-hamburger.is-open .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.app-hamburger.is-open .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.app-hamburger.is-open .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Drawer overlay ── */
.app-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.app-drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Navigation drawer ── */
.app-drawer {
  position: fixed;
  top: 54px;
  left: 50%;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%) translateY(-110%);
  z-index: 46;
  background: white;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
  transition: transform .28s cubic-bezier(.22, .68, 0, 1.2);
  overflow: hidden;
}

.app-drawer.is-open {
  transform: translateX(-50%) translateY(0);
}

/* Account info strip */
.app-drawer-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--gray-100);
}

.app-drawer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--blue);
  color: white;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.app-drawer-account-info { min-width: 0; }

.app-drawer-company-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-drawer-company-email {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav items */
.app-drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  gap: 2px;
}

.app-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--gray-700);
  font-size: 15px;
  font-weight: 600;
  transition: background .12s, color .12s;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  width: 100%;
}

.app-drawer-item:active { background: var(--gray-100); }

.app-drawer-item.is-active {
  background: var(--blue-light);
  color: var(--blue);
}

.app-drawer-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: background .12s;
}

.app-drawer-item.is-active .app-drawer-item-icon {
  background: rgba(29, 78, 216, .12);
}

.app-drawer-item-label { flex: 1; }

.app-drawer-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer (logout) */
.app-drawer-footer {
  padding: 6px 10px 14px;
  border-top: 1px solid var(--gray-100);
}

.app-drawer-signout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 600;
  transition: background .12s;
  -webkit-tap-highlight-color: transparent;
}

.app-drawer-signout:active { background: var(--gray-100); }

/* ── Main content area ── */
.app-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Section switching ── */
.app-section {
  display: none;
  flex-direction: column;
}

.app-section.is-active {
  display: flex;
  animation: section-in .18s ease both;
}

@keyframes section-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

/* ════════════════════════════════════════════════════════════
   HOME section — dashboard
   ════════════════════════════════════════════════════════════ */

.home-dashboard {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 32px;
}

/* ── Greeting bar ── */
.home-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 14px 14px;
  background: white;
  border-bottom: 1px solid var(--gray-100);
}

.home-greeting-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.1;
}

.home-greeting-sub {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}

.home-new-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
  box-shadow: 0 6px 16px rgba(29,78,216,.20);
  transition: transform .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.home-new-cta:active { transform: scale(.97); background: #1E40AF; }

/* ── Stats grid ── */
.home-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}

.home-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 14px;
  background: white;
}

.home-stat-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gray-400);
}

.home-stat-num {
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  color: var(--gray-900);
}

.home-stat--active  .home-stat-num { color: var(--blue); }
.home-stat--completed .home-stat-num { color: var(--green); }
.home-stat--expired  .home-stat-num { color: var(--red); }

.home-stat-desc {
  font-size: 11px;
  color: var(--gray-400);
  line-height: 1.3;
  margin-top: 1px;
}

/* ── Recent activity ── */
.home-recent-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.home-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
}

.home-recent-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.app-see-all-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  -webkit-tap-highlight-color: transparent;
}

.home-recent-list {
  display: flex;
  flex-direction: column;
}

.home-recent-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--gray-100);
  background: white;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
}

.home-recent-row:active { background: var(--gray-50); }

.home-recent-plate {
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--gray-900);
  color: white;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  flex: 0 0 auto;
}

.home-recent-client {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-recent-date {
  font-size: 11px;
  color: var(--gray-400);
  white-space: nowrap;
}

/* Empty state */
.home-empty-activity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 20px;
  text-align: center;
  border-top: 1px solid var(--gray-100);
  background: white;
  color: var(--gray-400);
}

.home-empty-activity p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-600);
  max-width: 240px;
}

.home-empty-cta {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

/* ── Legacy classes (kept for other templates) ── */
.app-home-welcome { display: none; }
.app-home-body { display: none; }
.app-home-new-btn { display: none; }
.app-home-recent { display: none; }
.app-home-section-label { display: none; }
.app-home-recent-list { display: none; }
.app-home-empty { display: none; }

/* ════════════════════════════════════════════════════════════
   INSPECCIONES section
   ════════════════════════════════════════════════════════════ */

.app-section-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  background: white;
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-section-topbar h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
}

.insp-section-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 32px;
}

.insp-section-body .dashboard-stats {
  padding: 12px 14px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.insp-section-body .dashboard-tools {
  padding: 10px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insp-section-body .inspection-table {
  padding: 10px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ════════════════════════════════════════════════════════════
   REPORTE + PAGO placeholder sections
   ════════════════════════════════════════════════════════════ */

.app-placeholder-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52dvh;
  padding: 32px 24px;
  gap: 14px;
  text-align: center;
}

.app-placeholder-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--blue-light);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-placeholder-shell h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
}

.app-placeholder-shell p {
  font-size: 14px;
  color: var(--gray-400);
  max-width: 240px;
  line-height: 1.5;
}

.app-soon-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════════
   PAGO — plan card
   ════════════════════════════════════════════════════════════ */

.app-plan-card {
  margin: 16px 14px 0;
  padding: 22px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
  color: white;
}

.app-plan-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .45);
  margin-bottom: 6px;
}

.app-plan-name {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.app-plan-desc {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, .58);
  line-height: 1.45;
}

.app-plan-features {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.app-plan-feature {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: rgba(255, 255, 255, .80);
}

.app-plan-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(34, 197, 94, .22);
  color: #22C55E;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

/* ════════════════════════════════════════════════════════════
   DESKTOP SaaS layout — sidebar + content (≥ 800px)
   ════════════════════════════════════════════════════════════ */

@media (min-width: 800px) {

  /* Make shell a 2-column grid: sidebar | content */
  .app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    /* row 1 = 54px header strip, row 2 = remaining content */
    grid-template-rows: 54px 1fr;
    max-width: none;
    min-height: 100dvh;
    background: var(--gray-50);
  }

  /* ── Header: becomes the brand strip at top of sidebar ── */
  .app-header {
    grid-column: 1;
    grid-row: 1;
    position: static;
    border-bottom: 1px solid var(--gray-100);
    border-right: 1px solid var(--gray-100);
    background: white;
    z-index: auto;
  }

  .app-header-inner {
    height: 54px;
    padding: 0 16px;
    justify-content: flex-start;
    gap: 0;
  }

  /* Hide hamburger on desktop */
  .app-hamburger {
    display: none;
  }

  /* ── Overlay: never needed on desktop ── */
  .app-drawer-overlay {
    display: none !important;
  }

  /* ── Drawer: becomes a permanent left sidebar nav ── */
  .app-drawer {
    grid-column: 1;
    grid-row: 2;
    position: sticky;
    top: 0;
    left: auto;
    width: 240px;
    height: calc(100dvh - 54px);
    max-width: none;
    transform: none !important;
    transition: none;
    border-radius: 0;
    box-shadow: none;
    border-right: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1;
    background: white;
  }

  /* Always visible — override the aria-hidden-triggered display:none if any */
  .app-drawer[aria-hidden="true"] {
    display: flex;
  }

  /* Push account info strip to the bottom */
  .app-drawer-account {
    order: 10;
    margin-top: auto;
    border-top: 1px solid var(--gray-100);
    border-bottom: none;
  }

  /* Nav takes natural flow in the middle */
  .app-drawer-nav {
    flex: 1;
    padding: 12px 10px;
  }

  /* Larger tap targets on desktop */
  .app-drawer-item {
    padding: 10px 12px;
    font-size: 14px;
  }

  /* Footer (logout) after account */
  .app-drawer-footer {
    order: 11;
    border-top: 1px solid var(--gray-100);
  }

  /* ── Main content: fills the right column, spans both rows ── */
  .app-content {
    grid-column: 2;
    grid-row: 1 / span 2;
    overflow-y: auto;
    height: 100dvh;
  }

  /* ── Toast: reposition to avoid sidebar ── */
  .dashboard-toast {
    left: calc(240px + 50%);
    transform: translateX(-50%);
  }

  /* ── Home section desktop ── */
  .home-greeting {
    padding: 18px 28px 16px;
  }

  .home-greeting-name {
    font-size: 22px;
  }

  .home-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .home-stat {
    padding: 20px 24px;
  }

  .home-stat-num {
    font-size: 48px;
  }

  .home-recent-header {
    padding: 16px 28px 12px;
  }

  .home-recent-row {
    padding: 12px 28px;
    grid-template-columns: auto minmax(0,1fr) auto auto;
    gap: 14px;
  }

  .home-empty-activity {
    padding: 48px 28px;
  }

  /* Inspecciones section desktop tweaks — align with 54px sidebar header */
  .app-section-topbar {
    height: 54px;
    padding: 0 28px;
    top: 0;
  }

  .insp-section-body .dashboard-stats {
    padding: 16px 28px 0;
    gap: 12px;
  }

  .insp-section-body .dashboard-tools {
    padding: 12px 28px 0;
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    align-items: center;
    gap: 14px;
  }

  .insp-section-body .dashboard-filters {
    justify-content: flex-end;
    overflow: visible;
    flex-wrap: wrap;
  }

  .insp-section-body .inspection-table {
    padding: 12px 28px 0;
    gap: 8px;
  }

  .insp-section-body .inspection-table-head,
  .insp-section-body .inspection-row {
    grid-template-columns: minmax(220px, 1.6fr) minmax(140px, .72fr) minmax(160px, auto);
    gap: 12px;
  }

  .insp-section-body .inspection-row {
    padding: 12px 14px;
  }

  .insp-section-body .inspection-plate {
    font-size: 13px;
    min-height: 27px;
    padding: 4px 9px;
  }

  .insp-section-body .status-badge {
    min-height: 26px;
    padding: 4px 10px;
    font-size: 12px;
  }

  .insp-section-body .row-action {
    min-height: 36px;
    min-width: 36px;
    padding: 0 11px;
    border-radius: 10px;
    font-size: 12px;
  }

  /* Placeholder and pago sections */
  .app-placeholder-shell {
    min-height: 60dvh;
    padding: 48px 28px;
  }

  .app-plan-card {
    margin: 20px 28px 0;
    max-width: 480px;
  }

  /* Nueva inspección form page */
  .screen--dashboard {
    margin-left: 0;
  }
}

@media (min-width: 1200px) {
  .app-home-body {
    max-width: 960px;
  }
}

/* ════════════════════════════════════════════════════════════
   Renovación panel interno
   ════════════════════════════════════════════════════════════ */

.app-shell {
  --sidebar-width: 270px;
  --sidebar-collapsed: 78px;
  --ui-primary: #2563EB;
  --ui-primary-strong: #1E40AF;
  --ui-primary-soft: #EAF2FF;
  --ui-ink: #172033;
  --ui-muted: #64748B;
  --ui-border: #DDE5F0;
  --ui-panel: #FFFFFF;
  --ui-bg: #F5F7FB;
  --ui-success: #0F9F6E;
  --ui-warning: #C76A15;
  --ui-danger: #DC3545;
  min-height: 100dvh;
  max-width: none;
  margin: 0;
  background: var(--ui-bg);
}

.app-content {
  min-width: 0;
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.08), transparent 34rem),
    var(--ui-bg);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 35;
  border-bottom: 1px solid var(--ui-border);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
}

.app-header-inner {
  height: 64px;
  padding: 0 18px;
  gap: 14px;
}

.app-topbar-copy {
  min-width: 0;
  flex: 1;
}

.app-topbar-kicker {
  margin-bottom: 2px;
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-topbar-copy h1 {
  color: var(--ui-ink);
  font-size: 19px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: 0;
}

.app-topbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 8px;
  background: #111827;
  color: white;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(17,24,39,.16);
}

.app-topbar-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary-strong);
  font-size: 12px;
  font-weight: 900;
}

.app-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 16px;
  border-bottom: 1px solid var(--ui-border);
  position: relative;
}

.app-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  color: var(--ui-muted);
  background: white;
  transition: background .15s, color .15s, transform .18s;
}

.app-drawer {
  background: #FFFFFF;
}

.app-drawer-nav {
  padding: 14px 12px;
  gap: 4px;
}

.app-drawer-item,
.app-drawer-signout {
  min-height: 44px;
  border-radius: 8px;
  color: var(--ui-muted);
  font-size: 14px;
  font-weight: 750;
}

.app-drawer-item:hover,
.app-drawer-signout:hover {
  background: #F4F7FB;
}

.app-drawer-item.is-active {
  background: var(--ui-primary-soft);
  color: var(--ui-primary-strong);
}

.app-drawer-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
}

.app-drawer-item.is-active .app-drawer-item-icon {
  background: rgba(29,78,216,.10);
}

.app-drawer-badge {
  background: var(--ui-primary);
}

.app-drawer-footer {
  order: 20;
  margin-top: auto;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--ui-border);
  background: linear-gradient(180deg, rgba(255,255,255,.88), #FFFFFF);
}

.app-drawer-signout {
  justify-content: flex-start;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ui-muted);
  box-shadow: none;
  font-size: 13px;
}

.app-drawer-signout:hover {
  border-color: #F3CDD2;
  background: #FFF8F8;
  color: #B42331;
}

.app-drawer-signout svg {
  color: #D65A66;
}

.app-section {
  min-height: calc(100dvh - 64px);
}

.home-dashboard,
.insp-section-body {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 48px;
  gap: 18px;
}

.home-greeting {
  align-items: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
}

.home-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--ui-primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-greeting-name {
  color: var(--ui-ink);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  letter-spacing: 0;
}

.home-greeting-sub {
  margin-top: 7px;
  color: var(--ui-muted);
  font-size: 14px;
}

.home-new-cta {
  min-height: 42px;
  border-radius: 8px;
  background: var(--ui-primary);
  color: #FFFFFF;
  box-shadow: 0 12px 22px rgba(37,99,235,.18);
}

.home-new-cta:hover {
  background: var(--ui-primary-strong);
}

.home-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  border: 0;
  background: transparent;
}

.home-stat {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-panel);
  box-shadow: 0 1px 2px rgba(17,24,39,.04);
}

.home-stat-label {
  color: var(--ui-muted);
  letter-spacing: 0;
}

.home-stat-num {
  margin-top: 8px;
  color: var(--ui-ink);
  font-size: 42px;
}

.home-stat-desc {
  color: var(--ui-muted);
  font-size: 12px;
}

.home-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.home-recent-wrap,
.home-side-card,
.inspection-table {
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(17,24,39,.04);
  overflow: hidden;
}

.home-recent-header {
  padding: 16px 18px;
  border-bottom: 1px solid #E5E7EB;
}

.home-recent-title {
  color: #111827;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.home-recent-sub {
  margin-top: 3px;
  color: #6B7280;
  font-size: 12px;
}

.app-see-all-btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: #F3F4F6;
  color: #1D4ED8;
}

.home-recent-row {
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr) auto auto;
  padding: 13px 18px;
  border-top: 0;
  border-bottom: 1px solid #F1F5F9;
}

.home-recent-row:last-child {
  border-bottom: 0;
}

.home-recent-plate,
.inspection-plate {
  border-radius: 6px;
  background: #111827;
  letter-spacing: .04em;
}

.home-side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-side-card {
  padding: 18px;
}

.home-side-card--soft {
  background: #F0FDF4;
  border-color: #BBF7D0;
}

.home-side-label {
  color: #6B7280;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-side-card strong {
  display: block;
  margin-top: 8px;
  color: #111827;
  font-size: 32px;
  font-weight: 900;
}

.home-side-card p {
  margin-top: 6px;
  color: #4B5563;
  font-size: 13px;
  line-height: 1.45;
}

.home-side-link {
  margin-top: 14px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: #111827;
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.insp-section-body .dashboard-stats,
.insp-section-body .dashboard-tools,
.insp-section-body .inspection-table {
  padding: 0;
}

.insp-section-body .dashboard-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.insp-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(234,242,255,.96), rgba(255,255,255,.74) 48%, rgba(237,253,248,.80)),
    #FFFFFF;
  box-shadow: 0 1px 2px rgba(17,24,39,.04);
}

.insp-hero-copy {
  min-width: 0;
}

.insp-hero h2 {
  color: var(--ui-ink);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 920;
  line-height: 1;
  letter-spacing: 0;
}

.insp-hero p {
  max-width: 620px;
  margin-top: 10px;
  color: #334155;
  font-size: 15px;
  line-height: 1.5;
}

.insp-account-line {
  display: block;
  margin-top: 12px;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.35;
}

.stat-pill {
  position: relative;
  min-height: 102px;
  padding: 16px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: #FFFFFF;
  overflow: hidden;
}

.stat-pill::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #CBD5E1;
}

.stat-pill span {
  position: relative;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.stat-pill strong {
  position: relative;
  display: block;
  margin-top: 8px;
  color: var(--ui-ink);
  font-size: 34px;
  line-height: 1;
}

.stat-pill small {
  position: relative;
  display: block;
  margin-top: 7px;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 650;
}

.stat-pill--total::before { background: #475569; }
.stat-pill--requested::before { background: var(--ui-primary); }
.stat-pill--active::before { background: var(--ui-warning); }
.stat-pill--completed::before { background: var(--ui-success); }
.stat-pill--expired::before { background: var(--ui-danger); }

.stat-pill--requested strong { color: var(--ui-primary); }
.stat-pill--active strong { color: var(--ui-warning); }
.stat-pill--completed strong { color: var(--ui-success); }
.stat-pill--expired strong { color: var(--ui-danger); }

.insp-section-body .dashboard-tools {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(17,24,39,.04);
}

.dashboard-tools-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-tools-title strong {
  color: var(--ui-ink);
  font-size: 15px;
  font-weight: 900;
}

.dashboard-tools-title span {
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 750;
}

.dashboard-tools-controls {
  display: grid;
  grid-template-columns: minmax(260px, 390px) 1fr;
  gap: 12px;
  align-items: center;
}

.dashboard-tools {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 12px;
  align-items: center;
}

.dashboard-search {
  height: 44px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: #F9FAFB;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.dashboard-search:focus-within {
  border-color: var(--ui-primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}

.dashboard-filters {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: #F4F7FB;
  overflow-x: auto;
}

.filter-chip {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.filter-chip.active {
  border-color: transparent;
  background: var(--ui-primary);
  color: #FFFFFF;
  box-shadow: 0 6px 14px rgba(37,99,235,.18);
}

.inspection-table {
  padding: 0;
  border-radius: 10px;
}

.inspection-table-head,
.inspection-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(170px, .7fr) minmax(170px, auto);
  align-items: center;
  gap: 14px;
}

.inspection-table-head {
  padding: 13px 18px;
  border-bottom: 1px solid var(--ui-border);
  background: #F7FAFE;
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.inspection-row {
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid #F1F5F9;
  border-radius: 0;
  background: #FFFFFF;
  transition: background .15s;
}

.inspection-row:hover {
  background: #FAFBFC;
}

.inspection-plate,
.home-recent-plate {
  background: #243044;
}

.row-action--primary,
.btn--primary {
  border-color: var(--ui-primary);
  background: var(--ui-primary);
  color: #FFFFFF;
}

.row-action--primary:hover,
.btn--primary:hover {
  border-color: var(--ui-primary-strong);
  background: var(--ui-primary-strong);
}

.empty-icon {
  color: var(--ui-primary);
  background: var(--ui-primary-soft);
}

.empty-dashboard {
  border-color: #C9D6EA;
  background: #FFFFFF;
}

.empty-dashboard h2 {
  color: var(--ui-ink);
}

.empty-dashboard p {
  color: var(--ui-muted);
}

.modal-lock {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(23,32,51,.42);
  backdrop-filter: blur(10px);
}

.modal-backdrop.is-open {
  display: flex;
  animation: modal-backdrop-in .18s ease both;
}

.new-inspection-modal {
  width: min(560px, 100%);
  max-height: min(720px, calc(100dvh - 36px));
  overflow-y: auto;
}

.new-modal-panel {
  border: 1px solid rgba(221,229,240,.96);
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: 0 26px 70px rgba(23,32,51,.22);
  animation: modal-panel-in .22s ease both;
}

.new-modal-panel[hidden],
.send-status[hidden] {
  display: none !important;
}

.new-modal-panel--form {
  padding: 22px;
}

.new-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.new-modal-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--ui-primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.new-modal-head h2 {
  color: var(--ui-ink);
  font-size: 28px;
  font-weight: 920;
  line-height: 1;
  letter-spacing: 0;
}

.new-modal-head p {
  margin-top: 9px;
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.45;
}

.new-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  color: var(--ui-muted);
  background: #F8FAFD;
}

.new-modal-form {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.new-modal-plate {
  text-align: center;
  text-transform: uppercase;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 16px;
}

.new-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--ui-border);
}

.new-modal-secondary,
.new-modal-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 850;
}

.new-modal-secondary {
  border: 1px solid var(--ui-border);
  color: var(--ui-muted);
  background: #FFFFFF;
}

.new-modal-primary {
  border: 1px solid var(--ui-primary);
  color: #FFFFFF;
  background: var(--ui-primary);
  box-shadow: 0 12px 22px rgba(37,99,235,.16);
}

.new-modal-primary:disabled {
  opacity: .68;
  cursor: wait;
}

.new-modal-panel--status {
  display: grid;
  place-items: center;
  min-height: 330px;
  padding: 38px 28px;
  text-align: center;
}

.send-status h2 {
  margin-top: 18px;
  color: var(--ui-ink);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
}

.send-status p {
  max-width: 340px;
  margin: 9px auto 0;
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.5;
}

.send-spinner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 4px solid #DCE8FF;
  border-top-color: var(--ui-primary);
  animation: send-spin .8s linear infinite;
  margin: 0 auto;
}

.send-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  color: #FFFFFF;
  background: var(--ui-success);
  box-shadow: 0 16px 34px rgba(15,159,110,.22);
  animation: check-pop .24s ease both;
}

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

@keyframes check-pop {
  from { transform: scale(.82); opacity: .4; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 620px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 10px;
  }

  .new-inspection-modal {
    max-height: calc(100dvh - 20px);
  }

  .new-modal-panel {
    border-radius: 14px;
  }

  .new-modal-panel--form {
    padding: 18px;
  }

  .new-modal-actions {
    flex-direction: column-reverse;
  }

  .new-modal-secondary,
  .new-modal-primary {
    width: 100%;
  }
}

.inspection-row:last-child {
  border-bottom: 0;
}

.inspection-main {
  min-width: 0;
}

.inspection-meta {
  gap: 8px;
}

.status-badge {
  border-radius: 999px;
  font-weight: 850;
}

.row-action {
  border-radius: 8px;
}

.app-placeholder-shell {
  width: min(680px, calc(100% - 32px));
  min-height: calc(100dvh - 120px);
  margin: 0 auto;
}

.app-placeholder-icon {
  border-radius: 8px;
  background: #E8F0FF;
}

.app-placeholder-icon--pay {
  background: #FEF3C7;
  color: #B45309;
}

.app-plan-card {
  width: min(520px, calc(100% - 32px));
  margin: 24px auto 0;
  border-radius: 8px;
  background: #111827;
}

.dashboard-toast {
  border-radius: 8px;
  background: #111827;
}

@media (max-width: 799px) {
  .app-shell {
    display: flex;
    max-width: none;
  }

  .app-sidebar-head {
    display: none;
  }

  .app-drawer {
    top: 64px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    transform: translateY(-120%);
    border: 1px solid #E5E7EB;
    border-radius: 8px;
  }

  .app-drawer.is-open {
    transform: translateY(0);
  }

  .app-topbar-action span {
    display: none;
  }

  .app-topbar-action {
    width: 38px;
    padding: 0;
  }

  .home-dashboard,
  .insp-section-body {
    width: min(100% - 24px, 680px);
    padding-top: 18px;
  }

  .home-greeting {
    flex-direction: column;
  }

  .insp-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 18px;
  }

  .insp-hero p {
    font-size: 14px;
  }

  .home-new-cta {
    width: 100%;
    justify-content: center;
  }

  .home-stats-grid,
  .dashboard-stats,
  .insp-section-body .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-workspace {
    grid-template-columns: 1fr;
  }

  .home-recent-row {
    grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
  }

  .home-recent-date,
  .home-recent-row .status-badge {
    justify-self: start;
  }

  .dashboard-tools {
    grid-template-columns: 1fr;
  }

  .dashboard-tools-controls {
    grid-template-columns: 1fr;
  }

  .dashboard-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    overflow: visible;
  }

  .filter-chip {
    justify-content: center;
  }

  .inspection-table-head {
    display: none;
  }

  .inspection-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .inspection-state,
  .inspection-actions {
    justify-content: flex-start;
  }
}

@media (min-width: 800px) {
  .app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: 1fr;
  }

  .app-shell.is-sidebar-collapsed {
    grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
  }

  .app-header {
    grid-column: 2;
  }

  .app-hamburger {
    display: none;
  }

  .app-drawer-overlay {
    display: none !important;
  }

  .app-drawer {
    position: sticky;
    top: 0;
    grid-column: 1;
    grid-row: 1;
    width: auto;
    height: 100dvh;
    max-width: none;
    transform: none !important;
    border-right: 1px solid #E5E7EB;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: visible;
    z-index: 40;
  }

  .app-drawer[aria-hidden="true"] {
    display: flex;
  }

  .app-sidebar-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .app-content {
    grid-column: 2;
    grid-row: 1;
    height: 100dvh;
    overflow-y: auto;
  }

  .app-shell.is-sidebar-collapsed .brand-wordmark,
  .app-shell.is-sidebar-collapsed .app-drawer-item-label,
  .app-shell.is-sidebar-collapsed .app-drawer-badge {
    display: none;
  }

  .app-shell.is-sidebar-collapsed .app-sidebar-head {
    justify-content: center;
    padding: 0 10px;
  }

  .app-shell.is-sidebar-collapsed .app-sidebar-toggle {
    transform: rotate(180deg);
    box-shadow: none;
  }

  .app-shell.is-sidebar-collapsed .app-drawer-item,
  .app-shell.is-sidebar-collapsed .app-drawer-signout {
    justify-content: center;
    padding: 8px;
  }

  .app-shell.is-sidebar-collapsed .app-drawer-item-icon {
    width: 36px;
    height: 36px;
  }

  .app-shell.is-sidebar-collapsed .app-drawer-footer {
    padding-inline: 10px;
  }
}

@media (max-width: 980px) and (min-width: 800px) {
  .home-stats-grid,
  .dashboard-stats,
  .insp-section-body .dashboard-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-workspace {
    grid-template-columns: 1fr;
  }

  .dashboard-tools {
    grid-template-columns: 1fr;
  }

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

.internal-form-shell {
  min-height: 100dvh;
  background: #F6F7F9;
}

.internal-form-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 18px;
  border-bottom: 1px solid #E5E7EB;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
}

.internal-form-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #FFFFFF;
  color: #374151;
  font-size: 13px;
  font-weight: 800;
}

.internal-form-main {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 560px);
  gap: 28px;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
  align-items: start;
}

.internal-form-intro h1 {
  color: #111827;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.internal-form-intro p {
  margin-top: 14px;
  color: #4B5563;
  font-size: 15px;
  line-height: 1.55;
}

.internal-form-card {
  padding: 22px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(17,24,39,.04);
}

.internal-plate-input {
  text-align: center;
  text-transform: uppercase;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  padding: 16px;
}

.internal-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  margin-top: 6px;
  border-radius: 8px;
}

@media (max-width: 760px) {
  .internal-form-back {
    width: 38px;
    padding: 0;
    justify-content: center;
    overflow: hidden;
    font-size: 0;
    gap: 0;
  }

  .internal-form-back svg {
    color: #374151;
    flex: 0 0 auto;
  }

  .internal-form-main {
    grid-template-columns: 1fr;
    padding: 24px 0;
  }

  .internal-form-card {
    padding: 18px;
  }
}
