/* Hedefler sayfası eklentileri
   1) Ders ders net hedefi kartı (.y-dh-*)
   2) Aylık hedefler: son tarih çipleri, tamamlananlar arşivi, geçmiş aylar (.y-due, .y-ag-*)
   index.html'deki yığılmış #yks yamalarının üstüne gelir; o yüzden seçiciler #yks ile başlar. */

/* ---------- 1. Ders ders net hedefi ---------- */
#yks .y-grid > .y-dh-card { grid-column: 1 / -1; height: auto; }

#yks .y-dh-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
#yks .y-dh-head h3 { margin: 0 0 4px; }
#yks .y-dh-head .hint { margin: 0; }
#yks .y-dh-ctrl { align-items: center !important; gap: 8px !important; }
#yks .y-dh-ctrl .seg { display: inline-flex; }
#yks .y-dh-ctrl select { height: 32px; min-height: 32px; font-size: 12px; padding: 0 28px 0 10px; width: auto; }
#yks .y-dh-ctrl > button { height: 32px; min-height: 32px; padding: 0 14px; font-size: 12px; }

#yks .y-dh-table { display: flex; flex-direction: column; }
#yks .y-dh-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.3fr) 70px 92px minmax(120px, 2fr) 96px;
  align-items: center; gap: 14px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
#yks .y-dh-row:last-child { border-bottom: 0; }
#yks .y-dh-th {
  padding-top: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut);
}
#yks .y-dh-th span:nth-child(2), #yks .y-dh-th span:nth-child(3) { text-align: center; }
#yks .y-dh-th span:last-child { text-align: right; }

#yks .y-dh-ad { display: flex; flex-direction: column; min-width: 0; }
#yks .y-dh-ad b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#yks .y-dh-ad span { font-size: 11px; color: var(--mut); }
#yks .y-dh-cur { text-align: center; font-family: var(--mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; font-weight: 700; }
#yks input.y-dh-in {
  height: 32px; min-height: 32px; width: 100%; text-align: center;
  font-family: var(--mono, ui-monospace, monospace); font-weight: 700; font-size: 13px; padding: 0 6px;
}

#yks .y-dh-bar i { display: block; height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
#yks .y-dh-bar i b { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--acc), #8b5cf6); transition: width .35s ease; }
#yks .y-dh-bar.ok i b { background: var(--green); }
#yks .y-dh-bar.low i b { background: var(--red); }

#yks .y-dh-kalan { text-align: right; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
#yks .y-dh-kalan.ok { color: var(--green); }
#yks .y-dh-kalan.low { color: var(--red); }
#yks .y-dh-kalan.none { color: var(--mut); font-weight: 600; }

#yks .y-dh-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--soft); font-size: 12px; color: var(--mut);
}
#yks .y-dh-foot b { color: var(--fg); }
#yks .y-dh-foot em { font-style: normal; font-weight: 700; }
#yks .y-dh-warn { color: #f59e0b; }
#yks .y-dh-okt { color: var(--green); }

/* ---------- 2. Aylık hedefler ---------- */
#yks .y-ag-add { flex-wrap: nowrap !important; }
#yks #y-ag-s {
  flex: 0 0 132px; width: 132px; height: 32px; min-height: 32px; font-size: 12px; padding: 4px 8px;
}

#yks .y-due {
  flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
  color: var(--mut); background: var(--soft); border: 1px solid transparent;
}
#yks .y-due.near { color: var(--acc); }
#yks .y-due.soon { color: #f59e0b; background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .25); }
#yks .y-due.late { color: var(--red); background: rgba(244, 63, 94, .12); border-color: rgba(244, 63, 94, .28); }
#yks .y-due.done { color: var(--green); background: transparent; }
#yks .y-ag-late { margin: 6px 0 0; font-size: 12px; color: var(--red); font-weight: 600; }

#yks .y-ag-tasi { width: 100%; margin-top: 10px; height: 32px; min-height: 32px; font-size: 12px; }

#yks .y-ag-arsiv { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
#yks .y-ag-arsiv summary {
  cursor: pointer; list-style: none; font-size: 12px; font-weight: 700; color: var(--mut); padding: 4px 0; user-select: none;
}
#yks .y-ag-arsiv summary::-webkit-details-marker { display: none; }
#yks .y-ag-arsiv summary::before { content: '▸'; display: inline-block; width: 14px; transition: transform .2s ease; }
#yks .y-ag-arsiv[open] summary::before { transform: rotate(90deg); }
#yks .y-ag-arsiv summary:hover { color: var(--fg); }

#yks .y-ag-gecmis { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
#yks .y-ag-gecmis-t { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); margin-bottom: 8px; }
#yks .y-ag-aylar { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
#yks button.y-ag-ay {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  height: auto !important; min-height: 0 !important; width: auto !important;
  padding: 7px 10px !important; text-align: left; border-radius: 8px;
}
#yks .y-ag-ay b { font-size: 12px; }
#yks .y-ag-ay span { font-size: 11px; font-weight: 700; color: var(--mut); font-variant-numeric: tabular-nums; }
#yks .y-ag-ay.iyi span { color: var(--green); }
#yks .y-ag-ay.dusuk span { color: var(--red); }
#yks .y-ag-ay.sel { border-color: var(--acc) !important; }

/* ---------- Dar ekran ---------- */
@media (max-width: 760px) {
  #yks .y-dh-row { grid-template-columns: minmax(0, 1fr) 46px 62px 70px; gap: 8px; }
  #yks .y-dh-kalan { font-size: 11px; }
  #yks .y-dh-bar, #yks .y-dh-th span:nth-child(4) { display: none; }
  #yks .y-dh-ctrl { width: 100%; }
  #yks .y-dh-ctrl > button.pri { flex: 1; }
  #yks .y-ag-add { flex-wrap: wrap !important; }
  #yks #y-ag { flex-basis: 100% !important; }
  #yks #y-ag-s { flex: 1 1 auto; width: auto; }
}
