/* =========================================================
   KodFit Panel — Tasarım Sistemi
   ========================================================= */
:root {
    --kf-primary: #2563EB;
    --kf-primary-rgb: 37, 99, 235;
    --kf-primary-dark: #1D4ED8;
    --kf-secondary: #F4C400;
    --kf-bg: #F3F5F9;
    --kf-card: #FFFFFF;
    --kf-border: #E6E9EF;
    --kf-text: #0F172A;
    --kf-muted: #64748B;
    --kf-sidebar: #0B1220;
    --kf-sidebar-2: #111A2E;
    --kf-sidebar-text: #9AA6B8;
    --kf-radius: 14px;
    --kf-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
    --kf-sidebar-w: 264px;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-primary: var(--kf-primary);
    --bs-primary-rgb: var(--kf-primary-rgb);
    --bs-link-color: var(--kf-primary);
    --bs-link-color-rgb: var(--kf-primary-rgb);
    --bs-link-hover-color: var(--kf-primary-dark);
}

html { font-size: 14px; }
body.kf-body { background: var(--kf-bg); color: var(--kf-text); font-family: var(--bs-body-font-family); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn, .nav-link, .dropdown-item, .page-link { text-decoration: none !important; }

/* ---------- Layout ---------- */
.kf-layout { display: flex; min-height: 100vh; }
.kf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-left: var(--kf-sidebar-w); transition: margin .2s; }
.kf-content { flex: 1; padding: 1.5rem 1.75rem; }
.kf-footer { padding: .9rem 1.75rem; color: var(--kf-muted); font-size: .8rem; border-top: 1px solid var(--kf-border); background: #fff; }

/* ---------- Sidebar ---------- */
.kf-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--kf-sidebar-w); background: linear-gradient(180deg, var(--kf-sidebar) 0%, var(--kf-sidebar-2) 100%); color: #fff; display: flex; flex-direction: column; z-index: 1040; transition: transform .25s; }
.kf-sidebar-brand { padding: 1.1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.06); }
.kf-brand-mark { width: 38px; height: 38px; border-radius: 11px; background: #B8FF4D; display: inline-flex; align-items: center; justify-content: center; color: #050505; font-size: 1.2rem; flex-shrink: 0; box-shadow: 0 6px 16px rgba(184,255,77,.2); }
.kf-brand-logo { width: 38px; height: 38px; border-radius: 10px; object-fit: contain; background: transparent; flex-shrink: 0; box-shadow: 0 6px 16px rgba(184,255,77,.14); }
.kf-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.kf-brand-name { color: #fff; font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.kf-brand-sub { color: var(--kf-sidebar-text); font-size: .72rem; }
.kf-sidebar-close { color: #fff !important; }
.kf-clinic-switch { padding: .75rem 1rem 0; }
.kf-clinic-switch-btn { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); color: #fff; font-size: .82rem; display: flex; align-items: center; border-radius: 10px; }
.kf-clinic-switch-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.kf-nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: .75rem .75rem 1rem; overscroll-behavior: contain; scroll-behavior: smooth; transition: box-shadow .2s; }
/* Sol menü kaydırma çubuğu — ince, yuvarlak, sadece ihtiyaç oldukça belirginleşir */
.kf-nav { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
.kf-nav::-webkit-scrollbar { width: 10px; }
.kf-nav::-webkit-scrollbar-track { background: transparent; }
.kf-nav::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,.18); border: 3px solid transparent; background-clip: content-box; border-radius: 999px; min-height: 40px; transition: background-color .2s; }
.kf-nav::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,.45); }
.kf-nav::-webkit-scrollbar-thumb:active { background-color: var(--kf-primary); }
.kf-sidebar:hover .kf-nav { scrollbar-color: rgba(255,255,255,.34) transparent; }
.kf-sidebar:hover .kf-nav::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,.3); }
/* Kaydırma gölgeleri (panel.js `.kf-nav-shadow-top` / `.kf-nav-shadow-bottom` sınıflarını ekler) */
.kf-nav.kf-nav-shadow-top { box-shadow: inset 0 14px 12px -14px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.07); }
.kf-nav.kf-nav-shadow-bottom { box-shadow: inset 0 -14px 12px -14px rgba(0,0,0,.85), inset 0 -1px 0 rgba(255,255,255,.07); }
.kf-nav.kf-nav-shadow-top.kf-nav-shadow-bottom { box-shadow: inset 0 14px 12px -14px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.07), inset 0 -14px 12px -14px rgba(0,0,0,.85), inset 0 -1px 0 rgba(255,255,255,.07); }
.kf-nav-list { list-style: none; margin: 0; padding: 0; }
.kf-nav-heading { color: rgba(255,255,255,.35); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 1rem .75rem .35rem; }
.kf-nav-link { display: flex; align-items: center; gap: .7rem; padding: .58rem .8rem; border-radius: 10px; color: var(--kf-sidebar-text); font-weight: 500; font-size: .875rem; transition: all .15s; }
.kf-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .9; }
.kf-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.kf-nav-link.active { background: var(--kf-primary); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.35); }
.kf-sidebar-footer { padding: .9rem 1rem; border-top: 1px solid rgba(255,255,255,.06); }
.kf-user { display: flex; align-items: center; gap: .65rem; }
.kf-user-meta { flex: 1; min-width: 0; line-height: 1.2; }
.kf-user-name { color: #fff; font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kf-user-role { color: var(--kf-sidebar-text); font-size: .72rem; }
.kf-sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1035; }

@media (max-width: 991.98px) {
    .kf-main { margin-left: 0; }
    .kf-sidebar { transform: translateX(-100%); }
    body.kf-sidebar-open .kf-sidebar { transform: translateX(0); }
    body.kf-sidebar-open .kf-sidebar-backdrop { display: block; }
    .kf-content { padding: 1rem; }
}

/* ---------- Topbar ---------- */
.kf-topbar { position: sticky; top: 0; z-index: 1020; height: 64px; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--kf-border); display: flex; align-items: center; gap: 1rem; padding: 0 1.75rem; }
@media (max-width: 991.98px) { .kf-topbar { padding: 0 1rem; } }
.kf-topbar-title { font-size: .95rem; color: var(--kf-text); }
.kf-topbar-title .breadcrumb { margin: 0; font-size: .85rem; }
.kf-topbar-actions { display: flex; align-items: center; gap: .75rem; }
.kf-topbar-search { position: relative; }
.kf-topbar-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--kf-muted); font-size: .85rem; }
.kf-topbar-search input { padding-left: 30px; width: 220px; border-radius: 999px; background: var(--kf-bg); border-color: transparent; }
.kf-topbar-search input:focus { background: #fff; border-color: var(--kf-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.kf-code-chip { display: inline-flex; align-items: center; gap: .4rem; background: #EEF2FF; color: #3730A3; border-radius: 999px; padding: .3rem .75rem; font-weight: 700; font-size: .8rem; letter-spacing: .05em; cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.kf-code-chip:hover { background: #E0E7FF; }

/* ---------- Page header ---------- */
.kf-page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.kf-page-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.kf-page-subtitle { color: var(--kf-muted); margin: .2rem 0 0; font-size: .9rem; }
.kf-page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--kf-border); border-radius: var(--kf-radius); box-shadow: var(--kf-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--kf-border); padding: 1rem 1.25rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card-header .card-title { margin: 0; font-size: 1rem; font-weight: 700; }
.card-body { padding: 1.25rem; }
.card-footer { background: transparent; border-top: 1px solid var(--kf-border); }

.kf-stat { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; height: 100%; }
.kf-stat-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.kf-stat-body { min-width: 0; flex: 1; }
.kf-stat-label { color: var(--kf-muted); font-size: .8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kf-stat-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.kf-stat-hint { font-size: .75rem; color: var(--kf-muted); margin-top: .15rem; }
.kf-stat-hint.up { color: #16A34A; } .kf-stat-hint.down { color: #DC2626; }
.kf-stat-link { display: block; color: inherit; }
.kf-stat-link:hover { text-decoration: none; }
.kf-stat-link:hover .card { border-color: rgba(37,99,235,.35); transform: translateY(-1px); transition: all .15s; }

.bg-soft-primary { background: rgba(37,99,235,.1); color: var(--kf-primary); }
.bg-soft-success { background: rgba(22,163,74,.1); color: #15803D; }
.bg-soft-danger { background: rgba(220,38,38,.1); color: #B91C1C; }
.bg-soft-warning { background: rgba(245,158,11,.12); color: #B45309; }
.bg-soft-info { background: rgba(14,165,233,.12); color: #0369A1; }
.bg-soft-secondary { background: rgba(100,116,139,.12); color: #475569; }
.bg-soft-purple { background: rgba(124,58,237,.12); color: #6D28D9; }
.bg-soft-pink { background: rgba(219,39,119,.12); color: #BE185D; }
.bg-soft-dark { background: rgba(15,23,42,.1); color: #0F172A; }

/* ---------- Badges ---------- */
.badge { font-weight: 600; padding: .38em .65em; border-radius: 6px; font-size: .74rem; }
.badge-soft-success { background: rgba(22,163,74,.12); color: #15803D; }
.badge-soft-danger { background: rgba(220,38,38,.12); color: #B91C1C; }
.badge-soft-warning { background: rgba(245,158,11,.15); color: #B45309; }
.badge-soft-info { background: rgba(14,165,233,.14); color: #0369A1; }
.badge-soft-primary { background: rgba(37,99,235,.12); color: var(--kf-primary-dark); }
.badge-soft-secondary { background: rgba(100,116,139,.14); color: #475569; }
.badge-soft-purple { background: rgba(124,58,237,.12); color: #6D28D9; }
.badge-soft-dark { background: rgba(15,23,42,.12); color: #0F172A; }
.badge-dot::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .4em; vertical-align: middle; }

/* ---------- Tables ---------- */
.table { --bs-table-color: var(--kf-text); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .8rem 1rem; vertical-align: middle; border-bottom-color: var(--kf-border); }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--kf-muted); font-weight: 700; background: #F8FAFC; border-bottom: 1px solid var(--kf-border); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { background: #F8FAFF; }
.table tbody tr:last-child td { border-bottom: 0; }
.table a.fw-semibold { color: var(--kf-text); }
.table a.fw-semibold:hover { color: var(--kf-primary); }
.table .kf-row-actions { white-space: nowrap; text-align: right; }
.table .kf-row-actions .btn { padding: .25rem .5rem; }
.kf-sort { color: inherit; display: inline-flex; align-items: center; gap: .25rem; }
.kf-sort:hover { color: var(--kf-primary); text-decoration: none; }
.kf-sort.active { color: var(--kf-primary); }
.kf-table-card .card-body { padding: 0; }
.kf-table-card .table-responsive { border-radius: 0 0 var(--kf-radius) var(--kf-radius); }
.kf-table-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.25rem; border-top: 1px solid var(--kf-border); font-size: .85rem; color: var(--kf-muted); }
.pagination { margin: 0; --bs-pagination-border-radius: 8px; --bs-pagination-padding-y: .35rem; --bs-pagination-padding-x: .7rem; --bs-pagination-font-size: .85rem; }
.page-item .page-link { border-color: var(--kf-border); color: var(--kf-text); margin: 0 2px; border-radius: 8px !important; }
.page-item.active .page-link { background: var(--kf-primary); border-color: var(--kf-primary); color: #fff; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .82rem; color: #334155; margin-bottom: .35rem; }
.form-label .req { color: #DC2626; margin-left: 2px; }
.form-control, .form-select { border-radius: 9px; border-color: #D9DEE7; padding: .5rem .8rem; font-size: .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--kf-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-control-sm, .form-select-sm { border-radius: 8px; }
.form-text { color: var(--kf-muted); font-size: .78rem; }
.input-group-text { border-radius: 9px; border-color: #D9DEE7; background: #F8FAFC; color: var(--kf-muted); }
.form-check-input:checked { background-color: var(--kf-primary); border-color: var(--kf-primary); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }
.kf-filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.kf-filters .form-control, .kf-filters .form-select { width: auto; min-width: 150px; }
.kf-filters .kf-filter-search { min-width: 240px; flex: 1; }
.kf-section-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--kf-muted); margin: 1.25rem 0 .75rem; padding-bottom: .35rem; border-bottom: 1px solid var(--kf-border); }
.kf-section-title:first-child { margin-top: 0; }
.kf-color-input { width: 52px; height: 38px; padding: 3px; border-radius: 9px; }

/* Aranabilir select */
.kf-select { position: relative; }
.kf-select-toggle { display: flex; align-items: center; justify-content: space-between; cursor: pointer; text-align: left; background: #fff; }
.kf-select-toggle.placeholder { color: #6c757d; opacity: 1; }
.kf-select-menu { position: absolute; z-index: 1050; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--kf-border); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.12); display: none; max-height: 300px; overflow: hidden; }
.kf-select.open .kf-select-menu { display: block; }
.kf-select-search { padding: .5rem; border-bottom: 1px solid var(--kf-border); }
.kf-select-list { max-height: 240px; overflow-y: auto; padding: .25rem; scrollbar-width: thin; scrollbar-color: rgba(15,23,42,.18) transparent; }
.kf-select-option { padding: .45rem .7rem; border-radius: 7px; cursor: pointer; font-size: .88rem; display: flex; align-items: center; gap: .6rem; }
.kf-select-option:hover, .kf-select-option.focus { background: #F1F5F9; }
.kf-select-option.selected { background: rgba(37,99,235,.1); color: var(--kf-primary-dark); }
.kf-select-option small { color: var(--kf-muted); margin-left: auto; }
.kf-select-empty { padding: .8rem; color: var(--kf-muted); font-size: .85rem; text-align: center; }

/* ---------- Buttons ---------- */
.btn { border-radius: 9px; font-weight: 600; font-size: .875rem; padding: .5rem .95rem; }
.btn-sm { padding: .32rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .7rem 1.3rem; font-size: 1rem; border-radius: 11px; }
.btn-primary { background: var(--kf-primary); border-color: var(--kf-primary); box-shadow: 0 4px 12px rgba(37,99,235,.25); }
.btn-primary:hover, .btn-primary:focus { background: var(--kf-primary-dark); border-color: var(--kf-primary-dark); }
.btn-light { background: #fff; border-color: var(--kf-border); color: var(--kf-text); }
.btn-light:hover { background: #F1F5F9; border-color: #D9DEE7; }
.btn-outline-primary { border-color: rgba(37,99,235,.4); }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-soft-primary { background: rgba(37,99,235,.1); color: var(--kf-primary-dark); border: 0; }
.btn-soft-primary:hover { background: rgba(37,99,235,.18); color: var(--kf-primary-dark); }
.btn-soft-danger { background: rgba(220,38,38,.1); color: #B91C1C; border: 0; }
.btn-soft-danger:hover { background: rgba(220,38,38,.18); color: #B91C1C; }
.btn-soft-success { background: rgba(22,163,74,.1); color: #15803D; border: 0; }
.btn-soft-success:hover { background: rgba(22,163,74,.18); color: #15803D; }
.btn-soft-secondary { background: rgba(100,116,139,.12); color: #334155; border: 0; }
.btn-soft-secondary:hover { background: rgba(100,116,139,.2); color: #0F172A; }
.dropdown-menu { border-radius: 12px; border: 1px solid var(--kf-border); padding: .4rem; font-size: .875rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .75rem; }
.dropdown-item.active, .dropdown-item:active { background: var(--kf-primary); }

/* ---------- Avatar ---------- */
.kf-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: linear-gradient(135deg, #DBEAFE, #C7D2FE); color: #1E3A8A; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.kf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.kf-avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }
.kf-entity { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.kf-entity-name { font-weight: 600; color: var(--kf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kf-entity-sub { font-size: .78rem; color: var(--kf-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Tabs ---------- */
.nav-tabs { border-bottom: 1px solid var(--kf-border); gap: .25rem; }
.nav-tabs .nav-link { border: 0; color: var(--kf-muted); font-weight: 600; padding: .65rem 1rem; border-radius: 8px 8px 0 0; }
.nav-tabs .nav-link:hover { color: var(--kf-text); }
.nav-tabs .nav-link.active { color: var(--kf-primary); background: transparent; box-shadow: inset 0 -2px 0 var(--kf-primary); }
.nav-pills .nav-link { border-radius: 8px; font-weight: 600; color: var(--kf-muted); padding: .45rem .9rem; font-size: .85rem; }
.nav-pills .nav-link.active { background: var(--kf-primary); color: #fff; }
.kf-pills-light .nav-link.active { background: rgba(37,99,235,.12); color: var(--kf-primary-dark); }

/* ---------- Definition list ---------- */
.kf-dl { margin: 0; }
.kf-dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--kf-border); font-size: .875rem; }
.kf-dl > div:last-child { border-bottom: 0; }
.kf-dl dt { font-weight: 500; color: var(--kf-muted); flex-shrink: 0; }
.kf-dl dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- Timeline / list ---------- */
.kf-list { list-style: none; margin: 0; padding: 0; }
.kf-list > li { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--kf-border); }
.kf-list > li:last-child { border-bottom: 0; }
.kf-list-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kf-timeline { position: relative; padding-left: 1.5rem; }
.kf-timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--kf-border); }
.kf-timeline-item { position: relative; padding-bottom: 1rem; }
.kf-timeline-item::before { content: ''; position: absolute; left: -1.5rem; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--kf-primary); }
.kf-timeline-item:last-child { padding-bottom: 0; }

/* ---------- Empty state ---------- */
.kf-empty { text-align: center; padding: 3rem 1.5rem; color: var(--kf-muted); }
.kf-empty-icon { width: 64px; height: 64px; border-radius: 18px; background: #F1F5F9; display: inline-flex; align-items: center; justify-content: center; font-size: 1.7rem; color: #94A3B8; margin-bottom: 1rem; }
.kf-empty h6 { color: var(--kf-text); font-weight: 700; }

/* ---------- Progress ---------- */
.progress { height: 8px; border-radius: 999px; background: #E9EDF3; }
.progress-bar { border-radius: 999px; }
.kf-progress-sm { height: 6px; }

/* ---------- Toasts ---------- */
.kf-toast-container { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1090; display: flex; flex-direction: column; gap: .6rem; max-width: 360px; }
.kf-toast { display: flex; align-items: flex-start; gap: .7rem; background: #fff; border-radius: 12px; padding: .85rem 1rem; box-shadow: 0 10px 30px rgba(15,23,42,.15); border-left: 4px solid var(--kf-primary); animation: kfToastIn .25s ease; font-size: .875rem; }
.kf-toast.success { border-left-color: #16A34A; } .kf-toast.success i { color: #16A34A; }
.kf-toast.error { border-left-color: #DC2626; } .kf-toast.error i { color: #DC2626; }
.kf-toast.warning { border-left-color: #F59E0B; } .kf-toast.warning i { color: #F59E0B; }
.kf-toast.info { border-left-color: var(--kf-primary); } .kf-toast.info i { color: var(--kf-primary); }
.kf-toast i { font-size: 1.15rem; margin-top: 1px; }
.kf-toast .kf-toast-close { margin-left: auto; background: none; border: 0; color: var(--kf-muted); padding: 0; }
@keyframes kfToastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal-content { border: 0; border-radius: 16px; box-shadow: 0 20px 60px rgba(15,23,42,.25); }
.modal-header { border-bottom: 1px solid var(--kf-border); padding: 1rem 1.25rem; }
.modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-footer { border-top: 1px solid var(--kf-border); padding: .85rem 1.25rem; }
.kf-confirm-icon { width: 56px; height: 56px; border-radius: 50%; background: rgba(220,38,38,.1); color: #DC2626; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; }

/* ---------- Alerts ---------- */
.alert { border-radius: 12px; border: 0; font-size: .875rem; }
.alert-primary { background: rgba(37,99,235,.08); color: #1E40AF; }
.alert-warning { background: rgba(245,158,11,.12); color: #92400E; }
.alert-success { background: rgba(22,163,74,.1); color: #166534; }
.alert-danger { background: rgba(220,38,38,.08); color: #991B1B; }

/* ---------- Auth ---------- */
.kf-auth-body { margin: 0; min-height: 100vh; background: var(--kf-bg); font-family: var(--bs-body-font-family); }
.kf-auth { display: flex; min-height: 100vh; }
.kf-auth-side { flex: 1; background: radial-gradient(1200px 600px at -10% -10%, rgba(37,99,235,.35), transparent 60%), radial-gradient(800px 500px at 110% 110%, rgba(244,196,0,.25), transparent 60%), var(--kf-sidebar); color: #fff; align-items: center; justify-content: center; padding: 3rem; }
.kf-auth-side-inner { max-width: 480px; }
.kf-auth-logo { display:flex; align-items:center; gap:.7rem; color:#fff; text-decoration:none; font-size: 1.6rem; font-weight: 800; margin-bottom: 2.5rem; }
.kf-auth-logo img { width:38px; height:38px; border-radius:11px; }
.kf-auth-logo i { color: var(--kf-secondary); }
.kf-auth-side h1 { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 1rem; }
.kf-auth-side p { color: rgba(255,255,255,.7); font-size: 1.05rem; margin-bottom: 2rem; }
.kf-auth-features { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.kf-auth-features li { display: flex; gap: .6rem; align-items: center; color: rgba(255,255,255,.85); }
.kf-auth-features i { color: var(--kf-secondary); }
.kf-auth-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.kf-auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 2.25rem; box-shadow: var(--kf-shadow); }
.kf-auth-logo-sm { display:inline-flex; font-weight: 800; font-size: 1.3rem; margin-bottom: 1.5rem; }
.kf-auth-logo-sm img { width:auto; height:35px; }
.kf-auth-logo-sm i { color: var(--kf-primary); }
.kf-auth-card h2 { font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; }

/* ---------- Utilities ---------- */
.fs-7 { font-size: .8rem !important; }
.fs-8 { font-size: .72rem !important; }
.text-muted { color: var(--kf-muted) !important; }
.fw-800 { font-weight: 800; }
.mw-0 { min-width: 0; }
.cursor-pointer { cursor: pointer; }
.kf-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.kf-chart { position: relative; width: 100%; }
.kf-week-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.kf-week-tabs .btn { min-width: 60px; }
.kf-day-card { border: 1px solid var(--kf-border); border-radius: 12px; }
.kf-day-card.rest { background: #F8FAFC; }
.kf-day-card .kf-day-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1rem; border-bottom: 1px solid var(--kf-border); background: #FBFCFE; border-radius: 12px 12px 0 0; }
.kf-exercise-row { display: grid; grid-template-columns: 24px 2fr repeat(6, minmax(70px, 1fr)) 2fr 32px; gap: .5rem; align-items: center; padding: .5rem .75rem; border-bottom: 1px dashed var(--kf-border); }
.kf-exercise-row:last-child { border-bottom: 0; }
.kf-exercise-row .drag { color: #CBD5E1; cursor: grab; }
.kf-exercise-head { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--kf-muted); font-weight: 700; }
@media (max-width: 991.98px) { .kf-exercise-row { grid-template-columns: 1fr 1fr; } .kf-exercise-head { display: none; } }
.kf-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--kf-border); border: 1px solid var(--kf-border); border-radius: 12px; overflow: hidden; }
.kf-calendar-head { background: #F8FAFC; padding: .5rem; font-size: .72rem; text-transform: uppercase; font-weight: 700; color: var(--kf-muted); text-align: center; }
.kf-calendar-day { background: #fff; min-height: 110px; padding: .4rem; font-size: .78rem; }
.kf-calendar-day.other { background: #FAFBFC; color: #CBD5E1; }
.kf-calendar-day.today .kf-cal-num { background: var(--kf-primary); color: #fff; }
.kf-cal-num { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; margin-bottom: .25rem; }
.kf-cal-event { display: block; padding: .2rem .4rem; border-radius: 5px; margin-bottom: 2px; font-size: .72rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--kf-primary); }
.kf-cal-event:hover { color: #fff; opacity: .9; text-decoration: none; }
.kf-cal-event.cancelled { background: #94A3B8; text-decoration: line-through; }
.kf-meal-card { border: 1px solid var(--kf-border); border-radius: 12px; padding: .9rem 1rem; }
.kf-meal-card ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.kf-color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; }
.kf-quick-actions .btn { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1rem .5rem; font-size: .8rem; background: #fff; border: 1px solid var(--kf-border); color: var(--kf-text); height: 100%; }
.kf-quick-actions .btn i { font-size: 1.4rem; color: var(--kf-primary); }
.kf-quick-actions .btn:hover { border-color: var(--kf-primary); background: rgba(37,99,235,.04); }
.kf-video-preview { width: 100%; max-height: 360px; border-radius: 12px; background: #000; }
.kf-thumb { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; background: #E2E8F0; }
.kf-thumb-lg { width: 100%; aspect-ratio: 16/10; border-radius: 12px; object-fit: cover; background: #E2E8F0; }
.kf-thumb-placeholder { display: inline-flex; align-items: center; justify-content: center; color: #94A3B8; }
.kf-sticky-actions { position: sticky; bottom: 0; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); padding: .85rem 1.25rem; border-top: 1px solid var(--kf-border); border-radius: 0 0 var(--kf-radius) var(--kf-radius); display: flex; justify-content: flex-end; gap: .5rem; z-index: 5; }
.kf-brand-preview { border-radius: 24px; overflow: hidden; border: 8px solid #0F172A; background: #fff; max-width: 300px; margin: 0 auto; box-shadow: 0 20px 50px rgba(15,23,42,.25); }
.kf-brand-preview-cover { height: 120px; background-size: cover; background-position: center; }
.kf-brand-preview-body { padding: 1rem; }
.kf-brand-preview .btn { width: 100%; }
[data-kf-copy] { cursor: pointer; }
.kf-inline-form { display: inline; }
.kf-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tooltip { font-size: .78rem; }
.kf-tag { display: inline-block; background: #F1F5F9; color: #334155; border-radius: 6px; padding: .2rem .5rem; font-size: .75rem; font-weight: 600; margin: 0 .25rem .25rem 0; }
.kf-number { font-variant-numeric: tabular-nums; }
@media print { .kf-sidebar, .kf-topbar, .kf-footer, .kf-page-actions, .kf-help-fab, .btn { display: none !important; } .kf-main { margin: 0; } }


/* =========================================================
   Açık zeminler için ince kaydırma çubuğu (yardımcı sınıf)
   ========================================================= */
.kf-scroll { scrollbar-width: thin; scrollbar-color: rgba(15,23,42,.2) transparent; }
.kf-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.kf-scroll::-webkit-scrollbar-track { background: transparent; }
.kf-scroll::-webkit-scrollbar-thumb { background-color: rgba(15,23,42,.16); border: 3px solid transparent; background-clip: content-box; border-radius: 999px; min-height: 36px; }
.kf-scroll::-webkit-scrollbar-thumb:hover { background-color: rgba(15,23,42,.3); }
.kf-select-list::-webkit-scrollbar { width: 10px; }
.kf-select-list::-webkit-scrollbar-track { background: transparent; }
.kf-select-list::-webkit-scrollbar-thumb { background-color: rgba(15,23,42,.16); border: 3px solid transparent; background-clip: content-box; border-radius: 999px; }

/* =========================================================
   Yardım balonu (sağ altta sabit) — Bilgi Bankası + WhatsApp
   ========================================================= */
.kf-help-fab { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1055; display: flex; flex-direction: column; align-items: flex-end; gap: .65rem; }
.kf-help-fab-btn {
    position: relative; width: 52px; height: 52px; border: 0; border-radius: 50%; cursor: pointer;
    background: linear-gradient(135deg, var(--kf-primary), var(--kf-primary-dark));
    color: #fff; font-size: 1.3rem; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 24px rgba(37,99,235,.38), 0 2px 6px rgba(15,23,42,.18);
    transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
}
.kf-help-fab-btn:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 30px rgba(37,99,235,.45); }
.kf-help-fab-btn:focus-visible { outline: 3px solid rgba(37,99,235,.35); outline-offset: 3px; }
.kf-help-fab-btn i { transition: opacity .18s, transform .25s; }
.kf-help-fab-btn .kf-help-icon-close { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.8); font-size: 1.05rem; }
.kf-help-fab.open .kf-help-icon-open { opacity: 0; transform: rotate(90deg) scale(.8); }
.kf-help-fab.open .kf-help-icon-close { opacity: 1; transform: rotate(0) scale(1); }
.kf-help-fab-btn .kf-help-pulse { position: absolute; width: 52px; height: 52px; border-radius: 50%; background: rgba(37,99,235,.45); animation: kfHelpPulse 2.6s ease-out infinite; pointer-events: none; }
@keyframes kfHelpPulse { 0% { transform: scale(1); opacity: .55; } 70% { transform: scale(1.55); opacity: 0; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .kf-help-fab-btn .kf-help-pulse { display: none; } .kf-help-fab-btn { transition: none; } }

.kf-help-menu {
    width: 288px; background: #fff; border: 1px solid var(--kf-border); border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15,23,42,.18), 0 2px 8px rgba(15,23,42,.06);
    overflow: hidden; transform-origin: bottom right;
    opacity: 0; visibility: hidden; transform: translateY(10px) scale(.96);
    transition: opacity .18s ease, transform .18s cubic-bezier(.34,1.4,.64,1), visibility .18s;
}
.kf-help-fab.open .kf-help-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.kf-help-menu-head { padding: .95rem 1.1rem .75rem; background: linear-gradient(135deg, #0B1220, #1E293B); color: #fff; }
.kf-help-menu-head strong { display: block; font-size: .92rem; }
.kf-help-menu-head span { font-size: .76rem; color: rgba(255,255,255,.65); }
.kf-help-menu-body { padding: .5rem; }
.kf-help-menu-item { display: flex; align-items: center; gap: .75rem; padding: .65rem .7rem; border-radius: 12px; color: var(--kf-text); transition: background .15s; }
.kf-help-menu-item:hover { background: #F1F5F9; text-decoration: none; color: var(--kf-text); }
.kf-help-menu-icon { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; }
.kf-help-menu-icon.kb { background: rgba(37,99,235,.12); color: var(--kf-primary); }
.kf-help-menu-icon.wa { background: rgba(37,211,102,.14); color: #128C7E; }
.kf-help-menu-text { min-width: 0; line-height: 1.25; }
.kf-help-menu-text b { display: block; font-size: .86rem; font-weight: 600; }
.kf-help-menu-text small { color: var(--kf-muted); font-size: .74rem; }
.kf-help-menu-foot { padding: .55rem 1.1rem .8rem; border-top: 1px solid var(--kf-border); color: var(--kf-muted); font-size: .72rem; }
@media (max-width: 575.98px) {
    .kf-help-fab { right: .9rem; bottom: .9rem; }
    .kf-help-menu { width: calc(100vw - 1.8rem); max-width: 320px; }
}
