:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1c2230;
  --muted: #667085;
  --line: #e3e6ec;
  --primary: #b4232c;
  --primary-ink: #ffffff;
  --primary-soft: #fbe9ea;
  --ok: #157f3d;
  --ok-soft: #e6f4ea;
  --err: #b42318;
  --err-soft: #fdecea;
  --info-soft: #eaf1fb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; font-size: 16px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: .2rem 0 .6rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 .8rem; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 24px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: var(--primary-ink);
  display: grid; place-items: center; font-size: 16px; }
.nav { display: flex; gap: 18px; align-items: center; }
.nav a, .linkbtn { color: var(--text); font: inherit; }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--primary); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.hero { margin-top: 6vh; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card { margin-top: 20px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > label { flex: 1 1 200px; }
.inline { display: inline; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
label .muted { font-weight: 400; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: 4px; }

input, textarea, select {
  font: inherit; width: 100%; padding: 10px 12px; border: 1px solid #cfd4dc; border-radius: 8px;
  background: #fff; color: var(--text);
}
input[type="checkbox"], input[type="radio"] { width: auto; }
input:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
textarea { resize: vertical; }
.code-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.3rem;
  letter-spacing: .12em; text-transform: uppercase; text-align: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--primary); background: var(--primary);
  color: var(--primary-ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(.95); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: #fff; color: var(--text); border-color: #cfd4dc; }
.btn-ghost:hover { background: #f6f7f9; filter: none; }
.btn-danger { background: var(--err); border-color: var(--err); }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-lg { padding: 14px 22px; font-size: 1.05rem; width: 100%; }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: #b7e1c3; }
.alert-err { background: var(--err-soft); color: var(--err); border-color: #f5c2bd; }
.alert-info { background: var(--info-soft); color: #1d4f91; border-color: #c4d7f2; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: #eef0f3; color: #475467; }
.badge-aktif { background: var(--ok-soft); color: var(--ok); }
.badge-kapali { background: #f2f4f7; color: #344054; }
.badge-taslak { background: #fff4e0; color: #8a5300; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td .btn + .btn { margin-left: 4px; }
.filter { margin-top: 18px; max-width: 320px; }

.list { list-style: none; padding: 0; margin: 0 0 16px; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  color: var(--muted); font-size: .88rem; }
.stat span { display: block; font-size: 1.7rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.results .stat { background: #fafbfc; }

.danger-zone { border-color: #f5c2bd; }
.danger-zone input { max-width: 240px; }

/* Oy pusulası */
.ballot { max-width: 720px; margin: 0 auto 20px; }
.desc { color: #344054; }
.hint { font-size: 1.05rem; }
.choices { display: grid; gap: 10px; margin: 16px 0; }
.choice { display: flex; align-items: center; gap: 14px; padding: 16px; border: 2px solid var(--line);
  border-radius: 10px; cursor: pointer; font-weight: 400; transition: border-color .15s, background .15s; }
.choice:hover { border-color: #c3c8d1; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-box { flex: 0 0 26px; height: 26px; border: 2px solid #98a2b3; border-radius: 6px; display: grid; place-items: center; }
.choice input[type="radio"] + .choice-box { border-radius: 50%; }
.choice.is-checked { border-color: var(--primary); background: var(--primary-soft); }
.choice.is-checked .choice-box { background: var(--primary); border-color: var(--primary); }
.choice.is-checked .choice-box::after { content: "✓"; color: #fff; font-weight: 700; font-size: 15px; }
.choice input:focus-visible + .choice-box { outline: 2px solid var(--primary); outline-offset: 2px; }
.choice input:disabled ~ .choice-text { opacity: .5; }
.choice-text { display: grid; }
.choice-text strong { font-size: 1.05rem; }
.choice-text small { color: var(--muted); }
.counter { min-height: 1.2em; }

.done { text-align: center; padding: 20px 0; }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok);
  font-size: 32px; display: grid; place-items: center; margin: 0 auto 10px; }

/* Sonuçlar */
.live { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: .82rem; color: var(--err); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--err); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } .bar-fill { transition: none; } }
.bars { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 16px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.bar-name { font-weight: 600; font-size: 1.05rem; }
.bar-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-val strong { color: var(--text); }
.bar-track { height: 14px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: #98a2b3; border-radius: 999px; transition: width .6s ease; }
.bar.lead .bar-fill { background: var(--primary); }

.foot { color: var(--muted); font-size: .82rem; padding-bottom: 32px; text-align: center; }

@media (max-width: 560px) {
  .card { padding: 18px; }
  h1 { font-size: 1.35rem; }
  .actions .btn { flex: 1; }
}
