/* Nobelexpo Analitik */
:root {
  --red: #d7282f;
  --red-dark: #b81f25;
  --ink: #1f1f1f;
  --ink-2: #3f3f3f;
  --muted: #6b6a66;
  --line: #e3e2dc;
  --bg: #f3f3f1;
  --card: #ffffff;
  --sidebar: #1e1e1f;
  --ok: #0a7d32;
  --warn: #9a6400;
  --err: #b3261e;
  --radius: 10px;
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--red-dark); }
h1, h2, h3 { color: var(--ink-2); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; margin-top: 1.4em; }
code, .code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.code { background: #f5f5f3; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; overflow-x: auto; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; margin: .3em 0 .8em; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: baseline; }

/* ---------- Layout ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; background: var(--sidebar); color: #d9d9d6; display: flex; flex-direction: column; z-index: 30; }
.sidebar-brand { display: flex; gap: 10px; align-items: center; padding: 20px 18px; color: #fff; text-decoration: none; border-bottom: 1px solid #2d2d2f; }
.sidebar-brand small { display: block; color: #a3a29e; font-size: 12px; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.sidebar-nav { padding: 10px 10px; overflow-y: auto; flex: 1; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #858480; padding: 14px 10px 6px; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: #d9d9d6; text-decoration: none; }
.sidebar-nav a:hover { background: #2b2b2d; color: #fff; }
.sidebar-nav a.is-active { background: var(--red); color: #fff; }
.nav-icon { width: 18px; text-align: center; opacity: .9; }
.sidebar-user { padding: 14px 18px; border-top: 1px solid #2d2d2f; }
.user-name { color: #fff; font-weight: 600; }
.user-role { font-size: 12px; color: #a3a29e; }
.user-actions { display: flex; gap: 14px; margin-top: 6px; }
.user-actions a, .user-actions .link-button { color: #d9d9d6; font-size: 13px; }
.content { margin-left: 240px; padding: 24px 32px 60px; max-width: 1500px; }
.nav-toggle { display: none; }
.guest-content { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.crumb a { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.narrow-card { max-width: 520px; }
.danger-zone { border-color: #f0c9c7; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 12px 16px; align-items: end; }
.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)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; border: 0; padding: 0; }
.field > span, .field > legend { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfcec8; border-radius: 7px; padding: 8px 10px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(215, 40, 47, .35); outline-offset: 1px; border-color: var(--red); }
textarea { resize: vertical; }
input[type=file] { padding: 6px; }
.checkbox-field { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 10px; }
label.inline { display: inline-flex; gap: 4px; align-items: center; font-weight: 400; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; border-radius: 7px; padding: 8px 14px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:disabled { opacity: .7; cursor: progress; }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: #cfcec8; }
.btn-ghost:hover { background: #f5f5f3; }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger-ghost { background: #fff; color: var(--err); border-color: #e8b4b0; }
.btn-small { padding: 4px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--red-dark); cursor: pointer; text-decoration: underline; }
.link-button.danger { color: var(--err); }
.inline-form { display: inline; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .inline-form, .row-actions .btn { margin-left: 4px; }

.alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; border: 1px solid; }
.alert ul { margin: 6px 0 0 18px; padding: 0; }
.alert-success { background: #edf7f0; border-color: #b7dfc3; color: #0f4d24; }
.alert-error { background: #fdeeed; border-color: #f0c1bd; color: #7d1a14; }
.alert-warning { background: #fff6e5; border-color: #f1d49b; color: #6b4600; }
.alert-info { background: #eef4fb; border-color: #c3d7ee; color: #1d3f66; }

.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eee; color: #444; }
.badge-ok, .badge-api { background: #e3f3e8; color: #0f5b2a; }
.badge-draft { background: #efeeea; color: #5a5955; }
.badge-error { background: #fbe3e1; color: #8f1d16; }
.badge-manual { background: #fff1d6; color: #7a5000; }
.badge-csv { background: #e5eefa; color: #1f4b80; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a.is-active { color: var(--red-dark); border-color: var(--red); }
.pagination { display: flex; gap: 6px; align-items: center; margin-top: 14px; }
.pagination a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink-2); }
.pagination a.is-active { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table-wrap.narrow { max-width: 720px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid #efeee9; vertical-align: top; }
.data-table tr:hover td { background: #fafaf8; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td.msg { max-width: 460px; font-size: 12.5px; color: var(--ink-2); word-break: break-word; }
.input-table input { padding: 5px 7px; text-align: right; min-width: 90px; font-variant-numeric: tabular-nums; }

/* ---------- Filters ---------- */
.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.filter-row > .field { align-self: flex-end; }
.filter-row .field { flex: 0 1 170px; }
.filter-row .platform-chips { flex: 1 1 360px; }
.platform-chips { display: flex; flex-flow: row wrap; gap: 6px; align-items: center; }
.platform-chips legend { flex: 1 0 100%; width: 100%; margin-bottom: 4px; float: none; }
.platform-chips .hint { flex: 1 0 100%; margin: 4px 0 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid #cfcec8; border-radius: 999px; font-size: 13px; background: #fff; color: var(--muted); user-select: none; }
.chip input:checked + span { border-color: var(--ink-2); color: var(--ink); background: #f5f5f3; font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid rgba(215, 40, 47, .45); outline-offset: 1px; }
.filter-actions { display: flex; gap: 8px; margin-left: auto; align-self: flex-end; }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid #efeee9; }
.preset { padding: 4px 10px; border-radius: 6px; text-decoration: none; color: var(--ink-2); font-size: 13px; }
.preset:hover { background: #f3f3f1; }
.preset.is-active { background: var(--ink-2); color: #fff; }
.range-label { margin-left: auto; color: var(--muted); font-size: 13px; }

/* ---------- Login ---------- */
.login-wrap { width: 100%; max-width: 400px; }
.login-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .08); border: 1px solid var(--line); }
.login-band { background: var(--red); color: #fff; padding: 22px 24px; display: flex; gap: 12px; align-items: center; clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%); padding-bottom: 34px; }
.login-band .brand-mark { background: #fff; color: var(--red); }
.login-band small { display: block; opacity: .85; }
.login-card form { padding: 18px 24px 26px; }

/* ---------- Slides (PDF tasarımı) ---------- */
.deck-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; align-items: start; }
.deck-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.deck-nav a { padding: 6px 10px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; }
.deck-nav a:hover { color: var(--ink); }
.deck-nav a.is-active { border-color: var(--red); color: var(--ink); font-weight: 600; }
.deck { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.slide { background: #fff; aspect-ratio: 16 / 9; width: 100%; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .04); border-radius: 4px; overflow: hidden; scroll-margin-top: 16px; font-size: 16px; color: #2b2b2b; }
.slide-plain { aspect-ratio: auto; }
.slide-head { background: var(--red); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 36px; min-height: 76px; flex: none; }
.slide-brand img { max-height: 48px; max-width: 320px; display: block; }
.brand-word { font-weight: 800; font-size: 44px; letter-spacing: .02em; line-height: 1; text-transform: lowercase; }
.slide-event { display: flex; align-items: center; gap: 18px; font-weight: 800; font-size: 20px; letter-spacing: .05em; text-transform: uppercase; text-align: right; }
.slide-event i { width: 1.5px; height: 36px; background: rgba(255, 255, 255, .85); }
.slide-body { padding: 26px 38px 30px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.slide-body h2 { font-size: 30px; font-weight: 700; color: #3f3f3f; margin-bottom: 14px; letter-spacing: -.01em; }
.slide .prose p { margin: 0 0 .8em; text-align: justify; line-height: 1.65; }
.slide-foot { margin-top: auto; padding-top: 14px; font-size: 14px; color: #3a3a3a; }
.lead-line { margin: 18px 0 10px; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 60px; margin: 28px 0 0 4px; }
.kpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 30px; margin: 10px 0 20px; }
.kpi { padding-left: 38px; position: relative; }
.kpi::before { content: ""; position: absolute; left: 0; top: 10px; width: 26px; height: 26px; border-radius: 3px; background: linear-gradient(145deg, #f25c5c 0%, #d41c1c 55%, #a70f0f 100%); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .5); }
.kpi-value { font-size: 44px; font-weight: 700; color: #3d3d3d; line-height: 1.05; letter-spacing: -.01em; font-variant-numeric: lining-nums; }
.kpi-grid-4 .kpi-value { font-size: 32px; }
.kpi-grid-4 .kpi::before { width: 20px; height: 20px; top: 7px; }
.kpi-grid-4 .kpi { padding-left: 30px; }
.kpi-label { font-size: 17px; color: #3a3a3a; margin-top: 4px; }
.kpi-sub { font-size: 13px; color: #555; margin-top: 4px; }

.funnel { list-style: none; margin: 18px 0 0; padding: 0; font-size: 17px; }
.funnel li { position: relative; padding: 4px 0 4px 26px; }
.funnel li + li { margin-top: 28px; }
.funnel li + li::before { content: "↓"; position: absolute; left: 4px; top: -28px; font-size: 18px; }
.funnel .check { position: absolute; left: 0; top: 4px; }
.funnel strong { margin-right: 4px; }
.funnel-goal { font-size: 19px; }
.funnel-goal .check { color: #e3a008; }

.stat-lines { list-style: none; padding: 0; margin: 0 0 10px; font-size: 18px; line-height: 1.9; }

.pdf-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.pdf-table th { background: #3f3f3f; color: #fff; text-align: left; padding: 6px 10px; font-weight: 700; white-space: nowrap; }
.pdf-table td { padding: 5px 10px; }
.pdf-table tbody tr:nth-child(odd) td { background: #dcdcdc; }
.pdf-table tbody tr:nth-child(even) td { background: #fff; }
.pdf-table tr.total td { font-weight: 700; border-top: 2px solid #3f3f3f; background: #fff; }
.pdf-table.compact { font-size: 12.5px; }
.pdf-table.compact td, .pdf-table.compact th { padding: 3px 8px; }
.pdf-table.large { font-size: 20px; }
.pdf-table.large td, .pdf-table.large th { padding: 6px 10px; }
.slide .table-wrap { margin: 8px 0 16px; }
.star { color: var(--red); }
.geo-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }

.chart-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; flex: 1; min-height: 0; }
.chart-pair figure { margin: 0; display: flex; flex-direction: column; min-height: 0; }
.chart-pair figcaption { font-weight: 700; color: #3f3f3f; margin-bottom: 8px; }
.chart-box { position: relative; flex: 1; min-height: 280px; }

.age-layout { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: 30px; align-items: start; }
.tri-list { list-style: none; padding: 0; margin: 0; }
.tri-list li { position: relative; padding-left: 20px; margin: 6px 0; }
.tri-list li::before { content: "‣"; position: absolute; left: 2px; top: -1px; }
.tri-list.roomy li { margin: 12px 0; font-size: 17px; line-height: 1.55; }
.done-list { list-style: none; padding: 0; margin: 0; columns: 1; font-size: 16px; }
.done-list li { margin: 8px 0; padding-left: 28px; position: relative; }
.done-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 4px; background: #34a853; color: #fff; font-size: 14px; font-weight: 800; display: grid; place-items: center; }

.yt-title { display: flex; align-items: center; gap: 12px; font-size: 40px !important; }
.yt-logo { background: #ff0000; color: #fff; font-size: 22px; width: 58px; height: 40px; border-radius: 10px; display: grid; place-items: center; }

.ga-tables { display: grid; gap: 14px; align-content: start; overflow: auto; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; align-content: start; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #f5f5f3; display: block; }
.gallery figcaption { font-size: 13px; margin-top: 6px; color: #444; display: flex; justify-content: space-between; gap: 8px; }
.admin-gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* Kapak */
.slide-cover { position: relative; }
.cover-band { background: var(--red); color: #fff; height: 62%; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 76%); display: flex; justify-content: center; padding-top: 5%; border-bottom-right-radius: 40% 12%; }
.cover-brand { text-align: center; }
.cover-brand img { max-height: 120px; max-width: 70%; }
.brand-word-xl { font-size: clamp(56px, 9vw, 130px); }
.cover-subtitle { font-weight: 800; font-size: clamp(18px, 2.6vw, 38px); letter-spacing: .06em; margin-top: 6px; }
.cover-dates { font-weight: 700; font-size: clamp(14px, 2vw, 28px); letter-spacing: .1em; margin-top: 3%; }
.cover-title { text-align: center; margin-top: -2%; }
.cover-title p { font-size: clamp(18px, 2.4vw, 34px); margin: 0; color: #333; }
.cover-title h1 { font-size: clamp(20px, 2.8vw, 38px); color: #333; margin: 4px 0 0; }
.cover-footer { position: absolute; left: 3%; right: 3%; bottom: 3%; max-height: 12%; object-fit: contain; width: 94%; }

.empty-state { justify-content: center; align-items: center; text-align: center; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .deck-layout { grid-template-columns: minmax(0, 1fr); }
  .deck-nav { display: none; }
  .slide { aspect-ratio: auto; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .nav-toggle { display: block; position: fixed; top: 10px; left: 10px; z-index: 40; width: 40px; height: 40px; border-radius: 8px; border: 0; background: var(--sidebar); color: #fff; font-size: 18px; }
  .content { margin-left: 0; padding: 60px 16px 40px; }
  .grid-2, .grid-3, .grid-4, .chart-pair, .age-layout { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: auto; }
  .kpi-grid, .kpi-grid-4 { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .slide-head { padding: 10px 16px; flex-wrap: wrap; min-height: 0; }
  .brand-word { font-size: 30px; }
  .slide-event { font-size: 13px; gap: 10px; }
  .slide-event i { height: 20px; }
  .slide-body { padding: 18px 16px 20px; }
  .slide-body h2 { font-size: 22px; }
  .kpi-value { font-size: 32px; }
  .range-label { margin-left: 0; width: 100%; }
  .filter-row .field { flex: 1 1 140px; }
  .cover-band { height: auto; padding: 30px 16px 60px; }
  .cover-title { padding: 10px 16px 30px; }
}

/* ---------- Print / PDF ---------- */
@media print {
  @page { size: 338.67mm 190.5mm; margin: 0; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .nav-toggle, .filters, .page-head, .deck-nav, .alert, .no-print { display: none !important; }
  .content { margin: 0; padding: 0; max-width: none; }
  .deck-layout { display: block; }
  .deck { gap: 0; }
  .slide { width: 338.67mm; height: 190.5mm; aspect-ratio: auto; box-shadow: none; border-radius: 0; break-after: page; page-break-after: always; overflow: hidden; }
  .slide:last-child { break-after: auto; }
}

.brand-preview { display: inline-flex; align-items: center; gap: 12px; background: var(--red); border-radius: 8px; padding: 10px 16px; margin: 6px 0; }
.brand-preview img { max-height: 46px; max-width: 260px; display: block; }
.slide.slide-auto { aspect-ratio: auto; min-height: 320px; }

.demo-chip { position: fixed; right: 14px; bottom: 14px; z-index: 50; background: rgba(215,40,47,.92); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; box-shadow: 0 1px 4px rgba(0,0,0,.25); pointer-events: none; }
@media print { .demo-chip { position: fixed; right: 8mm; bottom: 6mm; background: #d7282f !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

.sync-runner { margin: 8px 0 14px; }
.progress { height: 8px; background: #eceae4; border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.progress-bar { height: 100%; width: 0; background: var(--red); transition: width .25s ease; }
.runner-status { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.runner-log { list-style: none; margin: 12px 0 0; padding: 0; max-height: 220px; overflow-y: auto; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.runner-log li { padding: 4px 8px; border-left: 3px solid var(--line); margin-bottom: 3px; background: #fafaf8; border-radius: 0 4px 4px 0; }
.runner-log li.ok { border-color: var(--ok); }
.runner-log li.err { border-color: var(--err); color: #7d1a14; }
