/* ==========================================================================
   Okul Yönetim Sistemi — tek stil dosyası
   Renkler token olarak :root'ta; açık/koyu tema otomatik + elle geçiş.
   ========================================================================== */
:root {
  --brand:        #0c4968;
  --brand-2:      #14708f;
  --accent:       #1f9d6b;
  --danger:       #d7262d;
  --warn:         #c77700;
  --ok:           #1f9d6b;

  --bg:           #f4f5f7;
  --panel:        #ffffff;
  --panel-2:      #f8fafc;
  --ink:          #16202a;
  --muted:        #5c6b7a;
  --hair:         #e4e8ec;
  --hair-strong:  #cfd6dd;
  --shadow:       0 1px 2px rgba(16,32,42,.06), 0 4px 16px rgba(16,32,42,.06);
  --radius:       14px;
  --radius-sm:    9px;
  --font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg:           #0f151a;
  --panel:        #161d24;
  --panel-2:      #1b232b;
  --ink:          #e7ecf1;
  --muted:        #9aa7b3;
  --hair:         #26303a;
  --hair-strong:  #33404c;
  --shadow:       0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0f151a; --panel:#161d24; --panel-2:#1b232b; --ink:#e7ecf1;
    --muted:#9aa7b3; --hair:#26303a; --hair-strong:#33404c;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}

* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  line-height: 1.5;
}
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* ---- Genel öğeler ---- */
button { font-family: inherit; cursor: pointer; }
a { color: var(--brand-2); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
small { color: var(--muted); }

.btn {
  border: 1px solid var(--hair-strong); background: var(--panel); color: var(--ink);
  padding: 9px 16px; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 600;
  transition: filter .12s, background .12s; white-space: nowrap;
}
.btn:hover { filter: brightness(.98); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-accent  { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger  { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-ghost   { background: transparent; border-color: transparent; }
.btn-small   { padding: 5px 10px; font-size: .8rem; }

input, select, textarea {
  font-family: inherit; font-size: .92rem; color: var(--ink);
  background: var(--panel); border: 1px solid var(--hair-strong);
  border-radius: var(--radius-sm); padding: 9px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.field { margin-bottom: 12px; }

.card {
  background: var(--panel); border: 1px solid var(--hair);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.card + .card { margin-top: 14px; }
.kicker { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-2); font-weight: 700; }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--hair); color: var(--muted); }
.tag.ok     { color: var(--ok);     border-color: color-mix(in srgb, var(--ok) 40%, var(--hair)); }
.tag.warn   { color: var(--warn);   border-color: color-mix(in srgb, var(--warn) 40%, var(--hair)); }
.tag.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--hair)); }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--hair); }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.metric { background: var(--panel-2); border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 14px; }
.metric b { display: block; font-size: 1.7rem; line-height: 1; }
.metric span { font-size: .78rem; color: var(--muted); }

.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

/* ---- Uygulama kabuğu ---- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side {
  background: var(--panel); border-right: 1px solid var(--hair);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--hair); }
.side-brand .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .95rem; }
.side-brand b { font-size: .95rem; }
.side-brand small { display: block; font-size: .68rem; }
.side-nav { padding: 8px; overflow-y: auto; flex: 1; }
.nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  padding: 12px 12px 4px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: var(--radius-sm); border: 0; background: transparent;
  color: var(--ink); font-size: .9rem; font-weight: 500; margin: 1px 0;
}
.nav-item:hover { background: var(--panel-2); }
.nav-item.active { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); font-weight: 700; }
:root[data-theme="dark"] .nav-item.active { color: #6fd0f0; }
.nav-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-2); opacity: 0; }
.nav-item.active .dot { opacity: 1; }
.side-foot { padding: 12px; border-top: 1px solid var(--hair); display: flex; gap: 8px; align-items: center; justify-content: space-between; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 22px; border-bottom: 1px solid var(--hair); background: var(--panel);
  position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 1.05rem; margin: 0; }
.view { padding: 22px; max-width: 1100px; width: 100%; margin: 0 auto; }

.who { display: flex; align-items: center; gap: 10px; }
.who .av { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-2); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.who small { display: block; }

/* ---- Giriş ekranı ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; }
.login-head { text-align: center; margin-bottom: 18px; }
.login-head .logo { width: 54px; height: 54px; border-radius: 14px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; margin: 0 auto 10px; }
.demo-users { margin-top: 14px; border-top: 1px dashed var(--hair-strong); padding-top: 12px; }
.demo-users button { width: 100%; margin: 4px 0; justify-content: space-between; display: flex; }

/* ---- Toast ---- */
.toast-host { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .85rem;
  box-shadow: var(--shadow); animation: toastIn .18s ease; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok  { background: var(--accent); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---- Depolama şeridi (kayıt başarısız: kota dolu / depolama kapalı) ---- */
.depo-serit { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: center;
  background: var(--danger); color: #fff; padding: 8px 14px; font-size: .85rem; line-height: 1.35; }
.depo-serit[hidden] { display: none; }
.depo-serit button { background: #fff; color: var(--danger); border: 0; border-radius: 999px; padding: 4px 12px;
  font: inherit; font-weight: 600; cursor: pointer; }

/* ---- Overlay (toplu SMS onayı vb.) ---- */
.oy-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 16px; animation: toastIn .15s ease; }
.oy-sheet { width: min(560px, 100%); max-height: 88vh; overflow: auto; }

/* ---- Mobil ---- */
.menu-btn { display: none; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 39; display: none; }
  .scrim.open { display: block; }
  .menu-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px;
    border: 1px solid var(--hair-strong); background: var(--panel); }
  .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .view { padding: 16px; }
}
@media (max-width: 480px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: 1fr; }
}
