/* =====================================================================
   Okul Yönetim Sistemi — ortak stil dosyası (framework yok, saf CSS)
   Sade beyaz arayüz + karanlık mod. Tema: <html data-theme="dark">.
   Sınıf adları modül sözleşmesidir (docs/GELISTIRICI.md); adları değiştirmeyin.
   ===================================================================== */

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f6f7f8;
    --border: #e7e9ec;
    --border-strong: #cfd3d9;
    --control-border: #8f959e;
    --text: #15181d;
    --text-2: #434952;
    --muted: #666d77;
    --primary: #2b3bc0;
    --primary-hover: #222f9c;
    --primary-soft: #eef0fc;
    --on-primary: #ffffff;
    --success: #0f7641;
    --success-soft: #e8f5ee;
    --warning: #8f5508;
    --warning-soft: #fbf2e1;
    --danger: #bb261c;
    --danger-soft: #fcecea;
    --info: #434952;
    --info-soft: #f6f7f8;
    --on-solid: #ffffff;
    --backdrop: rgba(21, 24, 29, .32);
    --radius: 8px;
    --radius-sm: 6px;
    --shadow-lg: 0 8px 24px rgba(21, 24, 29, .12);
    /* Derinlik ve hareket: veli portalı diline göre yaklaşık %70. Kurallar canli.css içindedir; bu dosyayı veli portalı ve belge yerleşimi de yükler. */
    --shadow-sm: 0 1px 2px rgba(21, 24, 29, .045), 0 6px 18px -6px rgba(21, 24, 29, .11);
    --shadow-md: 0 2px 4px rgba(21, 24, 29, .055), 0 11px 22px -7px rgba(21, 24, 29, .18);
    --shadow-btn: 0 1px 2px rgba(21, 24, 29, .16);
    --ease: cubic-bezier(.16, 1, .3, 1);
    --dur-fast: 120ms;
    --dur: 200ms;
    --dur-slow: 260ms;
    --lift: -2px;
    --rise: 6px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --fs-xs: 12.5px;
    --fs-sm: 13.5px;
    --fs-md: 14.5px;
    --fs-lg: 17px;
    --fs-xl: 24px;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666d77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    --sidebar-w: 248px;
    --topbar-h: 56px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #141414;
    --surface: #141414;
    --surface-2: #1f1f1f;
    --border: #2c2c2c;
    --border-strong: #434343;
    --control-border: #636363;
    --text: #ededed;
    --text-2: #c2c2c2;
    --muted: #9c9c9c;
    --primary: #8fb8ff;
    --primary-hover: #aecbff;
    --primary-soft: #1c2a40;
    --on-primary: #0f1726;
    --success: #63cf95;
    --success-soft: #15291f;
    --warning: #e6b663;
    --warning-soft: #2c2213;
    --danger: #f4918a;
    --danger-soft: #331b19;
    --info: #c2c2c2;
    --info-soft: #1f1f1f;
    --on-solid: #141414;
    --backdrop: rgba(0, 0, 0, .55);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .5);
    /* Koyu zeminde gölge seçilmez: ince üst kenar ışığı ve yüzey farkı (--bg, canli.css). */
    --shadow-sm: inset 0 1px 0 rgba(255, 255, 255, .04);
    --shadow-md: inset 0 1px 0 rgba(255, 255, 255, .07), 0 6px 14px -8px rgba(0, 0, 0, .6);
    --shadow-btn: 0 0 0 transparent;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239c9c9c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--border-strong) transparent; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--fs-md);
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    caret-color: var(--primary);
}
::selection { background: var(--primary-soft); color: var(--text); }
a { color: var(--primary); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 600; text-wrap: balance; }
h1 { font-size: var(--fs-xl); letter-spacing: -.012em; }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0 0 1em; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
code, kbd { font-family: var(--mono); font-size: .9em; }

.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.icon-lg { width: 32px; height: 32px; }

.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Uygulama düzeni ---------- */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle:focus-visible ~ .app-shell .nav-burger { outline: 2px solid var(--primary); outline-offset: 2px; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    color: var(--text-2);
    border-right: 1px solid var(--border);
    flex: none;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 0 .75rem 2rem;
}
.brand {
    display: flex; align-items: center; gap: .55rem;
    min-height: var(--topbar-h);
    padding: 0 .6rem; margin-bottom: .5rem;
    color: var(--text); font-weight: 600;
}
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; color: var(--primary); }
.brand-mark .icon { width: 22px; height: 22px; }
.brand-text { font-size: var(--fs-md); line-height: 1.25; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-link, .nav-group-title {
    display: flex; align-items: center; gap: .6rem;
    min-height: 34px;
    padding: .35rem .6rem;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: var(--fs-sm);
    cursor: pointer;
}
.nav-link .icon, .nav-group-title .icon { color: var(--muted); }
.nav-link:hover, .nav-group-title:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--text); font-weight: 600; }
.nav-link.active:hover { background: none; }
.nav-link.active .icon { color: var(--primary); }
.nav-link.active > span, .nav-link.nav-sub.active { text-decoration: underline solid var(--primary) 2px; text-underline-offset: 5px; }
.nav-group.is-active > .nav-group-title { color: var(--text); font-weight: 600; }
.nav-group.is-active > .nav-group-title .icon { color: var(--primary); }
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group-title::after {
    content: ""; width: 6px; height: 6px; margin-left: auto; margin-right: 3px;
    border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
    transform: rotate(-45deg); transition: transform .15s ease-out;
}
.nav-group[open] > .nav-group-title::after { transform: rotate(45deg); }
.nav-sub { padding-left: 2.3rem; font-size: var(--fs-sm); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: .75rem;
    height: var(--topbar-h); padding: 0 1.75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 600; font-size: var(--fs-md); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-date { color: var(--text); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; margin-right: .25rem; }
.topbar-weekday { color: var(--muted); font-weight: 400; }
.btn.nav-burger { display: none; }
.content { padding: 1.75rem; flex: 1; width: 100%; max-width: 1400px; }
.footer { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 1.75rem; color: var(--muted); font-size: var(--fs-xs); border-top: 1px solid var(--border); }

/* Tema düğmesi: JS yoksa görünmez (bkz. theme.js) */
.btn.theme-toggle { display: none; }
.js .btn.theme-toggle { display: inline-flex; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-chip { display: flex; align-items: center; gap: .55rem; padding: .2rem .4rem; border-radius: var(--radius-sm); }
.user-chip:hover { background: var(--surface-2); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: var(--fs-sm); }
.user-name { display: flex; flex-direction: column; font-size: var(--fs-sm); line-height: 1.25; }
.user-name small { color: var(--muted); font-size: var(--fs-xs); }
.user-dropdown {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: .35rem; z-index: 30;
}
.user-dropdown a, .user-dropdown .link-button {
    display: flex; align-items: center; gap: .5rem; width: 100%;
    padding: .5rem .6rem; border-radius: var(--radius-sm); color: var(--text); font-size: var(--fs-sm);
}
.user-dropdown a:hover, .user-dropdown .link-button:hover { background: var(--surface-2); text-decoration: none; }
.link-button { background: none; border: 0; font: inherit; cursor: pointer; text-align: left; color: var(--primary); padding: 0; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: .35rem; font-size: var(--fs-sm); color: var(--muted); margin-bottom: .9rem; }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs .sep { opacity: .5; }

@media (max-width: 960px) {
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 50;
        transform: translateX(-100%); visibility: hidden;
        transition: transform .2s cubic-bezier(.16, 1, .3, 1), visibility .2s;
    }
    .nav-toggle:checked ~ .app-shell .sidebar { transform: translateX(0); visibility: visible; box-shadow: var(--shadow-lg); }
    .nav-backdrop { display: none; }
    .nav-toggle:checked ~ .app-shell .nav-backdrop { display: block; position: fixed; inset: 0; background: var(--backdrop); z-index: 40; }
    .btn.nav-burger { display: inline-flex; }
    .content { padding: 1.25rem 1rem; }
    .topbar { padding: 0 1rem; gap: .5rem; }
    .user-name { display: none; }
    .footer { flex-direction: column; gap: .25rem; padding: .9rem 1rem; }
}
@media (max-width: 560px) { .topbar-weekday { display: none; } }
@media (max-width: 420px) { .topbar-date { font-weight: 400; font-size: var(--fs-xs); margin-right: 0; } }

/* ---------- Sayfa başlığı ve araç çubuğu ---------- */
.page-header {
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.5rem;
}
.page-header h1 { margin: 0; }
.page-header p { margin: .25rem 0 0; }
.page-actions, .actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }

/* Filtre formu: <form class="filters"> içinde .field'ler yan yana */
.filters {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end;
    margin-bottom: 1rem;
}
.filters .field { margin: 0; min-width: 160px; flex: 1 1 160px; }
.filters .field-actions { display: flex; gap: .5rem; flex: 0 0 auto; }

/* ---------- Kart ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.card-title { font-size: var(--fs-md); font-weight: 600; margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-header .card-title { margin: 0; }
.card.narrow { max-width: 560px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-header { padding: .9rem 1.25rem; margin-bottom: 0; border-bottom: 1px solid var(--border); }

.grid { display: grid; gap: 1.25rem; }
.grid > .card { margin-bottom: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4, .grid-sidebar { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- İstatistik satırı: çizgiyle ayrılmış birleşik hücreler ---------- */
.stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; margin-bottom: 1.5rem;
}
.stat {
    display: flex; flex-direction: column; gap: .15rem;
    background: var(--surface); padding: .9rem 1.1rem; color: var(--text);
    border: 1px solid var(--border);
    margin: -1px 0 -1px -1px;
}
a.stat:hover { text-decoration: none; background: var(--surface-2); }
a.stat:focus-visible { outline-offset: -2px; }
.stat-label { color: var(--text-2); font-size: var(--fs-sm); }
.stat-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-hint { color: var(--muted); font-size: var(--fs-xs); }
.stat-success .stat-value { color: var(--success); }
.stat-warning .stat-value { color: var(--warning); }
.stat-danger .stat-value { color: var(--danger); }
.stat-info .stat-value { color: var(--info); }

/* ---------- Tablo ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.table th, .table td { padding: .6rem .85rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; border-bottom-color: var(--border-strong); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.actions { display: table-cell; white-space: nowrap; text-align: right; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--border-strong); border-bottom: 0; }
.table-compact th, .table-compact td { padding: .35rem .6rem; }
.card > .table-wrap { border: 0; border-radius: 0; }

@media (max-width: 720px) {
    .table td a { white-space: nowrap; }
    .table td.actions, .table th:last-child:empty, .table tfoot td:last-child:empty { position: sticky; right: 0; background: var(--surface); box-shadow: -8px 0 8px -8px rgba(0, 0, 0, .28), -1px 0 0 var(--border); }
    .table tbody tr:hover td.actions { background: var(--surface-2); }
}

@media (max-width: 480px) { .table th, .table td { padding-left: .5rem; padding-right: .5rem; } }

/* Tanım listesi: <dl class="kv"><dt>Ad</dt><dd>Ali</dd></dl> */
.kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: .5rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: var(--fs-sm); }
.kv dd { margin: 0; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; gap: .1rem; } .kv dd { margin-bottom: .6rem; } }

/* ---------- Formlar ---------- */
.form .field, .field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.25rem; }
.form-grid .span-2, .form-grid-3 .span-2 { grid-column: span 2; }
.form-grid .span-all, .form-grid-3 .span-all { grid-column: 1 / -1; }
@media (max-width: 720px) {
    .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .form-grid .span-2, .form-grid-3 .span-2 { grid-column: auto; }
}
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem .25rem; margin: 0 0 1.25rem; }
legend { font-weight: 600; padding: 0 .4rem; }
label { font-weight: 500; font-size: var(--fs-sm); color: var(--text-2); }
label.required::after { content: " *"; color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=time], input[type=tel], input[type=search], input[type=url],
input[type=month], input[type=file], select, textarea {
    width: 100%;
    font: inherit;
    font-size: var(--fs-md);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-sm);
    padding: .4rem .65rem;
    height: 38px;
}
input[type=file] { height: auto; }
select {
    appearance: none; -webkit-appearance: none;
    padding-right: 2rem;
    background: var(--surface) var(--chevron) no-repeat right .6rem center / 14px;
}
select[multiple] { height: auto; background-image: none; padding-right: .65rem; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { height: auto; min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; color: var(--text); margin-bottom: .6rem; }
.check input { width: 17px; height: 17px; margin: 0; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .25rem 1rem; }
.help { color: var(--muted); font-size: var(--fs-xs); }
.field-error { color: var(--danger); font-size: var(--fs-sm); }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .5rem; }
.input-group { display: flex; }
.input-group > input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group > .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.inline-form { display: inline; }

/* ---------- Butonlar ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font: inherit; font-size: var(--fs-sm); font-weight: 500;
    padding: .4rem .85rem; min-height: 38px;
    border-radius: var(--radius-sm); border: 1px solid transparent;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .12s ease-out, border-color .12s ease-out, filter .12s ease-out;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-success { background: var(--success); color: var(--on-solid); }
.btn-danger { background: var(--danger); color: var(--on-solid); }
.btn-warning { background: var(--warning); color: var(--on-solid); }
.btn-success:hover, .btn-danger:hover, .btn-warning:hover { filter: brightness(.92); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: .2rem .55rem; min-height: 28px; font-size: var(--fs-sm); }
.btn-lg { padding: .6rem 1.2rem; font-size: var(--fs-md); min-height: 44px; }
.btn-block { width: 100%; }
.btn-icon { padding: .35rem; min-width: 38px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }

/* ---------- Rozetler ---------- */
.badge {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .08rem .45rem; border-radius: 4px;
    font-size: var(--fs-xs); font-weight: 500; white-space: nowrap;
    background: var(--surface-2); color: var(--text-2);
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-info    { background: var(--info-soft);    color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-muted   { background: var(--surface-2); color: var(--muted); }

/* ---------- Uyarılar ---------- */
.alert { padding: .7rem .95rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: var(--fs-sm); }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error   { background: var(--danger-soft);  color: var(--danger); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info    { background: var(--info-soft);    color: var(--info); }

/* ---------- Sekmeler (bağlantı tabanlı) ---------- */
.tabs { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; scrollbar-width: none; }
.tabs a {
    padding: .55rem 0; color: var(--text-2);
    white-space: nowrap; font-size: var(--fs-sm);
}
.tabs a:hover { color: var(--text); text-decoration: none; box-shadow: inset 0 -2px 0 var(--border-strong); }
.tabs a.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--primary); font-weight: 600; }

/* ---------- Boş durum ---------- */
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty .icon-lg { opacity: .6; margin-bottom: .5rem; }
.empty p { margin: 0; }

/* ---------- Sayfalama ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-top: 1rem; }
.pagination-info { color: var(--muted); font-size: var(--fs-sm); margin-top: .75rem; }
.pagination .pagination-info { margin: 0; }
.pagination-links { display: flex; gap: .25rem; flex-wrap: wrap; }
.pagination-links a, .pagination-links span {
    min-width: 32px; height: 32px; display: grid; place-items: center; padding: 0 .45rem;
    border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--text-2); font-variant-numeric: tabular-nums;
}
.pagination-links a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.pagination-links .current { color: var(--text); font-weight: 600; text-decoration: underline solid var(--primary) 2px; text-underline-offset: 5px; }
.pagination-links .icon { width: 16px; height: 16px; }

/* ---------- Zaman çizelgesi (olay akışları için) ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 1px solid var(--border-strong); }
.timeline li { position: relative; padding: 0 0 1rem .75rem; }
.timeline li::before {
    content: ""; position: absolute; left: -1rem; top: .5rem; margin-left: -4px;
    width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
}
.timeline .time { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }

/* Adım göstergesi: <ol class="steps"><li class="done">..</li><li class="current">..</li><li>..</li></ol> */
.steps { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; list-style: none; padding: 0; margin: 0 0 1.5rem; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: var(--fs-sm); }
.steps li::before {
    content: counter(s); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
    border: 1px solid var(--border-strong); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600;
}
.steps li.done { color: var(--text-2); }
.steps li.done::before {
    content: ""; border: 0; background: var(--success);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L19 7'/%3E%3C/svg%3E") center / 70% no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L19 7'/%3E%3C/svg%3E") center / 70% no-repeat;
}
.steps li.current { color: var(--text); font-weight: 600; }
.steps li.current::before { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---------- Minimal düzen (giriş, hata) ---------- */
body.minimal { display: grid; place-items: center; min-height: 100vh; padding: 1.25rem; }
.minimal-wrap { width: 100%; max-width: 360px; }
.minimal-theme { position: fixed; top: .75rem; right: .75rem; }
.minimal-brand { display: flex; align-items: center; gap: .55rem; font-weight: 600; font-size: var(--fs-md); margin-bottom: 2.25rem; }
.minimal-brand .icon { width: 24px; height: 24px; color: var(--primary); }
.login-card { padding: 0; border: 0; background: none; margin: 0; }
.login-card .card-title { font-size: var(--fs-xl); letter-spacing: -.012em; margin-bottom: 1.25rem; }
.login-card .form { margin-bottom: 1.25rem; }
.login-card .btn { min-height: 40px; margin-top: .25rem; }
.error-page { padding: 1rem 0; }
.error-code { font-size: 3rem; font-weight: 600; letter-spacing: -.02em; color: var(--primary); line-height: 1; margin-bottom: .75rem; font-variant-numeric: tabular-nums; }

/* ---------- Dokunmatik ekranlar: öğretmenlerin telefon ve tablet kullanımı ---------- */
@media (pointer: coarse) {
    .nav-link, .nav-group-title { min-height: 44px; }
    .btn, .btn-icon { min-height: 44px; min-width: 44px; }
    .btn-sm { min-height: 36px; }
    .user-dropdown a, .user-dropdown .link-button { min-height: 44px; }
    .pagination-links a, .pagination-links span { min-width: 40px; height: 40px; }
    input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
    input[type=datetime-local], input[type=time], input[type=tel], input[type=search], input[type=url],
    input[type=month], select { font-size: 16px; height: 44px; }
    textarea { font-size: 16px; }
    .check input, .table input[type=checkbox] { width: 22px; height: 22px; }
}

/* ---------- Yazdırılabilir belge (tema ne olursa olsun beyaz kâğıt) ---------- */
body.print-doc { background: #e5e7eb; color: #111; }
.print-toolbar { display: flex; gap: .5rem; justify-content: center; padding: 1rem; }
.doc {
    background: #fff; color: #111; max-width: 210mm; min-height: 297mm; margin: 0 auto 2rem;
    padding: 18mm 18mm 20mm; box-shadow: var(--shadow-lg); font-size: 11pt; line-height: 1.55;
}
.doc-header { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #111; padding-bottom: .75rem; margin-bottom: 1.25rem; font-size: 10pt; }
.doc-meta { text-align: right; white-space: nowrap; }
.doc-title { text-align: center; font-size: 14pt; text-transform: uppercase; margin: 0 0 1.25rem; letter-spacing: .02em; }
.doc table { width: 100%; border-collapse: collapse; margin: .75rem 0; }
.doc th, .doc td { border: 1px solid #444; padding: 5px 8px; text-align: left; vertical-align: top; font-size: 10pt; }
.doc th { background: #f1f1f1; }
.doc .signatures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2rem; margin-top: 3rem; text-align: center; }
.doc .signatures div { padding-top: 3rem; border-top: 1px dotted #555; }
.doc .doc-footer { margin-top: 2rem; font-size: 8.5pt; color: #444; border-top: 1px solid #ccc; padding-top: .5rem; }

/* Sürgülü anahtar: gerçek onay kutusu (klavye, ekran okuyucu), görünüm komşu izde. Satır: ad, açıklama, anahtar. */
.switch { position: relative; display: inline-flex; flex: none; width: 40px; height: 24px; }
.switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.switch input:disabled { cursor: not-allowed; }
.switch-track {
    position: absolute; inset: 0; border: 1px solid var(--control-border); border-radius: 12px; background: var(--surface-2);
    transition: background-color .15s ease, border-color .15s ease;
}
.switch-track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--text-2); transition: transform .15s ease, background-color .15s ease;
}
.switch input:checked + .switch-track { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(16px); background: var(--on-primary); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .45; }
.switch-row { display: flex; align-items: flex-start; gap: .5rem 1rem; padding: .75rem 1rem; margin: 0; border-top: 1px solid var(--border); }
.switch-row:first-child { border-top: 0; }
.switch-text { flex: 1; min-width: 0; margin: 0; font-weight: 400; color: var(--text); }
.switch-name { display: block; font-weight: 600; font-size: var(--fs-md); }
.switch-desc { display: block; margin-top: .15rem; color: var(--muted); font-size: var(--fs-sm); }
.switch-meta { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin-top: .35rem; }
.switch-note { display: block; margin-top: .35rem; font-size: var(--fs-sm); color: var(--danger); }
.switch-note:empty { display: none; }
.switch-control { display: flex; flex: none; align-items: center; gap: .5rem; padding-top: .1rem; }
html.js .switch-save { display: none; }
@media (pointer: coarse) {
    .switch { width: 52px; height: 32px; }
    .switch-track { border-radius: 16px; }
    .switch-track::after { width: 24px; height: 24px; }
    .switch input:checked + .switch-track::after { transform: translateX(20px); }
    .switch input { top: -6px; bottom: -6px; height: 44px; }
}

/* Ortak öğrenci seçici (public/assets/js/ogrenci-sec.js): yuvarlak profil resmi ya da baş harfler, açılır liste, kart ve çipler. */
.ogrenci-sec { position: relative; min-width: 0; width: 100%; }
.ogrenci-sec [hidden] { display: none !important; }
.input-group > .ogrenci-sec { flex: 1 1 auto; width: auto; }
.input-group > .ogrenci-sec input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.ogrenci-sec-kutu { position: relative; }
.ogrenci-sec-liste {
    position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px);
    margin: 0; padding: .25rem; list-style: none;
    max-height: min(60vh, 27rem); overflow-y: auto; overscroll-behavior: contain;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.ogrenci-sec-oge {
    display: flex; align-items: center; gap: .65rem; min-height: 48px; padding: .3rem .5rem;
    border-radius: var(--radius-sm); cursor: pointer; color: var(--text);
}
.ogrenci-sec-oge.is-active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.ogrenci-sec-bos { padding: .6rem .6rem; color: var(--muted); font-size: var(--fs-sm); }
.ogrenci-sec-avatar {
    flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
    display: grid; place-items: center; font-size: var(--fs-sm); font-weight: 600; line-height: 1;
    background: var(--primary-soft); color: var(--primary);
}
.ogrenci-sec-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ogrenci-sec-avatar-k { width: 26px; height: 26px; font-size: 11px; }
.ogrenci-sec-bilgi { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ogrenci-sec-ad { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ogrenci-sec-alt { color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ogrenci-sec-kart {
    display: flex; align-items: center; gap: .65rem; padding: .45rem .65rem;
    background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.ogrenci-sec-kart .btn { margin-left: auto; flex: none; }
.ogrenci-sec-cipler { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.ogrenci-sec-cip {
    display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; padding: .15rem .2rem .15rem .2rem;
    background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 999px; font-size: var(--fs-sm); color: var(--text);
}
.ogrenci-sec-cip-ad { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ogrenci-sec-cip-no { color: var(--muted); font-size: var(--fs-xs); flex: none; }
.ogrenci-sec-cip-kaldir {
    flex: none; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: var(--muted); font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
}
.ogrenci-sec-cip-kaldir:hover { background: var(--danger-soft); color: var(--danger); }
.ogrenci-sec-cip-kaldir:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
@media (pointer: coarse) {
    .ogrenci-sec-oge { min-height: 56px; }
    .ogrenci-sec-cip-kaldir { width: 44px; height: 44px; margin: -.15rem 0; }
    .ogrenci-sec-cip { padding-left: .35rem; }
}

/* ---------- Modal (yerleşik <dialog>; bkz. app/Views/partials/modal.php ve app.js) ---------- */
.modal {
    padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
    width: min(520px, calc(100vw - 2rem)); max-width: none; max-height: calc(100dvh - 3rem);
    overflow: hidden;
}
.modal.modal-genis { width: min(760px, calc(100vw - 2rem)); }
.modal[open] { display: flex; flex-direction: column; animation: modal-ac .16s ease-out; }
.modal::backdrop { background: var(--backdrop); }
.modal[open]::backdrop { animation: modal-perde .16s ease-out; }
.modal-kutu { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.modal-ust {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .85rem .85rem .85rem 1.25rem; border-bottom: 1px solid var(--border); flex: none;
}
.modal-baslik { margin: 0; font-size: var(--fs-lg); }
.modal-govde { padding: 1.25rem; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.modal-govde > :last-child, .modal-govde form > :last-child { margin-bottom: 0; }
html:has(dialog.modal[open]) { overflow: hidden; }
@keyframes modal-ac { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes modal-perde { from { opacity: 0; } to { opacity: 1; } }

/* JS yoksa: modal sayfada görünür bir kart, açıcı ve kapatıcı düğmeler gizli. */
html:not(.js) [data-modal-ac], html:not(.js) .modal-kapat { display: none; }
html:not(.js) dialog.modal {
    display: block; position: static; width: auto; max-height: none; margin: 0 0 1.25rem;
    box-shadow: none; border-color: var(--border); overflow: visible;
}

@media (max-width: 600px) {
    .modal, .modal.modal-genis {
        width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh;
        border-radius: var(--radius) var(--radius) 0 0; border-width: 1px 0 0;
    }
    .modal[open] { animation-name: modal-ac-alt; }
    .modal-ust { padding-left: 1rem; }
    .modal-govde { padding: 1rem; }
}
@keyframes modal-ac-alt { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .modal[open], .modal[open]::backdrop { animation: none; }
}

@media print {
    dialog.modal { display: none !important; }
}

@media print {
    @page { size: A4; margin: 12mm; }
    :root, :root[data-theme="dark"] {
        --bg: #fff; --surface: #fff; --surface-2: #f4f4f4; --border: #ccc; --border-strong: #999;
        --text: #111; --text-2: #333; --muted: #555; --primary: #111; --primary-soft: #eee; --on-primary: #fff;
        --control-border: #999; --success: #111; --success-soft: #eee; --warning: #111; --warning-soft: #eee;
        --danger: #111; --danger-soft: #eee; --info: #111; --info-soft: #eee; --on-solid: #fff;
        color-scheme: light;
    }
    body, body.print-doc { background: #fff; color: #111; }
    .no-print, .print-toolbar, .sidebar, .topbar, .footer, .nav-backdrop, .page-actions, .filters, .pagination, form .btn { display: none !important; }
    .doc { box-shadow: none; margin: 0; padding: 0; max-width: none; min-height: 0; }
    .main, .content { padding: 0; }
    .card { border: 0; padding: 0; }
    a { color: inherit; }
    .field, .stat, .table tr, .card-header { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Salt okunur mali ekran: yazma formları gizlenir, asıl engel rota ve serviste. */
.mali-salt-okunur .content form[method="post"], .mali-salt-okunur .content [data-modal-ac] { display: none; }
.salt-okunur-not { margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
