:root {
  --bg: #0f1714;
  --bg-elev: #18241f;
  --panel: #1d2d27;
  --text: #e8f0ec;
  --muted: #9bb0a6;
  --accent: #3dcf8e;
  --accent-2: #6ee7b7;
  --danger: #f07178;
  --warn: #e6c07b;
  --border: rgba(255,255,255,.08);
  --shadow: 0 18px 50px rgba(0,0,0,.35);
  --radius: 16px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61,207,142,.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(56,120,255,.12), transparent 50%),
    linear-gradient(180deg, #101a16 0%, #0b1210 100%);
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20;
  background: rgba(15,23,20,.8);
}
.brand { font-weight: 700; letter-spacing: .02em; color: var(--text); font-size: 1.1rem; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .85rem; align-items: center; }
.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--text); }
.user { color: var(--text); font-size: .9rem; }

.container { width: min(1100px, calc(100% - 2rem)); margin: 1.5rem auto 3rem; }
.site-footer { text-align: center; color: var(--muted); padding: 2rem; font-size: .85rem; }

.hero {
  padding: 3rem 0 1rem;
}
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 .5rem; letter-spacing: -.02em; }
.hero p { color: var(--muted); max-width: 40rem; line-height: 1.5; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent 40%), var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 .6rem; font-size: 1rem; }
.stat { font-size: 1.8rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: .85rem; }

.auth-card, .panel {
  width: min(460px, 100%); margin: 2rem auto; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow);
}
.panel { width: 100%; }
.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .9rem; }
input, select, textarea {
  width: 100%; padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); font: inherit;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 0; border-radius: 999px; padding: .65rem 1.1rem; font: inherit; cursor: pointer;
  background: var(--accent); color: #062016; font-weight: 600;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn-secondary { background: #2a3d35; color: var(--text); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #1a0a0b; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

.flash { padding: .85rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.flash-success { background: rgba(61,207,142,.15); color: var(--accent-2); }
.flash-error { background: rgba(240,113,120,.15); color: #ffb4b8; }
.flash-info { background: rgba(110,231,183,.1); color: var(--text); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
th { color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.filters > * { flex: 1 1 140px; }

#map {
  height: min(70vh, 720px); width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
}

.chart {
  width: 100%; height: 220px; display: block; background: rgba(0,0,0,.15);
  border-radius: 12px;
}

.badge {
  display: inline-block; padding: .15rem .5rem; border-radius: 999px;
  background: rgba(61,207,142,.15); color: var(--accent-2); font-size: .75rem;
}
.badge-error { background: rgba(240,113,120,.15); color: #ffb4b8; }
.badge-warn { background: rgba(230,192,123,.15); color: var(--warn); }

.auth-oauth { margin-top: 1rem; }
.auth-divider {
  display: flex; align-items: center; gap: .75rem; color: var(--muted);
  font-size: .85rem; margin: .2rem 0 1rem;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.btn-google {
  background: #fff; color: #3c4043; border: 1px solid #dadce0;
  font-weight: 600;
}
.btn-google:hover { background: #f7f8f8; filter: none; }
.btn-google-icon { display: inline-flex; }

.year-bar {
  height: 8px;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  overflow: hidden;
}
.year-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2f9e6d, #6ee7b7);
  border-radius: 999px;
}

.status-card-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.progress-track {
  margin-top: 1rem;
  height: 10px;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  overflow: hidden;
}
.progress-track > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2f9e6d, #6ee7b7);
  border-radius: 999px;
  transition: width .3s ease;
}

.status-lines {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}
.status-lines li {
  margin: 0.25rem 0;
}

@media (max-width: 720px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .status-card-top { flex-direction: column; }
}
