body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  background: #f7f7f9;
  color: #222;
}

header {
  background: #0b5fa4;
  color: white;
  padding: 1rem 1.5rem;
}

header h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
}

nav a {
  color: #e6f1fb;
  text-decoration: none;
  margin-right: 1rem;
  font-size: 0.95rem;
}

nav a:hover {
  text-decoration: underline;
}

main {
  padding: 1rem 1.5rem 2rem;
}

/* ---------- Controls ---------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  min-width: 180px;
}

.control-group label {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

input[type="text"], select {
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}

/* ---------- TABLE ---------- */

/* Scroll container — ONLY thing that scrolls */
.table-wrapper {
  height: 70vh;                 /* fixed height REQUIRED */
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid #ddd;
  border-radius: 6px;           /* radius belongs HERE */
  background: white;
}

/* Table itself */
table {
  width: 100%;
  background: white;
  border-collapse: separate;   /* REQUIRED for sticky */
  border-spacing: 0;
}

/* Cells */
th, td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

/* Header cells */
th {
  background: #f0f4f8;
  text-align: left;
}

/* ✅ STICKY HEADER ROW */
#plansTable thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f0f4f8;
  border-bottom: 2px solid #ccc;
}

/* Row hover */
tr:hover {
  background: #f9fcff;
}

/* ---------- Country grouping rows ---------- */

.country-header-row td {
  background-color: #f3f5f7;
  font-size: 1rem;
  padding: 0.75em;
  border-top: 2px solid #ccc;
}

/* ---------- Buttons ---------- */

.plan-link-btn {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  background: #0b5fa4;
  color: white;
  text-decoration: none;
}

.plan-link-btn:hover {
  background: #094a80;
}

/* ---------- Footer ---------- */

footer {
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  color: #666;
  border-top: 1px solid #ddd;
  background: #fafbfc;
}

/* ---------- Map ---------- */

#mapContainer {
  height: 70vh;
  margin-top: 1rem;
}

#map {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.map-note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #555;
}

/* ---------- Mobile ---------- */

@media (max-width: 768px) {
  header, main, footer {
    padding: 0.75rem 1rem;
  }

  table {
    font-size: 0.8rem;
  }
}

footer .table-note {
  font-size: 0.85em;
  color: #555;
  margin-bottom: 0.5em;
}
