:root {
  --bg: #070c18; --bg2: #0b1324; --panel: #0f1a30; --panel2: #13203b; --line: #1f2d4d; --line2: #2a3b62;
  --text: #e7edf9; --muted: #8b9bbd; --dim: #5d6d91;
  --accent: #2dd4bf; --accent2: #0ea5a0; --gold: #f5c451; --red: #f43f5e; --green: #22c55e; --amber: #f59e0b;
  --radius: 14px; --shadow: 0 10px 30px rgba(0,0,0,.35);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: radial-gradient(1200px 600px at 10% -10%, #13234a 0%, transparent 60%), var(--bg); color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.num, td.n, .kpi b { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px 48px; }

/* üst bar */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); background: rgba(7,12,24,.78);
  border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: .3px; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: conic-gradient(from 200deg, var(--accent), var(--gold), var(--accent));
  box-shadow: 0 0 24px rgba(45,212,191,.35); }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.spacer { flex: 1; }
select, input, textarea { background: var(--bg2); color: var(--text); border: 1px solid var(--line2); border-radius: 10px;
  padding: 8px 10px; font: inherit; min-width: 0; }
input[type=number], input.num { font-variant-numeric: tabular-nums; }
select:focus, input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }

.btn { border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 700; cursor: pointer; font: inherit; font-weight: 700;
  background: var(--accent); color: #032a26; transition: transform .08s, filter .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line2); }
.btn.danger { background: var(--red); color: #fff; }
.btn.gold { background: var(--gold); color: #2b1d00; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: .3px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--green); background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.3); }
.pill.warn { color: var(--amber); background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); }
.pill.bad { color: var(--red); background: rgba(244,63,94,.1); border-color: rgba(244,63,94,.35); }
.pill.info { color: var(--accent); background: rgba(45,212,191,.08); border-color: rgba(45,212,191,.3); }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 20px 0; }
.kpi { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi b { display: block; font-size: 22px; margin-top: 2px; letter-spacing: -.3px; }
.kpi.bad b { color: var(--red); } .kpi.good b { color: var(--green); } .kpi.gold b { color: var(--gold); }

/* sekmeler */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { background: none; border: 0; color: var(--muted); padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.tab[aria-selected=true] { color: var(--text); border-color: var(--accent); }
.panel[hidden] { display: none; }

.grid2 { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 18px; align-items: start; }
.grid-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.grid2 > * { min-width: 0; }
.grid2.even { grid-template-columns: 1fr 1fr; }
body { overflow-x: hidden; }
@media (max-width: 900px) { .grid2, .grid2.even { grid-template-columns: 1fr; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card h3 .muted { font-weight: 500; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1; }
.row > .btn { flex: 0 0 auto; }
.row > label { min-width: 180px; }

/* tablolar */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--dim); background: var(--bg2); position: sticky; top: 0; }
td.n, th.n { text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.02); }
tr.zarar td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.hedefalti td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.neg { color: var(--red); } .pos { color: var(--green); } .gold { color: var(--gold); }

.score { display: inline-flex; align-items: center; gap: 8px; }
.score i { display: inline-block; height: 6px; width: 70px; border-radius: 4px; background: var(--line2); overflow: hidden; position: relative; }
.score i::after { content: ""; position: absolute; inset: 0; width: var(--w); background: var(--c, var(--accent)); }

/* büyük sonuç kartları */
.big { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.bigcard { border-radius: var(--radius); padding: 16px; background: var(--panel2); border: 1px solid var(--line2); }
.bigcard span { font-size: 12px; color: var(--muted); }
.bigcard b { display: block; font-size: 26px; margin-top: 4px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.bigcard p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.bigcard.bad { background: linear-gradient(160deg, rgba(244,63,94,.18), var(--panel2)); border-color: rgba(244,63,94,.4); }
.bigcard.bad b { color: #ff8197; }
.bigcard.good { background: linear-gradient(160deg, rgba(34,197,94,.14), var(--panel2)); border-color: rgba(34,197,94,.35); }
.bigcard.good b { color: #5ee08e; }
.bigcard.gold b { color: var(--gold); }
.messages { display: grid; gap: 8px; margin: 10px 0 16px; }
.msg { padding: 10px 14px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line2); }
.msg.bad { border-color: rgba(244,63,94,.45); color: #ffb3c0; }

.waterfall td:last-child { font-family: var(--mono); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { border: 1px dashed var(--line2); background: transparent; color: var(--muted); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.camp-list { display: grid; gap: 8px; }
.camp { text-align: left; width: 100%; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; }
.camp[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.camp .t { font-weight: 700; } .camp .s { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--accent); color: #032a26; }
.hash { font-family: var(--mono); font-size: 11px; color: var(--dim); }

/* toast */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line2); box-shadow: var(--shadow); animation: in .2s ease-out; }
.toast.bad { border-color: rgba(244,63,94,.5); } .toast.good { border-color: rgba(34,197,94,.5); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }

/* Buzlanmış Kayıp Uyarısı (eklenti bandının web önizlemesi) */
.frost { position: relative; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-radius: 16px; color: #eef3ff;
  background: linear-gradient(135deg, rgba(40,58,104,.55), rgba(18,24,44,.5)); backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%); border: 1px solid rgba(160,190,255,.28);
  box-shadow: 0 18px 50px rgba(5,10,30,.45), inset 0 1px 0 rgba(255,255,255,.12); }
.frost .ice { font-size: 26px; filter: drop-shadow(0 0 10px rgba(140,200,255,.7)); }
.frost .txt { flex: 1; min-width: 220px; } .frost .txt b { font-size: 14px; } .frost .txt div { opacity: .85; font-size: 13px; }
.frost .k { display: flex; gap: 10px; flex-wrap: wrap; }
.frost .k div { min-width: 120px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); text-align: center; }
.frost .k b { display: block; font-size: 16px; color: #ffd27a; } .frost .k span { font-size: 11px; opacity: .8; }
.frost-stage { position: relative; border-radius: 16px; overflow: hidden; padding: 16px; min-height: 260px;
  background: repeating-linear-gradient(0deg, #f4f6fb 0 38px, #e9edf6 38px 39px); }
.frost-stage .fake { position: absolute; inset: 0; padding: 70px 18px 18px; color: #39425a; font-size: 12px; filter: blur(1.5px); }
.frost-stage .fake div { height: 30px; margin-bottom: 9px; border-radius: 8px; background: rgba(255,255,255,.75); border: 1px solid #dde3ef; }

.lockbar { margin: 16px 0 0; }
.footer { color: var(--dim); font-size: 12px; text-align: center; padding: 24px 0 8px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
textarea { width: 100%; resize: vertical; min-height: 54px; }
@media (max-width: 640px) {
  .wrap { padding: 0 16px 40px; }
  .bigcard b { font-size: 22px; }
  .kpi b { font-size: 19px; }
}

/* Faz 2: çoklu işletme geçiş çubuğu, kota bandı, karne */
.ws-bar { display: flex; gap: 10px; overflow-x: auto; padding: 18px 0 4px; scrollbar-width: thin; }
.ws { flex: 0 0 236px; text-align: left; border: 1px solid var(--line2); background: var(--panel); color: var(--text);
  border-radius: 14px; padding: 12px 14px; cursor: pointer; font: inherit; display: grid; gap: 6px; }
.ws[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); }
.ws .t { font-weight: 800; font-size: 13px; line-height: 1.3; }
.ws .r { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 11px; color: var(--muted); }
.tier { font-size: 10px; font-weight: 900; letter-spacing: .6px; padding: 2px 8px; border-radius: 6px; }
.tier.LITE { background: rgba(148,163,184,.18); color: #cbd5e1; }
.tier.MEDIUM { background: rgba(45,212,191,.16); color: var(--accent); }
.tier.PRO { background: rgba(245,196,81,.18); color: var(--gold); }
.sku { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--text); }
.sku.KOTA_DOLUYOR { color: var(--amber); } .sku.KOTA_ASILDI { color: var(--red); }
.kota { margin-top: 14px; padding: 12px 16px; border-radius: 12px; border: 1px solid; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.kota.KOTA_DOLUYOR { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.4); color: #fcd38a; }
.kota.KOTA_ASILDI { background: rgba(244,63,94,.12); border-color: rgba(244,63,94,.45); color: #ffb3c0; }
.kota b { color: var(--text); }

/* Faz 3: talep kartları, mesaj dizisi, şalterler, müşteri paneli */
.talep { border-left: 3px solid var(--line2); }
.talep.GUVENLIK_FRENI_BEKLIYOR { border-left-color: var(--red); }
.talep.OPERATOR_INCELIYOR, .talep.ILETILDI { border-left-color: var(--amber); }
.talep.OTOMASYON_UYGULADI, .talep.TAMAMLANDI { border-left-color: var(--green); }
.threads { display: grid; gap: 6px; margin-top: 10px; }
.thread { max-width: 86%; padding: 8px 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line2); font-size: 13px; white-space: pre-wrap; }
.thread.ben { justify-self: end; background: rgba(45,212,191,.12); border-color: rgba(45,212,191,.35); }
.thread .who { display: block; font-size: 10px; color: var(--muted); margin-bottom: 2px; white-space: normal; }
.switches { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.sw { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.sw input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line2); position: relative; cursor: pointer; padding: 0; border: 0; transition: background .15s; }
.sw input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.sw input:checked { background: var(--accent); }
.sw input:checked::after { left: 19px; }
.sw input:disabled { opacity: .45; cursor: not-allowed; }
.golge-bant { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(245,196,81,.12); border: 1px solid rgba(245,196,81,.45); color: #fde7a8; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; margin-left: 6px; }
.golge-bant[hidden], [hidden] { display: none !important; }
