/* ===== Yardımcı ızgaralar ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } .hide-mobile { display: none !important; } }

/* Tema düğmesi ikonları: açıkken ay, koyuyken güneş */
.theme-sun { display: none; }
:root[data-theme="koyu"] .theme-sun { display: inline; } :root[data-theme="koyu"] .theme-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="acik"]):not([data-theme="koyu"]) .theme-sun { display: inline; } :root:not([data-theme="acik"]):not([data-theme="koyu"]) .theme-moon { display: none; } }

/* ===== Giriş / kurulum ===== */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 440px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 16px; }
.auth-brand .logo { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: var(--accent-text); }
@media (max-width: 480px) { .auth-card { padding: 20px; } }

/* ===== Bugün ===== */
.grid-today { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 900px) { .grid-today { grid-template-columns: 1fr; } }
.hero { padding: 18px 20px; border-left: 4px solid var(--sc, var(--accent)); display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.hero-title { font-size: 22px; font-weight: 700; line-height: 1.25; margin-top: 6px; }
.hero-timer { margin-top: 10px; font-size: 40px; font-weight: 700; letter-spacing: .02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.stats { display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.stat { display: flex; align-items: center; gap: 14px; }
.stat-n { font-size: 22px; font-weight: 700; } .stat-n small { font-size: 13px; font-weight: 500; color: var(--text-3); }
.stat-ico { width: 76px; height: 40px; display: grid; place-items: center; color: var(--accent); }
.stat-week { padding-top: 4px; }

.task-row { display: flex; align-items: stretch; gap: 12px; padding: 10px 12px 10px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.task-row.is-done .tr-title { color: var(--text-2); }
.tr-time { display: flex; flex-direction: column; justify-content: center; min-width: 46px; font-size: 13px; line-height: 1.25; } .tr-time span { color: var(--text-3); }
.tr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.tr-title { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tr-sub { color: var(--text-2); font-size: 12.5px; }
.tr-result { color: var(--success); font-size: 12.5px; font-weight: 600; }
.tr-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
@media (max-width: 640px) {
  .task-row { flex-wrap: wrap; gap: 8px 10px; }
  .tr-actions { width: 100%; justify-content: space-between; padding-left: 14px; }
}

/* ===== Plan ===== */
.plan-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.plan-bar .spacer { flex: 1; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 14px 0 8px; }
.day-head h3 { font-size: 14px; } .day-head.today h3 { color: var(--accent); }
/* Hafta görünümü: 7 sütun, dakikaya orantılı zaman çizelgesi */
.week { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.week-axis { position: relative; border-right: 1px solid var(--border); }
.week-axis span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--text-3); }
.week-col { position: relative; border-right: 1px solid var(--border); min-width: 0; }
.week-col:last-child { border-right: 0; }
.week-col-head { position: sticky; top: var(--topbar-h); z-index: 2; height: 44px; padding: 6px 8px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 650; line-height: 1.2; }
.week-col-head small { display: block; color: var(--text-3); font-weight: 500; }
.week-col.today .week-col-head { background: var(--accent-soft); color: var(--accent); }
.week-body { position: relative; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hr) - 1px), var(--border) calc(var(--hr) - 1px), var(--border) var(--hr)); }
.wt { position: absolute; left: 3px; right: 3px; padding: 3px 6px; overflow: hidden; font-size: 11px; line-height: 1.25; background: color-mix(in srgb, var(--sc, var(--c-sosyal)) 14%, var(--surface)); border-left: 3px solid var(--sc, var(--c-sosyal)); border-radius: 6px; cursor: pointer; text-align: left; border-top: 0; border-right: 0; border-bottom: 0; color: var(--text); }
.wt b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 650; word-break: break-word; }
.wt.exam { background: var(--tyt-soft); --sc: var(--tyt); } .wt.is-done { opacity: .6; } .wt.clash { outline: 2px solid var(--danger); background: var(--danger-soft); }
.wt:hover { filter: brightness(.97); z-index: 3; }
.week-col.drop { background: var(--accent-soft); }
.clash-strip { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
@media (max-width: 900px) { .only-wide { display: none !important; } }
@media (min-width: 901px) { .only-narrow { display: none !important; } }
.diff-list { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.sug { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* ===== Konular ===== */
.topic-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border); cursor: pointer; }
.topic-row:first-child { border-top: 0; } .topic-row:hover { background: var(--surface-2); }
.topic-row .tname { flex: 1; min-width: 0; font-weight: 600; }
.topic-row .tmeta { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 12.5px; }
.topic-row .bar { width: 90px; }
@media (max-width: 640px) { .topic-row { flex-wrap: wrap; } .topic-row .tmeta { width: 100%; flex-wrap: wrap; } .topic-row .bar { width: 70px; } }
.comp-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.comp-list li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.year-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 12px; }
.year-grid div { padding: 6px 2px; background: var(--surface-2); border-radius: 6px; } .year-grid b { display: block; font-size: 15px; }

/* ===== Ayarlar ===== */
.settings-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--topbar-h) + 16px); }
.settings-nav button { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; text-align: left; font-size: 14px; font-weight: 550; color: var(--text-2); background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.settings-nav button:hover { background: var(--surface-2); } .settings-nav button.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row .lbl { font-weight: 550; } .set-row .key { color: var(--text-3); font-size: 11px; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } .settings-nav { flex-direction: row; overflow-x: auto; position: static; } .settings-nav button { white-space: nowrap; } }
@media (max-width: 520px) { .set-row { grid-template-columns: 1fr; gap: 6px; } }
.swatches { display: flex; gap: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; } .swatch.on { border-color: var(--text); }

/* Vitrin */
.showcase { display: grid; gap: 20px; }

/* Orta genişlikte (tablet) ikincil tablo sütunlarını gizle */
@media (min-width: 641px) and (max-width: 1100px) { .tbl .hide-md { display: none; } }

/* ===== Analiz / Denemeler: kartlar ve sonuç tablosu ===== */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi-l { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.kpi-v { font-size: 26px; font-weight: 700; line-height: 1.2; display: flex; align-items: center; gap: 6px; } .kpi-v small { font-size: 13px; font-weight: 500; color: var(--text-3); }
.kpi-s { color: var(--text-3); font-size: 12px; }
.suggestion { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); }
.input.cell { width: 58px; height: 30px; text-align: right; padding: 0 8px; } .input.cell.wide { width: 90px; text-align: left; }
.tbl .group-row td { background: var(--surface-2); font-size: 12px; color: var(--text-2); padding: 6px 12px; }
.tbl .detail-row td { background: var(--surface-2); padding: 12px; }
.topic-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; max-height: 280px; overflow-y: auto; }
.tp { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.tp.on { border-color: var(--accent); background: var(--accent-soft); }
.tp-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-c { display: inline-flex; align-items: center; gap: 0; white-space: nowrap; font-size: 12px; } .tp-c > span { min-width: 30px; text-align: center; font-weight: 600; }
.icon-btn.sm { width: 24px; height: 24px; }
@media (max-width: 640px) {
  .tbl.cards .input.cell, .tbl.cards .input.cell.wide { width: 110px; }
  .tbl.cards .group-row td, .tbl.cards .detail-row td { display: block; text-align: left !important; }
  .tbl.cards .group-row td::before, .tbl.cards .detail-row td::before { display: none; }
  .topic-pick { grid-template-columns: 1fr; }
}

/* ===== Öğretmen ekranları ===== */
.student-card { border-left: 4px solid var(--border); }
.student-card.risk-mudahale { border-left-color: var(--danger); }
.student-card.risk-dikkat { border-left-color: var(--warning); }
.student-card.risk-yolunda { border-left-color: var(--success); }
.direction-card { border-left: 4px solid var(--border); }
.direction-card.tone-danger { border-left-color: var(--danger); } .direction-card.tone-warning { border-left-color: var(--warning); }
.direction-card.tone-success { border-left-color: var(--success); } .direction-card.tone-info { border-left-color: var(--info); }
.status-strip b { display: block; }
.note { max-width: 80%; padding: 8px 12px; border-radius: var(--radius); background: var(--surface-2); align-self: flex-start; }
.note.mine { align-self: flex-end; background: var(--accent-soft); }
#thread { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
@media (max-width: 640px) { .note { max-width: 94%; } }

/* ===== Asistan ===== */
.chat-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.chat-main { display: flex; flex-direction: column; min-height: 58vh; max-height: calc(100dvh - var(--topbar-h) - 190px); overflow: hidden; }
.chat-thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 14px; background: var(--surface-2); align-self: flex-start; }
.bubble.user { align-self: flex-end; background: var(--accent-soft); }
.bubble-text { white-space: pre-wrap; word-break: break-word; }
.bubble-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.chat-wait { flex-direction: column; gap: 10px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--border); }
.chat-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 10px 12px; height: auto; }
.chat-form .btn { height: 44px; min-width: 44px; }
.chat-empty { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; color: var(--text-2); max-width: 520px; }
.chat-empty > .i { width: 36px; height: 36px; color: var(--text-3); }
.chat-item { display: flex; align-items: center; gap: 4px; border-radius: var(--radius-sm); padding: 2px 4px; }
.chat-item.on { background: var(--accent-soft); }
.chat-item > .grow { display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: none; border: 0; padding: 6px 8px; cursor: pointer; color: var(--text); min-width: 0; }
@media (max-width: 900px) { .chat-grid { grid-template-columns: 1fr; } .chat-side { order: 2; } .chat-main { order: 1; max-height: none; min-height: 55vh; } .bubble { max-width: 94%; } }

/* ===== Hafıza ("Koçum beni nasıl tanıyor?") ===== */
.mem-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.mem-row:first-child { border-top: 0; }
.mem-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mem-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-3); font-size: 12px; }
.mem-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
@media (max-width: 520px) { .mem-row { flex-direction: column; } .mem-actions { width: 100%; justify-content: flex-end; } }

/* ===== Yapay zekâ ayarları ve koç kartları ===== */
.prov-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.prov-row:first-child { border-top: 0; }
@media (max-width: 760px) { .prov-row { grid-template-columns: 1fr; } }
.usage-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; background: var(--accent); }
.usage-bar.warn > span { background: var(--warning); } .usage-bar.over > span { background: var(--danger); }
.coach-card { border-left: 4px solid var(--accent); }
.coach-text { white-space: pre-wrap; word-break: break-word; }
/* ===== Sürükle-bırak sıralama ve plandan çıkarma ===== */
.drag-handle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; color: var(--text-3); background: none; border: 0; border-radius: 6px; cursor: grab; touch-action: none; flex-shrink: 0; }
.drag-handle:hover, .drag-handle:focus-visible { background: var(--surface-2); color: var(--text); }
body.sorting { user-select: none; cursor: grabbing; }
.dragging { opacity: .75; box-shadow: var(--shadow); position: relative; z-index: 5; }
.is-out { opacity: .6; }
.chip.sm { height: 26px; padding: 0 10px; font-size: 12px; flex-shrink: 0; }
.comp-list li { align-items: center; }
@media (pointer: coarse) { .drag-handle { width: 44px; height: 44px; } .chip.sm { height: 36px; min-width: 44px; justify-content: center; } }
/* Haftalık plan: alt kenardan süre değiştirme */
.wt-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; touch-action: none; }
.wt-resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: currentColor; opacity: 0; transition: opacity .12s; }
.wt:hover .wt-resize::after, .wt.resizing .wt-resize::after { opacity: .45; }
.wt.resizing { z-index: 6; outline: 2px solid var(--accent); }
.wt.resizing::after { content: attr(data-dur); position: absolute; right: 4px; bottom: 6px; padding: 1px 6px; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 6px; }
body.sizing { cursor: ns-resize; user-select: none; }
@media (pointer: coarse) { .wt-resize { height: 14px; } .wt-resize::after { opacity: .45; } }

/* ===== Kriterler ===== */
.rule-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.rule-row:first-of-type { border-top: 0; }
.rule-row .lbl { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rule-row .hint { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.rule-param { margin-top: 8px; }
.rule-row.is-off .lbl, .rule-row.is-off .hint, .rule-row.is-off .rule-param { opacity: .55; }
.rule-ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 10px; }
@media (max-width: 560px) { .rule-row { flex-wrap: wrap; } }
.wt.pushed { outline: 1px dashed var(--accent); z-index: 4; }
