:root {
  --green-950: #123f21;
  --green-800: #1f6b35;
  --green-100: #eaf4ec;
  --mint: #f5faf6;
  --blue-100: #e8f3ff;
  --orange-100: #fff1e8;
  --rose-100: #ffecec;
  --ink: #172017;
  --muted: #68746d;
  --line: #e5ebe6;
  --panel: #ffffff;
  --page: #fbfcfb;
  --shadow: 0 18px 52px rgba(18, 63, 33, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green-950);
  font-size: 24px;
  font-weight: 850;
  line-height: 1.05;
}

.brand-mark {
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(31, 107, 53, 0.2);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--green-950);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95) 0 22%, transparent 23%),
    linear-gradient(135deg, #dff0dd, #77bd67 50%, #1f6b35);
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 12px 24px rgba(18, 63, 33, 0.12);
}

.brand-mark::after {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
  content: "";
}

.brand-name {
  max-width: 150px;
}

.tagline {
  margin: -10px 0 8px 56px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  border-radius: 8px;
  padding: 13px 14px;
  color: #344039;
  font-weight: 650;
}

.nav-link:hover,
.nav-link.active {
  background: var(--green-100);
  color: var(--green-950);
}

.nav-link.is-mock {
  color: #5d6b63;
}

.sidebar-callout,
.hero-panel,
.search-panel,
.map-panel,
.restaurant-form,
.admin-login,
.metric,
.restaurant-card,
.approval-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar-callout {
  margin-top: auto;
  padding: 18px;
  background: linear-gradient(160deg, #fbf7ed, #eef8ef);
}

.sidebar-callout h2 {
  margin: 4px 0 8px;
  font-size: 18px;
  line-height: 1.2;
}

.sidebar-callout p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

main {
  min-width: 0;
  padding: 28px 32px 86px;
}

.mobile-header {
  display: none;
}

.workspace {
  max-width: 1360px;
  margin: 0 auto 28px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 26px;
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(234, 244, 236, 0.94), rgba(255, 255, 255, 0.82)),
    url("https://images.unsplash.com/photo-1543353071-10c8ba85a904?auto=format&fit=crop&w=1400&q=80");
  background-size: cover;
  background-position: center;
}

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

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

h1 {
  max-width: 820px;
  margin-bottom: 12px;
  color: var(--green-950);
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 30px;
}

h3 {
  margin-bottom: 0;
}

.hero-panel p:not(.eyebrow) {
  max-width: 660px;
  color: #304339;
  font-size: 17px;
  line-height: 1.55;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 13px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.button.primary {
  background: var(--green-950);
  color: #fff;
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--green-950);
}

.button.compact {
  padding: 10px 14px;
  min-height: 42px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green-950);
  font-size: 24px;
  font-weight: 800;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.metric {
  padding: 20px;
  box-shadow: none;
}

.filter-metric {
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.filter-metric:hover,
.filter-metric:focus {
  border-color: #9acba3;
  box-shadow: 0 12px 28px rgba(18, 63, 33, 0.09);
  outline: none;
  transform: translateY(-1px);
}

.metric span {
  display: block;
  color: var(--green-950);
  font-size: 34px;
  font-weight: 850;
}

.metric p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.metric.accent {
  background: var(--blue-100);
}

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

.form-note {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 130px 190px 210px 170px;
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: none;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green-800);
  box-shadow: 0 0 0 3px rgba(31, 107, 53, 0.12);
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.results-column {
  min-width: 0;
}

.result-count {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.restaurant-card,
.approval-card {
  padding: 18px;
  box-shadow: none;
}

.restaurant-card {
  cursor: pointer;
}

.restaurant-card:hover,
.restaurant-card.selected {
  border-color: #9acba3;
  box-shadow: 0 12px 34px rgba(18, 63, 33, 0.09);
}

.card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.restaurant-card h3 {
  margin: 0 0 5px;
  font-size: 19px;
}

.restaurant-meta,
.restaurant-links,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.restaurant-meta {
  color: var(--muted);
  font-size: 13px;
}

.status-badge,
.chip {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge {
  background: var(--blue-100);
  color: #19507f;
}

.status-dedicated {
  background: var(--green-100);
  color: var(--green-950);
}

.status-risk {
  background: var(--rose-100);
  color: #913238;
}

.chips {
  margin-top: 12px;
}

.chip {
  background: #f3f6f4;
  color: #415047;
}

.restaurant-card address {
  margin-top: 12px;
  color: #3c4941;
  font-style: normal;
  line-height: 1.45;
}

.snippet {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.restaurant-links {
  margin-top: 14px;
}

.restaurant-links a,
.restaurant-links button,
.approval-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--green-950);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

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

.admin-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: end;
  padding: 22px;
  box-shadow: none;
}

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

.admin-note {
  margin: -6px 0 14px;
}

.is-hidden {
  display: none !important;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.approval-actions .approve {
  background: var(--green-950);
  color: #fff;
  border-color: var(--green-950);
}

.approval-actions .reject {
  background: #fff;
  color: #913238;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  background: #fff;
}

.map-panel {
  position: sticky;
  top: 24px;
  padding: 16px;
  box-shadow: none;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.map-preview-link {
  position: relative;
  display: block;
  width: 220px;
  max-width: 100%;
  color: inherit;
}

.map-canvas {
  position: relative;
  aspect-ratio: 1 / 1;
  height: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 107, 53, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(31, 107, 53, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, #f5faf6, #edf5ff);
  background-size: 42px 42px, 42px 42px, auto;
}

.map-preview-cta {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--green-950);
  box-shadow: 0 10px 24px rgba(18, 63, 33, 0.14);
  font-size: 13px;
  font-weight: 850;
  pointer-events: none;
}

.map-canvas.is-real-map {
  background: #eef4f1;
}

.map-canvas .leaflet-container,
.map-canvas.leaflet-container {
  width: 100%;
  height: 100%;
  font-family: Inter, system-ui, sans-serif;
}

.map-canvas .leaflet-popup-content {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.map-canvas .leaflet-popup-content strong {
  color: var(--green-950);
}

.map-canvas .leaflet-control-attribution {
  font-size: 10px;
}

.map-pin {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--green-800);
  box-shadow: 0 8px 18px rgba(18, 63, 33, 0.24);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.map-pin.selected {
  width: 30px;
  height: 30px;
  background: #df7c2f;
}

.selected-place {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.selected-place strong {
  color: var(--ink);
}

.restaurant-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  padding: 18px;
  box-shadow: none;
}

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

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  padding: 13px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--green-950);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 0.2s ease;
  z-index: 20;
}

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

.bottom-nav {
  display: none;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  main {
    padding: 18px 18px 92px;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -18px -18px 18px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
  }

  .result-layout {
    grid-template-columns: 1fr;
  }

  .map-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 24px;
  }

  .mobile-header .brand {
    font-size: 20px;
  }

  .mobile-header .brand-mark {
    width: 42px;
    height: 42px;
  }

  .mobile-header .brand-name {
    max-width: 126px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .metrics,
  .search-panel,
  .restaurant-form,
  .admin-login {
    grid-template-columns: 1fr;
  }

  .section-head,
  .card-top,
  .map-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .map-preview-link,
  .map-canvas {
    width: 180px;
    max-width: 100%;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 12;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
  }

  .bottom-nav a {
    padding: 14px 8px 16px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
    font-weight: 800;
  }

  .bottom-nav a.active {
    color: var(--green-950);
    background: var(--green-100);
  }
}
