:root {
  --ink: #080d35;
  --navy: #111a70;
  --blue: #1467e8;
  --teal: #008c98;
  --teal-dark: #007582;
  --mint: #e4f7f2;
  --green: #15883e;
  --green-bg: #dcf6df;
  --orange: #9b5200;
  --orange-bg: #fff1d4;
  --red: #ba2636;
  --red-bg: #fff0f1;
  --muted: #6675a5;
  --line: #dbe3f1;
  --surface: #ffffff;
  --canvas: #f6f9fc;
  --shadow: 0 18px 50px rgba(18, 36, 82, .11);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 50% -20%, #fff 0, #f7fbfd 42%, #f1f6fa 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

.topbar {
  min-height: 78px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 max(28px, calc((100vw - 1500px) / 2));
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { width: 312px; max-width: 45vw; height: 58px; }
.topnav { display: flex; gap: 12px; margin: 0 auto; align-self: stretch; }
.topnav__item {
  border: 0;
  background: transparent;
  color: var(--navy);
  padding: 0 22px;
  font-weight: 700;
  font-size: 17px;
  border-bottom: 3px solid transparent;
}
.topnav__item.active { border-bottom-color: var(--teal); }
.badge-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 7px; border-radius: 20px; background: var(--red); color: #fff; font-size: 12px; }
.profile { display: flex; align-items: center; gap: 10px; min-width: 188px; justify-content: flex-end; }
.avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--mint); color: var(--navy); font-weight: 700; }
.profile__name { font-weight: 750; }
.profile__role { color: var(--muted); font-size: 13px; }
.icon-button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); }

.page { width: min(1460px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 96px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1 { margin: 0 0 6px; font-size: clamp(34px, 4vw, 50px); line-height: 1.05; letter-spacing: -.04em; }
h2 { margin: 0; font-size: 27px; letter-spacing: -.025em; }
h3 { margin: 0; font-size: 19px; }
p { line-height: 1.5; }

.btn { min-height: 48px; border-radius: 9px; padding: 0 22px; border: 1px solid transparent; font-weight: 740; display: inline-flex; align-items: center; justify-content: center; gap: 9px; text-decoration: none; }
.btn--primary { color: white; background: linear-gradient(135deg, var(--teal), #009ba5); box-shadow: 0 9px 24px rgba(0,140,152,.2); }
.btn--primary:hover { background: var(--teal-dark); }
.btn--secondary { background: #fff; border-color: var(--teal); color: var(--teal-dark); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--navy); }
.btn--wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: wait; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 24px rgba(23,50,90,.04); }
.panel__head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel__body { padding: 24px; }
.grid-2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.grid-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.search { flex: 1; position: relative; }
.search input { padding-left: 43px; }
.search::before { content: "⌕"; position: absolute; left: 15px; top: 10px; color: var(--muted); font-size: 24px; }
.field { display: grid; gap: 7px; }
.field label, .label { font-weight: 680; font-size: 14px; }
.field input, .field select, .input {
  width: 100%; min-height: 48px; border: 1px solid #c8d3e6; border-radius: 9px; padding: 10px 13px; color: var(--ink); background: #fff; outline: none;
}
.field input:focus, .field select:focus, .input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,140,152,.1); }
.field-help { color: var(--muted); font-size: 12px; min-height: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }

.table-wrap { overflow-x: auto; }
.cases-table { width: 100%; border-collapse: collapse; }
.cases-table th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .055em; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.cases-table td { padding: 17px 16px; border-bottom: 1px solid #e9eef6; vertical-align: middle; }
.cases-table tbody tr { cursor: pointer; transition: background .15s; }
.cases-table tbody tr:hover { background: #f6fbfc; }
.cases-table tbody tr.unread { box-shadow: inset 4px 0 var(--teal); background: #fbfefe; }
.vehicle-name { font-weight: 750; }
.vehicle-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.status--green { color: var(--green); background: var(--green-bg); }
.status--orange { color: var(--orange); background: var(--orange-bg); }
.status--blue { color: #185db8; background: #e7f0ff; }
.status--gray { color: #5a6685; background: #edf1f6; }
.empty { padding: 52px 20px; text-align: center; color: var(--muted); }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.detail-id { font-size: 20px; color: #4e6097; font-weight: 700; }
.definition { display: grid; gap: 0; }
.definition__row { display: grid; grid-template-columns: minmax(130px, .8fr) 1.2fr; gap: 18px; padding: 9px 0; border-bottom: 1px solid #e8edf5; }
.definition__row:last-child { border-bottom: 0; }
.definition dt { color: var(--muted); }
.definition dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.highlight { background: linear-gradient(120deg, #e8f8f5, #f3fbfc); border-radius: 10px; padding: 16px; }
.document-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e8edf5; }
.document-row:last-child { border: 0; }
.pdf { color: #e0202b; font-weight: 800; border: 2px solid currentColor; border-radius: 4px; padding: 3px; font-size: 10px; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.12fr .88fr; }
.login-art { padding: 64px clamp(42px, 7vw, 110px); background: linear-gradient(145deg, #07115a 0%, #0b6183 70%, #08a3a1 115%); color: #fff; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.login-art::after { content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%; border: 90px solid rgba(255,255,255,.06); right: -180px; bottom: -160px; }
.login-art .brand img { filter: brightness(0) invert(1); width: 360px; }
.login-art h1 { max-width: 650px; font-size: clamp(45px, 6vw, 78px); }
.login-art p { font-size: 21px; max-width: 620px; color: #d4eef2; }
.login-card-wrap { display: grid; place-items: center; padding: 38px; }
.login-card { width: min(440px, 100%); }
.login-card h2 { font-size: 36px; margin-bottom: 10px; }
.login-form { display: grid; gap: 18px; margin-top: 32px; }
.demo-note { margin-top: 22px; padding: 14px; border-radius: 10px; background: #eef8f7; color: #365c65; font-size: 13px; }

.wizard { position: fixed; inset: 0; z-index: 50; background: var(--canvas); overflow: auto; }
.wizard .topbar { position: sticky; }
.wizard-page { width: min(1420px, calc(100% - 48px)); margin: auto; padding: 26px 0 108px; }
.steps { display: flex; align-items: center; justify-content: center; gap: 0; margin: 24px auto; max-width: 1100px; }
.step { display: flex; align-items: center; gap: 10px; color: #7884ab; font-weight: 680; }
.step::after { content: ""; width: clamp(28px, 8vw, 115px); height: 1px; background: #ccd6e6; margin: 0 18px; }
.step:last-child::after { display: none; }
.step__number { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #e5ebf4; }
.step.active { color: var(--teal); }
.step.active .step__number, .step.done .step__number { background: var(--teal); color: #fff; }
.wizard-actions { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); padding: 14px max(28px, calc((100vw - 1420px) / 2)); display: flex; justify-content: space-between; gap: 12px; z-index: 55; }
.choice-row { display: flex; gap: 8px; }
.choice { flex: 1; }
.choice input { position: absolute; opacity: 0; }
.choice span { min-height: 46px; display: grid; place-items: center; border: 1px solid #c8d3e6; border-radius: 9px; font-weight: 650; }
.choice input:checked + span { color: var(--teal-dark); border-color: var(--teal); background: #edfbfa; box-shadow: inset 0 0 0 1px var(--teal); }
.vehicle-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: #fbfdff; }
.vehicle-card__title { font-size: 22px; font-weight: 800; margin-bottom: 14px; }
.offer-price { font-size: 44px; font-weight: 820; color: var(--teal-dark); letter-spacing: -.04em; }
.frequency-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 20px; }
.frequency { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 16px 10px; text-align: center; }
.frequency.active { border: 2px solid var(--teal); background: #effbfa; }
.confirm-list { display: grid; gap: 10px; }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.check input { width: 20px; height: 20px; accent-color: var(--teal); flex: 0 0 auto; }

.mobile-shell { max-width: 540px; margin: 0 auto; min-height: 100vh; background: #f8fbfd; box-shadow: 0 0 60px rgba(16,35,70,.12); }
.mobile-head { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 20px 10px; position: sticky; top: 0; z-index: 10; }
.mobile-head .brand img { width: 238px; height: 44px; max-width: 76vw; }
.branch-chip { margin-top: 8px; font-size: 12px; color: var(--muted); }
.mobile-main { padding: 22px 18px 112px; }
.mobile-main h1 { font-size: 31px; }
.mobile-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 18px 0 24px; }
.mobile-step { height: 5px; border-radius: 5px; background: #dce4ef; }
.mobile-step.active, .mobile-step.done { background: var(--teal); }
.mobile-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; overflow: hidden; }
.mobile-card__head { padding: 17px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mobile-card__body { padding: 0 17px 18px; }
.mobile-card.collapsed .mobile-card__body { display: none; }
.mobile-form { display: grid; gap: 14px; }
.mobile-actions { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 12; width: min(540px, 100%); padding: 14px 18px; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); display: flex; gap: 10px; }
.mobile-actions .btn { flex: 1; }
.success-mark { width: 78px; height: 78px; margin: 6px auto 16px; display: grid; place-items: center; border-radius: 50%; background: var(--green-bg); color: var(--green); font-size: 44px; font-weight: 800; }
.payment-amount { text-align: center; background: var(--mint); color: var(--teal-dark); font-size: 35px; font-weight: 800; padding: 15px; border-radius: 12px; }
.payment-options { display: grid; gap: 10px; margin-top: 14px; }
.payment-option { border: 1px solid var(--line); border-radius: 11px; padding: 15px; background: #fff; }
.qr-placeholder { width: 132px; height: 132px; margin: 12px auto; border: 10px solid #fff; outline: 1px solid var(--line); background: repeating-conic-gradient(#06102b 0 25%, #fff 0 50%) 50% / 18px 18px; }
.alert { padding: 13px 14px; border-radius: 10px; font-size: 13px; line-height: 1.45; }
.alert--info { background: #edf5ff; color: #345b8f; }
.alert--success { background: var(--green-bg); color: #176f38; }
.alert--warning { background: var(--orange-bg); color: #744300; }
.alert--error { background: var(--red-bg); color: var(--red); }
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast { min-width: 270px; max-width: 390px; padding: 13px 16px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--teal); border-radius: 9px; box-shadow: var(--shadow); }
.toast--error { border-left-color: var(--red); }
.toast--success { border-left-color: var(--green); }

@media (max-width: 900px) {
  .topnav { order: 3; width: 100%; min-height: 54px; justify-content: center; }
  .topbar { flex-wrap: wrap; padding: 10px 18px 0; }
  .profile { min-width: 0; margin-left: auto; }
  .profile__text { display: none; }
  .page { width: min(100% - 28px, 760px); padding-top: 24px; }
  .grid-2, .grid-equal { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { min-height: 340px; padding: 38px 28px; }
  .login-art h1 { font-size: 45px; }
  .login-art p { font-size: 17px; }
  .login-card-wrap { padding: 40px 24px 70px; }
  .steps .step span:last-child { display: none; }
  .frequency-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .page-head { align-items: stretch; flex-direction: column; }
  .filters { align-items: stretch; flex-direction: column; }
  .form-grid, .grid-3 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .brand img { width: 235px; }
  .topnav__item { padding: 0 10px; font-size: 14px; }
  .wizard-page { width: calc(100% - 28px); }
  .wizard-actions { padding: 12px 14px; }
}
