:root {
  --bg: #0b1015;
  --panel: #121a22;
  --panel-2: #17232e;
  --line: #273746;
  --text: #e9f2f7;
  --muted: #91a4b4;
  --accent: #32d3a2;
  --accent-2: #2f8fe6;
  --warn: #f1a33b;
  --bad: #f05d5d;
  --ok: #4ac26b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(50, 211, 162, 0.16), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(47, 143, 230, 0.15), transparent 28%),
    var(--bg);
  font-family: "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
}

a {
  color: inherit;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, monospace;
}

pre {
  max-width: 640px;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  background: #071018;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 21, 0.9);
  backdrop-filter: blur(12px);
}

.brand {
  font-size: 1.25rem;
  font-weight: 900;
  text-decoration: none;
  letter-spacing: -0.04em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

nav a,
.session a,
.linkbtn {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}

nav a:hover,
.session a:hover,
.linkbtn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.session {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.shell {
  width: min(1400px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.hero,
.panel,
.login-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(18, 26, 34, 0.94), rgba(23, 35, 46, 0.84));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  padding: 30px;
}

.panel {
  margin-top: 20px;
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.05em;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

h2 {
  margin-bottom: 14px;
}

p {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.stats-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.stats-grid span {
  color: var(--muted);
  font-weight: 800;
}

.stats-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: #d9e7ef;
}

.tag,
.status {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.status.imported {
  color: var(--ok);
}

.status.failed {
  color: var(--bad);
}

.status.pending {
  color: var(--warn);
}

.primary,
.secondary,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 11px 15px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  color: #06120f;
  background: var(--accent);
}

.secondary,
button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.filters,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 12px;
  color: var(--text);
  background: #0b1219;
}

.login-card {
  width: min(900px, 100%);
  margin: 8vh auto;
  padding: clamp(24px, 5vw, 46px);
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 30px;
}

.form-card {
  display: grid;
  gap: 14px;
}

.form-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.flash-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.flash.error {
  color: var(--bad);
}

.flash.ok {
  color: var(--ok);
}

#map,
#detailMap {
  min-height: 640px;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}

#detailMap {
  min-height: 420px;
  margin: 18px 0;
}

.dot-marker span {
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}

.error-cell {
  max-width: 360px;
  color: var(--bad);
}

.muted {
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar,
  .hero,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .session {
    margin-left: 0;
  }

  .stats-grid,
  .two-col,
  .login-card {
    grid-template-columns: 1fr;
  }
}
