:root {
  color-scheme: light;
  font-family: Inter, Arial, sans-serif;
  --brand: #2d5bff;
  --brand-dark: #1f43c4;
  --ink: #1b2230;
  --muted: #6b778d;
  --line: #e4e8f2;
  --surface: #ffffff;
  --bg: #f5f7fb;
  --ok: #176b3a;
  --ok-bg: #e4f7eb;
  --bad: #9b2525;
  --bad-bg: #fff0f0;
  --warn: #8a5a00;
  --warn-bg: #fff6e0;
  --panel: #fafbff;
  --panel-2: #ffffff;
  --chip: #eef2ff;
  --thead: #f2f5ff;
  --hover: #eef2ff;
  --row-hover: #f2f6ff;
  --earned: #f4fbf6;
  --track: #e8ecf5;
  --done: #d9f2e3;
  --ok-soft: #e4f7ec;
  --bad-soft: #fdeaea;
  --tick: #667085;
  --center: #222222;
  --field-border: #d5dcec;
}

/* Faz 6: karanlık tema */
[data-theme="dark"] {
  color-scheme: dark;
  --brand: #4a6cf7;
  --brand-dark: #3a56d4;
  --ink: #e6eaf2;
  --muted: #9aa3b2;
  --line: #2a3245;
  --surface: #171c26;
  --bg: #0f131b;
  --ok: #7fd6a4;
  --ok-bg: #12331f;
  --bad: #ff9b9b;
  --bad-bg: #3a1515;
  --warn: #ffd28a;
  --warn-bg: #33260d;
  --panel: #1d2431;
  --panel-2: #222a3a;
  --chip: #232d44;
  --thead: #20293a;
  --hover: #232d44;
  --row-hover: #20293a;
  --earned: #16301f;
  --track: #2a3245;
  --done: #1d3a2a;
  --ok-soft: #16301f;
  --bad-soft: #3a1d1d;
  --tick: #9aa3b2;
  --center: #e6eaf2;
  --field-border: #39435a;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--panel-2);
  color: var(--ink);
  border-color: var(--field-border);
}

[data-theme="dark"] ::placeholder { color: var(--muted); }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--brand);
  color: #fff;
  padding: 0.9rem 1.1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 { margin: 0; font-size: 1.15rem; }
.topbar p { margin: 0.15rem 0 0; font-size: 0.8rem; opacity: 0.85; }

.iconButton {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}

.userBadge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.18);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.layout {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  max-width: 1180px;
  margin: 1rem auto;
  padding: 0 1rem 2rem;
}

.sidebar {
  width: 230px;
  flex: 0 0 230px;
  background: var(--surface);
  border-radius: 12px;
  padding: 0.6rem;
  box-shadow: 0 6px 22px rgba(33, 36, 40, 0.08);
  position: sticky;
  top: 5rem;
  display: grid;
  gap: 0.3rem;
}

.sidebar nav { display: grid; gap: 0.25rem; }

.navItem {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: none;
  padding: 0.65rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.navItem:hover { background: var(--hover); }
.navItem.active { background: var(--brand); color: #fff; }
.navItem.logout { color: var(--bad); margin-top: 0.4rem; }

.sidebarForm { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.6rem 0.75rem; border-top: 1px solid var(--line); margin-top: 0.6rem; }
.sidebarForm input { padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; font-size: 0.85rem; }
.sidebarForm button { padding: 0.45rem 0.6rem; font-size: 0.85rem; }

.content { flex: 1; min-width: 0; }

.card,
.view {
  background: var(--surface);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 22px rgba(33, 36, 40, 0.08);
}

.view h2 { margin-top: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

form { display: grid; gap: 0.7rem; }

input, textarea, select, button {
  font: inherit;
  padding: 0.65rem;
  border-radius: 8px;
  border: 1px solid #d5dcec;
}

button {
  border: none;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

button:hover { background: var(--brand-dark); }
button.secondary { background: #6b778d; }
button.secondary:hover { background: #55606f; }

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.list { list-style: none; padding: 0; display: grid; gap: 0.75rem; }

.list li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem;
  background: var(--panel);
}

img.preview { max-width: 100%; margin-top: 0.4rem; border-radius: 8px; }

.actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }

.optionsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
}

.optionEditor {
  display: grid;
  gap: 0.4rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.questionImage, .optionImage {
  display: block;
  max-width: min(100%, 360px);
  max-height: 220px;
  margin-top: 0.5rem;
  border-radius: 8px;
  object-fit: contain;
}

.inlineForm { grid-template-columns: 1fr auto; align-items: center; }
.compactList { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.compactList li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.categoryDelete, .questionDelete { padding: 0.4rem 0.6rem; }

.subjectTree { display: grid; gap: 0.8rem; }
.subjectCard { border: 1px solid var(--line); border-radius: 10px; padding: 0.85rem; background: var(--panel); display: grid; gap: 0.5rem; }
.subjectHead { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.subjectHead .actions { margin-left: auto; display: flex; gap: 0.4rem; }
.subjectHead button { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
.topicForm { grid-template-columns: 1fr auto auto; }
.topicRow { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.topicRow button { padding: 0.3rem 0.55rem; font-size: 0.78rem; }

.feedbackInput { width: 100%; margin-top: 0.5rem; min-height: 4rem; }

.quizList { display: grid; gap: 0.8rem; }

.quizItem {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
  background: var(--panel);
}

.quizMeta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }

.badge {
  background: var(--chip);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
}

[data-theme="dark"] .badge { color: #aab9ff; }

.stars { color: #d99a00; letter-spacing: 0.05em; }

.quizOptions { display: grid; gap: 0.45rem; margin: 0.8rem 0; }

.quizOption {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
}

.quizOption:hover { border-color: var(--brand); }

.quizResult { margin-top: 0.7rem; padding: 0.7rem; border-radius: 8px; }
.quizResult.correct { background: var(--ok-bg); color: var(--ok); }
.quizResult.incorrect { background: var(--bad-bg); color: var(--bad); }
.quizResult.blank { background: var(--warn-bg); color: var(--warn); }

.statGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.statCard {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
  background: var(--panel);
  display: grid;
  gap: 0.2rem;
}

.statCard span { font-size: 0.78rem; color: var(--muted); }
.statCard strong { font-size: 1.35rem; }

.tableWrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.5rem; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--thead); }

/* ---- Test / sınav motoru ---- */
.testGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.8rem; }
.testCard { border: 1px solid var(--line); border-radius: 10px; padding: 0.85rem; background: var(--panel); display: grid; gap: 0.45rem; align-content: start; }
.testCard p { margin: 0; font-size: 0.82rem; }
.examBar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.examTimer { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--chip); border-radius: 10px; padding: 0.35rem 0.8rem; }
.timerWarn { background: #c62828; color: #fff; animation: timerPulse 1s infinite; }
@keyframes timerPulse { 50% { opacity: 0.6; } }
.examPalette { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.6rem 0; }
.paletteButton { width: 2.1rem; height: 2.1rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer; }
.paletteButton.done { background: var(--done); border-color: #35a06a; }
.paletteButton.current { outline: 2px solid var(--accent, #4a6cf7); }
.optionList { display: grid; gap: 0.4rem; margin: 0.5rem 0; }
.optionRow { display: flex; align-items: center; gap: 0.5rem; border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 0.6rem; cursor: pointer; }
.optionRow.correctOption { background: var(--ok-soft); border-color: #35a06a; }
.optionRow.wrongOption, li.wrongOption { background: var(--bad-soft); border-color: #d05252; }
li.correctOption { background: var(--ok-soft); }
.checkRow { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.testPicker { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem; display: grid; gap: 0.3rem; margin-top: 0.4rem; }
.pickerRow { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.85rem; }

/* Faz 4: bildirim zili, profil, rozetler, XP */
.bell { position: relative; margin-left: auto; }
.bell + .userBadge { margin-left: 0; }
.bellCount { position: absolute; top: -6px; right: -6px; background: #e5484d; color: #fff; font-size: 0.65rem; font-weight: 700; border-radius: 999px; padding: 0.1rem 0.35rem; min-width: 1.1rem; text-align: center; }
.bellPanel { position: fixed; top: 3.9rem; right: 0.8rem; width: min(340px, calc(100vw - 1.6rem)); max-height: 70vh; overflow-y: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16); z-index: 40; display: grid; }
/* Aktif kullanıcı dökümü: rozetin hemen altına, bildirim paneliyle çakışmadan. */
.activePanel { right: 5.5rem; width: min(260px, calc(100vw - 1.6rem)); padding: 0.4rem 0; }
.activePanelTitle { margin: 0.2rem 0.9rem 0.4rem; font-weight: 600; font-size: 0.85rem; color: var(--ink); }
.activeItem { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.35rem 0.9rem; font-size: 0.9rem; }
.activeCount.clickable { cursor: pointer; }
.activeCount.clickable:hover { border-color: var(--brand); }
.bellItem { display: block; text-align: left; background: none; border: none; border-bottom: 1px solid var(--line); padding: 0.6rem 0.8rem; cursor: pointer; font: inherit; }
.bellItem:last-child { border-bottom: none; }
.bellItem.unread { background: var(--row-hover); }
.bellItem p { margin: 0.2rem 0; font-size: 0.85rem; }
.bellItem small { font-size: 0.72rem; }
.bellEmpty { margin: 0; padding: 0.8rem; }
.xpFlash { color: var(--ok); font-weight: 700; }
.xpBar { height: 10px; background: var(--track); border-radius: 999px; overflow: hidden; margin: 0.4rem 0 0.2rem; min-width: 220px; }
.xpFill { height: 100%; background: linear-gradient(90deg, #4a6cf7, #7c4df7); border-radius: 999px; transition: width 0.4s ease; }
.profileHead { display: flex; gap: 1rem; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.profileAvatar { font-size: 2.6rem; }
.profileStats { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.badgeShelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }
.badgeCard { border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem; text-align: center; display: grid; gap: 0.15rem; }
.badgeCard.earned { background: var(--earned); border-color: #35a06a; }
.badgeCard.locked { opacity: 0.45; filter: grayscale(1); }
.badgeIcon { width: 1.6rem; height: 1.6rem; color: var(--brand, #2d5bff); }
.badgeCard small { color: var(--muted, #667); }
#leaderboardList tr.me { background: var(--hover); font-weight: 700; }

/* Faz 5: grafikler, atama, analitik */
.chartWrap { margin: 0.5rem 0; }
.chart { width: 100%; max-width: 620px; height: auto; display: block; }
.chartGrid { stroke: var(--line); stroke-width: 1; }
.chartTick { font-size: 10px; fill: var(--tick); }
.chartCenter { font-size: 22px; font-weight: 700; fill: var(--center); }
.donutWrap { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.donutWrap .chart { max-width: 180px; }
.legend { display: grid; gap: 0.25rem; font-size: 0.85rem; }
.legendItem i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 3px; margin-right: 0.35rem; }
.chartAlt { margin-top: 0.3rem; font-size: 0.8rem; }
.chartTable { font-size: 0.8rem; }
.compactCard { padding: 0.7rem 0.9rem; margin-bottom: 0.7rem; }
.tabActive { background: var(--brand); color: #fff; border-color: var(--brand); }
.csvLink { display: inline-block; padding: 0.4rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: inherit; font-size: 0.85rem; background: var(--panel); }
.csvLink:hover { background: var(--row-hover); }
#assignmentUsers.hidden { display: none; }

/* Faz 6: çevrimdışı bandı, odak görünürlüğü, yazdırma */
.offlineBanner { background: var(--warn-bg); color: var(--warn); text-align: center; padding: 0.45rem 0.8rem; font-size: 0.85rem; }

/* Faz 8: demo şifre güvenlik uyarı bandı (yalnızca admin görür) */
.demoBanner { background: var(--bad-soft); color: var(--bad); text-align: center; padding: 0.5rem 0.8rem; font-size: 0.85rem; border-bottom: 1px solid var(--line); }

/* Faz 7: toast bildirimleri ve onay modalı */
.toastHost { position: fixed; right: 0.9rem; bottom: 0.9rem; z-index: 60; display: flex; flex-direction: column; gap: 0.45rem; max-width: min(92vw, 22rem); }
.toast { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 0.6rem 0.8rem; font-size: 0.88rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); cursor: pointer; animation: toastIn 0.18s ease-out; }
.toast-ok { border-left-color: #35a06a; background: var(--ok-soft); }
.toast-error { border-left-color: #d05252; background: var(--bad-soft); }
.toast-info { border-left-color: var(--brand); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.uiModal { position: fixed; inset: 0; z-index: 70; background: rgba(10, 14, 22, 0.55); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.uiModalBox { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; max-width: 26rem; width: 100%; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35); }
.uiModalBox h3 { margin: 0 0 0.4rem; font-size: 1.02rem; }
.uiModalBox p { margin: 0 0 1rem; font-size: 0.92rem; line-height: 1.45; white-space: pre-line; }
.uiModalActions { display: flex; justify-content: flex-end; gap: 0.5rem; }
.uiModalActions button { min-width: 5.5rem; }
.uiModalInput { width: 100%; margin: 0 0 1rem; }

/* Faz 7: toplu soru içe aktarma kutusu */
.importBox { margin: 1rem 0; padding: 0.9rem 1rem; border: 1px dashed var(--field-border); border-radius: 12px; background: var(--panel); }
.importBox legend { padding: 0 0.4rem; font-weight: 600; font-size: 0.92rem; }
.importBox p { margin: 0 0 0.6rem; font-size: 0.88rem; }
.importResult { margin-top: 0.8rem; font-size: 0.9rem; }
.importResult ul { margin: 0.4rem 0 0; padding-left: 1.2rem; color: var(--bad); }

/* Faz 7: uzun not kırpma — boş satır paragraf, tek \n <br> */
.noteContent p { margin: 0 0 0.6rem; line-height: 1.55; }
.noteContent.clamped { max-height: 9.5rem; overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
[data-theme="dark"] :focus-visible { outline-color: #8fa5ff; }

/* ---- Faz 1: ayrı giriş sayfası ---- */
.loginPage { margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; }
.loginShell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 2rem;
  align-items: center;
  max-width: 1080px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem 1.2rem calc(2rem + env(safe-area-inset-bottom));
}
.loginCard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem 1.6rem;
  box-shadow: 0 12px 40px rgba(20, 26, 40, 0.1);
}
.loginBrand { text-align: center; margin-bottom: 1.4rem; }
.loginLogo { width: 56px; height: 56px; margin-bottom: 0.6rem; }
.loginBrand h1 { margin: 0; font-size: 1.5rem; }
.loginBrand p { margin: 0.3rem 0 0; font-size: 0.9rem; }
.loginCard form label { display: grid; gap: 0.35rem; font-size: 0.9rem; }
.loginCard form input { padding: 0.65rem 0.8rem; border: 1px solid var(--field-border); border-radius: 10px; font-size: 1rem; background: var(--panel-2); color: var(--ink); }
.loginCard form button { margin-top: 0.4rem; padding: 0.75rem; font-size: 1rem; }
.loginError { margin: 0; color: var(--bad); font-size: 0.9rem; }
.loginDemo { margin: 1rem 0 0; font-size: 0.8rem; text-align: center; }
.loginAside img { width: 100%; max-height: 70vh; object-fit: cover; border-radius: 16px; }
.loginThemeToggle { position: fixed; top: 1rem; right: 1rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
@media (max-width: 820px) {
  .loginShell { grid-template-columns: 1fr; }
  .loginAside { display: none; }
}

/* ---- Faz 3: kota aşım bandı ---- */
.quotaBanner {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bad-bg);
  color: var(--bad);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  text-align: center;
  border-bottom: 1px solid var(--bad);
}

/* ---- Faz 8: karşılama panosu ---- */
.boardBody { text-align: center; }
.boardBody h2 { margin-bottom: 0.2rem; }
.boardImage { max-width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; margin-bottom: 1rem; }
.boardText { text-align: left; line-height: 1.6; margin-top: 1rem; }

/* ---- Faz 2: platform ayarları ---- */
.settingsGroup { margin: 0 0 1rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); display: grid; gap: 0.7rem; }
.settingsGroup legend { padding: 0 0.4rem; font-weight: 600; }
.settingsGroup label { display: grid; gap: 0.3rem; font-size: 0.88rem; }
.settingsGroup input, .settingsGroup select, .settingsGroup textarea { padding: 0.5rem 0.6rem; border: 1px solid var(--field-border); border-radius: 8px; font-size: 0.9rem; background: var(--panel-2); color: var(--ink); }
.settingsGroup .checkRow { display: flex; align-items: center; gap: 0.5rem; }
.settingsGroup input[type="file"] { font-size: 0.8rem; }
.settingsGroup input:disabled, .settingsGroup select:disabled, .settingsGroup textarea:disabled { opacity: 0.6; }

/* ---- Not türleri, PDF görüntüleyici, sıralama ---- */
.viewHead { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.noteSort { display: flex; align-items: center; gap: 0.4rem; }
.noteSort select { padding: 0.4rem 0.5rem; border: 1px solid var(--field-border); border-radius: 8px; background: var(--panel-2); color: var(--ink); font-size: 0.85rem; }
.noteSummary { font-size: 0.9rem; opacity: 0.9; }
.noteHighlights { margin: 0.5rem 0; padding: 0.6rem 0.8rem; border-left: 3px solid var(--brand); border-radius: 8px; background: var(--panel); font-size: 0.9rem; }
.noteHighlights ul { margin: 0.3rem 0 0 1.1rem; padding: 0; }
.notePdfOpen { margin: 0.2rem 0; }
.pdfViewerBox { width: min(960px, 94vw); height: min(86vh, 900px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.pdfViewerHead { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); }
.pdfViewerHead .actions { display: flex; align-items: center; gap: 0.5rem; }
.pdfViewerBox iframe { flex: 1; width: 100%; border: 0; background: #20242c; }
.btnLike { display: inline-block; padding: 0.4rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: inherit; font-size: 0.85rem; background: var(--panel); }

/* ---- Aktif kullanıcı rozeti ---- */
.activeCount { font-size: 0.85rem; padding: 0.3rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); white-space: nowrap; }

/* ---- Pano: son eklenenler / üreticiler ---- */
.boardRecent, .boardProducers { margin-top: 1.4rem; text-align: left; }
.boardCols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.boardCol { border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.8rem; background: var(--panel); }
.boardCol h4 { margin: 0 0 0.5rem; }
.boardRecentItem { font-size: 0.86rem; padding: 0.35rem 0; border-bottom: 1px dashed var(--line); }
.boardRecentItem:last-child { border-bottom: 0; }
@media (max-width: 820px) { .boardCols { grid-template-columns: 1fr; } }

/* ---- Günlükler ---- */
.logMessage { font-family: ui-monospace, monospace; font-size: 0.8rem; word-break: break-word; }
.log_error td { background: color-mix(in srgb, var(--bad, #d33) 12%, transparent); }
.log_warn td { background: color-mix(in srgb, #e6a700 12%, transparent); }

/* ---- İlişkisel panel (Ders & Konu) ---- */
.relationGroup { margin-bottom: 0.8rem; }
.relationGroup h4 { margin: 0 0 0.4rem; }
.relationChips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.relationChip { display: inline-flex; align-items: center; gap: 0.3rem; max-width: 100%; padding: 0.35rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); opacity: 0.75; font-size: 0.82rem; cursor: pointer; transition: opacity 0.12s ease, transform 0.12s ease; }
.relationChip:hover { opacity: 1; transform: translateY(-1px); }
#subjectRelations { margin-bottom: 1rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }

/* ---- Bildirimler / öneri kartları ---- */
.feedbackCard .filters { margin-top: 0.5rem; }
.feedbackCard .filters input[type="text"] { flex: 1; }
.auditFlag td { background: color-mix(in srgb, var(--bad, #d33) 10%, transparent); }
.stackedForm { display: grid; gap: 0.6rem; }
#adminNoteEditor { margin: 0.8rem 0; padding: 0.9rem 1rem; border: 1px solid var(--brand); border-radius: 12px; background: var(--panel-2); }

.printOnly { display: none; }

@media print {
  .topbar, .sidebar, .offlineBanner, .demoBanner, .actions, .csvLink, #bellPanel, .toastHost, .uiModal { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .view { box-shadow: none; border: none; }
  .printOnly { display: block; }
}

@media (max-width: 820px) {
  .layout { padding: 0 0.6rem 2rem; }
  .sidebar {
    position: fixed;
    inset: 3.6rem auto 0 0;
    width: 240px;
    border-radius: 0 12px 12px 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    z-index: 30;
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .filters { grid-template-columns: 1fr; }
  .topbar p { display: none; }
}
