/* ============ TAKVİM ============ */
.ev-odev { --ec: var(--amber); --es: var(--amber-soft); }
.ev-sinav { --ec: var(--live); --es: var(--accent-soft); }
.ev-canli { --ec: var(--primary); --es: var(--primary-soft); }
.ev-etkinlik { --ec: var(--green); --es: var(--green-soft); }
.ev-chip:not(.is-active) { opacity: .55; text-decoration: line-through; }
.ev-chip.is-active { background: var(--es); color: var(--ec); border-color: var(--ec); }

.cal-layout { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.cal-card { padding: 18px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-head h2 { margin: 0; font-size: 1.35rem; }
.cal-nav { display: flex; gap: 8px; align-items: center; }
.cal-nav .icon-btn { font-size: 1.2rem; font-weight: 700; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow span { text-align: center; font-size: .8rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day {
  min-height: 104px; display: flex; flex-direction: column; gap: 3px; align-items: stretch; text-align: left;
  padding: 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); overflow: hidden;
}
.cal-day:hover { border-color: var(--primary); }
.cal-day.out { opacity: .45; }
.cd-num { font-weight: 700; font-size: .9rem; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cd-num { background: var(--accent); color: #fff; }
.cal-day.sel { border: 2px solid var(--primary); background: var(--primary-soft); }
.cd-ev { font-size: .72rem; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: var(--es); color: var(--text); border-left: 3px solid var(--ec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-more { font-size: .7rem; color: var(--muted); font-weight: 700; padding-left: 4px; }
.cd-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cd-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ec); }

.cal-side { display: grid; gap: 16px; }
.side-h { font-size: 1.05rem; margin-bottom: 12px; }
.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ev { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--es); border-left: 4px solid var(--ec); }
.ev-ic { font-size: 1.1rem; }
.ev div { flex: 1; display: grid; line-height: 1.3; min-width: 0; }
.ev b { font-size: .92rem; }
.ev small { color: var(--muted); font-size: .8rem; }
.ev-go { text-decoration: none; font-size: 1.4rem; font-weight: 700; color: var(--ec); padding: 0 6px; }
.ev-empty { color: var(--muted); padding: 8px 0; }

/* ============ SINIFIM ============ */
.class-hero {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap; color: #fff; border-radius: 26px; padding: 26px 30px; margin-bottom: 20px;
  background: radial-gradient(circle at 85% 0%, rgba(59, 130, 246,.55), transparent 50%), linear-gradient(130deg, #0b1f4d, #1e3a8a 60%, #1d4ed8);
}
.ch-badge { width: 92px; height: 92px; border-radius: 26px; background: #fff; color: #0b1f4d; display: grid; place-items: center; font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; flex-shrink: 0; }
.ch-info { flex: 1; min-width: 220px; }
.ch-info h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 800; margin: 0 0 2px; }
.ch-info p { margin: 0 0 10px; opacity: .88; }
.ch-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .92rem; }
.class-hero .btn-light { color: #0b1f4d; }

.ann-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ann.pinned { border-color: var(--primary); background: linear-gradient(var(--primary-soft), var(--surface) 70%); }
.ann-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ann-head div { flex: 1; display: grid; line-height: 1.3; }
.ann-head small { color: var(--muted); }
.ann p { margin: 0; }

.tt-wrap { padding: 8px; overflow-x: auto; }
.timetable { width: 100%; border-collapse: separate; border-spacing: 4px; min-width: 640px; }
.timetable th, .timetable td { padding: 10px; border-radius: 10px; text-align: center; font-size: .9rem; }
.timetable thead th { background: var(--bg-alt); font-weight: 700; }
.timetable thead th small { color: var(--primary); }
.timetable tbody th { text-align: left; background: var(--bg-alt); font-weight: 700; white-space: nowrap; }
.timetable tbody th small { display: block; color: var(--muted); font-weight: 500; }
.timetable td { background: var(--surface); border: 1px solid var(--border); font-weight: 600; }
.timetable .is-today { background: var(--primary-soft); border-color: var(--primary); }

.tch-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tch { display: flex; align-items: center; gap: 14px; padding: 16px; }
.tch div { flex: 1; display: grid; line-height: 1.3; }
.tch small { color: var(--muted); }
.tch .icon-btn { text-decoration: none; }

.std-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.std { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; }
.std b { flex: 1; font-size: .92rem; }
.std.me { border-color: var(--primary); background: var(--primary-soft); }
.std .avatar { width: 36px; height: 36px; font-size: .9rem; }
.av-1 { background: linear-gradient(135deg, #0e7490, #0f6e4f); } .av-2 { background: linear-gradient(135deg, #a6370a, #865105); }
.av-3 { background: linear-gradient(135deg, #be185d, #7c3aed); } .av-4 { background: linear-gradient(135deg, #475569, #0369a1); }
.small-note { font-size: .85rem; margin-top: 14px; }

/* ============ RAPORLARIM ============ */
.rep-actions { display: flex; gap: 8px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px; display: grid; gap: 2px; }
.kpi small { color: var(--muted); font-weight: 600; }
.kpi b { font-size: 1.6rem; line-height: 1.2; }
.delta { font-size: .8rem; color: var(--muted); font-weight: 600; }
.delta.up { color: var(--green); }
.delta.down { color: var(--live); }

.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart-card h2, .rep-grid .card h2 { font-size: 1.05rem; margin: 0 0 2px; }
.chart-card .sm { font-size: .82rem; margin: 0 0 14px; }
.chart-card.wide { grid-column: 1 / -1; }

.bar-chart { position: relative; height: 220px; padding-left: 34px; }
.bc-grid { position: absolute; inset: 0 0 26px 34px; display: flex; flex-direction: column; justify-content: space-between; }
.bc-grid span { border-top: 1px solid var(--border); position: relative; height: 0; }
.bc-grid i { position: absolute; left: -34px; top: -8px; font-style: normal; font-size: .72rem; color: var(--muted); width: 28px; text-align: right; }
.bc-bars { position: absolute; inset: 0 0 0 34px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.bc-col { position: relative; border: 0; background: transparent; padding: 0 18% 26px; display: flex; align-items: flex-end; cursor: default; border-radius: 8px; }
.bc-col:hover, .bc-col:focus-visible { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.bc-bar { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.bc-lbl { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: .78rem; color: var(--muted); font-weight: 600; }

.line-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.lc-grid { stroke: var(--border); stroke-width: 1; }
.lc-ax { fill: var(--muted); font-size: 11px; font-family: inherit; }
.lc-area { fill: color-mix(in srgb, var(--primary) 10%, transparent); }
.lc-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-dot { fill: var(--primary); stroke: var(--surface); stroke-width: 2; transition: r .1s; }
.lc-dot.on { r: 7; }
.lc-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.lc-lbl { fill: var(--text); font-size: 12px; font-weight: 700; font-family: inherit; }
.lc-hit { fill: transparent; outline: none; }
.lc-hit:focus-visible { stroke: var(--primary); stroke-width: 2; }

.chart-tip {
  position: fixed; z-index: 400; transform: translate(-50%, -100%); pointer-events: none; background: #0b1f4d; color: #fff;
  padding: 6px 10px; border-radius: 8px; font-size: .82rem; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.2);
}
.chart-tip[hidden] { display: none; }
.chart-tip b { margin-right: 4px; }

.tbl { margin-top: 12px; font-size: .88rem; }
.tbl summary { cursor: pointer; color: var(--primary); font-weight: 700; }
.tbl table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.tbl th, .tbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: 200px 1fr 48px; align-items: center; gap: 12px; }
.hb-name { font-weight: 600; font-size: .92rem; }
.hb-track { height: 12px; background: var(--bg-alt); border-radius: 4px; overflow: hidden; }
.hb-fill { display: block; height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; }
.hb-val { text-align: right; font-size: .92rem; }

.topic-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.topic-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg-alt); }
.topic-list b { flex: 1; }
.topic-list small { color: var(--muted); }
.topic-list .text-link { margin: 0; }
.topic-list.good li { border-left: 4px solid var(--green); }
.topic-list.improve li { border-left: 4px solid var(--amber); }

@media print {
  .sidebar, .topbar, .app-bottom, .rep-actions, .tbl summary, .toast-stack { display: none !important; }
  .app-body { margin: 0 !important; padding: 0 !important; }
  .tbl[open] table, .tbl table { display: table; }
  body.app { background: #fff; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: 1fr; }
  .rep-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .cal-day { min-height: 54px; padding: 4px; }
  .cd-ev, .cd-more { display: none; }
  .cd-dots { display: flex; }
  .cal-dow, .cal-grid { gap: 3px; }
  .hbars li { grid-template-columns: 1fr 44px; }
  /* Grafik küçülünce yazılar okunur kalsın */
  .lc-ax { font-size: 17px; }
  .lc-lbl { font-size: 19px; }
  .lc-dot { r: 6; }
  .rep-actions { width: 100%; }
  .rep-actions .btn { flex: 1; }
  .kpi { padding: 14px; }
  .kpi b { font-size: 1.35rem; }
  .hb-name { grid-column: 1 / -1; }
  .class-hero { padding: 22px 20px; }
  .ch-badge { width: 72px; height: 72px; font-size: 1.5rem; }
}

/* ============ SINIFIM & RAPORLAR (gerçek veri) ============ */
.ch-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sr-pick { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .88rem; }
.sr-pick select { font: inherit; font-weight: 700; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.class-hero .sr-pick { color: #fff; }
.class-hero .sr-pick select { border-color: rgba(255,255,255,.35); }
.rep-actions { align-items: center; flex-wrap: wrap; }
.tab-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; font-size: .72rem; font-weight: 800; background: var(--primary-soft); color: var(--primary); }

.ann-form { display: grid; gap: 10px; margin-bottom: 14px; }
.ann-form .field { margin: 0; }
.ann-form input, .ann-form textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.ann-form .error { color: var(--live); font-size: .8rem; }
.af-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--primary); }
.ann-del { width: 30px; height: 30px; font-size: .85rem; }

.tbl-card { padding: 0; overflow: hidden; }
.tbl-scroll { overflow-x: auto; }
.sr-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.sr-table th { text-align: left; font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sr-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sr-table tbody tr:hover { background: var(--bg-alt); }
.sr-table tr.risk td:first-child { box-shadow: inset 3px 0 0 var(--live); }
.sr-table a:not(.btn) { color: var(--text); font-weight: 600; }
.u-cell { display: flex; align-items: center; gap: 10px; }
.u-cell div { display: grid; line-height: 1.25; }
.u-cell small { color: var(--muted); }
.u-cell .avatar { width: 32px; height: 32px; font-size: .85rem; flex-shrink: 0; }
.late { color: var(--live); }
.mini-bar { display: inline-block; vertical-align: middle; width: 60px; height: 6px; border-radius: 3px; background: var(--bg-alt); overflow: hidden; margin-right: 6px; }
.mini-bar span { display: block; height: 100%; background: var(--primary); }
.rep-grid .card.wide { grid-column: 1 / -1; }
.rep-grid .card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

/* Çubuklarda karşılaştırma işareti (sınıf / ödev ortalaması) */
.hb-track { position: relative; overflow: visible; }
.hb-fill { border-radius: 4px; }
.hb-mark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--surface); }
.mk-legend { display: inline-block; width: 3px; height: 12px; border-radius: 2px; background: var(--text); vertical-align: -2px; margin: 0 2px 0 4px; }
.hb-name { display: grid; line-height: 1.25; min-width: 0; }
.hb-name small { color: var(--muted); font-weight: 500; font-size: .78rem; }
.hb-name a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-name a:hover { text-decoration: underline; }
.empty-card { text-align: center; padding: 32px; display: grid; gap: 6px; }

@media (max-width: 760px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .rep-grid { grid-template-columns: minmax(0, 1fr); }
  .hbars li { grid-template-columns: minmax(0, 1fr) 1fr 44px; }
}
