:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --ink: #142027;
  --muted: #65747f;
  --line: #dce5e8;
  --green: #1b8a5a;
  --blue: #236fc8;
  --red: #c4483d;
  --amber: #ad7416;
  --teal: #0f7d87;
  --shadow: 0 12px 30px rgba(28, 47, 56, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Segoe UI",
    "Noto Sans KR",
    system-ui,
    sans-serif;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
}

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

.subtitle {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.ghost-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.ghost-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.sync-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 154px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(27, 138, 90, 0.14);
}

.filters,
.summary,
.station-list,
.map-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px;
}

.filters label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

select {
  min-width: 132px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 32px 9px 10px;
  background: #fff;
  color: var(--ink);
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #eef4f5;
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.is-active {
  background: var(--teal);
  color: #fff;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.checks input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.dashboard {
  margin-top: 16px;
}

.source-box {
  border: 1px solid rgba(15, 125, 135, 0.22);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: rgba(15, 125, 135, 0.08);
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.source-box.warning {
  border-color: rgba(173, 116, 22, 0.28);
  background: rgba(173, 116, 22, 0.11);
  color: var(--amber);
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--line);
}

.summary article {
  min-height: 92px;
  padding: 18px;
  background: var(--surface);
}

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

.summary strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(310px, 0.9fr) minmax(420px, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.station-list,
.map-panel,
.detail-panel {
  min-height: 590px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

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

.list-body {
  display: grid;
  gap: 10px;
  max-height: 532px;
  overflow: auto;
  padding: 12px;
}

.station-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.station-card.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 125, 135, 0.13);
}

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

.card-title strong {
  font-size: 16px;
}

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

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

.badge,
.count-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.badge.fast {
  background: rgba(35, 111, 200, 0.11);
  color: var(--blue);
}

.badge.slow {
  background: rgba(173, 116, 22, 0.13);
  color: var(--amber);
}

.count-chip.available {
  background: rgba(27, 138, 90, 0.12);
  color: var(--green);
}

.count-chip.busy {
  background: rgba(35, 111, 200, 0.12);
  color: var(--blue);
}

.count-chip.fault {
  background: rgba(196, 72, 61, 0.12);
  color: var(--red);
}

.distance {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(15, 125, 135, 0.1);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.map-canvas {
  position: relative;
  min-height: 532px;
  overflow: hidden;
  border-radius: 0 0 8px 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    #dce9e6;
  background-size: 72px 72px;
}

.map-canvas::before,
.map-canvas::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.map-canvas::before {
  inset: 92px -80px auto 18%;
  height: 120px;
  border: 18px solid rgba(255, 255, 255, 0.8);
  transform: rotate(-11deg);
}

.map-canvas::after {
  left: -6%;
  right: 8%;
  bottom: 112px;
  height: 96px;
  border: 16px solid rgba(255, 255, 255, 0.74);
  transform: rotate(14deg);
}

.map-marker {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(20, 32, 39, 0.22);
  transform: translate(-50%, -50%);
}

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

.map-marker.busy {
  background: var(--blue);
}

.map-marker.fault {
  background: var(--red);
}

.map-marker.is-selected {
  outline: 4px solid rgba(15, 125, 135, 0.25);
}

.map-empty {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 532px;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.detail-panel {
  padding: 16px;
}

.empty-detail {
  display: grid;
  min-height: 520px;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.detail-title {
  margin-bottom: 14px;
}

.detail-title h2 {
  margin-bottom: 6px;
}

.detail-title p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.detail-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.detail-block h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}

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

.meta-grid span,
.mini-meta {
  color: var(--muted);
  font-size: 13px;
}

.meta-grid span {
  display: block;
  margin-bottom: 4px;
}

.meta-grid strong {
  display: block;
  font-size: 13px;
}

.charger-row,
.parking-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.charger-row span,
.parking-row span {
  color: var(--muted);
}

.status-text.available {
  color: var(--green);
}

.status-text.busy {
  color: var(--blue);
}

.status-text.fault {
  color: var(--red);
}

.empty-list {
  padding: 42px 12px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

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

  .detail-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .empty-detail {
    min-height: 180px;
  }
}

@media (max-width: 780px) {
  .app-shell {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .ghost-button {
    flex: 1;
  }

  .sync-box {
    width: 100%;
  }

  .filters {
    align-items: stretch;
    flex-direction: column;
  }

  .filters label,
  select,
  .segmented {
    width: 100%;
  }

  .summary,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .station-list,
  .map-panel {
    min-height: auto;
  }

  .map-canvas {
    min-height: 430px;
  }
}
