/* İİBF Planlama Sistemi — tasarım katmanı */
:root {
  --bg: #f4f5f9;
  --bg-2: #eceef5;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --ink: #0e1726;
  --ink-2: #2b3445;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e3e6ee;
  --line-2: #d3d8e3;
  --brand: #3446d4;
  --brand-2: #2636b5;
  --brand-soft: #eef0ff;
  --brand-ink: #1d2a9a;
  --navy: #0d1830;
  --navy-2: #16233f;
  --ok: #138a5b;
  --ok-soft: #e6f6ef;
  --warn: #b7700a;
  --warn-soft: #fff5e3;
  --danger: #cf3b3b;
  --danger-soft: #fdecec;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 60px -18px rgba(13, 24, 48, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }  /* iPhone Safari yazıyı kendiliğinden büyütmesin */
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 26px; height: 26px; }

/* ---------- Topbar ---------- */
.imp-bar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 6px 16px; background: #fff4d6; color: #6b4a00; font-size: 13px; border-bottom: 1px solid #f0d68a; }
.imp-bar form { margin: 0; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 650; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  background: var(--navy); color: #fff; border-radius: 8px;
}
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.brand-text { line-height: 1.15; }
.topnav { display: flex; align-items: center; gap: 4px; margin-left: 10px; }
.topnav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 550; font-size: 13.5px;
}
.topnav a:hover { background: var(--bg); color: var(--ink); }
.topnav a.active { background: var(--bg-2); color: var(--ink); }
.topbar-spacer { flex: 1; }
.presence { display: flex; align-items: center; }
.presence .avatar { margin-left: -7px; box-shadow: 0 0 0 2px #fff; }
.presence-label { font-size: 12px; color: var(--muted); margin-right: 12px; display: flex; align-items: center; gap: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #2fd38a; box-shadow: 0 0 0 3px rgba(47,211,138,.18); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 999px;
  background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 550;
}
.user-chip .role { font-size: 11px; font-weight: 600; color: var(--muted); padding: 0 6px 0 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }

.avatar {
  --c: #3446d4;
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--c);
  flex: none; letter-spacing: .01em;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }

/* ---------- Layout ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 32px 24px 64px; }
.page-wide { max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.page-head p.lead { color: var(--muted); margin-top: 6px; max-width: 640px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-body { padding: 18px 20px; }

/* ---------- Buttons & forms ---------- */
.btn {
  --b: var(--surface); --t: var(--ink-2); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--bd); background: var(--b); color: var(--t);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); border-color: #c3c9d6; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { --b: var(--brand); --t: #fff; --bd: var(--brand); box-shadow: 0 1px 2px rgba(52,70,212,.3), inset 0 1px 0 rgba(255,255,255,.12); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.danger { --t: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: #f2b8b8; color: var(--danger); }
.btn.danger.solid { --b: var(--danger); --t: #fff; --bd: var(--danger); }
.btn.ghost { --b: transparent; --bd: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn.block { width: 100%; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: 12px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
label.field .hint { font-weight: 400; color: var(--muted); }
.input, select.input, textarea.input {
  height: 38px; width: 100%; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 10px; background: #fff;
  font: inherit; font-size: 14px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(52,70,212,.12); }
.input.sm { height: 32px; font-size: 13px; padding: 0 9px; border-radius: 8px; }
select.input { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.seg { display: inline-flex; padding: 3px; background: var(--bg-2); border-radius: 10px; gap: 2px; }
.seg button, .seg a {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg button:hover, .seg a:hover { color: var(--ink); }
.seg .on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; background: var(--bg-2); color: var(--ink-2); white-space: nowrap;
}
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.dark { background: var(--navy); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--brand)); flex: none; }

/* ---------- Flash / toasts ---------- */
.toasts { position: fixed; right: 20px; top: 76px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.toast {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px; background: var(--navy); color: #e6ebf7;
  box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toastIn .25s ease;
}
.toast .t-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.12); }
.toast.success .t-icon { background: #1fa971; }
.toast.error .t-icon { background: var(--danger); }
.toast.info .t-icon { background: var(--brand); }
.toast b { color: #fff; }
.toast .t-close { margin-left: auto; background: none; border: 0; color: #8f9bb8; cursor: pointer; padding: 0 0 0 6px; font-size: 16px; line-height: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Giriş ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; background: var(--bg); }
.login-box { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px 30px 26px; }
.login-org { display: flex; align-items: center; gap: 12px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.login-org b { display: block; font-size: 14px; font-weight: 650; line-height: 1.3; }
.login-org span { font-size: 12.5px; color: var(--muted); }
.login h1 { font-size: 20px; font-weight: 650; margin-bottom: 18px; }
.login label.field { margin-bottom: 12px; }
.login .foot { margin-top: 18px; font-size: 13px; color: var(--muted); }
.login-footer { margin-top: 20px; font-size: 12px; color: var(--faint); }
.inline-flash { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.inline-flash.error { background: var(--danger-soft); color: #9d2a2a; }
.inline-flash.success { background: var(--ok-soft); color: #0e6c46; }
.inline-flash.info { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- Ana sayfa ---------- */
.hub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 26px; flex-wrap: wrap; }
.hub-head h1 { font-size: 24px; font-weight: 650; }
.hub-head .sub { color: var(--muted); margin-top: 4px; }
.module-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.module {
  display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
  color: var(--ink); transition: border-color .15s, background .15s;
}
.module:hover { border-color: var(--line-2); background: var(--surface-2); color: var(--ink); }
.module .m-ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); color: var(--ink-2); flex: none; }
.module .m-txt { flex: 1; min-width: 0; }
.module .m-txt b { display: block; font-size: 15px; font-weight: 650; }
.module .m-txt span { font-size: 13px; color: var(--muted); }
.module .m-go { color: var(--faint); }
.module.off { cursor: default; background: var(--surface-2); }
.module.off .m-txt b, .module.off .m-ico { opacity: .55; }
.module.off:hover { border-color: var(--line); }
.tag { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--bg-2); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.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: #fbfcfe; }
.table .code { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Admin tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
.person { display: flex; gap: 12px; align-items: center; }
.person b { font-weight: 650; }
.dept-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.dept-pick { position: relative; }
.dept-pick input { position: absolute; opacity: 0; pointer-events: none; }
.dept-pick span {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; background: #fff;
}
.dept-pick span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: .5; }
.dept-pick input:checked + span { background: color-mix(in srgb, var(--c) 12%, white); border-color: color-mix(in srgb, var(--c) 45%, white); color: color-mix(in srgb, var(--c) 75%, black); }
.dept-pick input:checked + span::before { opacity: 1; }
.dept-pick input:disabled + span { opacity: .45; cursor: not-allowed; }

/* ---------- Duty ---------- */
.week { margin-bottom: 28px; }
.week-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.week-head h2 { font-size: 16px; }
.day-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.day {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); min-height: 170px; box-shadow: var(--shadow-sm); scroll-margin-top: 90px;
}
.day.today { border-color: var(--ink-2); }
.day.mine { background: #f5f6ff; border-color: #d3d8fb; }
.day.past { opacity: .62; }
.day.closed { background: repeating-linear-gradient(-45deg, #fff, #fff 8px, #f6f7fa 8px, #f6f7fa 16px); }
.day-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.day-top .d-num { font-size: 22px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.day-top .d-name { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.slots { display: flex; flex-direction: column; gap: 6px; }
.slot-person { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.slot-person.me { background: var(--brand-soft); border-color: #cdd3ff; color: var(--brand-ink); }
.slot-empty { padding: 6px 8px; border-radius: 9px; border: 1px dashed var(--line-2); color: var(--faint); font-size: 12.5px; }
.day-actions { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.day-actions form { display: flex; gap: 6px; }
.count-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.count-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.count-pill b { font-variant-numeric: tabular-nums; background: var(--bg-2); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.mini-menu { position: relative; }
.mini-menu > summary { list-style: none; cursor: pointer; }
.mini-menu > summary::-webkit-details-marker { display: none; }
.mini-menu .menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 240px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 8px; }

/* ---------- Timetable ---------- */
.tt-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.tt { display: grid; grid-template-columns: 64px repeat(5, minmax(150px, 1fr)); min-width: 820px; }
.tt-h { padding: 10px; font-weight: 650; font-size: 12.5px; background: var(--surface-2); border-bottom: 1px solid var(--line); text-align: center; }
.tt-h + .tt-h { border-left: 1px solid var(--line); }
.tt-times, .tt-col { position: relative; height: var(--tt-h); }
.tt-col { border-left: 1px solid var(--line); }
.tt-time { position: absolute; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 7px; font-variant-numeric: tabular-nums; border-top: 1px solid var(--line); }
.tt-time:first-child { border-top: 0; }
.tt-time b { font-size: 12px; font-weight: 650; color: var(--ink); }
.tt-time span { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.tt-time.lunch { justify-content: center; padding: 0; font-size: 10.5px; color: var(--muted); background: var(--surface-2); }
.tt-row { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.tt-row:first-child { border-top: 0; }
.tt-row.lunch { background: repeating-linear-gradient(-45deg, var(--surface-2) 0 6px, #f1f3f8 6px 12px); }
.tt-item { position: absolute; border-radius: 8px; padding: 6px 8px; font-size: 11.5px; line-height: 1.3; overflow: hidden; display: flex; flex-direction: column; gap: 2px;
  background: color-mix(in srgb, var(--c) 8%, white); border: 1px solid color-mix(in srgb, var(--c) 24%, white); }
.tt-item.common { --c: #5b6475; }
.tt-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.tt-top b { font-size: 12px; white-space: nowrap; }
.tt-room { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-name { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tt-inst { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-time-sm { color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; margin-top: auto; }
.tt-item.short { padding: 4px 7px; gap: 0; }
.tt-item.short .tt-name { -webkit-line-clamp: 1; }
.tt-item.short .tt-time-sm { display: none; }
.tt-courses { margin-top: 18px; }
.tt-courses-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tt-courses-head h3 { margin: 0; }
.tt-table tr.closed { display: none; }
.tt-table.show-closed tr.closed { display: table-row; }
.tt-table tr.closed td { color: var(--muted); }
.tt-table .inst-input { width: 100%; }
.state-toggle { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.state-toggle.on { color: #12804f; border-color: color-mix(in srgb, #12804f 30%, white); background: color-mix(in srgb, #12804f 7%, white); }
.state-toggle:disabled { opacity: .5; cursor: default; }

/* ---------- Print ---------- */
.print-page { max-width: 1100px; margin: 0 auto; padding: 30px; background: #fff; }
.print-page h1 { font-size: 20px; }
.print-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 18px; }
.print-table th, .print-table td { border: 1px solid #c9cedb; padding: 6px 8px; text-align: left; }
.print-table th { background: #0e1726; color: #fff; font-weight: 600; }
.no-print { }
@media print {
  .no-print, .topbar, .toasts { display: none !important; }
  body { background: #fff; }
  .print-page { padding: 0; }
  .print-group { break-inside: avoid; }
}

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(13,24,48,.42); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0 } }
.modal {
  width: 100%; max-width: 760px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease;
}
.modal.wide { max-width: 980px; }
.modal.narrow { max-width: 520px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-foot .grow { flex: 1; }
.modal-section-title { font-size: 13px; font-weight: 650; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notice { display: flex; gap: 10px; padding: 11px 13px; border-radius: 11px; font-size: 13px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); color: #7a4a05; }
.notice.danger { background: var(--danger-soft); color: #8f2323; }
.notice.info { background: var(--brand-soft); color: var(--brand-ink); }
.notice.ok { background: var(--ok-soft); color: #0e6c46; }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

@media (max-width: 980px) {
  .module-list, .grid-3 { grid-template-columns: 1fr; }
  .day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topnav { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .day-grid { grid-template-columns: 1fr; }
  .page { padding: 20px 14px 48px; }
  .presence-label { display: none; }
}
.bar { height: 6px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink-2); border-radius: inherit; }

/* Üst menü: sade sekmeler */
.topbar { gap: 22px; }
.topnav { align-self: stretch; gap: 2px; margin-left: 18px; }
.topnav a { position: relative; height: 100%; padding: 0 12px; border-radius: 0; background: none !important; color: var(--muted); font-weight: 550; font-size: 13.5px; display: flex; align-items: center; }
.topnav a:hover { color: var(--ink); }
.topnav a.active { color: var(--ink); }
.topnav a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--ink); border-radius: 2px; }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu .user-chip { padding: 4px 8px 4px 4px; gap: 8px; }
.user-menu .user-chip:hover, .user-menu[open] .user-chip { background: var(--bg-2); }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px -12px rgba(16,24,40,.25); padding: 6px; display: flex; flex-direction: column; }
.user-pop a, .user-pop button { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); font: inherit; font-size: 13.5px; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.user-pop a:hover, .user-pop button:hover { background: var(--bg); color: var(--ink); }
.user-pop a.on { color: var(--ink); font-weight: 600; }
.user-pop form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }

/* Yönetim → Çevrimiçi */
.status-on { display: inline-flex; align-items: center; gap: 7px; color: #12804f; font-weight: 600; font-size: 13px; }
.online-table tr:not(.is-online) .avatar { opacity: .55; }

/* Gözetmen görev dağılımı */
.dist-summary { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 14px; background: #fff; margin-bottom: 18px; overflow: hidden; }
.dist-summary > div { flex: 1 1 150px; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); }
.dist-summary > div:first-child { border-left: 0; }
.dist-summary span { font-size: 12px; color: var(--muted); }
.dist-summary b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dist-summary .muted-cell b { color: var(--muted); }
.dist-card { margin-bottom: 18px; }
.dist-card .card-head h3 { margin: 0; }
.dist-table .target-in { width: 90px; }
.dist-table .ra-target { font-size: 14px; }
.dist-foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); }
.dist-warn { display: inline-flex; align-items: center; gap: 6px; color: var(--warn); font-weight: 600; }
.dist-group td { background: var(--surface-2); font-weight: 650; font-size: 12.5px; padding-top: 9px; padding-bottom: 9px; }
.dist-group td .muted { font-weight: 500; margin-left: 4px; }
.dist-bar { height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: #9aa6c4; border-radius: 99px; }
.dist-bar.done i { background: #23935f; }
.dist-bar.over i { background: #d9782b; }
.dist-others > summary { cursor: pointer; list-style: none; }
.dist-others > summary::-webkit-details-marker { display: none; }
.dist-others:not([open]) > summary { border-bottom: 0; }
.dist-card .search { position: relative; }
.dist-card .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.dist-card .search input { padding-left: 32px; height: 34px; font-size: 13px; }

/* Kişiler arası gözetmenlik kısıtı */
.pair-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.pair-h { font-size: 14px; margin-bottom: 8px; }
.pair-sec .blk-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; }
.pair-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.pair-form select, .pair-form input { width: 100%; min-width: 0; }

/* Sınav kayıtları */
.log-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; margin-bottom: 14px; }
.log-filters select { width: 220px; max-width: 100%; }
.log-filters .search { position: relative; flex: 1; min-width: 200px; }
.log-filters .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.log-filters .search input { width: 100%; padding-left: 32px; }
.log-table .nowrap { white-space: nowrap; }
.log-who { color: var(--ink); font-weight: 600; text-decoration: none; }
.log-who:hover { text-decoration: underline; }

/* Ders Programı: ders ekleme ve ortak sınav bağlama */
.tt-add { display: grid; grid-template-columns: 130px 1fr 1fr 110px auto auto; gap: 10px; align-items: end; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tt-add.hidden { display: none; }
@media (max-width: 900px) { .tt-add { grid-template-columns: 1fr 1fr; } }
.link-cell { white-space: normal; }
.link-chip { display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); font-size: 11.5px; font-weight: 600; }
.pk-pop { position: fixed; z-index: 400; width: 340px; max-height: 340px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(13,24,48,.18); overflow: hidden; }
.pk-pop .pk-top { padding: 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.pk-pop .pk-title { font-size: 12px; font-weight: 650; color: var(--muted); }
.pk-pop .pk-list { overflow-y: auto; padding: 4px 6px 8px; }
.pk-pop .pk-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; font: inherit; text-align: left; cursor: pointer; }
.pk-pop .pk-item:hover { background: var(--bg); }
.pk-pop .pk-name { display: flex; flex-direction: column; min-width: 0; }
.pk-pop .pk-name b { font-size: 12.5px; font-weight: 600; }
.pk-pop .pk-name small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-pop .pk-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }

.link-item { display: flex; flex-direction: column; padding: 4px 8px; margin-bottom: 4px; border-radius: 8px; background: var(--bg-2); line-height: 1.3; }
.link-item b { font-size: 11.5px; }
.link-item small, .pk-pop .pk-name small.t { font-size: 11px; color: var(--muted); }
.link-item small.t, .pk-pop .pk-name small.t { color: var(--ink-2); font-weight: 600; }
.split-item { cursor: pointer; }
.split-item input { flex: none; }
.split-foot { display: flex; align-items: center; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.split-foot span { margin-right: auto; }

#people-table tr.dept-row td { background: var(--surface-2); font-weight: 650; font-size: 12.5px; padding-top: 9px; padding-bottom: 9px; }

.ai-form { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 800px) { .ai-form { grid-template-columns: 1fr; } }

/* ---------- Yönetim: gruplu yan menü ---------- */
.admin-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 28px; align-items: start; }
.admin-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px; }
.admin-nav-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; padding: 4px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.admin-nav-group { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 12px 10px 4px; }
.admin-nav a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); font-size: 13.5px; font-weight: 550; }
.admin-nav a:hover { background: var(--surface-2); color: var(--ink); }
.admin-nav a.on { background: var(--brand); color: #fff; }
.admin-nav a .i { flex: none; }
.admin-main { min-width: 0; }
.admin-main .page-head { margin-bottom: 18px; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; gap: 16px; }
  .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 8px; }
  .admin-nav-title, .admin-nav-group { display: none; }
  .admin-nav a { padding: 6px 10px; font-size: 12.5px; }
}

/* ---------- Yönetim: genel bakış kartları ---------- */
.ov-group { margin-bottom: 22px; }
.ov-group h2 { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 10px; }
.ov-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ov-card { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
.ov-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.ov-card .ov-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ov-card .ov-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); }
.ov-card .ov-num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ov-card .ov-num.warn { color: #b45309; }
.ov-card b { font-size: 14.5px; }
.ov-card span.small { color: var(--muted); line-height: 1.4; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Akademik dönem seçici (kullanıcı menüsünde) ---------- */
.user-pop .term-list { display: flex; flex-direction: column; padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.user-pop .term-list form { border-top: 0; margin: 0; padding: 0; }
.user-pop .term-h { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 6px 10px 4px; }
.user-pop .term-list button { white-space: nowrap; }
.user-pop .term-list button.on { color: var(--brand); font-weight: 650; }
.user-pop { min-width: 230px; }
.user-chip .badge { margin-left: 2px; }

/* ---------- Görevlerim (ana sayfa kartı ve günlük pencere) ---------- */
.dh-counts { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dh-counts b { font-size: 22px; font-weight: 700; }
.dh-day { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dh-day-head { font-size: 12.5px; font-weight: 650; color: var(--ink-2); background: var(--surface-2); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.dh-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 12px; font-size: 13px; }
.dh-row + .dh-row { border-top: 1px solid var(--line); }
.dh-exam { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-room { font-weight: 650; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-role, .dd-role { font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }
.dh-role.own, .dd-item.own .dd-role { background: var(--ok-soft); color: var(--ok); }

.duty-modal { max-width: 720px; }
.dd-days { flex: none; display: flex; gap: 8px; padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); overflow-x: auto; }
.dd-chip { flex: 1 0 86px; position: relative; display: grid; justify-items: center; gap: 1px; padding: 8px 6px 9px; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .12s, background .12s; }
.dd-chip .w { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.dd-chip .ws { display: none; }
.dd-chip b { font-size: 20px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.dd-chip .m { font-size: 11px; color: var(--muted); }
.dd-chip i { position: absolute; top: 6px; right: 7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; background: var(--brand); color: #fff; }
.dd-chip.empty i { background: var(--bg-2); color: var(--faint); }
.dd-chip.past:not(.on) { opacity: .62; }
.dd-chip:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.dd-chip.on { background: var(--brand-soft); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.dd-chip.today .w { color: var(--brand); }
.dd-body { min-height: 280px; }
.dd-panel { display: flex; flex-direction: column; gap: 10px; }
.dd-head { display: flex; align-items: baseline; gap: 10px; }
.dd-head h3 { font-size: 16px; }
.dd-item { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 14px 14px 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 14px; }
.dd-item.own { border-left-color: var(--ok); }
.dd-time b { display: block; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dd-time span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dd-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dd-role { align-self: flex-start; }
.dd-exam { font-size: 14px; line-height: 1.35; }
.dd-exam b { font-weight: 700; }
.dd-sub { font-size: 12.5px; color: var(--muted); }
.dd-prox { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--ink-2); }
.dd-prox .l { width: 100%; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.dd-prox .rp { white-space: nowrap; }
.dd-prox .rp b { font-weight: 700; color: var(--ink); }
.dd-room { min-width: 74px; padding: 8px 10px; text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.dd-room span { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.dd-room b { font-size: 20px; font-weight: 750; }
.dd-room.long { max-width: 150px; }
.dd-room.long b { font-size: 13px; font-weight: 650; line-height: 1.3; }
.dd-empty { display: grid; justify-items: center; gap: 12px; padding: 40px 10px; text-align: center; color: var(--muted); }
@media (max-width: 600px) {
  #duty-dlg { padding: 8px; }
  .duty-modal { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 14px; }
  .duty-modal .modal-head { padding: 12px 14px; }
  .duty-modal .modal-body { padding: 12px 14px; }
  .duty-modal .modal-foot { padding: 10px 14px; }
  .duty-modal .modal-foot .small { display: none; }
  .dd-body { min-height: 0; }
  .dd-item { padding: 12px 12px 12px 10px; }
  .dd-days { padding: 10px 14px; }
  .dd-days { gap: 6px; }
  .dd-chip { flex: 1 0 50px; }
  .dd-chip .wl { display: none; }
  .dd-chip .ws { display: inline; }
  .dd-chip i { top: -6px; right: -6px; }
  .dd-days { padding-top: 12px; }
  .dd-item { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
  .dd-room { grid-column: 2; justify-self: start; display: flex; align-items: baseline; gap: 8px; max-width: none; text-align: left; }
  .dd-room span { display: inline; }
  .dh-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .dh-row .dh-role { display: none; }
}
