:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #d1d5db;
  --primary: #b91c1c;
  --primary-dark: #991b1b;
  --green: #166534;
  --green-bg: #dcfce7;
  --blue: #1d4ed8;
  --blue-bg: #dbeafe;
  --shadow: 0 20px 60px rgba(17, 24, 39, .14);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--blue); }
button, input, textarea { font: inherit; }
button, .button-link { min-height: 48px; }
button { cursor: pointer; }

.primary, .secondary, .complete-button, .button-link, .upload-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 12px 20px; font-weight: 750; text-decoration: none; border: 1px solid transparent;
}
.primary { background: var(--primary); color: white; }
.primary:hover { background: var(--primary-dark); }
.secondary { background: white; border-color: var(--border); color: var(--text); }
.complete-button { background: var(--green); color: white; min-width: 180px; }
.text-button { border: 0; background: transparent; color: var(--muted); text-decoration: underline; }

.flash-stack { position: fixed; z-index: 100; top: 16px; left: 50%; transform: translateX(-50%); width: min(92vw, 700px); }
.flash { border-radius: 12px; padding: 14px 18px; margin-bottom: 8px; box-shadow: var(--shadow); background: white; }
.flash-success { border-left: 5px solid var(--green); }
.flash-error { border-left: 5px solid var(--primary); }

.kiosk-body { min-height: 100vh; background: radial-gradient(circle at top, #374151 0, #111827 50%, #030712 100%); }
.kiosk-shell { min-height: 100vh; padding: 24px; display: grid; place-items: center; }
.kiosk-card { width: min(100%, 760px); min-height: min(650px, calc(100vh - 48px)); padding: clamp(28px, 6vw, 68px); border-radius: 28px; background: rgba(255,255,255,.98); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; }
.brand-mark { width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; background: var(--primary); color: white; font-weight: 900; letter-spacing: -.04em; font-size: 24px; margin-bottom: 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-size: 12px; font-weight: 800; margin: 0 0 8px; }
.step { display: none; }
.step.active { display: block; animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
.kiosk-card h1 { margin: 0 0 16px; font-size: clamp(38px, 7vw, 68px); line-height: 1; letter-spacing: -.04em; }
.kiosk-card p { font-size: clamp(18px, 3vw, 25px); color: var(--muted); }
.kiosk-card label:not(.consent-row) { display: block; font-size: clamp(28px, 5vw, 48px); line-height: 1.1; font-weight: 800; letter-spacing: -.025em; margin: 28px 0 24px; }
.kiosk-card input[type="text"], .kiosk-card input[type="tel"], .kiosk-card input[type="email"] { width: 100%; font-size: clamp(22px, 4vw, 34px); padding: 18px 20px; border: 2px solid var(--border); border-radius: 16px; outline: none; }
.kiosk-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(185,28,28,.12); }
.giant { width: 100%; min-height: 80px; font-size: 28px; margin-top: 30px; }
.admin-link { display: block; text-align: center; color: var(--muted); margin-top: 24px; font-size: 14px; }
.progress { height: 8px; border-radius: 999px; background: #e5e7eb; overflow: hidden; margin-bottom: 42px; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.step-actions { display: flex; gap: 12px; justify-content: space-between; margin-top: 36px; }
.step-actions button { min-width: 130px; font-size: 18px; }
.field-help { margin-top: -12px !important; font-size: 17px !important; }
.review-list { margin: 24px 0; }
.review-list div { padding: 14px 0; border-bottom: 1px solid #e5e7eb; }
.review-list dt { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.review-list dd { margin: 4px 0 0; font-size: 22px; font-weight: 700; }
.consent-row { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; color: var(--muted); }
.consent-row input { width: 24px; height: 24px; flex: 0 0 auto; }
.success-card { text-align: center; align-items: center; }
.success-icon { width: 94px; height: 94px; border-radius: 50%; display: grid; place-items: center; background: var(--green-bg); color: var(--green); font-size: 52px; font-weight: 900; margin-bottom: 22px; }

.admin-body { min-height: 100vh; }
.admin-header { background: #111827; color: white; padding: 28px max(24px, calc((100vw - 1240px)/2)); display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.admin-header h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.035em; }
.admin-header p { margin: 5px 0 0; color: #d1d5db; }
.admin-header .eyebrow { color: #9ca3af; }
.admin-header.compact { padding-top: 22px; padding-bottom: 22px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.admin-main, .detail-main { width: min(1240px, calc(100% - 32px)); margin: 28px auto 60px; }
.tabs { display: flex; gap: 8px; padding: 5px; border-radius: 14px; background: #e5e7eb; width: fit-content; }
.tab { padding: 11px 18px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 800; }
.tab.active { background: white; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.tab span { padding: 2px 7px; border-radius: 999px; background: #f3f4f6; font-size: 12px; }
.search-bar { display: flex; gap: 10px; margin: 22px 0; }
.search-bar input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; }
.record-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.record-card, .panel, .login-card { background: var(--surface); border: 1px solid #e5e7eb; border-radius: 18px; box-shadow: 0 8px 30px rgba(17,24,39,.06); }
.record-card { padding: 20px; }
.record-topline, .card-footer, .panel-heading, .status-panel { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.record-topline time { color: var(--muted); font-size: 13px; }
.record-card h2 { margin: 18px 0 4px; font-size: 25px; }
.vehicle-line { font-weight: 700; margin-top: 0; }
.card-footer { border-top: 1px solid #e5e7eb; margin-top: 18px; padding-top: 16px; color: var(--muted); }
.status-pill { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.status-pill.active { background: var(--blue-bg); color: var(--blue); }
.status-pill.completed { background: var(--green-bg); color: var(--green); }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 20px; background: white; border: 1px dashed var(--border); border-radius: 18px; color: var(--muted); }
.empty-state.small { padding: 24px; }

.detail-main { display: grid; gap: 18px; }
.panel { padding: clamp(18px, 3vw, 30px); }
.panel-heading { margin-bottom: 20px; }
.panel h2 { margin: 0; font-size: 27px; }
.muted { color: var(--muted); font-size: 13px; }
.back-link { color: #d1d5db; text-decoration: none; display: inline-block; margin-bottom: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel label { display: grid; gap: 7px; font-weight: 750; margin-bottom: 16px; }
.panel input, .panel textarea { width: 100%; border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; background: white; outline: none; }
.panel textarea { resize: vertical; line-height: 1.45; }
.panel input:focus, .panel textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(185,28,28,.1); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.form-actions.split { justify-content: space-between; }
.upload-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.upload-button { position: relative; overflow: hidden; background: var(--primary); color: white; cursor: pointer; }
.upload-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.photo-card { margin: 0; border: 1px solid #e5e7eb; border-radius: 14px; overflow: hidden; background: #f9fafb; }
.photo-card img { display: block; width: 100%; height: 170px; object-fit: cover; }
.photo-card form { padding: 8px; }
.photo-card button { width: 100%; min-height: 36px; border: 0; background: transparent; color: var(--primary); }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 12px 14px; border-radius: 11px; }
.estimate-panel textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.status-panel { border-left: 6px solid var(--green); }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #111827; }
.login-card { width: min(100%, 430px); padding: 34px; }
.login-card h1 { margin: 0 0 24px; }
.login-card label { display: grid; gap: 8px; font-weight: 750; }
.login-card input { width: 100%; padding: 13px; border: 1px solid var(--border); border-radius: 11px; margin-bottom: 16px; }
.login-card .primary { width: 100%; }
.login-card > a { display: block; text-align: center; margin-top: 20px; color: var(--muted); }

@media (max-width: 700px) {
  .kiosk-shell { padding: 0; }
  .kiosk-card { min-height: 100vh; border-radius: 0; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; justify-content: space-between; }
  .search-bar { flex-wrap: wrap; }
  .search-bar input { flex-basis: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .panel-heading, .status-panel { align-items: flex-start; flex-direction: column; }
  .panel-heading form, .panel-heading .primary { width: 100%; }
  .form-actions.split { flex-direction: column; }
  .form-actions.split button { width: 100%; }
}

.setup-body { background: #111827; min-height: 100vh; }
.setup-shell { width: min(900px, calc(100% - 28px)); margin: 32px auto; }
.setup-card { background: white; border-radius: 22px; padding: clamp(24px, 5vw, 50px); box-shadow: var(--shadow); }
.setup-card h1 { margin: 0 0 12px; font-size: clamp(36px, 6vw, 58px); letter-spacing: -.04em; }
.setup-card h2 { margin: 30px 0 12px; }
.setup-card label { display: grid; gap: 7px; font-weight: 750; margin-bottom: 16px; }
.setup-card input, .setup-card textarea { width: 100%; border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; }
.setup-message { padding: 15px 17px; border-radius: 12px; margin: 20px 0; }
.setup-message.success { background: var(--green-bg); color: var(--green); }
.setup-message.error { background: #fee2e2; color: #991b1b; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.instructions { line-height: 1.7; }
code { background: #f3f4f6; padding: 2px 5px; border-radius: 5px; }
.upload-button.choose { background: white; color: var(--text); border-color: var(--border); }
@media (max-width: 700px) { .setup-shell { width: 100%; margin: 0; } .setup-card { min-height: 100vh; border-radius: 0; } }
