/* ===== İkon ===== */
.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i.sm { width: 16px; height: 16px; } .i.lg { width: 22px; height: 22px; }

/* ===== Düğmeler ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer; user-select: none;
  border: 1px solid transparent; border-radius: var(--radius-sm); transition: background .12s, border-color .12s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-success { background: var(--success); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; cursor: pointer;
  color: var(--text-2); background: transparent; border: 0; border-radius: var(--radius-sm); position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }
@media (pointer: coarse) { .btn { height: 44px; } .btn.sm { height: 38px; } .icon-btn { width: 40px; height: 40px; } }

/* ===== Rozet ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; font-size: 12px; font-weight: 600; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge .i { width: 13px; height: 13px; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info, .badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.tyt { background: var(--tyt-soft); color: var(--tyt); } .badge.ayt { background: var(--ayt-soft); color: var(--ayt); }

/* ===== Kart ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 16px; } .card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 14px; }
@media (max-width: 640px) { .card-pad { padding: 14px; } }

/* ===== Bilgi bandı ===== */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; background: var(--info-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); }
.banner.warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.banner.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.banner.success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.banner .i { margin-top: 1px; }

/* ===== Modal (bulanık arka plan) / mobilde alt sayfa ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: var(--backdrop); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
  animation: fade .15s ease-out;
}
.modal { width: 100%; max-width: 520px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
.modal.lg { max-width: 760px; } .modal.sm { max-width: 400px; } .modal.xl { max-width: 960px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-foot .spacer { flex: 1; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.lg, .modal.xl, .modal.sm { max-width: none; max-height: 92dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 0; animation: sheet .22s cubic-bezier(.2, .8, .2, 1); }
  .modal-head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--surface-3); }
  .modal-head { position: relative; padding-top: 18px; }
  .modal-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* ===== Bildirim (toast) ===== */
.toasts { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { --tc: var(--info); position: relative; display: flex; align-items: center; gap: 12px; width: min(400px, calc(100vw - 32px)); padding: 12px 10px 12px 12px; overflow: hidden;
         background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); color: var(--text); font-size: 13.5px; line-height: 1.4;
         border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); pointer-events: auto; animation: toast-in .28s cubic-bezier(.2, .8, .2, 1); }
.toast.success { --tc: var(--success); } .toast.error { --tc: var(--danger); } .toast.warning { --tc: var(--warning); }
.toast-ico { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--tc); background: color-mix(in srgb, var(--tc) 16%, transparent); }
.toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-act { flex: none; padding: 6px 12px; font-size: 12.5px; font-weight: 650; color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, transparent); border: 0; border-radius: 8px; cursor: pointer; }
.toast-act:hover { background: color-mix(in srgb, var(--tc) 22%, transparent); }
.toast-x { flex: none; width: 28px; height: 28px; display: grid; place-items: center; color: var(--text-3); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.toast-x:hover { background: var(--surface-2); color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .toasts { left: 0; right: 0; top: 12px; bottom: auto; align-items: center; } @keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.97); } to { opacity: 1; transform: none; } } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ===== Seçim kutusu (arama + hızlı ekleme) ===== */
.cb { position: relative; }
.cb-btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px; text-align: left; cursor: pointer; font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cb-btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.cb-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: var(--focus); }
.cb-btn .ph { color: var(--text-3); } .cb-btn .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-pop { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); min-width: 220px; display: flex; flex-direction: column; max-height: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.cb-pop.up { top: auto; bottom: calc(100% + 4px); }
.cb-search { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.cb-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); height: 24px; }
.cb-list { overflow-y: auto; padding: 4px; flex: 1; }
.cb-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.cb-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.cb-opt.hl, .cb-opt:hover { background: var(--surface-2); } .cb-opt.sel { color: var(--accent); font-weight: 600; }
.cb-opt .star { color: var(--warning); margin-left: auto; font-size: 12px; }
.cb-empty { padding: 12px; text-align: center; color: var(--text-3); font-size: 13px; }
.cb-add { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: 0; border-top: 1px solid var(--border); background: var(--surface-2); color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; text-align: left; }
.cb-add:hover { background: var(--accent-soft); }

/* ===== Tablo (REHBER_v2 3.5) ===== */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 650; white-space: nowrap; border-bottom: 1px solid var(--border); text-align: left; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
/* hizalama: metin sola · sayı sağa · tarih/durum ortaya · işlem sütunu en sağa; başlık hizası hücreyle aynı */
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .ctr, .tbl th.ctr { text-align: center; }
.tbl .act, .tbl th.act { text-align: right; width: 1%; white-space: nowrap; }
.tbl th.sortable { cursor: pointer; user-select: none; } .tbl th.sortable:hover { color: var(--text); }
.tbl th .sort-i { opacity: .35; margin-left: 4px; } .tbl th.sorted .sort-i { opacity: 1; color: var(--accent); }
.tbl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.tbl-bar .search { position: relative; flex: 1; min-width: 180px; max-width: 320px; }
.tbl-bar .search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.tbl-bar .search input { padding-left: 34px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.chip:hover { background: var(--surface-2); } .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px) {
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .tbl.cards td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right !important; }
  .tbl.cards td::before { content: attr(data-label); color: var(--text-3); font-size: 12px; font-weight: 600; text-align: left; }
  .tbl.cards td.act { justify-content: flex-end; width: auto; }
  .tbl.cards td.act::before { display: none; }
}

/* ===== Sekmeler ===== */
.tabs { display: flex; gap: 4px; padding: 3px; background: var(--surface-2); border-radius: var(--radius-sm); overflow-x: auto; max-width: 100%; }
.tab { padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--text-2); background: transparent; border: 0; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); } .tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tab .n { margin-left: 6px; font-size: 11px; color: var(--text-3); }

/* ===== Açılır bölüm ===== */
.fold { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.fold > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-weight: 600; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .chev { transition: transform .15s; color: var(--text-3); margin-left: auto; }
.fold[open] > summary .chev { transform: rotate(90deg); }
.fold > summary .sub { color: var(--text-3); font-weight: 500; font-size: 12px; }
.fold-body { padding: 0 14px 14px; }

/* ===== Boş durum / iskelet / ilerleme ===== */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 16px; text-align: center; color: var(--text-2); }
.empty .i { width: 32px; height: 32px; color: var(--text-3); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--accent); transition: width .3s; }
.bar.success > i { background: var(--success); } .bar.warning > i { background: var(--warning); }
.ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring::before { content: ""; position: absolute; }
.ring > span { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-weight: 700; font-size: 16px; }
kbd { display: inline-block; padding: 1px 6px; font: 600 11px var(--font); color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); display: inline-block; }
.dot.live { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); }
.subject-bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--sc, var(--c-sosyal)); flex-shrink: 0; }
.s-turkce { --sc: var(--c-turkce); } .s-matematik { --sc: var(--c-matematik); } .s-geometri { --sc: var(--c-geometri); }
.s-fizik { --sc: var(--c-fizik); } .s-kimya { --sc: var(--c-kimya); } .s-biyoloji { --sc: var(--c-biyoloji); } .s-sosyal { --sc: var(--c-sosyal); }

/* ===== Bekleme göstergesi (spinner) ===== */
.spin { display: inline-block; flex: none; width: 16px; height: 16px; vertical-align: -3px; border-radius: 50%; box-sizing: border-box;
        border: 2.5px solid color-mix(in srgb, currentColor 22%, transparent); border-top-color: currentColor;
        animation: yks-spin 1.25s cubic-bezier(.55, .15, .45, .85) infinite; }
@keyframes yks-spin { to { transform: rotate(360deg); } }
/* Azaltılmış hareket açıkken de bekleme göstergesi çalışmalı (genel kural animasyonları sıfırlıyor) */
@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 1.6s !important; animation-timing-function: linear !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
