/* Öğrenci Takip — "sınıf defteri" tasarımı
   Tahta yeşili gezinme, kâğıt beyazı içerik, yoklama durumları için üç sabit renk. */
:root {
  --board: #1d3a31; --board-2: #285044; --board-ink: #d9e6e0; --board-mute: #8fa9a0;
  --chalk: #f1cf62;
  --paper: #f3f5f2; --surface: #fff; --sunk: #eaeeea;
  --ink: #16201c; --ink-2: #4f5d57; --ink-3: #7c8983;
  --line: #dbe2dd; --line-2: #c7d1cb;
  --var: #23804f; --var-bg: #e1f1e6;
  --yok: #c03a26; --yok-bg: #fbe5e0;
  --gec: #a86d12; --gec-bg: #f8edd5;
  --izin: #3c66a3; --izin-bg: #e2eaf6;
  --focus: #2f6fd6;
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --text: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --rail: 232px; --nav-h: 64px;
  --card-shadow: 0 1px 2px rgba(16, 28, 24, .05), 0 1px 0 rgba(16, 28, 24, .02);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.12; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
b { font-weight: 600; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-3); }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; }

/* ---------- iskelet ---------- */
.app { min-height: 100vh; }
.rail { position: fixed; inset: 0 auto 0 0; width: var(--rail); background: var(--board); color: var(--board-ink); display: flex; flex-direction: column; padding: 22px 14px 16px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; padding: 4px 10px 22px; color: #fff; }
.school-name { margin: -12px 10px 20px 47px; font-size: 12.5px; line-height: 1.35; color: var(--board-mute); }
.brand-name { font: 700 18px/1 var(--display); letter-spacing: -.01em; }
.brand-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 26px; height: 26px; flex: none; }
.brand-mark i { border-radius: 3px; background: #6fbf8f; }
.brand-mark i:nth-child(3) { background: #ef7a63; }
.brand-mark i:nth-child(4) { background: var(--chalk); }
.brand-mark.small { width: 22px; height: 22px; gap: 2.5px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--board-ink); text-decoration: none; font-weight: 500; position: relative; }
.nav a svg { color: var(--board-mute); }
.nav a:hover { background: rgba(255,255,255,.06); }
.nav a.active { background: var(--board-2); color: #fff; }
.nav a.active svg { color: var(--chalk); }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--chalk); }

.rail-foot { margin-top: auto; display: grid; gap: 14px; }
.demo-note { font-size: 12.5px; line-height: 1.45; color: var(--board-mute); padding: 0 12px; }
.profile { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0 10px; border-top: 1px solid rgba(255,255,255,.1); }
.profile-initials { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--board-2); color: #fff; font-size: 12.5px; font-weight: 600; flex: none; }
.profile-meta { min-width: 0; flex: 1; display: grid; }
.profile-meta b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.profile-meta small { font-size: 12px; color: var(--board-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar { display: none; }
main { margin-left: var(--rail); padding: 40px clamp(20px, 4vw, 56px) 64px; max-width: calc(1180px + var(--rail)); }
.view { display: none; }
.view.active { display: block; }

/* ---------- başlıklar ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.kicker { color: var(--ink-2); font-size: 14.5px; margin-bottom: 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 36px 0 12px; }
.hint { color: var(--ink-3); font-size: 13.5px; }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--board); border-radius: var(--r-sm); padding: 12px 16px; color: var(--ink-2); font-size: 14px; margin-bottom: 18px; max-width: 72ch; }
.empty { color: var(--ink-3); padding: 18px 0; font-size: 14px; }
.empty.good { color: var(--var); }

/* ---------- düğmeler ve alanlar ---------- */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid transparent; font: 600 14.5px/1 var(--text); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; }
.btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.btn.primary { background: var(--board); color: #fff; }
.btn.primary:hover { background: #142b24; }
.btn.ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { appearance: none; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.danger:hover { background: var(--yok-bg); color: var(--yok); }
.icon-btn.on-dark { color: var(--board-mute); }
.icon-btn.on-dark:hover { background: rgba(255,255,255,.08); color: #fff; }

.input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: 15px/1.3 var(--text); }
.input:focus { outline: none; border-color: var(--board); box-shadow: 0 0 0 3px rgba(29,58,49,.14); }
select.input { appearance: none; padding-right: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%234f5d57' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center; cursor: pointer; }
textarea.input { resize: vertical; }
label, .label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.field span { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 5px; background: var(--sunk); color: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; }
.pill.off { background: var(--sunk); color: var(--ink-2); }
.tel { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tel svg { width: 14px; height: 14px; color: var(--ink-3); }
.tel:hover { color: var(--board); text-decoration: underline; }

/* ---------- Bugün ---------- */
.today-line { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 40px; padding: 22px 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lead { font-size: 17px; color: var(--ink); max-width: 60ch; flex: 1 1 320px; }
.lead b { font-weight: 700; }
.lead .muted { display: block; font-size: 14px; margin-top: 4px; }
.figures { display: flex; gap: 32px; margin: 0; flex-wrap: wrap; }
.figures div { display: flex; flex-direction: column-reverse; }
.figures dt { font-size: 13px; color: var(--ink-2); }
.figures dd { margin: 0; font: 700 34px/1.05 var(--display); font-variant-numeric: tabular-nums; }
.c-var { color: var(--var); } .c-yok { color: var(--yok); } .c-gec { color: var(--gec); } .c-izin { color: var(--izin); }

.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.class-tile { appearance: none; text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 16px; display: grid; gap: 2px; position: relative; transition: border-color .15s, transform .15s; }
.class-tile:hover { border-color: var(--board); }
.class-tile:active { transform: scale(.98); }
.tile-name { font: 700 30px/1.05 var(--display); letter-spacing: -.02em; }
.tile-meta { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tile-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--sunk); margin-top: 12px; }
.tile-bar i { display: block; height: 100%; }
.b-var { background: var(--var); } .b-gec { background: var(--gec); } .b-yok { background: var(--yok); } .b-izin { background: var(--izin); }
.tile-flag { position: absolute; top: 14px; right: 12px; font-size: 12px; font-weight: 600; color: var(--yok); background: var(--yok-bg); padding: 2px 7px; border-radius: 5px; }
.class-tile.waiting { background: transparent; border-style: dashed; border-color: var(--line-2); }
.class-tile.waiting .tile-name { color: var(--ink-2); }
.class-tile.waiting .tile-bar { background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 10px); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 40px; margin-top: 40px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.count { font-size: 13.5px; color: var(--ink-2); }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.who { display: grid; min-width: 0; }
.who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--ink-3); font-size: 13px; }
.days { display: flex; align-items: center; gap: 10px; flex: 0 0 140px; }
.days i { height: 6px; border-radius: 3px; background: var(--yok); opacity: .75; }
.days b { font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; margin-left: auto; }

/* ---------- Yoklama ---------- */
.att-controls { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.att-controls .field { flex: 0 1 220px; margin: 0; }
.roll { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.roll .empty { padding: 28px 20px; }
.roll-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; transition: background .15s; }
.roll-row:last-child { border-bottom: 0; }
.roll-row.st-yok { background: #fdf3f1; border-left-color: var(--yok); }
.roll-row.st-gec { background: #fdf8ee; border-left-color: var(--gec); }
.roll-row.st-izin { background: #f2f6fc; border-left-color: var(--izin); }
.roll-no { text-align: right; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.roll-who { display: grid; min-width: 0; }
.roll-who b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roll-who small { font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.roll-who .tel span { color: var(--ink-3); }
.seg { display: inline-flex; background: var(--sunk); border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { appearance: none; border: 0; background: transparent; min-width: 70px; min-height: 40px; padding: 0 12px; border-radius: 6px; font: 600 14px/1 var(--text); color: var(--ink-2); cursor: pointer; transition: background .12s, color .12s; }
.seg button:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.seg button[aria-pressed="true"] { color: #fff; }
.seg .s-var[aria-pressed="true"] { background: var(--var); }
.seg .s-yok[aria-pressed="true"] { background: var(--yok); }
.seg .s-gec[aria-pressed="true"] { background: var(--gec); }
.seg .s-izin[aria-pressed="true"] { background: var(--izin); }

.savebar { position: sticky; bottom: 16px; z-index: 10; margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 12px 12px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px -12px rgba(22,32,28,.25); }
.savebar.dirty { border-color: var(--board); }
.tally { display: flex; gap: 20px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tally b { font: 700 20px/1 var(--display); margin-right: 3px; }
.t-var b { color: var(--var); } .t-yok b { color: var(--yok); } .t-gec b { color: var(--gec); } .t-izin b { color: var(--izin); }
.savebar-actions { display: flex; gap: 8px; }

/* ---------- Öğrenciler ---------- */
.filters { display: flex; gap: 12px; margin-bottom: 16px; }
.search { position: relative; flex: 1; max-width: 420px; margin: 0; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.search .input { padding-left: 40px; }
.filters select { width: 180px; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f8faf8; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfa; }
.num { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.name-cell b { display: block; }
.name-cell small { color: var(--ink-3); font-size: 12.5px; }
.mobile-only { display: none; }
.absence { font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.absence.some { color: var(--gec); font-weight: 600; }
.absence.high { color: var(--yok); font-weight: 600; }
.row-actions { white-space: nowrap; text-align: right; }

/* ---------- Öğretmenler ---------- */
.teacher-list { display: grid; gap: 10px; }
.teacher { display: grid; grid-template-columns: 40px minmax(160px, 1fr) 2fr auto; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 12px 12px 16px; }
.t-initials { width: 40px; height: 40px; border-radius: 50%; background: var(--board); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.empty-state { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 32px 24px; display: grid; justify-items: start; gap: 16px; }
.empty-state p { color: var(--ink-2); max-width: 52ch; }

/* ---------- Bildirimler ---------- */
.channel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin-bottom: 14px; max-width: 720px; display: grid; gap: 10px; justify-items: start; }
.channel-head { display: flex; align-items: center; gap: 12px; }
.channel p { color: var(--ink-2); max-width: 64ch; }

/* ---------- pencereler ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(16,28,24,.45); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-bg.show { display: flex; }
.modal { background: var(--surface); width: min(720px, 100%); max-height: calc(100vh - 40px); border-radius: var(--r-lg); display: flex; flex-direction: column; box-shadow: 0 24px 60px -20px rgba(0,0,0,.35); animation: rise .18s ease-out; }
.modal.narrow { width: min(520px, 100%); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 14px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 21px; }
.modal-body { padding: 18px 24px 8px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 18px; border-top: 1px solid var(--line); }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font: 700 15px/1 var(--display); padding: 0; margin-bottom: 12px; color: var(--board); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error { color: var(--yok); font-size: 14px; min-height: 20px; margin: 4px 0 8px; }
.class-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.class-check { margin: 0; }
.class-check input { position: absolute; opacity: 0; pointer-events: none; }
.class-check span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-weight: 600; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.class-check input:checked + span { background: var(--board); border-color: var(--board); color: #fff; }
.class-check input:focus-visible + span { outline: 2.5px solid var(--focus); outline-offset: 2px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-sm); font-size: 14.5px; max-width: min(92vw, 520px); z-index: 80; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: var(--board); }
.toast.bad { background: var(--yok); }

/* ---------- giriş ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); }
.login-side { background: var(--board); color: var(--board-ink); padding: 48px clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; overflow: hidden; }
.login-side .brand { padding: 0; }
.login-side h2 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; color: #fff; max-width: 14ch; font-weight: 700; }
.login-side p { color: var(--board-mute); max-width: 42ch; margin-top: 14px; }
.register { display: grid; grid-template-columns: repeat(17, 1fr); gap: 5px; max-width: 460px; }
.register i { aspect-ratio: 1; border-radius: 3px; background: rgba(255,255,255,.08); }
.register i.v { background: rgba(111,191,143,.55); }
.register i.y { background: #ef7a63; }
.register i.g { background: var(--chalk); }
.login-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--paper); }
.login-form { width: 100%; max-width: 360px; display: grid; gap: 16px; }
.login-form h1 { font-size: 30px; }
.login-form .sub { color: var(--ink-2); margin-top: -8px; }
.login-form .btn { width: 100%; min-height: 46px; margin-top: 4px; }
.login-form .foot { font-size: 13px; color: var(--ink-3); }
.err { color: var(--yok); font-size: 14px; min-height: 20px; }

/* ---------- tablet ve telefon ---------- */
@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
  .teacher { grid-template-columns: 40px 1fr auto; }
  .teacher .tags { grid-column: 2 / 3; }
  .teacher .icon-btn { grid-row: 1; grid-column: 3; }
}
@media (max-width: 860px) {
  body { padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 15; height: 54px; padding: 0 8px 0 16px; background: var(--board); color: #fff; }
  .topbar-name { flex: 1; font: 700 16px/1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail { inset: auto 0 0 0; width: auto; height: calc(var(--nav-h) + var(--safe-b)); padding: 0 4px var(--safe-b); flex-direction: row; border-top: 1px solid rgba(255,255,255,.08); }
  .rail .brand, .rail-foot { display: none; }
  .nav { flex-direction: row; flex: 1; gap: 0; }
  .nav a { flex: 1; flex-direction: column; gap: 3px; padding: 9px 2px 8px; font-size: 11.5px; justify-content: center; border-radius: 0; }
  .nav a:hover { background: none; }
  .nav a.active { background: none; }
  .nav a.active::before { left: 30%; right: 30%; top: 0; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  main { margin-left: 0; padding: 22px 16px 32px; }
  .page-head { margin-bottom: 18px; align-items: flex-start; }
  .page-head .btn span { display: none; }
  .page-head .btn { width: 44px; padding: 0; }
  .page-head > .btn.ghost { display: inline-flex; }
  .page-head .btn svg { width: 20px; height: 20px; }
  .figures { gap: 22px; }
  .figures dd { font-size: 28px; }
  .class-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile-name { font-size: 26px; }
  .filters { flex-direction: column; }
  .search { max-width: none; }
  .filters select { width: 100%; }

  /* öğrenci tablosu kart listesine dönüşür */
  .table-wrap { background: transparent; border: 0; overflow: visible; }
  .students-table thead { display: none; }
  .students-table, .students-table tbody, .students-table tr, .students-table td { display: block; }
  .students-table tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  .students-table td { padding: 0; border: 0; font-size: 14px; }
  .students-table tbody tr:hover td { background: none; }
  .students-table td[data-label] { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; }
  .students-table td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: 13px; }
  .students-table td.num { display: none; }
  .mobile-only { display: inline; }
  .students-table .name-cell { grid-column: 1; grid-row: 1; margin-bottom: 6px; }
  .students-table .row-actions { grid-column: 2; grid-row: 1; }
  .students-table td.empty { grid-column: 1 / -1; }

  .savebar { bottom: calc(var(--nav-h) + var(--safe-b) + 10px); flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .tally { justify-content: space-between; gap: 6px; font-size: 13px; }
  .tally b { font-size: 18px; }
  .savebar-actions .btn { flex: 1; }
  .savebar-actions .btn.primary { flex: 2; }
  .toast { top: 64px; bottom: auto; transform: translate(-50%, -12px); }
  .toast.show { transform: translate(-50%, 0); }
  .section-head { flex-direction: column; align-items: flex-start; gap: 4px; }

  .modal-bg { padding: 0; align-items: flex-end; }
  .modal, .modal.narrow { width: 100%; max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .modal-actions { padding-bottom: calc(14px + var(--safe-b)); }
  .modal-actions .btn { flex: 1; }

  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-side { padding: 28px 24px 26px; gap: 22px; }
  .login-side h2 { font-size: 26px; }
  .login-side p { display: none; }
  .register { grid-template-columns: repeat(17, 1fr); gap: 3px; max-width: 320px; }
  .login-main { align-items: flex-start; padding-top: 32px; }
}
@media (max-width: 560px) {
  .att-controls .field { flex: 1 1 100%; }
  .roll-row { grid-template-columns: 34px minmax(0, 1fr); grid-template-areas: "no who" ". seg"; row-gap: 8px; padding: 12px 12px 12px 0; }
  .roll-no { grid-area: no; align-self: start; padding-top: 2px; }
  .roll-who { grid-area: who; }
  .seg { grid-area: seg; display: grid; grid-template-columns: repeat(4, 1fr); }
  .seg button { padding: 0 4px; font-size: 13.5px; }
  .seg button { min-width: 0; min-height: 44px; }
  .form-grid { grid-template-columns: 1fr; }
  .figures { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; gap: 14px; }
}

/* ---------- yeni özellikler ---------- */
.head-actions { display: flex; gap: 8px; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.link-btn { appearance: none; border: 0; background: none; padding: 0; font: 600 14px var(--text); color: var(--board); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pw-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: -4px; }
input[readonly] { background: var(--sunk); color: var(--ink-2); }
code { font-size: 13px; background: var(--sunk); padding: 1px 5px; border-radius: 4px; }
.legend-note { font-size: 13px; color: var(--ink-3); margin-top: 10px; }

.name-link { appearance: none; border: 0; background: none; padding: 0; font: 600 15px/1.35 var(--text); color: var(--ink); cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.name-link:hover { color: var(--board); text-decoration: underline; text-underline-offset: 3px; }
.name-cell .name-link { display: block; }
.risk-text { font-weight: 600; }
.risk-over .risk-text { color: var(--yok); }
.risk-near .risk-text { color: var(--gec); }
.meter-mini { display: flex; align-items: center; gap: 10px; flex: 0 0 120px; }
.meter-mini i { height: 6px; border-radius: 3px; background: var(--yok); min-width: 3px; }
.meter-mini b { margin-left: auto; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.risk-near .meter-mini i { background: var(--gec); }
.people .more { padding-top: 10px; }
.t-actions { display: flex; align-items: center; gap: 4px; }

/* öğrenci geçmişi */
.back { appearance: none; border: 0; background: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px 6px 2px; margin: -8px 0 14px; font: 500 14.5px var(--text); color: var(--ink-2); cursor: pointer; border-radius: var(--r-sm); }
.back:hover { color: var(--ink); }
.back svg { width: 18px; height: 18px; }
.st-info { display: flex; flex-wrap: wrap; gap: 14px 40px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.st-info > div { display: grid; gap: 2px; }
.st-info span:first-child { font-size: 13px; color: var(--ink-3); }
.st-info .wide { flex-basis: 100%; }
.st-info p { color: var(--ink-2); max-width: 70ch; }
.meters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.meter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.meter-top span { font-size: 13.5px; color: var(--ink-2); }
.meter-top b { font: 700 28px/1 var(--display); font-variant-numeric: tabular-nums; }
.meter-top small { font: 500 13px var(--text); color: var(--ink-3); }
.meter-bar { height: 8px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: 4px; }
.meter.near { border-color: var(--gec); }
.meter.over { border-color: var(--yok); background: #fdf5f3; }
.meters .callout, .meters-note { grid-column: 1 / -1; margin: 0; }
.callout.over { border-left-color: var(--yok); color: var(--yok); font-weight: 600; }
.callout.near { border-left-color: var(--gec); color: #7d500b; font-weight: 600; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; }
.lg-var { background: var(--var-bg); box-shadow: inset 0 0 0 1.5px var(--var); }
.lg-yok { background: var(--yok); } .lg-izin { background: var(--izin); } .lg-gec { background: var(--gec-bg); box-shadow: inset 0 0 0 1.5px var(--gec); }
.lg-none { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 14px 16px; }
.month h3 { font-size: 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.month h3 small { font: 600 12.5px var(--text); color: var(--yok); }
.dow, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow span { font-size: 11.5px; color: var(--ink-3); text-align: center; padding-bottom: 2px; }
.day { appearance: none; border: 0; aspect-ratio: 1; border-radius: 6px; font: 500 13px/1 var(--text); font-variant-numeric: tabular-nums; display: grid; place-items: center; background: var(--paper); color: var(--ink); cursor: pointer; padding: 0; }
button.day:hover { box-shadow: inset 0 0 0 2px var(--board); }
.day.weekend, .day.future, .day.offterm { background: transparent; color: var(--line-2); cursor: default; }
.day.d-var { background: var(--var-bg); color: var(--var); }
.day.d-yok { background: var(--yok); color: #fff; font-weight: 700; }
.day.d-izin { background: var(--izin); color: #fff; font-weight: 700; }
.day.d-gec { background: var(--gec-bg); color: var(--gec); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--gec); }
.day.today { outline: 2px solid var(--board); outline-offset: 1px; }
.pad { display: block; }

.day-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 14px; }
.opt { appearance: none; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); min-height: 54px; font: 600 15px var(--text); color: var(--ink); cursor: pointer; display: grid; place-content: center; gap: 2px; }
.opt small { font: 500 12px var(--text); color: var(--ink-3); }
.opt:hover { border-color: var(--ink-3); }
.opt.on { color: #fff; border-color: transparent; }
.opt.on small { color: rgba(255,255,255,.8); }
.o-var.on { background: var(--var); } .o-yok.on { background: var(--yok); } .o-izin.on { background: var(--izin); } .o-gec.on { background: var(--gec); }
.o-clear { grid-column: 1 / -1; min-height: 42px; color: var(--ink-2); font-weight: 500; }

/* ayarlar */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin-bottom: 14px; max-width: 720px; display: grid; gap: 12px; justify-items: start; }
.panel .form-grid { width: 100%; }
.panel-text { color: var(--ink-2); font-size: 14.5px; max-width: 64ch; }
.panel .form-error { margin: 0; }
.channels { display: flex; gap: 8px; flex-wrap: wrap; }
.rep-desc { margin-top: 14px; font-size: 13.5px; }

@media (max-width: 1080px) {
  .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher .t-actions { grid-row: 1; grid-column: 3; }
}
@media (max-width: 860px) {
  .head-actions .btn { width: 44px; padding: 0; }
  .head-actions .btn span { display: none; }
  .students-table td[data-label="Özürsüz"], .students-table td[data-label="Toplam"] { grid-column: auto; }
  .students-table td[data-label="Özürsüz"] { grid-column: 1 / -1; }
  .meter-top b { font-size: 24px; }
  .calendar { grid-template-columns: 1fr; }
  .st-info { gap: 12px 28px; }
  .panel { padding: 18px; }
}


/* ---------- v4: profesyonel düzen ---------- */
.class-tile, .roll, .table-wrap, .meter, .month, .panel, .teacher, .channel, .cal-panel, .trend { box-shadow: var(--card-shadow); }
.students-table tr { box-shadow: none; }
.seg button:disabled { opacity: .35; cursor: not-allowed; background: transparent !important; color: var(--ink-3) !important; text-decoration: line-through; text-decoration-thickness: 1px; }
.opt:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn.flip svg { transform: scaleX(-1); }

/* devam oranı grafiği */
.trend { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 12px; margin-top: 24px; }
.trend .block-head { border: 0; padding-bottom: 6px; }
.trend-chart { display: grid; grid-template-columns: 38px 1fr; gap: 8px; height: 150px; }
.trend-scale { display: flex; flex-direction: column; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); padding-bottom: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.trend-bars { display: flex; align-items: stretch; gap: 4px; border-left: 1px solid var(--line); border-bottom: 0; padding-left: 6px; }
.bar { flex: 1; display: grid; grid-template-rows: 1fr 20px; min-width: 0; }
.bar i { align-self: end; display: block; background: var(--var); opacity: .8; border-radius: 3px 3px 0 0; min-height: 2px; }
.bar:hover i { opacity: 1; }
.bar span { font-size: 11px; color: var(--ink-3); white-space: nowrap; padding-top: 4px; overflow: visible; }

/* öğrenci başlığı */
.st-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.st-avatar { width: 56px; height: 56px; border-radius: 14px; background: var(--board); color: #fff; display: grid; place-items: center; font: 700 20px var(--display); flex: none; }
.st-head .kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.meter-sub { font-size: 12.5px; color: var(--ink-3); margin-top: -4px; }
.meter.plain { align-content: space-between; }

/* takvim paneli */
.cal-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 16px; margin-top: 28px; display: grid; gap: 14px; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h2 { font-size: 20px; min-width: 150px; text-align: center; }
.cal-pickers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cal-pickers select.input { width: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.goto { display: flex; align-items: center; gap: 8px; margin: 0; }
.goto span { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.goto .input { width: auto; min-height: 36px; padding: 5px 10px; }
.seg-switch { display: inline-flex; background: var(--sunk); border-radius: 8px; padding: 3px; gap: 2px; }
.seg-switch button { appearance: none; border: 0; background: transparent; padding: 0 14px; min-height: 30px; border-radius: 6px; font: 600 13.5px var(--text); color: var(--ink-2); cursor: pointer; }
.seg-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cal-summary { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-summary div { display: flex; flex-direction: column-reverse; }
.cal-summary dt { font-size: 12.5px; color: var(--ink-3); }
.cal-summary dd { margin: 0; font: 700 22px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.calendar.month-view { display: block; }
.month-view .month { border: 0; box-shadow: none; padding: 0; }
.month-view .dow { margin-bottom: 6px; }
.month-view .dow span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-align: left; padding-left: 8px; }
.month-view .cal-days { gap: 6px; }
.month-view .day { aspect-ratio: auto; min-height: 66px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 7px 8px; border-radius: 8px; text-align: left; border: 1px solid transparent; }
.month-view .dn { font-weight: 600; font-size: 14px; }
.month-view .dl { font-size: 11.5px; font-weight: 600; opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.month-view .day.weekend, .month-view .day.future, .month-view .day.offterm { background: transparent; border-color: var(--line); color: var(--ink-3); }
.month-view .day.weekend { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.025) 6px 8px); }
.year-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.year-view .month { box-shadow: none; padding: 12px; }
.year-view .month h3 { font-size: 14.5px; }
.year-view .day { font-size: 11.5px; border-radius: 4px; }
.year-view .dow span { font-size: 10.5px; }
.day.holiday:not(.d-var):not(.d-yok):not(.d-izin):not(.d-gec) { background: repeating-linear-gradient(135deg, var(--sunk) 0 5px, #dfe5e1 5px 8px); color: var(--ink-3); }
.lg-hol { background: repeating-linear-gradient(135deg, var(--sunk) 0 3px, #cfd7d2 3px 5px); }

/* anahtar (switch) */
.switch { display: flex; align-items: flex-start; gap: 12px; margin: 0; cursor: pointer; color: var(--ink); font-size: 14.5px; }
.switch input { position: absolute; opacity: 0; }
.switch .track { flex: none; width: 40px; height: 24px; border-radius: 12px; background: var(--line-2); position: relative; transition: background .15s; margin-top: 1px; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--board); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.switch b { display: block; font-weight: 600; }
.switch small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }

@media (max-width: 860px) {
  .school-name { display: none; }
  .st-avatar { width: 46px; height: 46px; font-size: 17px; border-radius: 12px; }
  .cal-panel { padding: 14px 12px; }
  .cal-toolbar { flex-direction: column; align-items: stretch; }
  .cal-nav { justify-content: space-between; }
  .cal-pickers { display: grid; grid-template-columns: 1fr 1fr; }
  .cal-pickers select.input { width: 100%; }
  .goto { grid-column: 1 / -1; justify-content: space-between; }
  .goto .input { flex: 1; }
  .seg-switch { justify-self: end; }
  .month-view .cal-days { gap: 4px; }
  .month-view .day { min-height: 46px; padding: 5px; }
  .month-view .dl { display: none; }
  .month-view .dow span { text-align: center; padding: 0; font-size: 11.5px; }
  .month-view .day { align-items: center; justify-content: center; }
  .cal-summary { gap: 8px 18px; }
  .cal-summary dd { font-size: 19px; }
  .trend-chart { height: 120px; }
  .bar span { font-size: 0; }
  .bar:first-child span, .bar:last-child span { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.err:empty, .form-error:empty { display: none; }
