:root {
  --bg: #f4fbf4;
  --card: #ffffff;
  --text: #173323;
  --muted: #4d6758;
  --brand: #1f7a3f;
  --brand-2: #2fa05a;
  --accent: #ffd447;
  --border: #d3e5d8;
  --shadow: 0 12px 34px rgba(31, 122, 63, 0.13);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.map-wrap,
.atm-item {
  scroll-margin-top: 90px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(120deg, #1c6a37, #2e8f4e);
  color: #fff;
  border-bottom: 4px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: transparent;
  padding: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.1;
}

.brand p {
  margin: 0.2rem 0 0;
  color: #e6f7ea;
  font-size: 0.95rem;
  line-height: 1.25;
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  align-items: stretch;
}

.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow: hidden;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.85rem;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.panel:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(31, 122, 63, 0.15);
}

.panel label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

select {
  width: 100%;
  border: 1px solid #cad5e6;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
  outline: none;
  min-height: 42px;
}

select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(47, 160, 90, 0.15);
}

.stats p {
  margin: 0.2rem 0;
}

.status-text {
  margin-top: 0.5rem;
  color: var(--brand);
  font-size: 0.85rem;
}

.flow-tip p {
  margin: 0.2rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.list-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.list-container h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

#atmList {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
  min-height: 160px;
}

.atm-item {
  margin-bottom: 0.45rem;
}

.atm-item button {
  width: 100%;
  text-align: left;
  background: #f8fbff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem;
  cursor: pointer;
}

.atm-item button:hover,
.atm-item button.active {
  border-color: #65b57d;
  background: #eefaf0;
}

.atm-item button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.atm-name {
  display: block;
  font-weight: 600;
}

.atm-address {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.atm-item button::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: middle;
  background-image: url("./logo en png.png");
  background-size: cover;
  background-position: center;
}

.empty-state {
  color: var(--muted);
  padding: 0.8rem 0.3rem;
  font-size: 0.9rem;
}

.map-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

#map {
  width: 100%;
  height: 100%;
  min-height: 560px;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(31, 122, 63, 0.2);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: linear-gradient(120deg, var(--brand), #239149);
  color: #fff;
  border: 2px solid var(--accent);
  font-weight: 700;
}

.cooeducar-marker-icon {
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(23, 51, 35, 0.35);
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 0.8rem;
    padding: 0.8rem;
  }
}

@media (max-width: 980px) {
  .topbar {
    padding: 0.85rem 1rem;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    padding: 0.7rem;
  }

  .sidebar {
    order: 2;
    overflow: visible;
  }

  .map-wrap {
    order: 1;
    min-height: 54vh;
  }

  #map {
    min-height: 54vh;
  }

  #atmList {
    max-height: none;
    overflow: visible;
    min-height: 0;
  }

  .list-container {
    flex: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0.7rem 0.8rem;
    border-bottom-width: 3px;
  }

  .brand {
    gap: 0.7rem;
    width: 100%;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .brand h1 {
    font-size: 1.02rem;
    word-break: break-word;
  }

  .brand p {
    font-size: 0.84rem;
    margin-top: 0.15rem;
  }

  .layout {
    padding: 0.6rem;
    gap: 0.6rem;
  }

  .panel {
    border-radius: 14px;
    padding: 0.75rem;
  }

  .panel label {
    font-size: 0.82rem;
  }

  .stats p {
    font-size: 0.88rem;
  }

  .list-container h2 {
    font-size: 0.95rem;
  }

  .atm-item button {
    padding: 0.62rem;
  }

  .atm-name {
    font-size: 0.92rem;
  }

  .atm-address {
    font-size: 0.8rem;
  }

  .map-wrap {
    min-height: 50vh;
  }

  #map {
    min-height: 50vh;
  }

  #atmList {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 420px) {
  .brand h1 {
    font-size: 0.95rem;
  }

  .brand p {
    font-size: 0.78rem;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .panel {
    padding: 0.65rem;
  }

  .topbar {
    padding: 0.6rem 0.65rem;
  }

  .layout {
    padding: 0.45rem;
    gap: 0.45rem;
  }

  #atmList {
    max-height: none;
    overflow: visible;
  }
}
