@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,300;0,400;0,500;0,600;1,400&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg:          #070c14;
  --surface:     #0c1420;
  --surface2:    #111b2d;
  --surface3:    #162133;
  --border:      #1c2d45;
  --border2:     #253d5a;
  --text:        #c8d6e8;
  --text-muted:  #4a6080;
  --text-bright: #e8f2ff;
  --accent:      #00cc7a;
  --accent-dim:  rgba(0,204,122,0.07);
  --accent-bdr:  rgba(0,204,122,0.22);
  --red:         #e53e3e;
  --orange:      #dd6b20;
  --yellow:      #c8920a;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 56px;
  background: rgba(7,12,20,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-bright);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-right: 28px;
  border-right: 1px solid var(--border);
  margin-right: 20px;
}

.nav-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.12em;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: livepulse 2.2s infinite;
}

@keyframes livepulse {
  0%,100% { opacity:1; box-shadow: 0 0 0 0 rgba(0,204,122,.5); }
  50%      { opacity:.8; box-shadow: 0 0 0 5px rgba(0,204,122,0); }
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.nav-link {
  padding: 7px 14px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface2);
}

.nav-link.active {
  color: var(--accent);
  border-color: var(--accent-bdr);
  background: var(--accent-dim);
}

/* ── PAGE WRAPPERS ──────────────────────────────────────────── */
.page     { padding-top: 56px; min-height: 100vh; }
.page-full{ height: 100vh; padding-top: 56px; position: relative; overflow: hidden; }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
}

.card-header {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── FORM ELEMENTS ──────────────────────────────────────────── */
label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}

input, select, textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
  color: var(--text-bright);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-bdr);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

input::placeholder { color: var(--text-muted); }

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a6080' fill='none' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

select option { background: var(--surface2); color: var(--text-bright); }

.form-group { margin-bottom: 20px; }
.form-hint { margin-top: 5px; font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--accent);
  color: #041a0e;
  border: none;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover:not(:disabled) { background: #00e888; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,204,122,.25); }
.btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-bdr);
}
.btn-ghost:hover:not(:disabled) { background: var(--accent-dim); }

/* ── STATS ──────────────────────────────────────────────────── */
.stat-value { font-size: 26px; font-weight: 600; color: var(--text-bright); line-height: 1.1; letter-spacing: -0.02em; }
.stat-label { font-size: 10px; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px; }

/* ── BADGE ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-green  { background: rgba(0,204,122,.14);  color: #00cc7a; }
.badge-red    { background: rgba(229,62,62,.14);   color: #e53e3e; }
.badge-yellow { background: rgba(200,146,10,.14);  color: #c8920a; }
.badge-blue   { background: rgba(59,130,246,.14);  color: #3b82f6; }

/* ── TABLE ──────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); text-align: left; padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 11px 16px; border-bottom: 1px solid rgba(28,45,69,.5); color: var(--text); font-size: 13px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }

/* ── GRID ───────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ── MAP ────────────────────────────────────────────────────── */
.map-wrap { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.leaflet-container { background: #e8e0d8 !important; }

/* ── LOADING ────────────────────────────────────────────────── */
.loading { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 13px; padding: 20px 0; }
.spinner {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ──────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 22px; border-radius: 6px;
  font-size: 13px; transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
  z-index: 9999; max-width: 380px; text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
#toast.show    { transform: translateX(-50%) translateY(0); }
#toast.success { border-color: var(--accent-bdr); color: var(--accent); }
#toast.error   { border-color: rgba(229,62,62,.35); color: var(--red); }

/* ── CHART ──────────────────────────────────────────────────── */
.chart-wrap { position: relative; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 820px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-brand span.tagline { display: none; }
  .nav-link { padding: 7px 10px; }
}
@media (max-width: 540px) {
  nav { padding: 0 14px; }
  .nav-link { font-size: 10px; padding: 6px 8px; letter-spacing: 0.04em; }
}