:root {
  color-scheme: light;
  --ink: #171320;
  --ink-soft: #5f586b;
  --paper: #f7f5f9;
  --surface: #ffffff;
  --surface-soft: #f1edf5;
  --purple-950: #1b0b2a;
  --purple-900: #32134f;
  --purple-800: #49206c;
  --purple-700: #642f91;
  --purple-600: #7941a5;
  --purple-100: #eee4f7;
  --yellow: #f3d447;
  --green: #248164;
  --green-soft: #e1f3ec;
  --red: #b83e51;
  --red-soft: #fbe8eb;
  --border: #e3dde8;
  --shadow: 0 18px 55px rgba(40, 18, 57, 0.1);
  --radius: 18px;
  --sidebar: 238px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--purple-700);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted {
  color: var(--ink-soft);
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  background: linear-gradient(145deg, #8c52b8, #4b1f6f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.brand-lens {
  position: relative;
  width: 22px;
  height: 15px;
  border: 3px solid white;
  border-radius: 5px;
}

.brand-lens::before,
.brand-lens::after {
  position: absolute;
  content: "";
}

.brand-lens::before {
  top: -8px;
  left: 4px;
  width: 8px;
  height: 5px;
  border-radius: 2px 2px 0 0;
  background: white;
}

.brand-lens::after {
  top: 3px;
  left: 7px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: -9px 7px 0 -0.5px white, 9px 7px 0 -0.5px white;
}

.brand-mark-large {
  width: 72px;
  height: 72px;
  margin-bottom: 34px;
  border-radius: 22px;
}

.brand-mark-large .brand-lens {
  width: 36px;
  height: 24px;
  border-width: 4px;
}

.auth-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(380px, 0.9fr) minmax(480px, 1.1fr);
  background: var(--surface);
}

.auth-brand {
  position: relative;
  display: flex;
  overflow: hidden;
  padding: clamp(48px, 7vw, 110px);
  flex-direction: column;
  justify-content: center;
  color: white;
  background:
    radial-gradient(circle at 76% 22%, rgba(169, 103, 210, 0.28), transparent 30%),
    linear-gradient(145deg, #160923 0%, #2d1245 48%, #4b1f6f 100%);
}

.auth-brand::before,
.auth-brand::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
}

.auth-brand::before {
  width: 500px;
  height: 500px;
  right: -330px;
  bottom: -100px;
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.025), 0 0 0 140px rgba(255, 255, 255, 0.018);
}

.auth-brand::after {
  width: 230px;
  height: 230px;
  top: -110px;
  left: -110px;
}

.auth-brand .eyebrow {
  color: #cba8e6;
}

.auth-brand h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 5.5rem);
  font-weight: 740;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.auth-lead {
  max-width: 580px;
  margin: 30px 0 44px;
  color: #d6c9df;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.65;
}

.trust-strip {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: #cbbcd5;
  font-size: 0.77rem;
  font-weight: 650;
}

.trust-strip span::before {
  margin-right: 7px;
  color: #b987d6;
  content: "✓";
}

.auth-card-wrap {
  display: grid;
  padding: 38px;
  place-content: center;
  background:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
    radial-gradient(circle at 80% 20%, var(--purple-100), transparent 35%);
}

.auth-card {
  width: min(100%, 460px);
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 38px;
  color: var(--purple-900);
  font-size: 1.05rem;
}

.auth-heading h2,
.auth-panel h2 {
  margin: 0 0 9px;
  font-size: clamp(2rem, 3vw, 2.65rem);
  letter-spacing: -0.045em;
}

.auth-heading > p:last-child,
.auth-panel > p {
  margin: 0;
  line-height: 1.6;
}

.segmented {
  display: grid;
  padding: 4px;
  margin: 30px 0 24px;
  grid-template-columns: 1fr 1fr;
  border-radius: 12px;
  background: var(--surface-soft);
}

.segment {
  padding: 10px;
  border: 0;
  border-radius: 9px;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 700;
}

.segment.active {
  color: var(--purple-900);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(38, 20, 50, 0.08);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.form-stack label,
.vehicle-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #37303f;
  font-size: 0.84rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--purple-600);
  box-shadow: 0 0 0 4px rgba(111, 56, 161, 0.11);
}

input::placeholder,
textarea::placeholder {
  color: #9b94a1;
}

.field-hint {
  margin: -7px 0 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.5;
}

.form-link {
  align-self: flex-end;
  margin-top: -7px;
}

.button {
  display: inline-flex;
  min-height: 45px;
  padding: 11px 18px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 760;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--purple-700), var(--purple-800));
  box-shadow: 0 10px 24px rgba(89, 38, 127, 0.21);
}

.button-secondary {
  border-color: var(--border);
  color: var(--purple-900);
  background: var(--surface);
}

.button-danger {
  border-color: #efcbd1;
  color: var(--red);
  background: var(--red-soft);
}

.button-wide {
  width: 100%;
}

.button-small {
  min-height: 40px;
  padding: 8px 13px;
  font-size: 0.8rem;
}

.text-button {
  padding: 3px;
  border: 0;
  color: var(--purple-700);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 750;
}

.privacy-footnote {
  margin: 30px 0 0;
  color: #8b8391;
  font-size: 0.72rem;
  text-align: center;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar);
  padding: 25px 18px 18px;
  flex-direction: column;
  color: #dcd0e5;
  background: linear-gradient(180deg, #1a0b28 0%, #27103b 62%, #190b25 100%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-size: 0.97rem;
  text-decoration: none;
}

.sidebar-brand b {
  color: #b88bd7;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.primary-nav {
  display: flex;
  margin-top: 48px;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  width: 100%;
  padding: 12px 13px;
  align-items: center;
  gap: 13px;
  border: 0;
  border-radius: 10px;
  color: #bcaec6;
  background: transparent;
  font-weight: 650;
  text-align: left;
}

.nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  color: #ac83c9;
  background: rgba(255, 255, 255, 0.055);
}

.nav-item:hover,
.nav-item.active {
  color: white;
  background: rgba(255, 255, 255, 0.09);
}

.nav-item.active .nav-icon {
  color: var(--purple-950);
  background: #c89be6;
}

.sidebar-footer {
  padding-top: 15px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-button {
  display: flex;
  width: 100%;
  padding: 5px;
  align-items: center;
  gap: 10px;
  border: 0;
  color: white;
  background: transparent;
  text-align: left;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: white;
  background: linear-gradient(145deg, #8e52b7, #5a277f);
  font-size: 0.77rem;
  font-weight: 800;
}

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

.profile-copy b {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy small {
  color: #a897b3;
  font-size: 0.68rem;
  text-transform: capitalize;
}

.mobile-header,
.bottom-nav {
  display: none;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: 38px clamp(24px, 4.2vw, 68px) 60px;
}

.view {
  width: min(100%, 1350px);
  margin: 0 auto;
}

.page-heading {
  display: flex;
  margin-bottom: 26px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 3.15rem);
  font-weight: 740;
  letter-spacing: -0.05em;
  line-height: 1;
}

.status-pill {
  display: inline-flex;
  padding: 8px 11px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 0.73rem;
  font-weight: 700;
}

.status-pill > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a9a3ae;
}

.status-pill.secure {
  border-color: #c8e6da;
  color: #266d58;
  background: var(--green-soft);
}

.status-pill.secure > span {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(36, 129, 100, 0.12);
}

.scan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.65fr);
  gap: 22px;
}

.camera-card,
.panel,
.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(41, 24, 52, 0.045);
}

.camera-card {
  overflow: hidden;
}

.camera-stage {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 490px;
  place-items: center;
  color: white;
  background:
    linear-gradient(135deg, rgba(68, 31, 95, 0.4), rgba(13, 9, 17, 0.7)),
    repeating-linear-gradient(125deg, #1f1725 0 30px, #251b2b 30px 60px);
}

.camera-stage.scanning .camera-placeholder {
  display: none;
}

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

.camera-placeholder {
  position: relative;
  z-index: 2;
  width: min(380px, 75%);
  text-align: center;
}

.camera-placeholder h2 {
  margin: 14px 0 6px;
  font-size: 1.5rem;
}

.camera-placeholder p {
  margin: 0;
  color: #bfb4c6;
  line-height: 1.55;
}

.camera-symbol {
  font-size: 3.4rem;
  color: #bb8bd7;
}

.plate-guide {
  position: absolute;
  z-index: 3;
  display: none;
  width: min(76%, 620px);
  aspect-ratio: 4.7 / 1;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 10px;
  box-shadow: 0 0 0 999px rgba(9, 5, 12, 0.28), inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.camera-stage.scanning .plate-guide {
  display: block;
}

.plate-guide::before,
.plate-guide::after {
  position: absolute;
  width: 25px;
  height: 25px;
  content: "";
}

.plate-guide::before {
  top: -5px;
  left: -5px;
  border-top: 5px solid var(--yellow);
  border-left: 5px solid var(--yellow);
  border-radius: 8px 0 0;
}

.plate-guide::after {
  right: -5px;
  bottom: -5px;
  border-right: 5px solid var(--yellow);
  border-bottom: 5px solid var(--yellow);
  border-radius: 0 0 8px;
}

.plate-guide span {
  position: absolute;
  top: calc(100% + 13px);
  left: 50%;
  padding: 6px 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  color: white;
  background: rgba(17, 10, 22, 0.7);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.scan-progress {
  position: absolute;
  z-index: 4;
  bottom: 24px;
  left: 50%;
  display: flex;
  padding: 8px 12px;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(21, 12, 27, 0.76);
  backdrop-filter: blur(8px);
}

.scan-progress span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; transform: scale(0.75); }
}

.camera-actions {
  display: flex;
  padding: 17px 18px 8px;
  justify-content: center;
  gap: 10px;
}

.privacy-line {
  margin: 5px 18px 17px;
  color: #756d7b;
  font-size: 0.71rem;
  text-align: center;
}

.privacy-line span {
  margin-right: 5px;
  color: var(--green);
}

.scan-side {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.panel {
  padding: 22px;
}

.panel-heading,
.fleet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2,
.manual-panel h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
}

.panel-heading p {
  margin: 5px 0 0;
  font-size: 0.82rem;
}

.compact-form {
  margin-top: 18px;
  gap: 12px;
}

.plate-input {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.detection-card {
  padding: 22px;
  border: 1px solid #d5c1e5;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #f8f3fc, #fff);
  box-shadow: 0 10px 30px rgba(75, 31, 109, 0.08);
}

.number-plate {
  display: inline-flex;
  min-width: 190px;
  padding: 10px 15px 9px 24px;
  justify-content: center;
  border: 3px solid #18151b;
  border-radius: 6px;
  color: #111;
  background: var(--yellow);
  box-shadow: inset 7px 0 #2d6fb4;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.45rem;
  letter-spacing: 0.07em;
  line-height: 1;
  text-transform: uppercase;
}

.number-plate.small {
  min-width: 150px;
  padding: 8px 11px 7px 19px;
  font-size: 1.05rem;
}

.confidence-row {
  display: flex;
  margin: 15px 0;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.confidence-row b {
  color: var(--green);
}

.retention-note {
  display: flex;
  padding: 16px;
  align-items: flex-start;
  gap: 13px;
  border: 1px solid #e5daf0;
  border-radius: 14px;
  background: #f5effa;
}

.retention-icon {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: white;
  background: var(--purple-700);
  font-size: 0.78rem;
  font-weight: 850;
}

.retention-note b {
  font-size: 0.8rem;
}

.retention-note p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.45;
}

.recent-panel {
  margin-top: 22px;
}

.recent-list {
  display: grid;
  margin-top: 14px;
  gap: 8px;
}

.recent-item {
  display: grid;
  padding: 11px 3px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--border);
}

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

.mini-plate {
  padding: 5px 7px;
  border: 2px solid #17151a;
  border-radius: 4px;
  background: var(--yellow);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.recent-item b,
.recent-item small {
  display: block;
}

.recent-item b {
  font-size: 0.83rem;
}

.recent-item small,
.empty-copy {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.empty-copy {
  margin: 10px 0;
}

.stats-grid {
  display: grid;
  margin-bottom: 20px;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-card {
  display: grid;
  padding: 18px 20px;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 12px;
}

.stat-card span,
.stat-card small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.stat-card strong {
  grid-row: span 2;
  color: var(--purple-900);
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.fleet-panel {
  padding: 0;
  overflow: hidden;
}

.fleet-toolbar {
  padding: 17px 19px;
  border-bottom: 1px solid var(--border);
}

.search-field {
  position: relative;
  width: min(100%, 430px);
}

.search-field input {
  padding: 10px 38px 10px 13px;
  background: var(--paper);
}

.search-field > span:last-child {
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  color: #8e8694;
}

.table-scroll {
  overflow-x: auto;
}

.fleet-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.fleet-table th,
.fleet-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.fleet-table th {
  color: #817987;
  background: #fbfafc;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.fleet-table td {
  font-size: 0.79rem;
}

.fleet-table tbody tr:hover {
  background: #fcfafd;
}

.vehicle-name b,
.vehicle-name small,
.time-cell b,
.time-cell small {
  display: block;
}

.vehicle-name small,
.time-cell small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.retention-chip,
.role-chip {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  color: #675c6e;
  background: var(--surface-soft);
  font-size: 0.68rem;
  font-weight: 750;
}

.retention-chip.saved {
  color: #226d57;
  background: var(--green-soft);
}

.row-open {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  color: var(--purple-700);
  background: var(--purple-100);
}

.empty-state {
  padding: 60px 20px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state > span {
  color: #b098bf;
  font-size: 2.8rem;
}

.empty-state h2 {
  margin: 8px 0 5px;
  color: var(--ink);
  font-size: 1.1rem;
}

.empty-state p {
  margin: 0;
  font-size: 0.78rem;
}

.map-frame {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 180px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #e9e4ec;
  box-shadow: var(--shadow);
}

#fleet-map {
  position: absolute;
  inset: 0;
}

.map-key {
  position: absolute;
  z-index: 500;
  right: 14px;
  bottom: 14px;
  display: flex;
  padding: 9px 12px;
  gap: 13px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 20px rgba(35, 25, 42, 0.12);
  font-size: 0.67rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.key-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
}

.key-dot.saved { background: var(--green); }
.key-dot.expiring { background: var(--purple-600); }

.vehicle-marker {
  display: grid;
  width: 35px !important;
  height: 35px !important;
  margin: -17px 0 0 -17px !important;
  place-items: center;
  border: 3px solid white;
  border-radius: 12px 12px 12px 3px;
  color: white;
  background: var(--purple-700);
  box-shadow: 0 5px 15px rgba(49, 20, 71, 0.28);
  font-size: 0.68rem;
  font-weight: 800;
  transform: rotate(-45deg);
}

.vehicle-marker.saved {
  background: var(--green);
}

.vehicle-marker span {
  transform: rotate(45deg);
}

.map-popup b,
.map-popup span {
  display: block;
}

.map-popup b {
  font-size: 0.86rem;
}

.map-popup span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.team-list {
  display: grid;
  margin-top: 16px;
}

.team-row {
  display: grid;
  padding: 14px 0;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

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

.team-person {
  display: flex;
  align-items: center;
  gap: 11px;
}

.team-person b,
.team-person small {
  display: block;
}

.team-person small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.team-row select {
  width: auto;
  padding: 8px 31px 8px 10px;
  font-size: 0.75rem;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.65fr) minmax(400px, 1.35fr);
  gap: 20px;
}

.account-card {
  text-align: center;
}

.avatar-large {
  width: 70px;
  height: 70px;
  margin: 3px auto 15px;
  border-radius: 20px;
  font-size: 1.2rem;
}

.account-card h2 {
  margin: 0 0 4px;
}

.account-card > p {
  margin: 0 0 10px;
  font-size: 0.8rem;
}

.account-card .compact-form {
  margin: 28px 0 12px;
  text-align: left;
}

.policy-card h2 {
  margin: 0;
  font-size: 1.5rem;
}

.policy-list {
  display: grid;
  padding: 0;
  margin: 22px 0 0;
  list-style: none;
}

.policy-list li {
  display: flex;
  padding: 17px 0;
  gap: 14px;
  border-top: 1px solid var(--border);
}

.policy-list li > span {
  color: var(--purple-600);
  font-size: 0.72rem;
  font-weight: 850;
}

.policy-list b {
  font-size: 0.86rem;
}

.policy-list p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.5;
}

.vehicle-dialog {
  width: min(720px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  padding: 26px;
  overflow-y: auto;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 35px 90px rgba(23, 11, 31, 0.32);
}

.vehicle-dialog::backdrop {
  background: rgba(20, 10, 27, 0.64);
  backdrop-filter: blur(5px);
}

.dialog-close {
  position: absolute;
  top: 17px;
  right: 17px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #6f6675;
  background: var(--surface-soft);
  font-size: 1.4rem;
}

.dialog-heading {
  margin-bottom: 23px;
}

.dialog-heading .number-plate {
  margin: 3px 0 9px;
}

.dialog-heading > p:last-child {
  margin: 0;
  font-size: 0.75rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.full-field {
  grid-column: 1 / -1;
}

.save-toggle {
  display: flex !important;
  padding: 14px;
  margin: 19px 0;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 11px !important;
  border: 1px solid #dccbe8;
  border-radius: 12px;
  background: #faf6fd;
}

.save-toggle input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--purple-700);
}

.save-toggle b,
.save-toggle small {
  display: block;
}

.save-toggle small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-weight: 500;
  line-height: 1.4;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.history-section {
  padding-top: 22px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}

.history-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: grid;
  padding: 10px 12px;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border-radius: 10px;
  background: var(--paper);
  font-size: 0.74rem;
}

.history-item small {
  color: var(--ink-soft);
}

.toast-region {
  position: fixed;
  z-index: 2000;
  top: max(18px, env(safe-area-inset-top));
  right: 18px;
  display: grid;
  width: min(390px, calc(100% - 36px));
  gap: 8px;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--purple-600);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 15px 40px rgba(31, 18, 39, 0.18);
  font-size: 0.79rem;
  line-height: 1.45;
  animation: toast-in 220ms ease-out;
  backdrop-filter: blur(10px);
}

.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
}

@media (max-width: 1100px) {
  :root {
    --sidebar: 82px;
  }

  .sidebar-brand > span,
  .nav-item > span:last-child,
  .profile-copy {
    display: none;
  }

  .sidebar {
    align-items: center;
    padding-inline: 13px;
  }

  .primary-nav {
    width: 100%;
  }

  .nav-item {
    justify-content: center;
  }

  .profile-button {
    justify-content: center;
  }

  .scan-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(250px, 0.7fr);
  }

  .camera-stage {
    min-height: 430px;
  }
}

@media (max-width: 860px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-card-wrap {
    min-height: 100vh;
    padding: 38px 22px;
    place-content: center;
  }

  .mobile-brand {
    display: flex;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    z-index: 600;
    top: 0;
    display: flex;
    height: calc(66px + env(safe-area-inset-top));
    padding: calc(12px + env(safe-area-inset-top)) 18px 10px;
    align-items: center;
    justify-content: space-between;
    color: white;
    background: rgba(29, 12, 44, 0.97);
    backdrop-filter: blur(14px);
  }

  .mobile-header .brand-mark {
    width: 37px;
    height: 37px;
  }

  .mobile-header .avatar-button {
    border: 0;
  }

  .workspace {
    margin-left: 0;
    padding: 29px 20px calc(94px + env(safe-area-inset-bottom));
  }

  .bottom-nav {
    position: fixed;
    z-index: 700;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(28, 12, 42, 0.98);
    backdrop-filter: blur(16px);
  }

  .bottom-nav button {
    display: flex;
    min-height: 49px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border: 0;
    border-radius: 10px;
    color: #9f90aa;
    background: transparent;
    font-size: 0.61rem;
    font-weight: 750;
  }

  .bottom-nav button span {
    font-size: 1.15rem;
  }

  .bottom-nav button.active {
    color: #dfbdf1;
    background: rgba(255, 255, 255, 0.07);
  }

  .scan-layout,
  .account-grid {
    grid-template-columns: 1fr;
  }

  .scan-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .retention-note {
    grid-column: 1 / -1;
  }

  .map-frame {
    min-height: calc(100vh - 245px);
  }
}

@media (max-width: 600px) {
  .workspace {
    padding: 24px 14px calc(91px + env(safe-area-inset-bottom));
  }

  .page-heading {
    margin-bottom: 20px;
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .page-heading h1 {
    font-size: 2.2rem;
  }

  .page-heading > .button {
    width: 100%;
  }

  .camera-stage {
    min-height: 365px;
  }

  .plate-guide {
    width: 83%;
  }

  .camera-actions {
    flex-direction: column;
  }

  .camera-actions .button {
    width: 100%;
  }

  .scan-side {
    display: flex;
  }

  .panel,
  .detection-card {
    padding: 18px;
  }

  .recent-panel {
    padding: 18px;
  }

  .recent-item {
    grid-template-columns: auto 1fr;
  }

  .recent-item > time {
    grid-column: 2;
    color: var(--ink-soft);
    font-size: 0.68rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card:last-child {
    grid-column: 1 / -1;
  }

  .fleet-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .fleet-table th:nth-child(2),
  .fleet-table td:nth-child(2),
  .fleet-table th:nth-child(4),
  .fleet-table td:nth-child(4) {
    display: none;
  }

  .fleet-table th,
  .fleet-table td {
    padding: 12px 11px;
  }

  .mini-plate {
    font-size: 0.66rem;
  }

  .map-frame {
    min-height: calc(100vh - 225px);
    border-radius: 14px;
  }

  .map-key {
    right: 9px;
    bottom: 9px;
    flex-direction: column;
    gap: 5px;
  }

  .team-row {
    grid-template-columns: 1fr auto;
  }

  .team-row .button {
    grid-column: 1 / -1;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .full-field {
    grid-column: auto;
  }

  .vehicle-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 14px);
    padding: 22px 17px calc(22px + env(safe-area-inset-bottom));
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions .button {
    width: 100%;
  }

  .toast-region {
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    width: calc(100% - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
