.admin-body {
  background: #eef3f1;
  overflow-x: hidden;
}

.admin-topbar {
  --vstp-blue: #006b86;
  --vstp-red: #ec0037;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 46px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.admin-topbar .brand img {
  width: min(250px, 44vw);
}

.admin-topbar nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-topbar a {
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.admin-icon-nav a {
  width: 78px;
  min-height: 64px;
  display: grid;
  grid-template-rows: 34px auto;
  align-items: center;
  justify-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 6px 6px;
  color: var(--vstp-blue);
  background: #f8fbfb;
  border: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.05;
  text-align: center;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.admin-icon-nav a:hover,
.admin-icon-nav a:focus-visible {
  color: #fff;
  background: var(--vstp-blue);
  border-color: var(--vstp-blue);
  transform: translateY(-1px);
}

.admin-icon-nav a:first-child,
.admin-icon-nav a:last-child {
  color: var(--vstp-red);
}

.admin-icon-nav a:first-child:hover,
.admin-icon-nav a:first-child:focus-visible,
.admin-icon-nav a:last-child:hover,
.admin-icon-nav a:last-child:focus-visible {
  color: #fff;
  background: var(--vstp-red);
  border-color: var(--vstp-red);
}

.admin-icon-nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-icon-nav span {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}

.admin-shell {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 4vw, 42px);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-card img {
  width: 260px;
  max-width: 100%;
}

.login-card h1 {
  margin: 0;
  font-size: 34px;
}

.login-card p {
  margin: 0;
  color: var(--muted);
}

.admin-alert {
  padding: 12px;
  color: #8f1f1f;
  background: #ffe7e7;
  border: 1px solid #f1bbbb;
  font-weight: 850;
}

.admin-back-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: #f5f7f8;
  border: 1px solid var(--line);
  font-weight: 900;
  text-decoration: none;
}

.admin-hero,
.admin-panel,
.admin-metrics article {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: clamp(22px, 4vw, 42px);
}

.admin-hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.98;
}

.admin-hero p:not(.eyebrow) {
  max-width: 780px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.occupancy-ring {
  width: 156px;
  height: 156px;
  display: grid;
  place-content: center;
  text-align: center;
  color: #fff;
  background: var(--ink);
  border: 8px solid var(--pink);
  border-radius: 50%;
}

.occupancy-ring strong {
  font-size: 42px;
  line-height: 1;
}

.occupancy-ring span {
  color: rgba(255, 255, 255, 0.72);
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 12px;
}

.admin-metrics article {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 18px;
}

.admin-metrics span {
  color: var(--muted);
  font-weight: 800;
}

.admin-metrics strong {
  color: var(--pink);
  font-size: 30px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-panel {
  padding: 20px;
}

.admin-panel.wide {
  grid-column: 1 / -1;
}

.admin-panel h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.report-panel {
  display: grid;
  gap: 18px;
}

.report-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.report-head h2 {
  margin: 0;
}

.report-filter {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 0;
}

.report-filter label {
  min-width: 150px;
}

.report-filter input {
  min-height: 42px;
}

.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.report-kpis article {
  display: grid;
  gap: 8px;
  min-height: 108px;
  padding: 18px;
  background: #f5f7f8;
  border: 1px solid var(--line);
}

.report-kpis span {
  color: var(--muted);
  font-weight: 850;
}

.report-kpis strong {
  color: var(--ink);
  font-size: 28px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.chart-card {
  display: grid;
  gap: 14px;
  min-height: 270px;
  padding: 18px;
  background: #f8faf9;
  border: 1px solid var(--line);
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card h3 {
  margin: 0;
  font-size: 18px;
}

.combo-chart {
  min-height: 230px;
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 12px 8px 0;
  overflow-x: auto;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.combo-day {
  min-width: 34px;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.bar-stack {
  height: 190px;
  display: flex;
  align-items: end;
  gap: 3px;
}

.bar {
  width: 10px;
  display: block;
}

.bar.reservations,
.legend-dot.reservations {
  background: var(--pink);
}

.bar.revenue,
.legend-dot.revenue {
  background: var(--green);
}

.combo-day span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.chart-legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
}

.horizontal-chart {
  display: grid;
  gap: 13px;
}

.hbar-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
}

.hbar-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hbar-row b {
  height: 13px;
  display: block;
  background: #e5ece9;
}

.hbar-row i {
  height: 100%;
  display: block;
  background: var(--pink);
}

.vehicle-chart .hbar-row i {
  background: var(--green);
}

.hbar-row strong {
  text-align: right;
}

.empty-report {
  margin: auto;
  color: var(--muted);
  font-weight: 850;
}

.admin-table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.state {
  display: inline-flex;
  padding: 5px 8px;
  color: #fff;
  background: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.state.available {
  background: var(--green);
}

.state.occupied {
  background: var(--danger);
}

.state.reserved {
  background: var(--amber);
}

.state.blocked {
  background: var(--ink);
}

.dot.blocked {
  background: var(--ink);
}

.live-map-panel {
  display: grid;
  gap: 14px;
}

.live-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.admin-refresh {
  min-height: 40px;
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.live-legend {
  justify-content: flex-start;
}

.live-map-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  background: #edf3f0;
  -webkit-overflow-scrolling: touch;
}

.live-map-canvas {
  position: relative;
  min-width: 1700px;
  aspect-ratio: 4100 / 2105;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(23, 32, 40, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 32, 40, 0.045) 1px, transparent 1px),
    #f7faf8;
  background-size: 42px 42px;
}

.live-map-canvas::before {
  content: "";
  position: absolute;
  left: 5.6%;
  right: 11.6%;
  top: 21%;
  bottom: 15%;
  border: 4px solid rgba(224, 0, 122, 0.72);
  border-radius: 10px 10px 34px 34px;
  pointer-events: none;
}

.live-road {
  position: absolute;
  display: grid;
  place-items: center;
  color: rgba(23, 32, 40, 0.5);
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed rgba(23, 32, 40, 0.24);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.live-road span {
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.9);
}

.live-road i {
  position: absolute;
  width: 52px;
  height: 14px;
}

.live-road i::before,
.live-road i::after {
  content: "";
  position: absolute;
}

.live-road i::before {
  left: 0;
  right: 8px;
  top: 6px;
  height: 3px;
  background: rgba(23, 32, 40, 0.32);
}

.live-road i::after {
  right: 0;
  top: 1px;
  width: 11px;
  height: 11px;
  border-top: 3px solid rgba(23, 32, 40, 0.32);
  border-right: 3px solid rgba(23, 32, 40, 0.32);
  transform: rotate(45deg);
}

.live-road-upper {
  left: 14%;
  right: 17%;
  top: 35%;
  height: 8%;
}

.live-road-upper i:nth-of-type(1) {
  left: 20%;
}

.live-road-upper i:nth-of-type(2) {
  left: 46%;
}

.live-road-upper i:nth-of-type(3) {
  left: 72%;
}

.live-road-lower {
  left: 13%;
  right: 22%;
  top: 58%;
  height: 8%;
}

.live-road-lower i {
  transform: rotate(180deg);
}

.live-road-lower i:nth-of-type(1) {
  left: 32%;
}

.live-road-lower i:nth-of-type(2) {
  left: 62%;
}

.live-control {
  position: absolute;
  left: 52.6%;
  top: 43.2%;
  width: 7.5%;
  height: 18%;
  display: grid;
  place-content: center;
  color: #fff;
  background: var(--ink);
  border: 4px solid #fff;
  font-weight: 950;
  z-index: 2;
}

.live-gate {
  position: absolute;
  bottom: 12.6%;
  display: grid;
  gap: 7px;
  justify-items: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  z-index: 2;
}

.live-gate b {
  width: 98px;
  height: 10px;
  display: block;
  background: repeating-linear-gradient(135deg, #111 0 12px, #ffd447 12px 24px);
  border: 2px solid #fff;
}

.live-entry {
  left: 43.8%;
}

.live-exit {
  left: 56.4%;
}

#adminLiveSpots {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.live-spot {
  position: absolute;
  width: var(--spot-w, 6.6%);
  height: var(--spot-h, 4.8%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(8, 122, 77, 0.72);
  background: rgba(16, 166, 106, 0.26);
  color: var(--ink);
  transform: translate(-50%, -50%) rotate(var(--angle));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.8), 0 8px 14px rgba(23, 32, 40, 0.08);
}

.live-spot span {
  transform: rotate(calc(var(--angle) * -1));
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  font-weight: 950;
}

.live-spot.tractor {
  --spot-w: 3.6%;
  --spot-h: 4.6%;
}

.live-spot.roadtrain {
  --spot-w: 7.8%;
}

.live-spot.reserved {
  border-color: rgba(240, 162, 2, 0.88);
  background: rgba(240, 162, 2, 0.3);
}

.live-spot.occupied {
  border-color: rgba(200, 61, 61, 0.88);
  background: rgba(200, 61, 61, 0.34);
}

.live-spot.blocked {
  border-color: rgba(23, 32, 40, 0.9);
  background: repeating-linear-gradient(135deg, rgba(23,32,40,0.24) 0 8px, rgba(255,255,255,0.7) 8px 16px);
}

.admin-list,
.event-strip {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-list li,
.event-strip div {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: #f5f7f8;
  border-left: 4px solid var(--pink);
}

.admin-list span,
.event-strip span {
  color: var(--muted);
  font-size: 13px;
}

.event-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .admin-metrics,
  .report-kpis,
  .event-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid,
  .admin-hero,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-head,
  .report-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .report-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  }
}

@media (max-width: 640px) {
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
    padding: 14px 16px;
  }

  .admin-topbar .brand img {
    width: 210px;
    max-width: 70vw;
  }

  .admin-topbar nav {
    width: 100%;
    gap: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 3px;
  }

  .admin-topbar nav a {
    flex: 0 0 auto;
    width: 74px;
    min-height: 60px;
    padding: 7px 5px 6px;
    background: #f5f7f8;
    border: 1px solid var(--line);
  }

  .admin-shell {
    padding: 16px;
  }

  .login-screen {
    padding: 16px;
  }

  .login-card {
    padding: 22px;
  }

  .login-card h1,
  .admin-hero h1 {
    font-size: 34px;
    line-height: 1.04;
  }

  .admin-hero,
  .admin-panel {
    padding: 18px;
  }

  .occupancy-ring {
    width: 132px;
    height: 132px;
    border-width: 7px;
  }

  .occupancy-ring strong {
    font-size: 34px;
  }

  .admin-metrics,
  .report-kpis,
  .event-strip {
    grid-template-columns: 1fr;
  }

  .report-filter {
    grid-template-columns: 1fr;
  }

  .combo-day {
    min-width: 30px;
  }

  .hbar-row {
    grid-template-columns: 90px minmax(0, 1fr) 34px;
  }

  .admin-metrics article {
    min-height: auto;
  }

  th,
  td {
    padding: 10px;
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .admin-topbar nav a {
    width: 70px;
    min-height: 58px;
  }

  .login-card,
  .admin-hero,
  .admin-panel {
    padding: 16px;
  }

  .login-card h1,
  .admin-hero h1 {
    font-size: 30px;
  }
}
