:root {
  --bg: #f5f5f5;
  --paper: #ffffff;
  --paper-elevated: #ffffff;
  --ink: #1f1f1f;
  --muted: #5f6470;
  --line: #d7dbe2;
  --green: #0078d4;
  --green-dark: #005a9e;
  --blue: #0078d4;
  --yellow: #fce100;
  --coral: #d13438;
  --danger: #c50f1f;
  --field: #ffffff;
  --secondary-bg: #f7f7f7;
  --secondary-line: #c6cbd3;
  --chrome: #ebedf0;
  --shadow: 0 10px 26px rgba(19, 24, 32, 0.09);
  --inset-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

html[data-theme="dark"] {
  --bg: #111318;
  --paper: #1b1d23;
  --paper-elevated: #20232a;
  --ink: #f5f7fb;
  --muted: #a8b0bd;
  --line: #30343d;
  --green: #5eb7ff;
  --green-dark: #9bd4ff;
  --blue: #5eb7ff;
  --yellow: #f3c969;
  --coral: #ff9a9a;
  --danger: #ff7f86;
  --field: #15171d;
  --secondary-bg: #22252c;
  --secondary-line: #3d424e;
  --chrome: #171a20;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  --inset-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body:not(.can-admin-tools) .admin-tool-link {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, var(--chrome) 0, var(--bg) 180px),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Lato, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  line-height: 1.4;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  padding: 9px clamp(14px, 3vw, 34px);
  background: rgba(245, 245, 245, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(24px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .app-header {
  background: rgba(17, 19, 24, 0.94);
  box-shadow: none;
}

.app-header h1,
.app-header p {
  margin: 0;
}

nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.theme-toggle {
  min-width: 104px;
}

nav a,
.button,
footer button,
.theme-toggle,
.icon-button,
.segmented button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-elevated);
  text-decoration: none;
  color: var(--ink);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  cursor: pointer;
  box-shadow: var(--inset-shadow);
  transition: background 140ms ease, border-color 140ms ease, transform 80ms ease;
}

nav a:hover,
.button:hover,
footer button:hover,
.theme-toggle:hover,
.icon-button:hover,
.segmented button:hover {
  background: #f9f9f9;
  border-color: #bdbdbd;
}

nav a:active,
.button:active,
footer button:active,
.theme-toggle:active,
.icon-button:active,
.segmented button:active,
.pagination button:active,
.account-actions button:active,
.form-actions button:active,
.pending-actions button:active,
.user-actions button:active {
  transform: translateY(1px);
}

html[data-theme="dark"] nav a:hover,
html[data-theme="dark"] .button:hover,
html[data-theme="dark"] footer button:hover,
html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .segmented button:hover {
  background: #272b33;
  border-color: #535a68;
}

.app-header h1 {
  font-size: 1.28rem;
  line-height: 1.1;
  font-weight: 600;
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
  box-shadow: none;
}

.button.secondary {
  background: var(--secondary-bg);
  border-color: var(--secondary-line);
}

.eyebrow {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 16px clamp(14px, 3vw, 34px) 10px;
  padding: 16px 18px;
  background: var(--paper-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-media {
  display: none;
}

.hero-media::before,
.hero-media::after {
  content: "";
  position: absolute;
  left: -10%;
  width: 120%;
  height: 34%;
  border-radius: 50%;
}

.hero-media::before {
  bottom: 25%;
  background: #7da46f;
}

.hero-media::after {
  bottom: -11%;
  background: #496e52;
}

.sun {
  position: absolute;
  top: 44px;
  right: 58px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--yellow);
}

.road {
  position: absolute;
  bottom: -10%;
  left: 46%;
  width: 22%;
  height: 70%;
  background: #737569;
  transform: skewX(-13deg);
  clip-path: polygon(34% 0, 66% 0, 100% 100%, 0 100%);
}

.road::after {
  content: "";
  position: absolute;
  top: 12%;
  left: 48%;
  width: 8px;
  height: 78%;
  background: repeating-linear-gradient(#f4edcb 0 28px, transparent 28px 48px);
}

.van {
  position: absolute;
  left: 17%;
  bottom: 21%;
  width: 210px;
  height: 112px;
  border-radius: 18px 28px 10px 10px;
  background: #fffdf8;
  border: 5px solid #25332b;
  box-shadow: 0 15px 0 rgba(0, 0, 0, 0.08);
}

.van::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 22px;
  width: 55px;
  height: 32px;
  border-radius: 6px;
  background: var(--blue);
  box-shadow: 72px 0 0 var(--blue);
}

.van::after {
  content: "";
  position: absolute;
  left: 26px;
  bottom: -20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #25332b;
  box-shadow: 120px 0 0 #25332b;
}

.van span {
  position: absolute;
  right: 22px;
  bottom: 14px;
  width: 34px;
  height: 42px;
  border-radius: 5px 5px 0 0;
  background: var(--coral);
}

.pin {
  position: absolute;
  width: 26px;
  height: 26px;
  background: var(--coral);
  border: 4px solid white;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
}

.pin::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: white;
}

.pin-a {
  top: 28%;
  left: 24%;
}

.pin-b {
  top: 41%;
  right: 28%;
}

.pin-c {
  bottom: 30%;
  right: 17%;
}

.hero-copy {
  max-width: none;
}

.hero-copy h2 {
  margin: 0;
  font-size: clamp(1.28rem, 2vw, 1.8rem);
  line-height: 1.12;
  font-weight: 600;
}

.hero-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.96rem;
  max-width: 72ch;
  margin: 8px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 clamp(14px, 3vw, 34px) 12px;
  background: transparent;
  border: 0;
}

.stats div {
  background: var(--paper-elevated);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--inset-shadow);
}

.stats strong {
  display: block;
  font-size: 1.65rem;
}

.stats span {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(238px, 0.85fr) minmax(360px, 1.3fr) minmax(340px, 1.25fr);
  gap: 12px;
  align-items: start;
  padding: 12px clamp(14px, 3vw, 34px) 24px;
  border-top: 0;
}

.filters,
.detail,
.results,
.place-form,
.pending-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--inset-shadow);
}

.filters,
.detail,
.results {
  padding: 12px;
}

.filters {
  position: sticky;
  top: 76px;
}

.section-title h2,
.section-title p {
  margin: 0;
}

.section-title h2 {
  font-size: 1.18rem;
  line-height: 1.15;
  font-weight: 600;
}

.section-title {
  margin-bottom: 18px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.search,
.range,
.auth-form label,
.place-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  padding: 7px 9px;
  color: var(--ink);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(94, 183, 255, 0.32);
  border-color: var(--green);
}

textarea {
  resize: vertical;
}

.filter-group {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  font-weight: 700;
}

.filter-group label,
fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.filter-group input,
fieldset input {
  width: auto;
}

.range output {
  color: var(--green);
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 18px;
  padding: 3px;
  background: var(--chrome);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented button.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.results-top,
.place-card header,
.detail-header,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.results-top p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.icon-button {
  width: 34px;
  padding: 0;
  font-size: 1.08rem;
}

.place-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.pagination button {
  min-height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--field);
  cursor: pointer;
  padding: 0 12px;
}

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

.place-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  padding: 11px 12px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 80ms ease, box-shadow 140ms ease;
}

.place-card:hover {
  border-color: var(--secondary-line);
  background: var(--secondary-bg);
}

.place-card.active {
  border-color: var(--green);
  box-shadow: inset 3px 0 0 var(--green);
}

.place-card h3,
.detail h3 {
  margin: 0;
}

.place-card p,
.detail p {
  color: var(--muted);
}

.badges,
.amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 6px;
  background: #e8f2fb;
  color: var(--green-dark);
  padding: 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

html[data-theme="dark"] .badge {
  background: #17324b;
  color: #b9e2ff;
}

.badge.pending {
  background: #fff1da;
  color: #8a5520;
}

.badge.price {
  background: #e8f0f4;
  color: #214f68;
}

html[data-theme="dark"] .badge.pending {
  background: #3b2f18;
  color: #f7d78f;
}

html[data-theme="dark"] .badge.price {
  background: #222b3a;
  color: #c9d7ee;
}

.map-view {
  margin-top: 14px;
}

.map-canvas {
  height: 560px;
  min-height: 560px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #dce7dc;
  z-index: 0;
}

html[data-theme="dark"] .map-canvas {
  background: #171a20;
}

.detail {
  position: static;
}

.detail-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  background: var(--field);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
}

.detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.detail-meta div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--field);
}

.detail-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.auth-band,
.form-band,
.admin-band {
  padding: 18px clamp(14px, 3vw, 34px);
  border-top: 1px solid var(--line);
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(280px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.auth-form,
.account-card,
.place-form {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--inset-shadow);
}

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

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

.form-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.error-text {
  color: var(--danger);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 16px;
}

legend {
  font-weight: 800;
}

.place-form button {
  justify-self: start;
}

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

.pending-item,
.user-item {
  padding: 16px;
}

.user-form,
.user-edit-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-form label,
.user-edit-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

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

.user-edit-form .form-actions {
  grid-column: 1 / -1;
}

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

.user-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-item.is-locked {
  opacity: 0.78;
}

.account-card p,
.user-item p {
  margin: 0;
  color: var(--muted);
}

.account-actions,
.form-actions,
.pending-actions,
.user-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.account-actions button,
.form-actions button,
.pending-actions button,
.user-actions button {
  min-height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--field);
  cursor: pointer;
}

.danger-button {
  min-height: 32px;
  border-radius: 6px;
  border: 1px solid var(--danger);
  background: var(--field);
  color: var(--danger);
  padding: 0 12px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.pending-actions .approve {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

footer {
  padding: 14px clamp(14px, 3vw, 34px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper-elevated);
}

@media (max-width: 820px) {
  .app-header,
  .hero,
  .stats,
  .workspace,
  .auth-grid,
  .place-form {
    grid-template-columns: 1fr;
  }

  .app-header {
    align-items: flex-start;
  }

  .hero {
    min-height: auto;
  }

  .hero-media {
    min-height: 330px;
    order: 2;
  }

  .hero-copy {
    order: 1;
  }

  .filters {
    position: static;
  }

  .place-form button {
    width: 100%;
  }

  .section-title-row,
  .user-form,
  .user-edit-form,
  .user-item {
    grid-template-columns: 1fr;
  }

  .section-title-row {
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .app-header,
  .results-top,
  footer {
    flex-direction: column;
    align-items: stretch;
  }

  nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-copy h2 {
    font-size: 2rem;
  }

  .van {
    left: 8%;
    transform: scale(0.78);
    transform-origin: left bottom;
  }

  .detail-meta {
    grid-template-columns: 1fr;
  }
}
