.admin-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0, #d9f26e24, transparent 28rem),
    var(--cream);
}

.dashboard {
  max-width: 1440px;
}

.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 18px 0;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(14px);
}

.dashboard-title {
  margin: 56px 0 28px;
}

.dashboard-title h1 {
  font-size: clamp(48px, 6vw, 76px);
  line-height: .95;
}

.title-copy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.add-button {
  min-height: 48px;
  padding-inline: 20px;
  box-shadow: 0 10px 25px #0d5c3d26;
}

.add-button span {
  margin-right: 5px;
  font-size: 20px;
}

.primary,
.quiet,
.danger {
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px #0d5c3d30;
}

.fleet-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.fleet-stats article {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: 104px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #ffffffa6;
}

.fleet-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.fleet-stats strong {
  font: 700 36px/1 Georgia, serif;
  color: var(--green);
}

.filters {
  position: sticky;
  top: 72px;
  z-index: 15;
  padding: 10px 0;
  background: var(--cream);
}

.search-field {
  position: relative;
  flex: 1;
}

.search-field span {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-53%);
  color: var(--muted);
  font-size: 20px;
}

.search-field input {
  width: 100%;
  min-height: 48px;
  padding-left: 44px;
}

.filters select {
  min-height: 48px;
  min-width: 170px;
}

.table-wrap {
  box-shadow: 0 14px 45px #203a2a0c;
}

thead {
  position: static;
}

tbody tr {
  transition: background .15s ease;
}

tbody tr:hover {
  background: #f8faf5;
}

th,
td {
  vertical-align: middle;
}

.id-cell strong {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--green);
}

.vehicle-cell strong {
  font-weight: 720;
}

.renter-input {
  width: 150px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
}

.renter-input:hover {
  border-color: var(--line);
  background: #fff;
}

.renter-input:focus {
  border-color: var(--green);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px #0d5c3d16;
}

.renter-input:disabled {
  cursor: wait;
  opacity: .55;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.row-actions button {
  min-height: 38px;
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 18px 50px #0003;
  font-size: 13px;
  font-weight: 700;
  animation: toast-in .2s ease-out;
}

.toast[data-tone="error"] {
  background: var(--red);
}

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

@media (max-width: 900px) {
  .dashboard {
    padding: 18px 16px 100px;
  }

  .dashboard-header {
    padding: 12px 0;
  }

  .dashboard-header p,
  #user-email {
    display: none;
  }

  .dashboard-title {
    align-items: end;
    margin: 36px 0 22px;
  }

  .dashboard-title h1 {
    font-size: 48px;
  }

  .title-copy {
    max-width: 270px;
  }

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

  .fleet-stats article {
    min-height: 88px;
    padding: 16px;
  }

  .fleet-stats strong {
    font-size: 30px;
  }

  .filters {
    top: 58px;
    flex-direction: row;
    padding: 8px 0 12px;
  }

  .filters select {
    min-width: 132px;
    width: 132px;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px #203a2a0c;
  }

  tbody tr:hover {
    background: #fff;
  }

  tbody td {
    display: grid;
    gap: 6px;
    padding: 0;
    border: 0;
  }

  tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
  }

  .id-cell {
    grid-column: 1;
  }

  .vehicle-cell {
    grid-column: 1 / -1;
    grid-row: 1;
    padding-left: 46px;
  }

  .id-cell {
    grid-row: 1;
    z-index: 1;
  }

  .id-cell::before {
    display: none;
  }

  .renter-cell,
  .vin-cell,
  .row-actions {
    grid-column: 1 / -1;
  }

  .renter-input {
    width: 100%;
    border-color: var(--line);
    background: #fafbf8;
  }

  .mono {
    overflow-wrap: anywhere;
  }

  .row-actions {
    display: flex;
    justify-content: stretch;
    padding-top: 12px;
    border-top: 1px solid #edf0eb;
  }

  .row-actions::before {
    display: none;
  }

  .row-actions button {
    flex: 1;
    min-height: 44px;
  }

  dialog {
    width: min(100% - 16px, 650px);
    max-height: calc(100dvh - 16px);
    margin-bottom: 8px;
  }

  #vehicle-form {
    padding: 24px 20px;
  }

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

  .form-grid .wide {
    grid-column: 1 / -1;
  }

  .form-actions {
    position: sticky;
    bottom: -24px;
    margin: 24px -20px -24px;
    padding: 14px 20px;
    background: #fff;
    border-top: 1px solid var(--line);
  }

  .toast {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 560px) {
  .dashboard-title {
    display: block;
  }

  .add-button {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 40;
    min-height: 52px;
    border-radius: 999px;
  }

  .fleet-stats {
    gap: 8px;
  }

  .filters {
    top: 58px;
  }

  .filters select {
    width: 112px;
    min-width: 112px;
    padding-inline: 9px;
  }

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

  .form-grid .wide {
    grid-column: auto;
  }

  .toast {
    bottom: 82px;
  }
}
