:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-elev2: #1c2333;
  --border: #2a3242;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #4f9dff;
  --accent2: #a371f7;
  --green: #3fb950;
  --amber: #d29922;
  --red: #f85149;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2740 0%, var(--bg) 60%);
}
.login-card {
  width: 360px; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card .sub { color: var(--muted); margin-bottom: 24px; font-size: 13px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
input, select {
  width: 100%; padding: 10px 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 10px 16px; background: var(--accent); color: #fff; border: none;
  border-radius: 8px; font-weight: 600; font-size: 14px;
}
.btn:hover { filter: brightness(1.08); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.danger { background: var(--red); }
.btn.small { padding: 6px 10px; font-size: 12px; }
.error-box { background: rgba(248,81,73,.12); border: 1px solid var(--red); color: #ffb4ae; padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center;
  justify-content: space-between; padding: 12px 24px; background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.topbar .nav { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }
.topbar .nav .who { color: var(--text); }
.badge { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px; border-radius: 999px; background: var(--bg-elev2); color: var(--muted); border: 1px solid var(--border); }
.badge.admin { color: var(--accent2); border-color: var(--accent2); }

.container { max-width: 1400px; margin: 0 auto; padding: 20px 24px 60px; }

/* ---------- Filters ---------- */
.filters { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; }
.filters .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.filters label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display:block; margin-bottom: 4px;}
.filters .actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- Cards / stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat .value.small { font-size: 20px; }

.panel { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.panel h2 .muted { color: var(--muted); font-weight: 400; font-size: 12px; }
.charts-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.charts-row.three { grid-template-columns: 1fr 1fr; }
@media (max-width: 980px){ .charts-row, .charts-row.three { grid-template-columns: 1fr; } }
.chart-box { position: relative; height: 300px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; user-select: none; }
tbody tr:hover { background: var(--bg-elev2); cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.pill.gezsen { color: #7ee2b8; border-color:#2e6b52; }
.pill.go { color:#8fbcff; border-color:#2f5488; }
.pill.il { color:#d6c17a; }
.pill.alt { color:#c99fe8; }
.verified { color: var(--accent); }

/* ---------- Media grid ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.media-card { background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.media-card .thumb { position: relative; width: 100%; aspect-ratio: 1/1; background: #0b0e14; overflow: hidden; }
.media-card .thumb img { width: 100%; height: 100%; object-fit: cover; display:block; }
.media-card .thumb .type { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); border-radius: 6px; padding: 2px 6px; font-size: 10px; }
.media-card .body { padding: 10px; font-size: 12px; }
.media-card .cap { color: var(--muted); height: 32px; overflow: hidden; margin-bottom: 8px; }
.media-card .metrics { display: flex; gap: 12px; color: var(--text); }
.media-card .metrics span { display:flex; align-items:center; gap:4px; }
.media-card .date { color: var(--muted); font-size: 11px; margin-top: 6px; }
.thumb-fallback { display:flex;align-items:center;justify-content:center;height:100%;color:var(--muted);font-size:11px;text-align:center;padding:8px;}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab { padding: 8px 16px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; z-index: 100; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px; }
.modal-overlay.open { display: flex; }
.modal { width: 900px; max-width: 100%; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.modal .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal .modal-head h2 { margin: 0; font-size: 17px; }
.modal .modal-body { padding: 20px; }
.close-x { background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; margin-bottom: 20px; }
.kv .k { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.kv .v { font-size: 16px; font-weight: 600; }

.muted { color: var(--muted); }
.loading { color: var(--muted); padding: 30px; text-align: center; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 18px; }
.hidden { display: none !important; }
.flex { display:flex; align-items:center; gap: 10px; }
.spacer { flex: 1; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--bg-elev2); border: 1px solid var(--border); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 200; display:none; }
.toast.show { display: block; }
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }

/* ---------- Heatmap ---------- */
.heatmap { display: grid; grid-template-columns: 32px repeat(24, 1fr); gap: 2px; font-size: 9px; align-content: start; overflow-x: auto; }
.heatmap .hc { aspect-ratio: 1/1; border-radius: 2px; background: var(--bg-elev2); min-width: 10px; }
.heatmap .hlbl { color: var(--muted); display: flex; align-items: center; justify-content: center; }
.heatmap .hhdr { color: var(--muted); text-align: center; font-size: 8px; }

/* ---------- Detay modal ek ---------- */
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 8px; }
.mini-card { background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.mini-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.mini-card .mm { padding: 6px; font-size: 11px; }
.sort-arrow::after { content: " ⇅"; color: var(--muted); font-size: 9px; }
.sort-arrow.asc::after { content: " ↑"; color: var(--accent); }
.sort-arrow.desc::after { content: " ↓"; color: var(--accent); }
