/* Panel stili — site kimliğiyle ortak tasarım belirteçleri (../style.css ile aynı palet). */
:root {
  --bg: #0e1420;
  --bg-soft: #131a27;
  --bg-card: #18202e;
  --border: #283349;
  --text: #e8eef6;
  --text-muted: #9aa7b8;
  --accent: #2dd4bf;          /* teal — birincil vurgu */
  --accent-2: #f59e0b;        /* amber — ikincil vurgu */
  --danger: #f87171;
  --ok: #34d399;
  --link: #7dd3fc;
  --radius: 12px;
  --maxw: 1100px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Sticky nav ---------- */

nav {
  position: sticky;
  top: 0;
  z-index: 1100; /* Leaflet panelleri z-index ~1000 kullanır */
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.2rem;
  align-items: baseline;
  padding: 0.7rem 1.25rem;
  background: rgba(14, 20, 32, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
nav .brand { font-weight: 700; color: var(--accent); margin-right: 0.8rem; letter-spacing: -0.01em; }
nav a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.1rem;
  transition: color 0.15s ease;
}
nav a:hover { color: var(--text); text-decoration: none; }
nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

main { max-width: var(--maxw); margin: 0 auto; padding: 1.25rem 1.25rem 3rem; }

h1 { font-size: 1.5rem; letter-spacing: -0.01em; margin: 1rem 0 1rem; }
h1::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin-top: 0.5rem;
}
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; margin-bottom: 0.4rem; }

a { color: var(--link); }
code {
  font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
}

/* ---------- Kartlar ---------- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.1rem 0;
}
.card h2 { margin-top: 0.2rem; }

/* ---------- İstatistik kartları (büyük sayı + küçük başlık) ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  margin: 1rem 0 1.25rem;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat-sub { font-size: 0.78rem; color: var(--text-muted); }
.stat-ok { color: var(--accent); }
.stat-bad { color: var(--accent-2); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.15rem 1rem; margin: 0.5rem 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; }

/* ---------- Tablolar (sitedeki fiyat tablosuyla aynı dil) ---------- */

.table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0.75rem 0 1.25rem;
}
.card .table-wrap { background: var(--bg-soft); }

table { border-collapse: collapse; width: 100%; min-width: 600px; font-size: 0.92rem; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--bg-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.card th { background: rgba(14, 20, 32, 0.55); }
tr:last-child td { border-bottom: none; }
tr:nth-child(odd) td { background: rgba(255, 255, 255, 0.025); } /* 1. satır başlık: veri satırları zebra */
tr:hover td { background: rgba(45, 212, 191, 0.06); }
td { font-variant-numeric: tabular-nums; }

/* ---------- Durum çipleri ---------- */

.chip {
  display: inline-block;
  padding: 0.08rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.55;
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip-active {
  color: var(--accent-2);
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.45);
}
.chip-cleared {
  color: var(--accent);
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.4);
}
.chip-pending {
  color: var(--text-muted);
  background: rgba(154, 167, 184, 0.12);
  border-color: rgba(154, 167, 184, 0.35);
}
.chip-neutral { color: var(--text-muted); border-color: var(--border); }

.muted { color: var(--text-muted); }
.ok { color: var(--ok); }
.bad { color: var(--danger); }

/* ---------- Uyarı bandı ---------- */

.banner {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  margin: 0.6rem 0 1rem;
}
.banner.warn {
  background: rgba(245, 158, 11, 0.09);
  color: #fbd38d;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-left: 4px solid var(--accent-2);
}

/* ---------- Filtre hapları ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filters a {
  margin: 0;
  padding: 0.25rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.filters a:hover { color: var(--text); border-color: var(--text-muted); }
.filters a.active {
  color: var(--accent);
  background: rgba(45, 212, 191, 0.08);
  border-color: rgba(45, 212, 191, 0.5);
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Harita & grafikler ---------- */

.map {
  height: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}
.map.mini { height: 260px; max-width: 560px; }

canvas { max-height: 320px; }

/* ---------- Erişim anahtarı formu ---------- */

.token-form {
  max-width: 460px;
  margin: 3.5rem auto;
  padding: 2rem 1.8rem 1.8rem;
  text-align: center;
}
.token-form h2 { margin-top: 0; }
.token-form input[type="password"] {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  width: 100%;
  max-width: 420px;
  font: inherit;
  text-align: center;
}
.token-form input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}
.token-form button {
  background: var(--accent);
  color: var(--bg);
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 1.4rem;
  margin-top: 0.9rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.token-form button:hover { filter: brightness(1.12); }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  main { padding: 1rem 0.9rem 2.5rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 0 1rem; }
  .kv dt { margin-top: 0.35rem; }
  .map { height: 320px; }
  .map.mini { max-width: none; }
  table { min-width: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  nav a, .filters a, .token-form button { transition: none; }
}
