:root {
  --navy: #0F1B3D; --navy-2: #1B2A57; --accent: #FF5A1F; --accent-d: #E2460E;
  --bg: #F3F4F7; --card: #FFFFFF; --line: #E3E5EA; --text: #0F1B3D; --muted: #5B6478;
  --ok: #0CA678; --err: #D6336C; --warn: #F59F00;
  --r: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 61, .06), 0 6px 18px rgba(15, 27, 61, .05);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--navy-2); }
a:hover { color: var(--accent-d); }
h1 { font-size: 1.55rem; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
code { font: 12px/1.4 ui-monospace, Consolas, monospace; background: #EEF0F4; padding: 1px 5px; border-radius: 5px; }
.small { font-size: .82rem; }
.muted { color: var(--muted); }

/* Üst çubuk */
.top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 24px; padding: 10px 24px; flex-wrap: wrap; }
.top__logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; }
.top__logo span { font-size: .8rem; opacity: .7; border-left: 1px solid rgba(255,255,255,.3); padding-left: 10px; }
.top__nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.top__nav a { color: rgba(255,255,255,.8); text-decoration: none; padding: 8px 12px; border-radius: 8px; }
.top__nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.top__nav a.is-on { background: rgba(255,255,255,.14); color: #fff; }
.top__user { display: flex; align-items: center; gap: 12px; margin: 0; font-size: .85rem; color: rgba(255,255,255,.8); }
.top .btn--ghost { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 24px 24px 64px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.head--sm h2 { margin: 0; }
.crumbs { margin: 0 0 4px; font-size: .85rem; }
.crumbs a { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; overflow-x: auto; }
.narrow { max-width: 560px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid2 > .card { margin-bottom: 20px; }

/* Sayılar */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 8px 0 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.7rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat--ok b { color: var(--ok); }
.stat--bad b { color: var(--err); }

/* Tablo */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-muted td { opacity: .55; }
.table td.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #ADB5BD; margin-right: 6px; vertical-align: middle; flex: none; }
.dot--on { background: var(--ok); box-shadow: 0 0 0 3px rgba(12,166,120,.18); }
.dot--off { background: var(--err); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: #EEF0F4; color: var(--muted); }
.badge--aktif { background: #E6F7F1; color: #087F5B; }
.badge--pasif { background: #FFF0F3; color: #A61E4D; }

/* Form */
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .88rem; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--text); border: 1px solid #CDD2DB; border-radius: 9px; padding: 9px 11px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(255,90,31,.35); border-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { background: #F6F7F9; }
.stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid__full { grid-column: 1 / -1; }
.filters { display: flex; gap: 10px; margin: 0 0 16px; flex-wrap: wrap; }
.filters input { flex: 1 1 240px; width: auto; }
.filters select { flex: 0 1 240px; width: auto; }
form.inline { display: flex; gap: 6px; align-items: center; margin: 0; }
form.inline input { width: 150px; padding: 6px 9px; }
.code-input { font-size: 2rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 9px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--accent-d); border-color: var(--accent-d); color: #fff; }
.btn--ghost { background: #fff; color: var(--navy); border-color: #CDD2DB; }
.btn--ghost:hover { background: #F3F4F7; color: var(--navy); border-color: #B8BFCB; }
.btn--danger { background: #fff; color: var(--err); border-color: #F3B6C8; }
.btn--danger:hover { background: var(--err); color: #fff; border-color: var(--err); }
.btn--sm { padding: 5px 11px; font-size: .82rem; }

.alert { background: #FFF0F3; color: #A61E4D; border: 1px solid #FCC2D7; border-radius: 9px; padding: 10px 14px; }
.flash { background: #E6F7F1; color: #087F5B; border: 1px solid #96F2D7; border-radius: 9px; padding: 10px 14px; margin: 0 0 16px; }
.danger-zone { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-top: 1px dashed var(--line); margin-top: 18px; padding-top: 16px; }

.dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0; }
.dl dt { color: var(--muted); font-size: .85rem; }
.dl dd { margin: 0; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.links { line-height: 2; }

/* 14 günlük çubuk grafik (yüzde sınıfları: CSP inline style'a izin vermiyor) */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 6px 0 0; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars__bar { width: 100%; max-width: 28px; background: var(--ok); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars__lbl { font-size: .7rem; color: var(--muted); }
.h0 { height: 2px; background: #DEE2E6; } .h5 { height: 5%; } .h10 { height: 10%; } .h15 { height: 15%; } .h20 { height: 20%; }
.h25 { height: 25%; } .h30 { height: 30%; } .h35 { height: 35%; } .h40 { height: 40%; } .h45 { height: 45%; } .h50 { height: 50%; }
.h55 { height: 55%; } .h60 { height: 60%; } .h65 { height: 65%; } .h70 { height: 70%; } .h75 { height: 75%; } .h80 { height: 80%; }
.h85 { height: 85%; } .h90 { height: 90%; } .h95 { height: 95%; } .h100 { height: 100%; }
.h5, .h10, .h15, .h20, .h25, .h30, .h35, .h40, .h45, .h50, .h55, .h60, .h65, .h70, .h75 { background: var(--warn); }
.h5, .h10, .h15, .h20, .h25 { background: var(--err); }

/* Giriş */
.login { max-width: 400px; margin: 8vh auto 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 32px; }
.login h1 { margin-top: 18px; }

@media (max-width: 760px) {
  .wrap { padding: 16px 16px 48px; }
  .top { padding: 10px 16px; gap: 10px; }
  .top__user span { display: none; }
  .grid2, .form-grid { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { display: block; border: 0; padding: 2px 4px; }
  .table td.actions { display: flex; }
}

/* ---- Muhasebe ---- */
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.table tfoot td { border-top: 2px solid var(--line); font-weight: 600; padding: 10px; }
.pos { color: #087F5B; }
.neg { color: #A61E4D; }
.mt { margin-top: 12px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.notice { background: #EDF2FF; color: #364FC7; border: 1px solid #BAC8FF; border-radius: 9px; padding: 10px 14px; margin: 0 0 16px; }
.notice--warn { background: #FFF9DB; color: #8F6B00; border-color: #FFE066; }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.span2 { grid-column: span 2; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; display: grid; gap: 12px; }
.box legend { font-weight: 700; padding: 0 6px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
label.check input { width: auto; }
.w-xs { width: 70px; } .w-sm { width: 120px; }
.lines td { padding: 6px 4px; vertical-align: middle; }
.lines input, .lines select { padding: 7px 8px; }
.lines td:first-child { min-width: 260px; }
.totals { display: flex; justify-content: flex-end; margin-top: 16px; }
.totals dl { display: grid; grid-template-columns: auto auto; gap: 6px 24px; margin: 0; min-width: 300px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 1.15rem; font-weight: 700; color: var(--navy); border-top: 2px solid var(--line); padding-top: 6px; }
.dl--num dd { text-align: right; font-variant-numeric: tabular-nums; }
.actions-card { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; overflow: visible; }
.actions-card form { margin: 0; }
.cancel-box summary { list-style: none; }
.cancel-box summary::-webkit-details-marker { display: none; }
.cancel-box[open] { flex-basis: 100%; }
.badge--taslak { background: #F1F3F5; color: #495057; }
.badge--onaylandi { background: #E7F5FF; color: #1864AB; }
.badge--gonderiliyor, .badge--gonderildi { background: #EDF2FF; color: #364FC7; }
.badge--kabul { background: #E6F7F1; color: #087F5B; }
.badge--red, .badge--hata, .badge--iptal { background: #FFF0F3; color: #A61E4D; }
details summary { cursor: pointer; }
@media (max-width: 760px) {
  .form-grid--3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .lines td:first-child { min-width: 0; }
  .totals dl { min-width: 0; width: 100%; }
}
@media print {
  .top, .filters, .actions-card, .row-btns, form, details { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
}

/* ---- Kampanya / kreatif ---- */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.thumbs--sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.thumb { display: grid; gap: 4px; text-decoration: none; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; position: relative; font-weight: 400; }
.thumb:hover { border-color: var(--accent); color: var(--text); }
.thumb__media { position: relative; display: block; aspect-ratio: 16 / 9; background: #0F1B3D; border-radius: 6px; overflow: hidden; }
.thumb__media img, .thumb__media video { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb__play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.6rem; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.thumb b { font-size: .9rem; }
.thumb--check { cursor: pointer; }
.thumb--check input { position: absolute; top: 14px; left: 14px; width: 20px; height: 20px; z-index: 2; accent-color: var(--accent); }
.thumb--check:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: #FFF6F2; }
.screen16x9 { aspect-ratio: 16 / 9; background: #0F1B3D; border-radius: 8px; overflow: hidden; }
.screen16x9 img, .screen16x9 video { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 16px; align-items: start; }
.preview__frame { aspect-ratio: 16 / 9; background: #0F1B3D; border-radius: 8px; overflow: hidden; }
.preview__frame img, .preview__frame video { width: 100%; height: 100%; object-fit: contain; }
.preview__info { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.preview__info .warn { color: #8F6B00; font-weight: 600; }
.screen-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.sgroup { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; display: grid; gap: 4px; }
.sgroup legend { padding: 0 4px; }
.sitem { font-weight: 400; display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.sitem__name { flex: 1; min-width: 0; }
.sitem.is-full { opacity: .5; }
.occ { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.occ__bar { width: 48px; height: 6px; border-radius: 3px; background: #E9ECEF; position: relative; overflow: hidden; }
.occ__bar::after { content: ""; position: absolute; inset: 0 auto 0 0; background: var(--ok); }
.o0::after { width: 0; } .o1::after { width: 12.5%; } .o2::after { width: 25%; } .o3::after { width: 37.5%; } .o4::after { width: 50%; }
.o5::after { width: 62.5%; background: var(--warn); } .o6::after { width: 75%; background: var(--warn); } .o7::after { width: 87.5%; background: var(--warn); } .o8::after { width: 100%; background: var(--err); }
.badge--cr-beklemede { background: #FFF9DB; color: #8F6B00; }
.badge--cr-onayli { background: #E6F7F1; color: #087F5B; }
.badge--cr-red { background: #FFF0F3; color: #A61E4D; }
.badge--k-yayinda { background: #E6F7F1; color: #087F5B; }
.badge--k-aktif { background: #E7F5FF; color: #1864AB; }
.badge--k-durduruldu { background: #FFF9DB; color: #8F6B00; }
.badge--st-yayinda { background: #E6F7F1; color: #087F5B; }
.badge--st-dolu, .badge--st-sektor { background: #FFF0F3; color: #A61E4D; }
.bars__bar.bars__bar--plain { background: var(--navy-2); }
.playlist { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.playlist__slot { border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: .8rem; display: grid; gap: 4px; min-width: 0; }
.playlist__slot b { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.playlist__slot--promo { background: #F8F9FA; color: var(--muted); }
.playlist__slot--ad { border-color: var(--accent); background: #FFF6F2; }
.playlist__slot a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .preview { grid-template-columns: 1fr; }
  .playlist { grid-template-columns: repeat(4, 1fr); }
  .screen-groups { grid-template-columns: 1fr; }
}
