/* ============================================================================
   Europe Panel — Tasarım Sistemi (koyu tema)
   Linear / Vercel / Plausible estetiği. Tek CSS, sıfır CLS.
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Palet */
  --bg: #0b0e14;
  --surface: #141925;
  --surface-2: #1c2230;
  --surface-3: #232a3a;
  --border: #2a3140;
  --border-soft: #222836;
  --text: #e6e9ef;
  --text-dim: #8a93a6;
  --text-faint: #5d6678;
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, 0.14);
  --accent-hover: #6fa1ff;
  --green: #3fb950;
  --green-soft: rgba(63, 185, 80, 0.14);
  --red: #f85149;
  --red-soft: rgba(248, 81, 73, 0.14);
  --amber: #d29922;
  --amber-soft: rgba(210, 153, 34, 0.14);

  /* Geometri */
  --r: 10px;
  --r-sm: 7px;
  --r-lg: 14px;
  --sidebar-w: 240px;

  /* Boşluk (8px taban) */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 0.86em;
}

::selection { background: var(--accent-soft); }

/* Scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ============================================================================
   KABUK — Sidebar + İçerik
   ============================================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  grid-column: 1;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
}
.sidebar-brand:hover { color: var(--text); }
.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--green));
  flex: 0 0 auto;
}
.brand-sub { color: var(--accent); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 12px;
  flex: 1;
  overflow-y: auto;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 13.5px;
  position: relative;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover { color: var(--text); background: var(--surface-2); }
.sidebar-nav a.active { color: var(--text); background: var(--surface-2); }
.sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-ico {
  flex: 0 0 18px;
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: .85;
}
.nav-ico svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.sidebar-foot {
  border-top: 1px solid var(--border-soft);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.user-avatar {
  flex: 0 0 30px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hover);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}
.user-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- İçerik ---- */
.content {
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.content-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 14, 20, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: 0 var(--s6);
  min-height: 60px;
}
.page-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }

.content-body {
  padding: var(--s5) var(--s6) var(--s7);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}

/* ---- Hamburger (mobil) ---- */
.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }
.sidebar-backdrop { display: none; }

/* ============================================================================
   KARTLAR
   ============================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s5);
  min-height: 0;
}
.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 var(--s4);
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
  letter-spacing: -0.01em;
}
.card-title .muted { font-weight: 500; font-size: 0.78rem; }

/* Genel grid yardımcıları (sabit kolon → sıfır CLS) */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s4);
}
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }

/* Stat kartı (analytics / index / manage) */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  min-height: 104px;
}
.stat-label {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-top: var(--s1);
}
.stat-sub { margin-top: var(--s1); font-size: 0.78rem; color: var(--text-dim); }
.stat-bot .stat-value { color: var(--amber); }

/* ============================================================================
   KPI ŞERİDİ (Komuta Merkezi)
   ============================================================================ */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--s4);
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s4) var(--s5);
  min-height: 116px;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  transition: border-color .15s;
}
.kpi-card:hover { border-color: var(--surface-3); }
.kpi-label {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-period {
  font-size: 0.62rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  text-transform: none;
}
.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-top: auto;
}
.kpi-value.empty { color: var(--text-faint); }
.kpi-foot {
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
  font-size: 0.78rem;
}
.kpi-prev { color: var(--text-dim); font-size: 0.74rem; }
.kpi-trend {
  font-weight: 600;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.kpi-trend.up   { color: var(--green); background: var(--green-soft); }
.kpi-trend.down { color: var(--red);   background: var(--red-soft); }
.kpi-trend.flat { color: var(--text-dim); background: var(--surface-2); }

/* ============================================================================
   TABLOLAR
   ============================================================================ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-sm);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th, .table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  white-space: nowrap;
}
.table thead th {
  color: var(--text-dim);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.table tbody tr { transition: background .12s; }
.table tbody tr:nth-child(even) { background: rgba(255,255,255,0.012); }
.table tbody tr:hover { background: var(--accent-soft); }
.table tbody tr:last-child td { border-bottom: none; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td strong { font-weight: 600; }

.muted { color: var(--text-dim); }
.flag { font-size: 15px; margin-right: 6px; vertical-align: -1px; }
.msg-cell {
  max-width: 320px;
  white-space: normal;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
}
.key-mask { letter-spacing: 1px; }
.actions-cell { white-space: nowrap; }

.table .row-active { background: var(--accent-soft); }
.table .row-active:hover { background: var(--accent-soft); }
.path-cell {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
}
.table tfoot .row-total td {
  border-top: 1px solid var(--border);
  border-bottom: none;
  background: var(--surface-2);
  font-weight: 600;
}

/* ============================================================================
   ROZETLER
   ============================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-ok    { background: var(--green-soft); color: var(--green); border-color: rgba(63,185,80,0.32); }
.badge-warn  { background: var(--amber-soft); color: var(--amber); border-color: rgba(210,153,34,0.32); }
.badge-err   { background: var(--red-soft);   color: var(--red);   border-color: rgba(248,81,73,0.32); }
.badge-muted { background: var(--surface-2);  color: var(--text-dim); border-color: var(--border); }
.badge-busy  {
  background: var(--accent-soft); color: var(--accent-hover);
  border-color: rgba(79,140,255,0.32);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ============================================================================
   BUTONLAR
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  transition: background .15s, border-color .15s, opacity .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--red-soft); border-color: rgba(248,81,73,0.4); color: var(--red); }
.btn-danger:hover { background: rgba(248,81,73,0.22); color: var(--red); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-icon { padding: 6px 10px; font-size: 14px; }
.actions-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin: var(--s3) 0; }
.inline-form { display: inline-block; margin: 0 4px 0 0; }
.cell-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ============================================================================
   FORMLAR
   ============================================================================ */
label {
  display: block;
  font-size: 0.74rem;
  color: var(--text-dim);
  margin: 0 0 6px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
input[type="text"], input[type="password"], input[type="email"], input[type="search"],
select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select { cursor: pointer; }

.form-inline { display: flex; gap: var(--s4); align-items: flex-end; flex-wrap: wrap; }
.form-inline .field { min-width: 180px; }
.form-inline .field.grow { flex: 1; min-width: 260px; }
.form-inline .field-btn { min-width: auto; }
.field { margin: 0; }
.filter-form { margin: 0; }

.status-select { width: auto; min-width: 156px; font-size: 12.5px; padding: 6px 10px; }
.status-new       { border-color: rgba(79,140,255,0.5); }
.status-read      { border-color: var(--border); }
.status-contacted { border-color: rgba(210,153,34,0.5); }
.status-closed    { border-color: var(--border); color: var(--text-dim); }

/* ============================================================================
   UYARILAR
   ============================================================================ */
.alert {
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  border: 1px solid;
}
.alert code { background: rgba(0,0,0,0.25); }
.alert-info  { background: var(--accent-soft); border-color: rgba(79,140,255,0.4); color: #b9caff; }
.alert-ok    { background: var(--green-soft);  border-color: rgba(63,185,80,0.4);  color: #a6e8b0; }
.alert-warn  { background: var(--amber-soft);  border-color: rgba(210,153,34,0.4); color: #f0d49a; }
.alert-error { background: var(--red-soft);    border-color: rgba(248,81,73,0.4);  color: #f6a9a4; }
.alert a { color: inherit; text-decoration: underline; }

/* Boş durum */
.empty-state {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  padding: 22px 18px;
  color: var(--text-dim);
  font-size: 13.5px;
  text-align: center;
}
.empty-state.sm { padding: 14px; font-size: 12.5px; }

/* ============================================================================
   LOGIN
   ============================================================================ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(79,140,255,0.10), transparent 60%),
    var(--bg);
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 30px;
  box-shadow: var(--shadow);
}
.login-brand {
  font-weight: 800;
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.02em;
  margin-bottom: var(--s1);
}
.login-box h1 { font-size: 0.95rem; font-weight: 500; color: var(--text-dim); margin: 0 0 22px; }
.login-box form { display: flex; flex-direction: column; gap: 14px; }
.login-box label { margin: 0 0 6px; }
.login-box .field { margin: 0; }
.login-box .btn { margin-top: var(--s2); }
.login-hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

/* ============================================================================
   SİTE DETAYI (site.php — kapsam dışı, sınıfları korunur)
   ============================================================================ */
.info-list {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 13.5px;
}
.info-list dt { color: var(--text-dim); font-weight: 600; }
.info-list dd { margin: 0; }
.theme-preview { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 26px; height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.18);
  display: inline-block;
}

/* Progress bar */
.progress {
  position: relative;
  height: 26px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: var(--s3) 0 var(--s2);
}
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 999px;
  transition: width .35s ease;
}
.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

/* Import log */
.import-log {
  background: #07090e;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  max-height: 320px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  margin-top: var(--s3);
}
.log-line { color: var(--text-dim); }
.log-line::before { content: "› "; color: var(--border); }
.log-ok { color: var(--green); }
.log-warn { color: var(--amber); }
.log-err { color: var(--red); }

/* ============================================================================
   GRAFİKLER (saf CSS, kütüphanesiz)
   ============================================================================ */
.legend { display: flex; gap: var(--s4); margin-left: auto; font-size: 12px; color: var(--text-dim); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sw-human { background: var(--accent); }
.sw-bot   { background: var(--amber); }

.chart-note { font-size: 12px; color: var(--text-dim); margin: var(--s3) 0 0; }
.chart-note strong { color: var(--text); font-weight: 600; }

/* Ağ trafiği grafiği (index) */
.netchart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 220px;
  padding: var(--s2) 2px 0;
  border-bottom: 1px solid var(--border);
}
.net-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.net-bars {
  width: 100%;
  max-width: 20px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}
.net-bar { width: 46%; min-height: 0; border-radius: 3px 3px 0 0; transition: filter .15s; }
.net-human { background: var(--accent); }
.net-bot   { background: var(--amber); opacity: .8; }
.net-col:hover .net-bar { filter: brightness(1.25); }
.net-col .net-x {
  margin-top: 5px;
  font-size: 9px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* Günlük bar grafik (analytics detay) */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 180px;
  padding: var(--s2) 2px 0;
  border-bottom: 1px solid var(--border);
}
.bar-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.bar-col .bar {
  width: 100%;
  max-width: 20px;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  transition: filter .15s;
}
.bar-col:hover .bar { filter: brightness(1.25); }
.bar-col .bar-x {
  margin-top: 5px;
  font-size: 9px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* Saatlik dağılım (analytics detay) */
.hour-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 150px;
  padding: var(--s2) 2px 0;
  border-bottom: 1px solid var(--border);
}
.hour-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.hour-bars { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.hour-bar {
  width: 100%;
  max-width: 16px;
  min-height: 0;
  border-radius: 3px 3px 0 0;
  background: var(--green);
  transition: filter .15s;
}
.hour-col:hover .hour-bar { filter: brightness(1.25); }
.hour-col .hour-x {
  margin-top: 5px;
  font-size: 9px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* İnsan/Bot oran çubuğu (analytics detay) */
.ratio-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.ratio-human { background: var(--accent); }
.ratio-bot   { background: var(--amber); opacity: .8; }

/* Dağılım listesi (ülke vb.) */
.dist-list { display: flex; flex-direction: column; gap: 9px; }
.dist-row {
  display: grid;
  grid-template-columns: 90px 1fr 64px;
  align-items: center;
  gap: var(--s3);
}
.dist-label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.dist-bar {
  height: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.dist-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.dist-val { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-dim); }

/* ============================================================================
   LİDER TABLOLARI (index C)
   ============================================================================ */
.lead-card { min-height: 160px; }
.lead-list { list-style: none; margin: 0; padding: 0; counter-reset: lead; }
.lead-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}
.lead-list li:last-child { border-bottom: none; }
.lead-rank {
  counter-increment: lead;
  flex: 0 0 22px;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lead-rank::before { content: counter(lead); }
.lead-list li:nth-child(1) .lead-rank { background: var(--accent-soft); color: var(--accent-hover); }
.lead-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead-name:hover { color: var(--accent-hover); }
.lead-val {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

/* ============================================================================
   SAĞLIK ŞERİDİ (index D)
   ============================================================================ */
.health-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s5);
}
.health-item { min-width: 0; }
.health-top { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; margin-bottom: 8px; }
.health-num { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.health-cap { font-size: 12px; color: var(--text-dim); }
.health-bar {
  height: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.health-fill { display: block; height: 100%; border-radius: 999px; }
.health-fill.ok     { background: var(--green); }
.health-fill.accent { background: var(--accent); }
.health-fill.warn   { background: var(--amber); }
.health-fill.err    { background: var(--red); }

/* ============================================================================
   MASTER TABLO (index F)
   ============================================================================ */
.master-filter {
  width: auto;
  min-width: 240px;
  max-width: 340px;
  margin-left: auto;
  font-size: 13px;
  padding: 7px 12px;
}
.master-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 5;
}
.master-table th.sortable { cursor: pointer; user-select: none; }
.master-table th.sortable:hover { color: var(--text); }
.master-table th.sortable::after { content: "⇅"; font-size: 9px; margin-left: 5px; opacity: .35; }
.master-table th.sorted-asc::after  { content: "▲"; opacity: .9; color: var(--accent-hover); }
.master-table th.sorted-desc::after { content: "▼"; opacity: .9; color: var(--accent-hover); }
.master-table td { white-space: nowrap; }
.dom-link { color: var(--text-dim); }
.dom-link:hover { color: var(--accent-hover); }
.dom-link .ext { font-size: 10px; opacity: .7; }
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.dot-ok  { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot-off { background: var(--text-faint); box-shadow: 0 0 0 3px rgba(93,102,120,0.18); }
.dot-lbl { font-size: 12.5px; }
.pill-new {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 6px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ============================================================================
   DÖNEM TOGGLE (analytics)
   ============================================================================ */
.period-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 3px;
}
.period-label { font-size: 12px; color: var(--text-dim); font-weight: 600; padding: 0 8px 0 6px; }
.period-btn {
  padding: 5px 13px;
  border-radius: 5px;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
}
.period-btn:hover { color: var(--text); background: var(--surface-2); }
.period-btn.active { background: var(--accent); color: #fff; }
.period-btn.active:hover { background: var(--accent-hover); color: #fff; }

/* ============================================================================
   TOOLBAR (kart başlığı + aksiyon)
   ============================================================================ */
.manage-toolbar {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-bottom: var(--s4);
}
.manage-toolbar .manage-title { margin: 0; }
.manage-note { font-size: 12.5px; }
.manage-progress { margin: var(--s1) 0 var(--s4); }
.manage-table td { vertical-align: top; }
.cache-age {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-faint);
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
}
.detail-head .card-title { margin: 0; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 264px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 35;
  }
  .content { grid-column: 1; }
  .nav-toggle { display: inline-flex; }
  .content-topbar { padding: 0 var(--s4); gap: var(--s3); }
  .content-body { padding: var(--s4) var(--s4) var(--s7); gap: var(--s4); }
  .page-title { font-size: 1.25rem; }
}

@media (max-width: 600px) {
  .kpi-value, .stat-value { font-size: 1.6rem; }
  .netchart { height: 170px; }
  .bar-chart { height: 140px; }
  .hour-chart { height: 120px; }
  .net-col .net-x, .bar-col .bar-x, .hour-col .hour-x { font-size: 8px; }
  .master-filter { min-width: 0; width: 100%; margin: var(--s2) 0 0; }
  .path-cell { max-width: 180px; }
  .dist-row { grid-template-columns: 72px 1fr 52px; gap: var(--s2); }
}
