:root { --bg:#f4f6fb; --card:#fff; --ink:#1b2440; --muted:#667089; --navy:#1f2d4f; --gold:#c9a45c; --line:#e3e7f0;
  --ok:#15803d; --okbg:#e8f6ee; --warn:#b45309; --warnbg:#fff4e0; --err:#b91c1c; --errbg:#fdecec; --info:#1d4ed8; --infobg:#e8efff; }
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; background:var(--bg); color:var(--ink); line-height:1.45; }
header { display:flex; align-items:center; gap:14px; padding:6px 16px; min-height:68px; background:linear-gradient(135deg,#1f2d4f,#2c3f6b); color:#fff; position:sticky; top:0; z-index:5; border-bottom:3px solid var(--gold); box-shadow:0 2px 12px rgba(31,45,79,.25); }
header a.brand { display:flex; flex-shrink:0; }
header img { width:auto; height:56px; filter:drop-shadow(0 2px 3px rgba(0,0,0,.35)); transition:transform .15s; }
header a.brand:hover img { transform:rotate(-4deg) scale(1.05); }
header b { font-size:1.25rem; letter-spacing:.3px; } header .grow span { display:block; color:#cfd6e6; font-size:.8rem; }
header .grow { flex:1; }
main { max-width:1000px; margin:0 auto; padding:16px 16px 60px; }
h2 { margin:22px 0 12px; font-size:1.1rem; }
a { color:var(--info); }

/* Sinif secimi */
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(84px,1fr)); gap:10px; }
.cls { position:relative; padding:16px 0; font-size:1.25rem; font-weight:700; border:2px solid var(--line); border-radius:12px; background:var(--card); color:var(--navy); transition:transform .12s, border-color .12s; }
.cls:hover { border-color:var(--gold); transform:translateY(-2px); }
.cls.on { background:var(--navy); color:#fff; border-color:var(--navy); }
.cls .n { position:absolute; top:-7px; right:-7px; min-width:22px; height:22px; padding:0 6px; border-radius:11px; background:var(--gold); color:var(--navy); font-size:.75rem; line-height:22px; }

/* Odev kartlari: guncel odevler renkli + hover */
.card { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:16px; margin-bottom:12px; }
.odev { border-left:6px solid var(--ok); background:linear-gradient(90deg,var(--okbg),#fff 40%); transition:transform .15s, box-shadow .15s; }
.odev:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(31,45,79,.12); }
.odev.soon { border-left-color:var(--warn); background:linear-gradient(90deg,var(--warnbg),#fff 40%); }
.odev.last { border-left-color:var(--err); background:linear-gradient(90deg,var(--errbg),#fff 40%); }
.odev h3 { margin:0 0 6px; font-size:1.05rem; }
.card, td, .og .tt { overflow-wrap:anywhere; } .odev p { white-space:pre-line; }
.meta { color:var(--muted); font-size:.88rem; display:flex; flex-wrap:wrap; gap:6px 14px; }
.badge { display:inline-block; padding:2px 9px; border-radius:999px; font-size:.78rem; font-weight:600; background:var(--okbg); color:var(--ok); }
.badge.warn { background:var(--warnbg); color:var(--warn); } .badge.err { background:var(--errbg); color:var(--err); }
.badge.info { background:var(--infobg); color:var(--info); } .badge.mute { background:#eef0f5; color:var(--muted); }

/* Form */
label { display:block; font-size:.85rem; color:var(--muted); margin:10px 0 4px; }
input, select, textarea { width:100%; padding:11px; border:2px solid #9aa3b8; box-shadow:inset 0 1px 2px rgba(31,45,79,.08); border-radius:9px; font:inherit; font-size:16px; background:#fff; }
input:focus, select:focus, textarea:focus { outline:3px solid var(--gold); outline-offset:0; border-color:var(--navy); }
label { color:var(--ink); font-weight:600; }
.row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.hint { font-size:.8rem; color:var(--muted); margin-top:4px; }
.note label.chk { display:flex; align-items:center; gap:8px; margin:8px 0 0; color:inherit; }
.note label.chk input { width:22px; height:22px; flex:none; padding:0; }
.note { margin-top:10px; padding:10px 12px; border-radius:9px; font-size:.88rem; background:var(--warnbg); color:var(--warn); }
.note.err { background:var(--errbg); color:var(--err); } .note.info { background:var(--infobg); color:var(--info); }
button.btn { margin-top:12px; padding:11px 18px; min-height:44px; border:0; border-radius:9px; background:var(--navy); color:#fff; font:inherit; font-weight:600; }
button.btn:hover { background:#2b3d69; }
button.btn.sec { background:#eef0f7; color:var(--ink); } button.btn.del { background:var(--errbg); color:var(--err); } button.btn.gold { background:var(--gold); color:var(--navy); }
button.btn.sm { margin:0; padding:6px 10px; min-height:34px; font-size:.85rem; }
button:disabled { opacity:.6; }
.msg { margin-top:10px; font-size:.92rem; }
.msg.fail { font-size:1.05rem; font-weight:700; padding:14px; border:2px solid var(--err); } .msg.ok { color:var(--ok); font-weight:600; } .msg.err { color:var(--err); }
progress { width:100%; height:10px; margin-top:10px; accent-color:var(--navy); }

/* Admin */
.tabs { display:flex; gap:6px; flex-wrap:wrap; margin:6px 0 4px; }
.tabs button { margin:0; }
table { width:100%; border-collapse:collapse; background:var(--card); font-size:.88rem; border-radius:12px; overflow:hidden; }
th, td { text-align:left; padding:9px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
th { background:#f0f2f8; font-weight:600; }
tr.past td { background:#f6f6f8; color:#8a90a0; }
tr.danger td { background:var(--errbg); }
.empty { color:var(--muted); padding:18px 0; }
.alerts .note { margin:0 0 8px; }
.toolbar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }

/* Teslimler: odev gruplari (acilir) */
.gh { margin:18px 0 8px; font-size:1rem; }
details.og, details.pastbox { background:var(--card); border:1px solid var(--line); border-radius:12px; margin-bottom:8px; overflow:hidden; }
details.og { border-left:5px solid var(--ok); }
details.og.unread { border-left-color:var(--err); }
#tGroups summary { list-style:none; display:flex; align-items:center; gap:10px; padding:12px 14px; }
#tGroups summary::-webkit-details-marker { display:none; }
#tGroups summary::after { content:"▾"; color:var(--muted); transition:transform .15s; }
#tGroups details[open] > summary::after { transform:rotate(180deg); }
#tGroups summary:hover { background:#f7f8fc; }
.og .rd { font-size:1.15rem; flex-shrink:0; }
.og .tt { flex:1; min-width:0; } .og .tt b { display:block; overflow-wrap:anywhere; } .og .tt small { color:var(--muted); }
.og .selall { margin:0 14px 8px; font-weight:500; }
.og table { border-radius:0; border-top:1px solid var(--line); }
tr.new td { background:#fff6f6; }

/* Mesajlar: secim cubugu, secilenler, WhatsApp butonlari */
.selbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:14px; padding:10px 14px; border-radius:12px; background:var(--navy); color:#fff; box-shadow:0 6px 20px rgba(31,45,79,.3); }
.selbar span { flex:1; font-weight:600; } .selbar[hidden] { display:none; }
.msgpanel { margin-top:8px; padding:12px; } .msgpanel[hidden] { display:none; }
.msgpanel .mp-head { display:flex; justify-content:space-between; align-items:center; }
.msgpanel textarea { margin:6px 0 8px; } .msgpanel .hint { margin:4px 0; font-size:.8rem; }
.sellist { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:10px 0 4px; }
.sellist .pick { display:inline-flex; align-items:center; gap:4px; padding:4px 4px 4px 10px; border-radius:999px; background:#eef0f7; font-size:.82rem; overflow-wrap:anywhere; }
.sellist .pick button { border:0; background:none; color:var(--muted); font-size:1.1rem; line-height:1; padding:2px 6px; }
.walist { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.walist a { padding:9px 14px; border-radius:9px; background:#1f9d55; color:#fff; font-weight:600; font-size:.88rem; text-decoration:none; }
.walist a:hover { background:#17824a; } .walist a.sent { background:var(--okbg); color:var(--ok); }
#wa h3 { margin:18px 0 4px; }
.walink { display:inline-block; padding:2px 8px; border-radius:7px; background:#e3f6ea; color:#17824a; font-weight:600; text-decoration:none; white-space:nowrap; }
.walink:hover { background:#1f9d55; color:#fff; }
details.pastbox { margin-top:18px; background:#f3f4f8; }
details.pastbox > summary { font-weight:700; justify-content:space-between; }
.pastbox .og { margin:0 10px 8px; border-left-color:#9aa3b8; } .pastbox .og.unread { border-left-color:var(--err); }
.pastbox > .empty { padding:0 14px 12px; }

/* Takvim */
.cal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.cal { display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.cal .dow { font-size:.75rem; color:var(--muted); text-align:center; padding:4px 0; }
.cal .day { min-height:86px; background:var(--card); border:1px solid var(--line); border-radius:8px; padding:4px; font-size:.75rem; overflow:hidden; }
.cal .day.out { opacity:.4; } .cal .day.today { border:2px solid var(--gold); }
.cal .day b { display:block; font-size:.8rem; margin-bottom:2px; }
.chip { display:block; padding:1px 5px; margin-top:2px; border-radius:5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; background:var(--infobg); color:var(--info); }
.chip.end { background:var(--errbg); color:var(--err); } .chip.past { background:#eef0f5; color:var(--muted); }

@media (max-width:640px) {
  main { padding:12px 12px 50px; }
  .row { grid-template-columns:1fr; }
  header span { display:none; }
  /* Tablolar mobilde kart gibi */
  table.cards thead { display:none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display:block; width:100%; }
  table.cards tr { margin-bottom:10px; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--card); }
  table.cards td { border:0; padding:5px 12px; }
  table.cards td::before { content:attr(data-label); display:block; font-size:.72rem; color:var(--muted); }
  /* Teslimler: kompakt kart (ad soyad ust, dosya alta) */
  .og table.cards { background:none; border-top:0; }
  .og tbody.tes { padding:0 10px; }
  tbody.tes tr { display:grid; grid-template-columns:auto 1fr; gap:3px 12px; padding:12px 14px; box-shadow:0 2px 8px rgba(31,45,79,.06); border-left:4px solid var(--navy); }
  tbody.tes tr.new, tbody.tes tr.danger { border-left-color:var(--err); }
  tbody.tes td { padding:0; background:none; min-width:0; overflow-wrap:anywhere; }
  tbody.tes td::before { content:none; }
  tbody.tes td:nth-child(1) { grid-column:1; grid-row:1 / span 2; align-self:center; }
  tbody.tes td:nth-child(1) input { width:20px; height:20px; accent-color:var(--navy); }
  tbody.tes td:nth-child(3) { grid-column:2; grid-row:1; font-size:1.05rem; font-weight:700; color:var(--navy); }
  tbody.tes td:nth-child(5) { grid-column:2; grid-row:2; margin-top:4px; }
  tbody.tes td:nth-child(5) a { display:inline-block; max-width:100%; padding:6px 12px; border-radius:8px; background:var(--infobg); color:var(--info); font-weight:600; font-size:.85rem; text-decoration:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  tbody.tes td:nth-child(6) { grid-column:2; grid-row:3; margin-top:4px; font-size:.85rem; }
  tbody.tes td:nth-child(2), tbody.tes td:nth-child(4) { grid-column:2; font-size:.75rem; color:var(--muted); }
  tbody.tes td:nth-child(4) { grid-row:4; margin-top:6px; } tbody.tes td:nth-child(2) { grid-row:5; }
  tbody.tes td.none, tbody.tes td.empty::before { display:none; }
  tbody.tes td.empty { grid-column:1 / -1; }
  tbody.tes tr.e { box-shadow:none; border-left:0; }
  /* Ayrinti: dokununca acilir */
  tbody.tes tr::after, #tMail tr::after { content:"Ayrıntı ▾"; grid-column:1 / -1; justify-self:end; font-size:.72rem; color:var(--muted); }
  tbody.tes tr.open::after, #tMail tr.open::after { content:"Kapat ▴"; }
  tbody.tes tr.e::after { content:none; }
  tbody.tes tr:not(.open) td:nth-child(2), tbody.tes tr:not(.open) td:nth-child(6) { display:none; }
  tbody.tes td:nth-child(4) .walink { font-size:.85rem; padding:5px 10px; }
  tbody.tes tr::after { grid-row:6; }
  /* Kayitli e-postalar: ad + sinif + teslim sayisi, gerisi acilir */
  #tMail tr { display:grid; grid-template-columns:1fr auto; gap:3px 12px; padding:12px 14px; box-shadow:0 2px 8px rgba(31,45,79,.06); border-left:4px solid var(--gold); }
  #tMail td { padding:0; min-width:0; overflow-wrap:anywhere; }
  #tMail td:nth-child(2) { grid-column:1; grid-row:1; font-size:1.05rem; font-weight:700; color:var(--navy); }
  #tMail td:nth-child(2)::before { content:none; }
  #tMail td:nth-child(3) { grid-column:2; grid-row:1; align-self:start; padding:2px 9px; border-radius:999px; background:var(--gold); color:var(--navy); font-size:.75rem; font-weight:700; }
  #tMail td:nth-child(3)::before { content:none; }
  #tMail td:nth-child(6) { grid-column:1 / -1; grid-row:2; font-size:.85rem; }
  #tMail td:nth-child(6)::before, #tMail td:nth-child(4)::before, #tMail td:nth-child(5)::before { display:inline; content:attr(data-label) ": "; font-size:inherit; }
  #tMail td:nth-child(1), #tMail td:nth-child(4), #tMail td:nth-child(5) { grid-column:1 / -1; font-size:.8rem; color:var(--muted); }
  #tMail td:nth-child(1)::before { content:none; }
  #tMail tr:not(.open) td:nth-child(1), #tMail tr:not(.open) td:nth-child(4), #tMail tr:not(.open) td:nth-child(5) { display:none; }
  .cal .day { min-height:58px; font-size:.65rem; }
  .cal .chip { padding:0 3px; }
}
@media (prefers-reduced-motion:reduce) { * { transition:none !important; } }
header a.home { color:#fff; text-decoration:none; font-size:.85rem; font-weight:600; padding:8px 12px; border:1px solid rgba(255,255,255,.35); border-radius:9px; white-space:nowrap; }
header a.home:hover { background:var(--gold); color:var(--navy); border-color:var(--gold); }
header a.home i { font-style:normal; }
@media (max-width:520px) { header { gap:10px; padding:6px 12px; } header img { height:48px; } header b { font-size:1.05rem; line-height:1.2; } header a.home { padding:8px 10px; font-size:1.1rem; } header a.home i { display:none; } }

/* Ozel imlecler (32x32; sirayla: normal, tiklanabilir, metin). Hotspot ortada. */
html, body { cursor:url(/cursors/default.png?v=4) 16 16, auto; }
:where(p,h1,h2,h3,h4,li,td,th,label,span,b,small,input,textarea) { cursor:url(/cursors/text.png?v=4) 16 16, text; }
a, button, select, summary, input[type=checkbox], label.btn, .cls { cursor:url(/cursors/pointer.png?v=4) 16 16, pointer; }
a *, button *, .cls *, label.btn * { cursor:inherit; }
button:disabled, progress { cursor:url(/cursors/progress.png?v=4) 13 16, progress; }
input[type=file] { cursor:url(/cursors/file.png?v=4) 16 16, pointer; }
input[type=file]::file-selector-button { cursor:url(/cursors/file.png?v=4) 16 16, pointer; }

/* Admin: veri yuklenirken ortada kart, arka plan bugulu */
.loading { position:fixed; inset:0; z-index:50; display:grid; place-items:center; background:rgba(244,246,251,.55); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); }
.loading[hidden] { display:none; }
.loading > div { display:flex; align-items:center; gap:12px; padding:18px 26px; background:var(--card); border:1px solid var(--line); border-top:3px solid var(--gold); border-radius:14px; box-shadow:0 10px 30px rgba(31,45,79,.18); color:var(--navy); font-weight:700; }
.spin { width:22px; height:22px; border:3px solid var(--line); border-top-color:var(--gold); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration:2.4s; } }
