/* ── Design tokens ──────────────────────────────────────── */
:root {
  --blue-900: #0d47a1;
  --blue-700: #1565c0;
  --blue-600: #1976d2;
  --blue-500: #1e88e5;
  --blue-400: #42a5f5;
  --blue-50:  #e3f2fd;
  --cyan-600: #0097a7;
  --cyan-500: #00acc1;
  --green-600: #388e3c;
  --green-500: #43a047;
  --orange:   #f57c00;
  --ink:      #1a1a2e;
  --ink-muted:#5a6478;
  --surface:  #ffffff;
  --surface-2:#f4f7fb;
  --border:   rgba(30, 136, 229, 0.15);
  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

/* ── Reset basics ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Header bar ──────────────────────────────────────────── */
#header {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 60%, var(--cyan-500) 100%);
  height: 80px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

#headerTitle {
  position: absolute;
  top: 16px;
  left: 16px;
  margin: 0;
  font-size: 1.7em;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}

#headerTitle a:link,
#headerTitle a:visited {
  text-decoration: none;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0,0,0,.25);
}

#headerTag {
  position: absolute;
  top: 50px;
  left: 18px;
  margin: 0;
  font-weight: 400;
  font-size: 0.78em;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: rgba(255,255,255,.8);
  letter-spacing: 0.02em;
}

#headerImg {
  position: absolute;
  top: 10px;
  right: 12px;
  opacity: .9;
}

#headerLogin {
  position: absolute;
  top: 55px;
  right: 14px;
  font-size: 12px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

#headerLogin a:link,
#headerLogin a:visited {
  text-decoration: none;
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 11px;
  transition: background 0.2s;
}

#headerLogin a:hover {
  background: rgba(255,255,255,.28);
  color: #fff;
}

/* ── Navigation menu ─────────────────────────────────────── */
#menu {
  float: left;
  width: 100%;
  background: var(--blue-900);
  font-size: 13px;
  font-family: "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}

#menu a {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  color: rgba(255,255,255,.82);
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

#menu a:hover { background: rgba(255,255,255,.08); color: #fff; }
#menu a.active { color: #fff; border-bottom: 2px solid var(--blue-400); }

#menu ul {
  list-style-type: none;
  margin: 0 0 0 12px;
  padding: 0;
  overflow: hidden;
}

#menu li { float: left; }

#menu li a, .dropbtn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

#menu li.dropdown { display: inline-block; }

#menu .dropdown-content {
  display: none;
  position: absolute;
  background: var(--blue-700);
  min-width: 180px;
  box-shadow: var(--shadow-md);
  z-index: 10;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  border: 1px solid rgba(255,255,255,.1);
  border-top: none;
}

#menu .dropdown-content a {
  color: rgba(255,255,255,.85);
  padding: 8px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
  font-size: 12px;
}

#menu .dropdown-content a:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

#menu .dropdown:hover .dropdown-content { display: block; }

/* ── Footer ──────────────────────────────────────────────── */
#footer {
  font-size: 11px;
  color: var(--ink-muted);
  text-align: center;
  padding: 16px;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

#footer a { color: var(--blue-500); }

/* ── Node number clickable ───────────────────────────────── */
.nodeNum {
  margin: 4px;
  cursor: pointer;
  color: var(--blue-500);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  transition: background 0.15s;
}

.nodeNum:hover {
  background: var(--blue-50);
  font-weight: 700;
}

/* ── Tables ──────────────────────────────────────────────── */
table.rtcm {
  border-collapse: collapse;
  border: 1px solid var(--border);
  font-family: "Segoe UI", system-ui, sans-serif;
  border-radius: var(--radius-md);
  overflow: hidden;
}

table.rtcm tr { font-size: 13px; }

table.rtcm td { white-space: nowrap; padding: 8px 12px; }

table.rtcm th {
  border: 1px solid var(--border);
  font-size: 12px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 700;
  padding: 10px 12px;
}

table.gridtable {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink);
  border-width: 1px;
  border-color: var(--border);
  border-collapse: collapse;
  width: 100%;
}

table.gridtable th {
  border-width: 1px;
  padding: 10px 12px;
  border-style: solid;
  border-color: var(--border);
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

table.gridtable td {
  border-width: 1px;
  padding: 9px 12px;
  border-style: solid;
  border-color: var(--border);
  background: var(--surface);
}

table.gridtable tr.rColor td {
  background: #e3f2fd;
  color: var(--blue-700);
}

table.gridtable tr.cColor td {
  background: #fff3e0;
  color: var(--orange);
}

/* ── Voter bars ──────────────────────────────────────────── */
#table_2020 { width: 50%; }

.disconnect {
  font-size: 14px;
  text-align: left;
}

.text {
  position: relative;
  margin: 0 0 0 10px;
  width: 330px;
  font-size: 14px;
  text-align: left;
}

.barbox_a {
  position: absolute;
  top: 2px;
  left: 10px;
  margin: 0;
  width: 302px;
  height: 22px;
  background: var(--ink);
  border-radius: 3px;
  overflow: hidden;
}

.bar {
  position: relative;
  top: 1px;
  left: 1px;
  margin: 0;
  width: 0;
  height: 20px;
  background: var(--blue-500);
  text-align: center;
  color: #fff;
  border-radius: 2px;
}

.per {
  position: absolute;
  top: 0;
  font-size: 12px;
  left: 50%;
  height: 20px;
  margin: 0;
  background: var(--blue-500);
  color: #fff;
}

.blank {
  background: var(--surface-2);
  width: 300px;
}

/* ── Login panel ─────────────────────────────────────────── */
#login { display: none; }

#login-header {
  margin: 0 auto;
  position: absolute;
  right: 250px;
}

#login-link {
  position: absolute;
  top: 0;
  right: 0;
  display: block;
  background: var(--blue-700);
  padding: 5px 15px;
  color: #fff;
  font-size: 13px;
}

#login-panel {
  position: absolute;
  top: 26px;
  right: 0;
  width: 200px;
  padding: 10px 15px 5px;
  background: var(--blue-900);
  font-size: 8pt;
  font-weight: bold;
  color: #fff;
  display: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-md);
}

#connect_form { margin-bottom: 0.5em; }

.node_input { margin-bottom: 0.5em; }

label { line-height: 1.8; }

.clearer { clear: both; }

#cpMain { display: none; }

/* ── Bubble chart ────────────────────────────────────────── */
#bubblechart { font-size: 8px; }
