:root {
  color-scheme: light;
  --ink: #202427;
  --muted: #687077;
  --line: #d8dde1;
  --bg: #f4f5f6;
  --panel: #fff;
  --brand: #e30613;
  --brand-dark: #bf0711;
  --accent: #555d63;
  --soft: #f7f8f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  letter-spacing: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 76px;
  padding: 0 clamp(16px, 4vw, 42px);
  background: #fff;
  border-bottom: 3px solid var(--brand);
  box-shadow: 0 1px 2px rgba(32, 36, 39, .06);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(180px, 26vw, 310px);
  max-height: 54px;
  height: auto;
  object-fit: contain;
}

.brand span {
  color: var(--accent);
  padding-left: 14px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fff;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 800;
}

.status.ok {
  border-color: rgba(15, 118, 110, .25);
  color: #0f766e;
  background: #f5fbfa;
}

.status.warn {
  border-color: rgba(227, 6, 19, .28);
  color: var(--brand);
  background: #fff5f5;
}

.shell {
  width: min(1120px, calc(100% - 28px));
  margin: 28px auto 60px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.05;
}

.muted {
  margin: 8px 0 0;
  color: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr);
  gap: 22px;
  align-items: stretch;
  min-height: 360px;
  margin-bottom: 24px;
  padding: clamp(28px, 6vw, 70px);
  border-radius: 8px;
  background: linear-gradient(135deg, #2b2f33 0%, #202427 58%, #e30613 100%);
  color: #fff;
}

.dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, .55fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 24px;
}

.dashboard-head > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(32, 36, 39, .05);
  padding: 24px;
}

.dashboard-head .hero-text {
  color: var(--muted);
}

.dashboard-status {
  display: grid;
  align-content: start;
}

.status-metrics {
  display: grid;
  gap: 12px;
}

.status-metrics div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.status-metrics strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 2rem;
  line-height: 1;
}

.status-metrics span {
  display: block;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 650;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.section-head p {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #fff;
}

.hero h1 {
  max-width: 920px;
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(2rem, 6vw, 4.9rem);
  line-height: 1.02;
  font-weight: 800;
}

.hero-text {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, .9);
  font-size: 1.08rem;
}

.hero-card {
  align-self: stretch;
  display: grid;
  align-content: space-between;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

.hero-metrics {
  display: grid;
  gap: 12px;
}

.hero-metrics div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
}

.hero-metrics strong {
  display: block;
  margin-bottom: 4px;
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
}

.hero-metrics span {
  display: block;
  color: rgba(255, 255, 255, .82);
  font-size: .95rem;
}

.operation-strip,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(32, 36, 39, .05);
}

.operation-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 18px 20px;
}

.operation-strip span,
.operation-strip small,
.empty {
  display: block;
  color: var(--muted);
}

.operation-strip strong {
  display: block;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.25;
}

.panel {
  margin-bottom: 22px;
  padding: 24px;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.15;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: #344054;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

select {
  appearance: auto;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(227, 6, 19, .22);
  outline-offset: 2px;
}

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

.vehicle-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(88px, .45fr) minmax(110px, .6fr) max-content 46px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.vehicle-row.manual {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(88px, .45fr) minmax(110px, .6fr) max-content 46px;
}

.vehicle-row.existing {
  grid-template-columns: minmax(0, 1.6fr) minmax(88px, .45fr) minmax(110px, .6fr);
}

.vehicle-row label {
  margin: 0;
}

.vehicle-title {
  display: grid;
  gap: 3px;
  align-self: center;
}

.vehicle-title strong {
  line-height: 1.2;
}

.vehicle-title span {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
}

.form-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .92rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 15px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
button:hover {
  border-color: #aeb6bd;
  background: #fdfdfd;
}

.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.primary:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.secondary {
  color: var(--accent);
}

.ghost {
  color: var(--accent);
}

.icon {
  width: 46px;
  padding: 0;
  color: var(--accent);
  font-size: 1.35rem;
}

.row-send {
  min-width: 92px;
}

.danger {
  border-color: #d7a3a0;
  background: #fff5f4;
  color: #8f0f13;
}

.danger:hover {
  border-color: #8f0f13;
  background: #fff;
}

.operation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.operation-card {
  display: grid;
  gap: 6px;
  min-height: 140px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.operation-card:hover {
  border-color: var(--brand);
}

.operation-card span {
  color: var(--brand);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.operation-card strong {
  display: block;
  font-size: 1.08rem;
  line-height: 1.25;
}

.operation-card small {
  color: var(--muted);
  font-weight: 650;
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  font-weight: 750;
}

.message.success {
  border-color: rgba(15, 118, 110, .22);
  color: #0f766e;
  background: #f5fbfa;
}

.message.error {
  border-color: rgba(227, 6, 19, .28);
  color: var(--brand);
  background: #fff5f5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 750;
}

pre {
  overflow: auto;
  max-height: 420px;
  max-width: none;
  margin: 16px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #101828;
  color: #f9fafb;
  font-size: .82rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .hero,
  .dashboard-head {
    grid-template-columns: 1fr;
  }

  .hero-card {
    min-height: 220px;
  }
}

@media (max-width: 720px) {
  .site-header {
    height: auto;
    min-height: 68px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand {
    flex: 1 1 auto;
    gap: 10px;
  }

  .brand-logo {
    width: min(190px, 54vw);
  }

  .brand span {
    display: none;
  }

  .status {
    min-height: 42px;
    padding: 0 10px;
    font-size: .82rem;
  }

  .shell {
    width: calc(100% - 16px);
    margin: 16px auto 44px;
  }

  .hero {
    min-height: 0;
    padding: 28px 18px;
  }

  .panel {
    margin-bottom: 14px;
    padding: 16px;
  }

  .operation-strip,
  .page-head,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .vehicle-row,
  .vehicle-row.manual,
  .vehicle-row.existing {
    grid-template-columns: 1fr;
  }

  .actions {
    gap: 8px;
    margin-top: 14px;
  }

  .actions button,
  .row-send,
  .icon {
    width: 100%;
  }
}
