:root {
  --bg: #0c0c0d;
  --panel: #161617;
  --panel2: #1e1e20;
  --ink: #ececec;
  --muted: #8b8b92;
  --line: #2a2a2d;
  --accent: #e4e4e7;       /* açık gri / beyaza yakın vurgu */
  --accent-ink: #18181b;   /* vurgu üzerindeki yazı */
  --danger: #f87171;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

.topbar {
  background: linear-gradient(120deg, #000, #18181b);
  color: #fff;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar h1 { margin: 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; }
.topbar h1 span { color: var(--muted); }
.sub { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }

.corner { display: flex; align-items: center; gap: 10px; }
.admin-corner { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  font-style: italic; font-family: Georgia, serif; font-size: 1.05rem; font-weight: 700;
  background: rgba(255, 255, 255, .08); color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .22); flex-shrink: 0;
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand-sub { color: var(--muted); font-size: .82rem; font-weight: 600; letter-spacing: .08em; }
.icon-btn:hover { background: rgba(255, 255, 255, .18); }
#admin-btn {
  background: rgba(255, 255, 255, .08); color: #d4d4d8; font-size: .85rem;
  padding: 8px 16px; border: 1px solid rgba(255, 255, 255, .22);
}
#admin-btn:hover { background: rgba(255, 255, 255, .18); }
#admin-durum { color: #a1a1aa; font-size: .78rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px;
  margin-top: 22px;
}

.ptur { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.ptur-tab {
  background: var(--panel2); color: var(--muted); font-weight: 600; font-size: .95rem;
  padding: 10px 20px; border-radius: 10px; border: 1px solid var(--line);
}
.ptur-tab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ptur-tab:hover:not(.active) { background: #27272a; color: var(--ink); }

fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 16px; padding: 14px 16px 18px; }
legend { font-weight: 600; padding: 0 8px; color: var(--ink); }
legend .opt, .opt { font-weight: 400; color: var(--muted); font-size: .82rem; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }

/* Ders giriş satırları: ders adı | Doğru | Yanlış | net */
.subjects { display: flex; flex-direction: column; gap: 10px; }
.subj { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; align-items: end; gap: 12px; }
.subj-name { font-weight: 600; font-size: .92rem; align-self: center; }
.dy { font-size: .74rem; color: var(--muted); gap: 3px; }
.subj-net { align-self: center; font-size: .85rem; font-weight: 700; color: #d4d4d8; text-align: right; font-variant-numeric: tabular-nums; }
.subj-net.err { color: var(--danger); }
@media (max-width: 720px) {
  .subj { grid-template-columns: 1fr 1fr; grid-template-areas: "name name" "d y" "net net"; gap: 6px 10px; }
  .subj-name { grid-area: name; } .subj-net { grid-area: net; text-align: left; }
}
.net-toplam { align-self: center; color: var(--muted); font-size: .85rem; }
.net-toplam.err { color: var(--danger); }

label { display: flex; flex-direction: column; font-size: .82rem; color: var(--muted); gap: 5px; font-weight: 500; }
.mx { color: #6b6b73; font-weight: 400; }
input, select {
  font-size: 1rem; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--panel2); color: var(--ink); width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); background: #232327; }
input::placeholder { color: #6b6b73; }

.actions { display: flex; gap: 12px; margin-top: 4px; align-items: center; }
button {
  font-size: 1rem; font-weight: 600; border: 0; border-radius: 10px;
  padding: 12px 22px; cursor: pointer;
}
#calc { background: var(--accent); color: var(--accent-ink); }
#calc:hover { background: #fff; }
.ghost { background: var(--panel2); color: var(--ink); border: 1px solid var(--line); }
.ghost:hover { background: #27272a; }

.hidden { display: none; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card .k { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.card .v { font-size: 1.5rem; font-weight: 800; margin-top: 4px; }
.card.hl { background: #26262a; border-color: #3a3a40; }
.card.hl .v { color: #fff; }
.card.hl2 { background: #2b2b30; border-color: #45454c; }
.card.hl2 .v { color: #fff; }

.hint { color: var(--muted); font-size: .85rem; margin: 12px 2px 0; }

.yil-panel h3 { margin: 0 0 12px; font-size: 1.05rem; }
.yil-foot { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
#ag-kaydet { background: var(--accent); color: var(--accent-ink); padding: 10px 18px; font-size: .92rem; }
#ag-kaydet:hover { background: #fff; }
.yil-rows { display: flex; flex-direction: column; gap: 12px; }
.yil-row { display: grid; grid-template-columns: 130px 1fr 52px 120px 120px; align-items: center; gap: 12px; }
.yil-lbl { font-weight: 600; }
.yil-w { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.yil-puan { color: var(--muted); font-size: .9rem; }
.yil-sira { font-weight: 700; color: #fff; text-align: right; font-variant-numeric: tabular-nums; }
.yil-row input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; padding: 0; }
@media (max-width: 720px) {
  .yil-row { grid-template-columns: 1fr 44px; grid-template-areas: "lbl w" "slider slider" "puan sira"; }
  .yil-lbl { grid-area: lbl; } .yil-w { grid-area: w; }
  .yil-row input[type="range"] { grid-area: slider; }
  .yil-puan { grid-area: puan; } .yil-sira { grid-area: sira; text-align: left; }
}

.prog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 10px; flex-wrap: wrap; }
.prog-head h2 { font-size: 1.15rem; margin: 0; }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 2px 10px; font-size: .8rem; margin-left: 6px; font-weight: 700; }
.prog-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.prog-filters #filter { width: 220px; }
.prog-filters select { cursor: pointer; max-width: 180px; }
@media (max-width: 560px) { .prog-filters { width: 100%; } .prog-filters #filter, .prog-filters select { flex: 1; max-width: none; width: auto; } }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; max-height: 520px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #1a1a1c; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); position: sticky; top: 0; }
tbody tr:hover { background: var(--panel2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td.bolum { white-space: normal; min-width: 220px; }
.tag { font-size: .72rem; padding: 1px 7px; border-radius: 6px; background: #27272a; color: var(--muted); }
.tag.vakif { background: #3a3a40; color: #e4e4e7; }
.tag.devlet { background: #242427; color: #a1a1aa; }

/* info penceresi (modal) */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.hidden { display: none; }   /* .modal'dan daha özgül -> kapanır */
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); }
.modal-box {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); padding: 24px 26px;
  max-width: 640px; width: 100%; max-height: 84vh; overflow-y: auto;
}
.modal-box h3 { margin: 0 0 10px; font-size: 1.2rem; }
.modal-close {
  position: absolute; top: 12px; right: 14px; background: transparent; color: var(--muted);
  font-size: 1.6rem; line-height: 1; padding: 4px 8px; border-radius: 8px;
}
.modal-close:hover { background: var(--panel2); color: var(--ink); }
.modal-meta { color: var(--muted); font-size: .85rem; margin: 0 0 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pay-box, .admin-box { max-width: 460px; }
.pay-iframe { width: 100%; min-height: 560px; border: 0; border-radius: 10px; background: #fff; }
#pay-frame-wrap { margin-top: 12px; }
.modal-input { width: 100%; margin: 10px 0 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.modal-actions button:not(.ghost) { background: var(--accent); color: var(--accent-ink); }
.modal-actions button:not(.ghost):hover { background: #fff; }
.fiyat-rozet { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 2px 12px; font-size: .9rem; font-weight: 700; margin-left: 6px; }

/* toast (native alert yerine) */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #26262a; color: var(--ink); border: 1px solid var(--line);
  padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow);
  z-index: 100; max-width: 90vw; font-size: .9rem;
}

.info-body { margin-top: 8px; }
.info-body h4 { margin: 16px 0 4px; color: var(--ink); font-size: .95rem; }
.info-body p { margin: 0; color: #b8b8c0; font-size: .9rem; }
.info-body code { background: var(--panel2); padding: 1px 6px; border-radius: 5px; font-size: .85rem; color: #e4e4e7; }
.info-body .warn { margin-top: 16px; color: var(--muted); }

@media (max-width: 560px) { .topbar h1 { font-size: 1.35rem; } .icon-btn { width: 30px; height: 30px; } #admin-btn { padding: 6px 12px; font-size: .8rem; } }
