:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #687487;
  --line: #dce3ed;
  --line-strong: #c6d0dd;
  --paper: #ffffff;
  --wash: #f5f8fb;
  --navy: #172033;
  --teal: #0f8b8d;
  --teal-dark: #087174;
  --mint: #dff4ee;
  --coral: #f36b4f;
  --gold: #f3bd3e;
  --green: #1c9a62;
  --red: #c43d34;
  --shadow: 0 18px 42px rgba(24, 33, 47, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--wash);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  color: #f6fbff;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  margin-top: 3px;
  color: #aebbd0;
  font-size: 12px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dbe6f4;
  background: transparent;
  text-align: left;
}

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

.nav-icon {
  width: 26px;
  color: #93e2d6;
  font-weight: 800;
}

.sidebar-panel {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-panel strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.sidebar-panel p {
  margin: 0 0 12px;
  color: #b6c3d5;
  font-size: 12px;
  line-height: 1.45;
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 72px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
}

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

.search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px 0 40px;
  color: var(--ink);
  background: var(--paper);
}

.search::before {
  content: "⌕";
  position: absolute;
  left: 15px;
  top: 8px;
  color: var(--muted);
  font-size: 20px;
}

.user-chip {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.content {
  padding: 28px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 22px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  background: white;
  font-weight: 700;
  text-decoration: none;
}

.btn.primary {
  color: white;
  background: var(--teal);
}

.btn.primary:hover {
  background: var(--teal-dark);
}

.btn.dark {
  color: white;
  background: var(--navy);
}

.btn.ghost {
  border-color: var(--line);
}

.btn.danger {
  color: var(--red);
  border-color: #f0c4c0;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.metrics {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.grid.two {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  box-shadow: 0 1px 0 rgba(24, 33, 47, 0.02);
}

.metric {
  min-height: 126px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 30px;
  letter-spacing: 0;
}

.trend {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.trend.warn {
  color: var(--coral);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

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

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

.status {
  border-radius: 999px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
}

.status.open {
  color: #0f6b48;
  background: #dff5ea;
}

.status.busy {
  color: #8a5400;
  background: #fff1c7;
}

.status.closed {
  color: #8b2c26;
  background: #ffe1dc;
}

.lot-list {
  display: grid;
  gap: 12px;
}

.lot-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.business-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
}

.lot-row p,
.mini-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.capacity {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8edf4;
}

.capacity span {
  height: 100%;
  display: block;
  background: var(--teal);
}

.map-board {
  min-height: 360px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  align-content: start;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    #253246;
  background-size: 32px 32px;
  border-radius: 8px;
}

.space {
  aspect-ratio: 1.35;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.space.available {
  background: rgba(15, 139, 141, 0.75);
}

.space.occupied {
  background: rgba(243, 107, 79, 0.75);
}

.space.hold {
  background: rgba(243, 189, 62, 0.8);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
}

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

.role-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
}

.role-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.public-page {
  min-height: 100vh;
  background: #f7faf9;
}

.public-hero {
  min-height: 520px;
  padding: 22px clamp(18px, 4vw, 56px) 36px;
  color: white;
  background:
    linear-gradient(90deg, rgba(23, 32, 51, 0.92), rgba(23, 32, 51, 0.56)),
    url("https://images.unsplash.com/photo-1506521781263-d8422e82f27a?auto=format&fit=crop&w=1600&q=80") center/cover;
  display: grid;
  align-content: space-between;
}

.public-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.public-hero h1 {
  max-width: 800px;
  font-size: clamp(38px, 8vw, 78px);
}

.public-hero .lead {
  color: #dbe6f4;
}

.purchase-band {
  margin: -58px auto 34px;
  width: min(1120px, calc(100% - 36px));
  position: relative;
  z-index: 2;
}

.checkout-panel {
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 0;
}

.checkout-grid.single {
  grid-template-columns: 1fr;
}

.checkout-form {
  padding: 24px;
}

.checkout-summary {
  padding: 24px;
  border-left: 1px solid var(--line);
  background: #fbfcfd;
}

.price-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.price-line.total {
  border-bottom: 0;
  font-size: 22px;
  font-weight: 800;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfd;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.search-results {
  display: grid;
  gap: 10px;
}

.business-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  background: #fbfcfd;
  text-decoration: none;
}

.business-result:hover {
  border-color: var(--teal);
}

.business-result span {
  color: var(--muted);
  font-size: 13px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1fr);
  background: white;
}

.login-art {
  min-height: 100%;
  padding: 38px;
  color: white;
  background:
    linear-gradient(180deg, rgba(23, 32, 51, 0.22), rgba(23, 32, 51, 0.84)),
    url("https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?auto=format&fit=crop&w=1200&q=80") center/cover;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-card {
  width: min(460px, calc(100% - 36px));
  margin: auto;
}

.notice {
  border: 1px solid #b9e5df;
  border-radius: 8px;
  padding: 12px;
  color: #075f62;
  background: var(--mint);
  font-size: 13px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 44px));
  border-radius: 8px;
  padding: 14px 16px;
  color: white;
  background: var(--navy);
  box-shadow: var(--shadow);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  z-index: 20;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1060px) {
  .app-shell,
  .grid.two,
  .checkout-grid,
  .login-wrap {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-group {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-panel {
    margin-top: 0;
  }

  .grid.metrics,
  .grid.three,
  .role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkout-summary {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .login-art {
    min-height: 320px;
  }
}

@media (max-width: 680px) {
  .content,
  .topbar {
    padding: 18px;
  }

  .topbar,
  .page-head,
  .public-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-group,
  .grid.metrics,
  .grid.three,
  .role-grid,
  .form-grid.two-col {
    grid-template-columns: 1fr;
  }

  .map-board {
    grid-template-columns: repeat(4, 1fr);
  }

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

  .button-row .btn {
    width: 100%;
  }
}
