:root {
    --navy: #12213d; --navy2: #1e3966; --red: #c8102e; --red-dark: #a30f29;
    --bg: #f3f6fb; --surface: #fff; --line: #e4eaf3; --text: #18243a; --muted: #68778d;
    --ok: #087443; --ok-bg: #effaf3; --err: #a61b31; --err-bg: #fff2f4; --warn: #8a5a00; --warn-bg: #fff8e6;
    --shadow: 0 14px 38px #10234310;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; color: var(--text);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
    background: radial-gradient(ellipse at 94% 0, #dbe8ff 0, transparent 34%), radial-gradient(ellipse at 0 100%, #fbe4e9 0, transparent 30%), var(--bg); }
a { color: var(--red-dark); font-weight: 700; text-decoration: none; }
a:hover { text-decoration: underline; }
code { padding: 2px 6px; border-radius: 6px; background: #eef2f8; font-size: .92em; overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(25px, 3vw, 32px); letter-spacing: -.04em; line-height: 1.2; }
h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
small { color: var(--muted); }
.eyebrow { margin: 0 0 9px; color: #ec8b9c; font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.muted { color: var(--muted); line-height: 1.6; margin: 6px 0 0; }

/* Formlar */
form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: #45546a; font-size: 12px; font-weight: 800; }
label small { font-weight: 500; }
input:not([type=checkbox]), select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d8e0eb; border-radius: 10px; background: #fff; font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s; }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #c8102e33; outline-offset: 2px; }
input:not([type=checkbox]):focus, select:focus { border-color: #d46a79; outline: 0; box-shadow: 0 0 0 4px #c8102e14; }

/* Butonlar */
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; background: var(--red); color: #fff; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s; }
button:hover { transform: translateY(-1px); background: var(--red-dark); box-shadow: 0 8px 18px #c8102e26; }
button:active { transform: none; }
button.secondary, button.ghost { border-color: var(--line); background: #fff; color: #3b4a62; box-shadow: 0 1px 2px #10234310; }
button.secondary:hover, button.ghost:hover { background: #f6f8fc; box-shadow: 0 6px 14px #10234314; }
button.danger { border-color: #f4cbd1; background: #fff4f5; color: var(--err); }
button.danger:hover { background: #ffe9ec; box-shadow: none; }
button.small { min-height: 34px; padding: 6px 11px; font-size: 12px; }

/* Bildirimler */
.alert, .success, .warning { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 13px 15px; border-radius: 12px; font-size: 13px; font-weight: 700; line-height: 1.5; }
.alert { background: var(--err-bg); color: var(--err); border: 1px solid #f6d5d9; }
.success { background: var(--ok-bg); color: var(--ok); border: 1px solid #cdeedb; }
.warning { background: var(--warn-bg); color: var(--warn); border: 1px solid #f1dca4; }
.alert i, .success i, .warning i { margin-top: 2px; }

/* Giriş kartı */
.login-card { width: min(440px, calc(100% - 32px)); margin: 9vh auto 40px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 26px 70px #10234320; }
.login-card .login-head { padding: 30px 32px 26px; background: linear-gradient(135deg, var(--navy), var(--navy2)); color: #fff; text-align: center; border-bottom: 4px solid var(--red); }
.login-card .login-head img { display: block; width: 62px; height: 62px; margin: 0 auto 14px; padding: 5px; object-fit: contain; border: 3px solid #ffffffbd; border-radius: 50%; background: #fff; }
.login-card .login-head .eyebrow { margin-bottom: 7px; }
.login-card .login-head h1 { font-size: 24px; }
.login-card .login-body { padding: 24px 32px 30px; }
.login-card .login-body > .muted { margin: 0 0 20px; font-size: 13px; }
.login-card .login-body button { width: 100%; }
/* Eski (başlıksız) giriş kartı yapısı için geri uyum */
.login-card > h1, .login-card > .eyebrow, .login-card > .muted, .login-card > form, .login-card > .alert { margin-left: 32px; margin-right: 32px; }
.login-card > .eyebrow { margin-top: 32px; } .login-card > form { margin-bottom: 32px; }

/* Panel kabuğu */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 24px 16px; background: linear-gradient(180deg, #1c2b46, #121e33); color: #dbe5f5; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 20px; border-bottom: 1px solid #ffffff1c; }
.side-brand img { flex: none; object-fit: contain; border: 3px solid #fff; border-radius: 50%; background: #fff; }
.side-brand strong { display: block; font-size: 14px; color: #fff; }
.side-brand small { color: #9fb0cd; font-size: 11px; }
.side nav { display: grid; gap: 4px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid transparent; border-radius: 10px; color: #c9d4e7; font-size: 13px; font-weight: 600; transition: background .18s, color .18s; }
.side-link i { width: 18px; text-align: center; color: #a9b9d2; }
.side-link:hover, .side-link.active { background: #ffffff14; color: #fff; text-decoration: none; }
.side-link.active { box-shadow: inset 3px 0 var(--red); }
.side-link.active i { color: #ff8797; }
.side-logout { margin-top: auto; }
.side-logout button { width: 100%; background: #ffffff10; border-color: #ffffff22; color: #fff; box-shadow: none; }
.side-logout button:hover { background: #ffffff1f; box-shadow: none; }
.content { min-width: 0; width: 100%; max-width: 1280px; margin: 0 auto; padding: 32px clamp(16px, 3.5vw, 48px) 24px; }

/* Üst başlık + istatistikler */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; padding: 28px 30px; border-radius: 18px; border-bottom: 4px solid var(--red); background: linear-gradient(125deg, var(--navy), var(--navy2)); color: #fff; box-shadow: var(--shadow); }
.hero h1 { color: #fff; }
.hero .muted { margin-top: 8px; color: #d5dfef; font-size: 13px; max-width: 560px; }
.hero code { background: #ffffff1c; color: #fff; }
.stats { display: flex; gap: 10px; flex: none; }
.stat { min-width: 92px; padding: 13px 16px; border: 1px solid #ffffff26; border-radius: 13px; background: #ffffff14; text-align: center; }
.stat span { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.stat small { color: #cbd7ec; font-size: 11px; font-weight: 700; }
.stat.ok span { color: #7ee2a8; } .stat.off span { color: #ffb3bd; }

/* Kartlar */
.card { margin: 0 0 22px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); scroll-margin-top: 20px; }
.card-head { margin-bottom: 18px; }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2 i { color: var(--red); }
.school-form { grid-template-columns: 1fr 1fr auto; align-items: end; }
.inline-form { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; }
.school-form button, .inline-form button { white-space: nowrap; }
.card.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.card.empty i { margin-bottom: 12px; color: #b9c4d6; font-size: 34px; }

/* Okul listesi */
.schools-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 6px 0 14px; scroll-margin-top: 20px; }
.search { position: relative; display: block; width: min(320px, 100%); }
.search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #8795ab; pointer-events: none; }
.search input { padding-left: 36px; border-radius: 999px; }
.school-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.school-card { display: flex; flex-direction: column; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; }
.school-card:hover { box-shadow: 0 20px 44px #10234318; transform: translateY(-2px); }
.school-card[hidden] { display: none; }
.school-card.is-off { background: #fbfcfe; }
.school-card.is-off .school-avatar { background: #98a4b8; }
.school-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.school-id { display: flex; align-items: center; gap: 13px; min-width: 0; }
.school-id h3 { overflow-wrap: anywhere; }
.school-avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg, var(--navy), var(--navy2)); color: #fff; font-size: 18px; font-weight: 800; }
.status { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 11px; font-weight: 800; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.off { background: var(--err-bg); color: var(--err); }
.school-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed #cfd8e6; border-radius: 11px; background: #f8faff; font-size: 12px; }
.school-link a { overflow-wrap: anywhere; }
.features { border: 1px solid var(--line); border-radius: 12px; }
.features summary { display: flex; align-items: center; gap: 9px; padding: 12px 14px; cursor: pointer; font-size: 13px; font-weight: 800; list-style: none; }
.features summary::-webkit-details-marker { display: none; }
.features summary::after { content: "\f078"; margin-left: auto; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 11px; color: #8795ab; transition: transform .2s; }
.features[open] summary::after { transform: rotate(180deg); }
.features summary small { margin-left: 4px; font-weight: 700; }
.feature-form { padding: 4px 14px 14px; }
.principal-form { padding: 4px 14px 14px; }.principal-form button{justify-self:start}.empty-inline{margin:0;padding:4px 14px 14px;color:var(--muted);font-size:12px;line-height:1.55}
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.toggle { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 12px; font-weight: 700; color: #3b4a62; cursor: pointer; }
.toggle:hover { background: #f4f7fc; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: #cdd5e2; transition: background .18s; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .18s; }
.toggle input:checked + .track { background: var(--ok); }
.toggle input:checked + .track::after { transform: translateX(14px); }
.toggle input:focus-visible + .track { outline: 3px solid #c8102e33; outline-offset: 2px; }
.school-actions { margin-top: auto; }
.school-actions button { width: 100%; }
.no-result { text-align: center; padding: 20px; }
.foot { padding: 14px 0 6px; color: #7b879b; font-size: 12px; text-align: center; }

@media (max-width: 1100px) { .school-list { grid-template-columns: 1fr; } .hero { flex-direction: column; align-items: flex-start; } }
@media (max-width: 900px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .side { position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 14px; overflow-x: auto; }
    .side-brand { padding: 0; border: 0; } .side-brand div { display: none; }
    .side nav { display: flex; gap: 4px; } .side-link { padding: 9px 11px; white-space: nowrap; }
    .side-logout { margin: 0 0 0 auto; } .side-logout button { min-height: 38px; padding: 8px 12px; }
    .school-form { grid-template-columns: 1fr; } .inline-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .content { padding: 18px 12px 20px; }
    .hero { padding: 22px 18px; } .stats { width: 100%; } .stat { flex: 1; min-width: 0; }
    .card, .school-card { padding: 17px; } .schools-head { flex-direction: column; align-items: stretch; } .search { width: 100%; }
    .feature-grid, .inline-form { grid-template-columns: 1fr; }
    .login-card { margin-top: 5vh; } .login-card .login-head, .login-card .login-body { padding-left: 20px; padding-right: 20px; }
    input:not([type=checkbox]) { font-size: 16px; }
    .side-link span { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
