:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --border: #e4e3de;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #7a7974;
  --accent: #2a78d6;
  --up: #0f7a3d;
  --down: #c4302b;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110;
    --surface: #1a1a19;
    --surface-2: #242422;
    --border: #2f2f2c;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --text-3: #908f86;
    --accent: #5598e7;
    --up: #3fbf74;
    --down: #ef6b64;
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface: #1a1a19; --surface-2: #242422; --border: #2f2f2c;
  --text: #ffffff; --text-2: #c3c2b7; --text-3: #908f86; --accent: #5598e7;
  --up: #3fbf74; --down: #ef6b64;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
img { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Ust bar */
.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav a {
  text-decoration: none; color: var(--text-2); padding: 6px 10px; border-radius: 999px;
  white-space: nowrap; font-size: 14px;
}
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--text); color: var(--surface); }

main { padding: 24px 0 48px; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0 0 12px; }
.lede { color: var(--text-2); margin: 0 0 20px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }

/* Kartlar */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
  text-decoration: none; transition: border-color .15s;
}
.card:hover { border-color: var(--text-3); }
.card-head { display: flex; gap: 10px; align-items: flex-start; }
.card-head img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.card-title { font-weight: 600; line-height: 1.3; }
.card-foot { display: flex; justify-content: space-between; align-items: center; color: var(--text-3); font-size: 13px; margin-top: auto; }

.orow { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.orow .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.orow .val { font-weight: 600; text-align: right; }
.bar { grid-column: 1 / -1; height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

.badges { display: flex; gap: 4px; flex-wrap: wrap; }
.badge {
  font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--text-2); background: var(--surface-2); white-space: nowrap;
}
.badge.closed { color: var(--down); }

/* Event sayfasi */
.ev-head > div { min-width: 0; }
.ev-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.ev-head img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; }
.meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-2); font-size: 14px; }
.panel {
  min-width: 0; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.src-link { font-size: 14px; color: var(--accent); text-decoration: none; }
.src-link:hover { text-decoration: underline; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 12px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.otable .pbar { width: 38%; }
.otable .pbar .bar { height: 6px; }
.big { font-size: 17px; font-weight: 700; }
.up { color: var(--up); }
.down { color: var(--down); }
.inactive td { color: var(--text-3); }

.ranges { display: flex; gap: 4px; }
.ranges a { text-decoration: none; font-size: 13px; padding: 4px 10px; border-radius: 6px; color: var(--text-2); border: 1px solid var(--border); }
.ranges a.on { background: var(--text); color: var(--surface); border-color: var(--text); }

/* Grafik */
.chart { margin: 0; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0; margin: 0 0 8px; font-size: 13px; color: var(--text-2); }
.legend .sw { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.plot { position: relative; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.gl { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; }
.axis { fill: var(--text-3); font-size: 11px; }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dot { stroke: var(--surface); stroke-width: 2; }
.direct { fill: var(--text-2); font-size: 12px; }
.direct .val { fill: var(--text); font-weight: 600; }
.line.s1 { stroke: var(--s1); } .dot.s1, .sw.s1 { fill: var(--s1); background: var(--s1); }
.line.s2 { stroke: var(--s2); } .dot.s2, .sw.s2 { fill: var(--s2); background: var(--s2); }
.line.s3 { stroke: var(--s3); } .dot.s3, .sw.s3 { fill: var(--s3); background: var(--s3); }
.line.s4 { stroke: var(--s4); } .dot.s4, .sw.s4 { fill: var(--s4); background: var(--s4); }
.cross { stroke: var(--text-3); stroke-width: 1; }
.tip {
  position: absolute; top: 0; pointer-events: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; box-shadow: 0 4px 12px rgb(0 0 0 / .12); white-space: nowrap;
}
.tip b { font-weight: 600; }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.chart-empty { color: var(--text-3); font-size: 14px; }

.desc { color: var(--text-2); font-size: 14px; white-space: pre-line; }
details summary { cursor: pointer; color: var(--text-2); font-size: 14px; }

.foot { border-top: 1px solid var(--border); padding: 20px 0 32px; color: var(--text-3); font-size: 13px; }
.foot p { margin: 4px 0; }

/* Yonetim */
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-tabs a { text-decoration: none; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; }
.admin-tabs a.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.atable td { vertical-align: top; font-size: 14px; }
.atable .t { font-weight: 600; }
.atable img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.btn {
  display: inline-block; font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--down); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
form.inline { display: inline; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--text-2); }
input[type=text], input[type=url], input[type=search], textarea, select {
  font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); width: 100%;
}
textarea { min-height: 90px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.flash.err { color: var(--down); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select { width: auto; }
.pager { display: flex; gap: 8px; margin-top: 12px; }

@media (max-width: 640px) {
  h1 { font-size: 21px; }
  .ev-head img { width: 48px; height: 48px; }
  .otable .pbar { display: none; }
  .hide-sm { display: none; }
  .top .wrap { gap: 12px; }
}

/* Kategori ikonu (kaynak gorselleri yerine) */
.cat-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 22%; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.prose h2 { margin: 18px 0 6px; font-size: 16px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 8px; color: var(--text-2); }
