/* Kumo (Cloudflare) semantik tokenları — Mistik Yuva teması */
:root {
  --kumo-canvas: oklch(98.75% 0 0);
  --kumo-elevated: oklch(98% 0 0);
  --kumo-recessed: oklch(96% 0 0);
  --kumo-base: #fff;
  --kumo-tint: oklch(97% 0 0);
  --kumo-hairline: oklch(93.5% 0 0);
  --kumo-line: oklch(14.5% 0 0 / 0.1);
  --kumo-control-line: oklch(14.5% 0 0 / 0.14);
  --text-default: oklch(21% 0.006 285.885);
  --text-strong: oklch(14.5% 0 0);
  --text-subtle: oklch(55.6% 0 0);
  --text-muted: oklch(37.1% 0 0);
  --kumo-brand: oklch(0.52 0.21 295);
  --kumo-brand-hover: oklch(0.46 0.21 295);
  --kumo-brand-tint: oklch(0.96 0.025 295);
  --kumo-brand-ink: oklch(0.42 0.2 295);
  --kumo-success: oklch(59.6% 0.145 163.225);
  --text-success: oklch(43.2% 0.095 166.913);
  --kumo-success-tint: oklch(96.2% 0.043 156.7 / 0.8);
  --text-warning: oklch(52% 0.13 57.5);
  --kumo-warning-tint: oklch(93.1% 0.107 94.6 / 0.45);
  --text-danger: oklch(50.5% 0.213 27.518);
  --kumo-danger-tint: oklch(93.6% 0.032 17.7 / 0.6);
  --kumo-info-tint: oklch(93.2% 0.032 255.585 / 0.7);
  --text-info: oklch(42.4% 0.199 265.638);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--kumo-canvas); color: var(--text-default); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--kumo-brand-ink); text-decoration: none; }
a:hover { color: var(--kumo-brand-hover); text-decoration: underline; }
h1 { margin: 0; font-size: 22px; font-weight: 600; color: var(--text-strong); }
p { margin: 0; }
.mono { font-family: var(--mono); }
.subtle { color: var(--text-subtle); }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Layout */
.app { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--kumo-elevated); border-right: 1px solid var(--kumo-hairline); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.brand { display: flex; gap: 9px; align-items: center; padding: 6px 8px 14px; }
.brand { flex-direction: column; align-items: flex-start; gap: 2px; }
.brand-logo { display: block; width: 152px; height: auto; }
.brand-sub { padding-left: 4px; }
.brand-name { font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.brand-sub { font-size: 11px; color: var(--text-subtle); }
.nav-item { display: flex; gap: 10px; align-items: center; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--text-muted); font-size: 14px; }
.nav-item i { font-size: 17px; }
.nav-item:hover { background: var(--kumo-recessed); color: var(--text-strong); text-decoration: none; }
.nav-item.is-active { background: oklch(94% 0 0); color: var(--text-strong); font-weight: 500; }
.sidebar-user { display: flex; gap: 10px; align-items: center; padding: 10px 8px 4px; border-top: 1px solid var(--kumo-hairline); }
.sidebar-user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; font-weight: 500; }
.sidebar-user-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-meta .sub { font-size: 11px; font-weight: 400; color: var(--text-subtle); }
.sidebar-user form { margin: 0; }
.main { min-width: 0; padding: 28px 36px 60px; display: flex; flex-direction: column; gap: 24px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-header p { color: var(--text-subtle); }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { flex-direction: row; flex: 1 1 100%; order: 3; overflow-x: auto; }
  .sidebar-user { border: 0; padding: 0; margin-left: auto; }
  .sidebar-user-meta { display: none; }
  .brand { padding: 4px; }
  .main { padding: 20px 16px 48px; }
}

.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--kumo-brand-tint); color: var(--kumo-brand-ink); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.icon-btn { width: 30px; height: 30px; border: 0; background: transparent; border-radius: 6px; color: var(--text-muted); display: grid; place-items: center; font-size: 16px; cursor: pointer; }
.icon-btn:hover { background: var(--kumo-recessed); text-decoration: none; }
.icon-btn.danger { color: var(--text-danger); }
.icon-btn.danger:hover { background: var(--kumo-danger-tint); }

/* Button */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--kumo-line); background: var(--kumo-base); color: var(--text-default); font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; box-shadow: 0 1px 2px oklch(0% 0 0 / .05); text-decoration: none !important; }
.btn:hover { background: var(--kumo-tint); color: var(--text-default); }
.btn-primary { background: var(--kumo-brand); border-color: transparent; color: #fff; box-shadow: none; }
.btn-primary:hover { background: var(--kumo-brand-hover); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible, a:focus-visible { outline: 2px solid var(--text-strong); outline-offset: 2px; }

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.field-hint { font-weight: 400; font-size: 12px; color: var(--text-subtle); }
.input { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--kumo-control-line); background: #fff; font-family: inherit; font-size: 14px; font-weight: 400; color: var(--text-default); outline: none; min-width: 0; }
textarea.input { height: auto; min-height: 80px; padding: 8px 12px; resize: vertical; }
.input:focus { border-color: var(--kumo-brand); box-shadow: 0 0 0 3px oklch(0.52 0.21 295 / .15); }
.input-group { display: flex; gap: 6px; }
.input-group .input { flex: 1; }
.search { position: relative; display: flex; margin: 0; }
.search i { position: absolute; left: 10px; top: 10px; color: var(--text-subtle); }
.search .input { width: 240px; padding-left: 32px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.check { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--kumo-control-line); border-radius: 8px; font-weight: 400; font-size: 14px; cursor: pointer; }
.check:has(input:checked) { border-color: var(--kumo-brand); background: oklch(0.97 0.015 295); }
.check input { accent-color: var(--kumo-brand); width: 16px; height: 16px; margin: 0; }

/* LayerCard */
.layer { background: var(--kumo-recessed); border: 1px solid var(--kumo-hairline); border-radius: 14px; padding: 4px; }
.layer-head { padding: 8px 10px 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.layer-head strong { font-weight: 600; }
.layer-body { background: var(--kumo-base); border: 1px solid var(--kumo-hairline); border-radius: 10px; }
.layer-body.pad { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

/* Banner / Badge / Toast */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 13px; }
.banner i { font-size: 17px; margin-top: 1px; }
.banner-info { background: var(--kumo-info-tint); color: var(--text-info); }
.banner-danger { background: var(--kumo-danger-tint); color: var(--text-danger); }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--kumo-recessed); color: oklch(26.9% 0 0); white-space: nowrap; font-weight: 500; }
.badge-success { background: var(--kumo-success-tint); color: var(--text-success); }
.badge-warning { background: var(--kumo-warning-tint); color: var(--text-warning); }
.badge-danger { background: var(--kumo-danger-tint); color: var(--text-danger); }
.badge-info { background: var(--kumo-info-tint); color: var(--text-info); }
.badge-brand { background: var(--kumo-brand-tint); color: var(--kumo-brand-ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 12px; border-radius: 999px; border: 1px solid oklch(0.52 0.21 295 / .35); background: var(--kumo-brand-tint); color: var(--kumo-brand-ink); font-size: 13px; font-weight: 500; }
.chip:hover { text-decoration: none; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; background: var(--text-strong); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px; display: flex; gap: 8px; align-items: center; box-shadow: 0 10px 30px oklch(0% 0 0 / .2); max-width: calc(100% - 40px); }
.toast-success i { color: oklch(76.5% 0.177 163.223); }
.toast-error i { color: oklch(70.4% 0.191 22.216); }

/* Table */
.table-wrap { border: 1px solid var(--kumo-hairline); border-radius: 12px; background: #fff; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-subtle); background: var(--kumo-elevated); padding: 10px 12px; border-bottom: 1px solid var(--kumo-hairline); }
td { padding: 12px; border-bottom: 1px solid var(--kumo-hairline); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .sub { display: block; font-size: 12px; color: var(--text-subtle); }
.actions { display: flex; gap: 2px; justify-content: flex-end; }
.actions form { margin: 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--kumo-hairline); border-radius: 12px; background: #fff; overflow: hidden; }
.stat { padding: 16px 18px; border-right: 1px solid var(--kumo-hairline); display: flex; flex-direction: column; gap: 6px; }
.stat:last-child { border-right: 0; }
.stat span { font-size: 13px; color: var(--text-subtle); }
.stat strong { font-size: 24px; font-weight: 600; color: var(--text-strong); }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.list-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--kumo-hairline); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Course cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.card-cover { height: 120px; border-radius: 10px; display: grid; place-items: center; font-size: 40px; background: var(--kumo-brand-tint); color: var(--kumo-brand-ink); }
.card-cover.c1 { background: oklch(0.95 0.04 165); color: oklch(0.45 0.1 165); }
.card-cover.c2 { background: oklch(0.95 0.04 70); color: oklch(0.48 0.12 60); }
.card-cover { height: auto; aspect-ratio: 16/9; }
.card-cover.has-img { position: relative; overflow: hidden; background: var(--kumo-recessed); }
.card-cover.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card-cover.has-img:hover img { transform: scale(1.03); }
.play-badge { position: relative; width: 48px; height: 48px; border-radius: 50%; background: oklch(100% 0 0 / .92); color: var(--text-strong); display: grid; place-items: center; font-size: 20px; box-shadow: 0 4px 16px oklch(0% 0 0 / .2); }
.card-body { margin-top: 4px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--text-strong); }
.meter { height: 6px; border-radius: 3px; background: var(--kumo-recessed); overflow: hidden; }
.meter > div { height: 100%; background: var(--kumo-brand); border-radius: 3px; }

/* Watch */
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-subtle); }
.crumbs a { color: var(--text-subtle); }
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .watch { grid-template-columns: 1fr; } }
.player { aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: oklch(12% 0 0); position: relative; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watermark { position: absolute; bottom: 52px; right: 14px; z-index: 2; pointer-events: none; font: 11px var(--mono); color: oklch(100% 0 0 / .4); }
.lessons { padding: 4px; display: flex; flex-direction: column; }
.lesson { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 7px; color: var(--text-strong); }
.lesson:hover { background: var(--kumo-tint); color: var(--text-strong); text-decoration: none; }
.lesson.is-active { background: var(--kumo-brand-tint); font-weight: 600; }
.lesson i { font-size: 18px; margin-top: 1px; color: oklch(70.8% 0 0); }
.lesson.is-done i { color: var(--kumo-success); }
.lesson.is-active i { color: var(--kumo-brand); }
.lesson small { display: block; font-size: 12px; font-weight: 400; color: var(--text-subtle); }

/* Segmented tabs */
.tabs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 9px; background: var(--kumo-recessed); flex-wrap: wrap; align-self: flex-start; }
.tabs a { height: 30px; padding: 0 12px; display: flex; align-items: center; border-radius: 7px; font-size: 13px; font-weight: 500; color: oklch(43.9% 0 0); }
.tabs a:hover { text-decoration: none; color: var(--text-strong); }
.tabs a.is-active { background: #fff; color: var(--text-strong); box-shadow: 0 1px 2px oklch(0% 0 0 / .08); }

/* Dialog */
dialog { border: 1px solid var(--kumo-line); border-radius: 14px; padding: 0; width: min(480px, calc(100% - 32px)); max-height: calc(100% - 32px); box-shadow: 0 20px 50px oklch(0% 0 0 / .18); color: var(--text-default); }
dialog::backdrop { background: oklch(0% 0 0 / .35); }
.dlg-head { padding: 18px 20px 4px; display: flex; flex-direction: column; gap: 4px; }
.dlg-head strong { font-size: 16px; font-weight: 600; }
.dlg-head .ph-check-circle { color: var(--kumo-success); font-size: 20px; }
.dlg-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.dlg-foot { padding: 14px 20px; border-top: 1px solid var(--kumo-hairline); background: var(--kumo-elevated); display: flex; justify-content: flex-end; gap: 8px; }
.creds { border: 1px solid var(--kumo-hairline); border-radius: 10px; background: var(--kumo-elevated); font: 13px var(--mono); }
.creds div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--kumo-hairline); }
.creds div:last-child { border-bottom: 0; }
.creds span:first-child { color: var(--text-subtle); }
.creds span:last-child { word-break: break-all; text-align: right; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.auth-brand { display: flex; justify-content: center; align-items: center; gap: 10px; }
.auth-logo { display: block; width: 240px; max-width: 70%; height: auto; }
.empty { padding: 40px 20px; text-align: center; color: var(--text-subtle); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty i { font-size: 28px; color: oklch(70.8% 0 0); }

/* v4: kapak, dosyalar */
.thumb { width: 64px; aspect-ratio: 16/9; flex: none; border-radius: 6px; object-fit: cover; background: var(--kumo-recessed); }
.thumb-lg { width: 128px; aspect-ratio: 16/9; flex: none; border-radius: 8px; object-fit: cover; background: var(--kumo-recessed); border: 1px solid var(--kumo-hairline); }
.thumb-empty { display: grid; place-items: center; color: oklch(70.8% 0 0); font-size: 18px; }
.cover-field { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; }
.file-input { font: inherit; font-size: 13px; font-weight: 400; max-width: 100%; }
.file-input::file-selector-button { font: inherit; font-weight: 500; height: 30px; padding: 0 10px; margin-right: 10px; border-radius: 7px; border: 1px solid var(--kumo-line); background: #fff; cursor: pointer; }
.file-list { border: 1px solid var(--kumo-hairline); border-radius: 8px; }
.file-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--kumo-hairline); font-weight: 400; font-size: 13px; }
.file-row:last-child { border-bottom: 0; }
.file-row .grow { flex: 1; min-width: 0; }
.file-row > i, .file-ico { color: var(--text-danger); font-size: 18px; }
.lesson-thumb { position: relative; width: 72px; aspect-ratio: 16/9; flex: none; border-radius: 5px; overflow: hidden; background: var(--kumo-recessed); }
.lesson-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lesson .lesson-thumb i { position: absolute; right: 3px; bottom: 3px; margin: 0; font-size: 15px; background: #fff; border-radius: 50%; }
@media (max-width: 760px) { .brand-logo { width: 110px; } .brand-sub { display: none; } }
.card-cover.placeholder { background: oklch(97.5% 0.008 20); }
.card-cover.placeholder img { width: 38%; height: auto; opacity: .85; }
.sidebar .brand { flex-direction: column !important; align-items: flex-start !important; }
