/* AI Media Studio – yönetim paneli stilleri (harici bağımlılık yok) */
:root, [data-theme="light"] {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --text: #111827;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-soft: #eef2ff;
  --success: #15803d; --success-soft: #dcfce7;
  --warning: #b45309; --warning-soft: #fef3c7;
  --danger: #b91c1c; --danger-soft: #fee2e2;
  --info: #0369a1; --info-soft: #e0f2fe;
  --neutral-soft: #eef1f5;
  --sidebar: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #1e293b;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 12px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #0f172a;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #818cf8;
  --primary-600: #6366f1;
  --primary-soft: #1e1b4b;
  --success: #4ade80; --success-soft: #052e16;
  --warning: #fbbf24; --warning-soft: #422006;
  --danger: #f87171; --danger-soft: #450a0a;
  --info: #38bdf8; --info-soft: #082f49;
  --neutral-soft: #1f2937;
  --sidebar: #070b16;
  --sidebar-text: #94a3b8;
  --sidebar-active: #162033;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; line-height: 1.5; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); padding: 10px; border-radius: 8px; margin: 0; }
.icon { width: 18px; height: 18px; flex: none; }
.icon-sm { width: 14px; height: 14px; }
[hidden] { display: none !important; }

/* Kabuk */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; background: var(--sidebar); color: var(--sidebar-text);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 12px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; padding: 4px 8px 14px; color: #fff; }
.guest .brand { color: var(--text); }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; font-size: 13px; }
.nav-group { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: #64748b; margin: 14px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text); }
.nav-link:hover { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 #818cf8; }
.nav-count { margin-left: auto; background: #f59e0b; color: #111; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.page-title { font-size: 18px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 24px; flex: 1; width: 100%; max-width: 1400px; }
.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 24px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.menu-btn { display: none; }
.inline-form { display: inline; margin: 0; }
.safety-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.safety-pill.safe { background: var(--success-soft); color: var(--success); }
.safety-pill.live { background: var(--danger-soft); color: var(--danger); }
[data-theme="dark"] .theme-light-only, [data-theme="light"] .theme-dark-only, :root:not([data-theme]) .theme-dark-only { display: none; }
.sidebar-backdrop { display: none; }

/* Kartlar ve ızgaralar */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 360px; }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 12px; }
.mb0 { margin-bottom: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; border: 1px dashed var(--border); border-radius: 10px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* Tablolar */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Rozetler ve uyarılar */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.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-neutral { background: var(--neutral-soft); color: var(--muted); }
.badge-info { background: var(--info-soft); color: var(--info); }
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info { background: var(--info-soft); color: var(--info); }
.notice { border-left: 3px solid var(--info); background: var(--info-soft); color: var(--text); padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.notice.warn { border-color: var(--warning); background: var(--warning-soft); }
.notice.danger { border-color: var(--danger); background: var(--danger-soft); }

/* Formlar */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .label { font-weight: 600; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], input[type=date],
input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text); font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 16px; height: 16px; }
form > label.check { display: flex; margin-top: 8px; }
.alert .inline-form { margin-left: 8px; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
[data-theme="dark"] .btn-primary { color: #0b1120; }
.btn-success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-warning { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 160px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 9px 14px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active, .tab:hover { color: var(--text); border-bottom-color: var(--primary); text-decoration: none; }
details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 10px; }

/* Video */
.player { background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 9 / 16; max-height: 72vh; margin: 0 auto; display: flex; }
.player video { width: 100%; height: 100%; object-fit: contain; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.video-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.video-thumb { aspect-ratio: 9 / 16; background: #000; max-height: 300px; }
.video-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card .body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.video-card .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Takvim */
.cal-day { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.cal-day-head { padding: 10px 14px; background: var(--surface-2); font-weight: 600; display: flex; justify-content: space-between; }
.cal-slot { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); }
.cal-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-entry { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.cal-free { color: var(--muted); font-style: italic; }

/* Hosting testi */
.check-row { display: grid; grid-template-columns: 22px minmax(140px, 1fr) minmax(0, 1.2fr) auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.check-row:last-child { border-bottom: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.dot-ok { background: #22c55e; } .dot-warn { background: #f59e0b; } .dot-fail { background: #ef4444; } .dot-info { background: #94a3b8; }

/* Giriş / kurulum */
.guest-wrap { max-width: 760px; margin: 0 auto; padding: 32px 16px; }
.guest-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.auth-card { max-width: 420px; margin: 8vh auto 0; }
.steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.step { padding: 6px 12px; border-radius: 999px; background: var(--neutral-soft); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.step.active { background: var(--primary-soft); color: var(--primary); }
.step.done { background: var(--success-soft); color: var(--success); }

/* Duyarlı düzen */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; }
  .menu-btn { display: inline-grid; }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .safety-pill span, .safety-pill { font-size: 11px; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .stat-value { font-size: 22px; }
  .page-title { font-size: 16px; }
  .safety-pill { display: none; }
  .check-row { grid-template-columns: 18px minmax(0, 1fr); }
  .check-row > :nth-child(3), .check-row > :nth-child(4) { grid-column: 2; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { margin-top: 6px; }
}
.prompt { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; margin: 8px 0; max-height: 320px; overflow: auto; }

/* AŞAMA 3 */
.qc-checklist { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.qc-checklist legend { font-weight: 600; padding: 0 4px; }
.qc-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.qc-item:last-of-type { border-bottom: 0; }
.sheet { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }
.thumb-sm { width: 64px; height: auto; border-radius: 6px; }
.score { font-variant-numeric: tabular-nums; font-weight: 600; }
.flags { display: flex; flex-wrap: wrap; gap: 4px; }
.token-once { word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: 10px; border: 2px dashed var(--warning, #d97706); border-radius: 8px; }
.project-switch { display: flex; align-items: center; gap: 6px; }
.project-switch select { max-width: 200px; }
.est { font-style: italic; }
.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; }
@media (max-width: 720px) { .project-switch select { max-width: 130px; } }
.input-xs { width: 5.5rem; min-width: 0; }
.text-danger { color: var(--danger); }

/* Montaj ajanı ilerleme çubuğu */
.pbar { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; min-width: 80px; margin-top: 3px; }
.pbar > span { display: block; height: 100%; background: var(--primary, #2563eb); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #94a3b8; }
.dot.on { background: #16a34a; }
