:root {
  --bg: #0f0f16;
  --bg-grid: rgba(255, 255, 255, .025);
  --sidebar: #12121b;
  --panel: #191923;
  --panel-2: #1f1f2b;
  --border: #2a2a38;
  --border-strong: #3a3a4c;
  --text: #ecebf5;
  --text-2: #b3b2c6;
  --muted: #8a89a0;
  --accent: #a594f9;
  --accent-2: #8b7cf0;
  --accent-soft: rgba(165, 148, 249, .14);
  --danger: #f05a6a;
  --warn: #f5a524;
  --ok: #34d399;

  --c-video: #3ddc97;
  --c-muzik: #4ea8de;
  --c-uretkenlik: #4f5bff;
  --c-ai: #7b16d9;

  --radius: 12px;
  --font: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'Inter', sans-serif;
  --mono: 'Space Mono', ui-monospace, 'SFMono-Regular', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 36px 36px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex-shrink: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.money { white-space: nowrap; }
.muted { color: var(--muted); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip-link {
  position: absolute; left: 12px; top: -40px; z-index: 100;
  background: var(--accent-2); color: #fff; padding: 8px 12px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 210px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  z-index: 30;
}
.brand { padding: 0 8px 26px; }
.brand-row { display: flex; align-items: center; gap: 8px; }
.ghost { width: 22px; height: 22px; }
.ghost path { fill: var(--accent); }
.ghost circle { fill: var(--sidebar); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.brand-name span { color: var(--accent); }
.brand-sub { font-size: 9.5px; letter-spacing: .18em; color: var(--muted); margin-top: 4px; font-weight: 600; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px;
  color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 13px;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.nav a .short { display: none; }
.nav a .long { display: flex; align-items: center; flex: 1; gap: 8px; }
.nav .tag { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 5px; }
.nav a.active .tag { color: #cfc6ff; border-color: rgba(165,148,249,.45); }
.nav a svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { background: rgba(255,255,255,.03); color: var(--text); }
.nav a.active { color: #cfc6ff; border-color: rgba(165,148,249,.55); background: var(--accent-soft); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.ai-badge {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 10.5px; font-weight: 600; color: #cfc6ff;
  border: 1px solid rgba(165,148,249,.5); border-radius: 6px; padding: 4px 8px;
}
.ai-badge svg { width: 11px; height: 11px; fill: var(--accent); }
.mode-badge {
  align-self: flex-start; font-size: 10px; font-weight: 600; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: 6px; padding: 3px 8px; cursor: help;
}
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lang-btn {
  display: inline-flex; padding: 2px; margin-left: auto; border-radius: 7px;
  border: 1px solid var(--border-strong); background: transparent;
}
.lang-btn span { padding: 3px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.lang-btn span.on { background: var(--accent-soft); color: #cfc6ff; }
.lang-btn:hover span:not(.on) { color: var(--text); }

.refresh-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: transparent; border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 8px; font-size: 12px; font-weight: 600;
  transition: border-color .15s, background .15s;
}
.refresh-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.refresh-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.refresh-btn.spin svg { animation: spin 1s linear infinite; }
.copyright { font-size: 10.5px; color: var(--muted); padding: 4px 2px 0; }

/* Main */
.main { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1720px; outline: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-family: var(--display); font-size: 26px; letter-spacing: -.02em; }
.today { color: var(--muted); font-size: 12px; margin-top: 8px; white-space: nowrap; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.label {
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #b9adff;
}
.label.plain { color: var(--text-2); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpis.five { grid-template-columns: repeat(5, 1fr); }
.kpi { padding: 12px 16px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.kpi .label, .kpi .value { align-self: stretch; }
.kpi .value small { font-family: var(--font); font-size: .6em; font-weight: 600; color: var(--text-2); margin-left: 6px; letter-spacing: 0; }
.kpi .value {
  font-family: var(--mono); font-size: clamp(18px, 1.7vw, 24px); font-weight: 700;
  margin-top: 6px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi .sub { font-size: 11px; color: var(--muted); margin-top: auto; padding-top: 4px; }
.kpi.danger { border-color: rgba(240, 90, 106, .6); }
.kpi.danger .value { color: var(--danger); font-size: clamp(16px, 1.3vw, 18px); }
.chip {
  display: inline-block; margin-top: 8px; padding: 5px 10px; border-radius: 6px;
  background: #34343f; font-weight: 600; font-size: 12.5px;
}
.chip.aktif { background: rgba(165,148,249,.2); color: #d8d0ff; }

.alert {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  padding: 11px 14px; border-radius: var(--radius);
  background: rgba(245, 165, 36, .08); border: 1px solid rgba(245, 165, 36, .35);
}
.alert-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(245,165,36,.15); color: var(--warn); }
.alert-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.alert-text { flex: 1; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.alert-text b { color: var(--text); margin-right: 6px; }

.intro {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
  padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(165,148,249,.14), rgba(165,148,249,.05));
  border: 1px solid rgba(165,148,249,.4);
}
.intro-icon { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px; background: rgba(165,148,249,.2); }
.intro-icon svg { width: 17px; height: 17px; fill: var(--accent); }
.intro-text { flex: 1; min-width: 0; }
.intro-text h2 { font-family: var(--display); font-size: 15px; }
.intro-text p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--text-2); }
.intro-actions { display: flex; gap: 8px; flex-shrink: 0; }
.intro-actions a.btn { text-decoration: none; color: var(--text); }

/* Grafikler */
.grid-2 { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; margin-bottom: 26px; }
/* Düzen ekrana değil kutunun genişliğine göre değişir; dar kutuda açıklamalar grafiğin altına iner */
.donut-panel { container-type: inline-size; display: flex; flex-direction: column; min-height: 210px; }
.donut-panel .label { margin-bottom: 4px; }
.donut-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.legend-col { display: flex; flex-direction: column; gap: 46px; min-width: 0; }
.legend-col.right { text-align: right; }
.legend-item .name { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.legend-col.right .name { flex-direction: row-reverse; }
.legend-item .dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.legend-item .amount { font-weight: 700; font-size: 12.5px; margin-top: 4px; }
.legend-item .amount span { color: var(--muted); font-weight: 500; white-space: nowrap; }
.donut { width: clamp(160px, 10vw, 190px); height: auto; aspect-ratio: 1; margin: 0 16px; }
.legend-item .amount { white-space: nowrap; }
@container (max-width: 440px) {
  .donut-body { grid-template-columns: 1fr 1fr; gap: 14px 12px; }
  .donut-body .donut { grid-column: 1 / -1; grid-row: 1; justify-self: center; margin: 8px 0; }
  .legend-col { gap: 12px; }
  .legend-col.right { text-align: left; }
  .legend-col.right .name { flex-direction: row; }
}
.donut circle { transition: stroke-dasharray .5s ease, stroke-dashoffset .5s ease; }

.limit-total { font-family: var(--display); font-weight: 700; font-size: 20px; margin: 8px 0 10px; }
.ticks { display: flex; gap: 3px; height: 12px; }
.ticks i { flex: 1; border-radius: 2px; background: #2e2e3d; }
.ticks i.on { background: #9d8cf2; }
.limit-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); margin: 8px 0 16px; }
.limit-meta b { color: var(--text); }
.cat-row { margin-bottom: 10px; }
.cat-row .top { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; margin-bottom: 4px; }
.cat-row .top .n { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.cat-row .top .n i { width: 8px; height: 8px; border-radius: 2px; }
.cat-row .top .v { color: var(--muted); font-size: 11px; text-align: right; }
.cat-row .bar { height: 4px; border-radius: 3px; background: #23232f; }
.cat-row .bar div { height: 100%; border-radius: 3px; transition: width .4s ease; }

.chart-panel svg, .tx-chart svg { width: 100%; height: auto; display: block; }
.chart-panel .label, .tx-chart .label { margin-bottom: 8px; display: block; }
.axis-text { fill: var(--muted); font-size: 10px; font-family: var(--font); }
svg .dot { fill: #a594f9; stroke: var(--panel); stroke-width: 2; transition: r .15s; }
svg .dot:hover { r: 6; }

/* Kategori yığını ve abonelikler */
.subs-layout { display: grid; grid-template-columns: clamp(280px, 22vw, 360px) minmax(0, 1fr); gap: 26px; align-items: start; }
.stack-col { position: sticky; top: 18px; }
.stack { perspective: 900px; padding: 4px 6px 10px 0; }
.stack-item {
  position: relative; display: block; width: 100%; text-align: left;
  height: 92px; margin-top: -18px; padding: 16px 20px;
  border-radius: var(--radius); border: 1px solid rgba(255,255,255,.08);
  transform: rotateY(-8deg) rotateZ(-1.6deg);
  transform-origin: left center;
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
  transition: transform .25s ease, border-color .2s, filter .2s;
  color: #fff;
}
.stack-item:first-child { margin-top: 0; }
.stack-item:nth-child(1) { background: linear-gradient(135deg, #b1a3f5, #8c7ce2); z-index: 1; }
.stack-item:nth-child(2) { background: linear-gradient(135deg, #6e61b3, #54489a); z-index: 2; }
.stack-item:nth-child(3) { background: linear-gradient(135deg, #4b4472, #3b355c); z-index: 3; }
.stack-item:nth-child(4) { background: linear-gradient(135deg, #3a3550, #2c283f); z-index: 4; }
.stack-item:nth-child(5) { background: linear-gradient(135deg, #302c42, #252235); z-index: 5; }
.stack-item:hover { transform: rotateY(-8deg) rotateZ(-1.6deg) translateX(6px); filter: brightness(1.08); }
.stack-item.selected { border-color: rgba(255,255,255,.75); transform: rotateY(-8deg) rotateZ(-1.6deg) translateX(8px); }
.stack-item .nm { font-family: var(--display); font-size: 19px; font-weight: 600; }
.stack-item .am { position: absolute; top: 16px; right: 20px; font-weight: 700; font-size: 13.5px; }
.stack-item .ct { position: absolute; top: 37px; right: 20px; font-size: 11px; opacity: .8; }

.total-card {
  margin-top: 20px; background: #f4f2fb; color: #16151f; gap: 6px 12px;
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.total-card .t { font-size: 10px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; }
.total-card .s { font-size: 10.5px; color: #6c6a80; margin-top: 3px; }
.total-card .v { font-family: var(--display); font-weight: 700; font-size: 20px; white-space: nowrap; }

.subs-title { font-family: var(--display); font-size: 19px; margin: 0 0 12px; }
.sub-panel {
  display: grid; grid-template-columns: clamp(280px, 21vw, 340px) minmax(0, 1fr); gap: 22px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 16px; margin-bottom: 14px; position: relative;
  transition: border-color .2s;
}
.sub-panel:hover { border-color: var(--border-strong); }
.sub-info-col { min-width: 0; }
.status-badge {
  position: absolute; top: 14px; right: 16px;
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 5px;
  background: rgba(165,148,249,.22); color: #d8d0ff;
}
.status-badge.frozen { background: #34343f; color: var(--text-2); }

/* Sanal kart */
.vcard {
  position: relative; aspect-ratio: 1.586; border-radius: 14px; padding: 16px 18px;
  background: linear-gradient(135deg, #ab9cf3 0%, #8573dc 55%, #6f5fc4 100%);
  box-shadow: 0 10px 24px rgba(88, 66, 196, .35);
  display: flex; flex-direction: column; justify-content: space-between;
  color: #fff; overflow: hidden;
}
.vcard::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 85% 0%, rgba(255,255,255,.18), transparent 60%);
  pointer-events: none;
}
.vcard.is-frozen { filter: saturate(.4) brightness(.82); box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.vcard .row { display: flex; justify-content: space-between; align-items: center; }
.vcard .bank { font-size: 11px; letter-spacing: .12em; font-weight: 500; }
.vcard .bank b { font-weight: 800; }
.vcard .pill { font-size: 9px; font-weight: 800; letter-spacing: .1em; border: 1.3px solid rgba(255,255,255,.85); border-radius: 5px; padding: 2px 6px; }
.vcard .chip-img { width: 38px; height: 28px; border-radius: 5px; background: linear-gradient(135deg, #f6dc7a, #caa53d); box-shadow: inset 0 0 3px rgba(0,0,0,.3); }
.vcard .num { font-family: var(--mono); font-size: 14px; letter-spacing: 2px; white-space: nowrap; }
.vcard .meta { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; font-size: 8.5px; letter-spacing: .12em; opacity: .9; }
.vcard .meta span:last-child { text-align: right; }
.vcard .meta b { display: block; font-size: 12px; letter-spacing: 0; margin-top: 3px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.usage { margin-top: 12px; }
.usage .top { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.usage .top b { color: var(--text); }
.usage .bar { height: 5px; border-radius: 3px; background: #2c2c3a; margin-top: 5px; overflow: hidden; }
.usage .bar div { height: 100%; background: #a594f9; border-radius: 3px; transition: width .3s; }
.usage.over .bar div { background: linear-gradient(90deg, #a594f9, var(--danger)); }
.limit-label { display: block; font-size: 10.5px; color: var(--muted); margin: 12px 0 5px; }
.limit-row { display: flex; gap: 8px; }
.num-input {
  flex: 1; display: flex; align-items: center; min-width: 0;
  background: #14141d; border: 1px solid var(--border-strong); border-radius: 7px; padding: 0 6px 0 10px;
  transition: border-color .15s, box-shadow .15s;
}
.num-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(165,148,249,.25); }
.num-input.invalid { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(240,90,106,.2); }
.num-input input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; padding: 7px 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.spin-btns { display: flex; flex-direction: column; background: #e9e7f2; border-radius: 3px; overflow: hidden; }
.spin-btns button { border: 0; background: transparent; color: #222; width: 13px; height: 10px; font-size: 7px; line-height: 10px; padding: 0; }
.spin-btns button:hover { background: #d4d0e6; }
.save-btn {
  width: 32px; border-radius: 7px; border: 1px solid var(--border-strong); background: transparent;
  display: grid; place-items: center; color: var(--muted); transition: all .15s;
}
.save-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.save-btn.dirty { color: #fff; border-color: var(--accent); background: var(--accent-2); }
.save-btn:disabled { cursor: default; }
.limit-warn {
  display: flex; align-items: flex-start; gap: 7px;
  margin-top: 8px; padding: 8px 10px; border-radius: 7px; font-size: 11px; font-weight: 600; line-height: 1.4;
  color: #ffc2c8; border: 1px solid rgba(240,90,106,.35); background: rgba(240,90,106,.08);
}
.limit-warn svg { width: 13px; height: 13px; margin-top: 1px; fill: none; stroke: var(--danger); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.sub-name { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 16px; margin-top: 2px; padding-right: 90px; }
.risk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.risk-dot.orta { background: var(--warn); }
.risk-dot.yuksek { background: var(--danger); }
.sub-cat { font-size: 11.5px; color: var(--muted); margin: 5px 0 9px; }
.sub-line { display: flex; flex-wrap: wrap; align-items: baseline; row-gap: 4px; font-size: 12px; color: var(--text-2); }
.sub-line b { color: var(--text); }
.sub-line .sep { margin: 0 7px; color: var(--muted); }

.hike {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 9px 11px; border-radius: 8px;
  background: rgba(245,165,36,.07); border: 1px solid rgba(245,165,36,.3);
}
.hike-text { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--text-2); }
.hike-text b { display: inline-flex; align-items: center; gap: 5px; color: var(--warn); }
.hike svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hike.capped { background: rgba(165,148,249,.06); border-color: rgba(165,148,249,.3); }
.hike.capped .hike-text b { color: #cfc6ff; }
.hike-state { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: #cfc6ff; }

.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid var(--border-strong); border-radius: 7px;
  padding: 7px 11px; font-size: 12px; font-weight: 600;
  transition: border-color .15s, background .15s, transform .1s;
}
.btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { border-color: #5b5b72; background: rgba(255,255,255,.03); }
.btn:active { transform: translateY(1px); }
.btn.activate { color: #cfc6ff; border-color: rgba(165,148,249,.6); }
.btn.activate:hover { background: var(--accent-soft); }
.btn.icon { padding: 7px 9px; color: var(--accent); }
.btn.icon svg { fill: currentColor; stroke: none; }
.btn.icon.busy svg { animation: pulse 1s ease-in-out infinite; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { font-size: 11px; padding: 5px 10px; white-space: nowrap; }
.btn.small svg { width: 11px; height: 11px; }
.btn.outline-accent { border-color: rgba(165,148,249,.6); color: #cfc6ff; font-size: 11px; padding: 5px 10px; }
.btn.outline-accent svg { width: 11px; height: 11px; }

.ai-out { margin-top: 12px; }
.ai-lead {
  border-left: 2px solid var(--accent); background: rgba(165,148,249,.07);
  padding: 9px 12px; border-radius: 0 7px 7px 0; font-size: 12px; line-height: 1.55;
}
.ai-box { margin-top: 10px; background: #15151e; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.ai-box.flat { background: transparent; border: 0; padding: 0; margin: 0; }
.ai-box .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ai-box .head .label { color: var(--text); }
.ai-box .when { font-size: 10px; color: var(--muted); }
.ai-box ul { margin: 0; padding-left: 16px; }
.ai-box li { font-size: 11.5px; line-height: 1.6; color: var(--text-2); }
.ai-error { margin-top: 12px; font-size: 12px; color: #ffb3bb; background: rgba(240,90,106,.1); border: 1px solid rgba(240,90,106,.35); border-radius: 7px; padding: 8px 11px; }

.skeleton { margin-top: 12px; }
.skeleton i {
  display: block; height: 10px; border-radius: 5px; margin-bottom: 9px;
  background: linear-gradient(90deg, #262633 0%, #34344a 50%, #262633 100%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
.skeleton i.big { height: 24px; margin-bottom: 14px; }
.panel.skeleton { margin-top: 0; }
.boot .kpis, .boot .grid-2 { margin-top: 18px; }
.boot .panel.skeleton:not(.kpi) {
  background: linear-gradient(90deg, var(--panel) 0%, #20202c 50%, var(--panel) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}

.empty { color: var(--muted); padding: 30px; text-align: center; }
.empty .btn { margin-top: 12px; }

/* B2B */
.b2b-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: -4px 0 14px; gap: 12px; }
.select {
  appearance: none; background: #15151e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23b3b2c6' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
  border: 1.5px solid rgba(165,148,249,.7); border-radius: 8px;
  padding: 9px 36px 9px 12px; min-width: 190px; font-weight: 600;
}
.select option { background: #1b1b26; }
.b2b-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 11px; color: var(--muted); }

.b2b-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; margin-bottom: 12px; }
.churn-panel { display: flex; flex-direction: column; align-items: center; position: relative; }
.churn-panel .label { align-self: flex-start; display: flex; align-items: center; gap: 6px; }
.churn-panel .btn.small svg { fill: var(--accent); stroke: none; }
.info { position: relative; display: inline-flex; color: var(--muted); cursor: help; }
.info svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.tooltip {
  position: absolute; top: 22px; left: -60px; width: min(340px, 80vw); z-index: 20;
  background: #1c1c28; border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 12px 14px; box-shadow: 0 16px 40px rgba(0,0,0,.5);
  font-size: 11.5px; line-height: 1.6; color: var(--text-2); letter-spacing: 0; text-transform: none; font-weight: 400;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: all .15s;
}
.tooltip b { display: block; color: var(--text); font-size: 12.5px; margin-bottom: 6px; }
.info:hover .tooltip, .info:focus .tooltip { opacity: 1; visibility: visible; transform: none; }
.ring { width: 150px; height: 150px; margin: 10px 0 8px; position: relative; }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 22px; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.actions-list .item { display: grid; grid-template-columns: 28px 1fr; padding: 12px 0; border-top: 1px solid var(--border); }
.actions-list .item:first-child { border-top: 0; }
.actions-list .no { color: #b9adff; font-size: 11px; font-weight: 700; padding-top: 2px; }
.actions-list .t { font-weight: 700; font-size: 13px; }
.actions-list .d { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }

/* Modal */
.overlay {
  position: fixed; inset: 0; background: rgba(6,6,12,.6); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 50; animation: fade .15s ease; padding: 16px;
}
.modal {
  width: min(430px, 100%); background: #1a1a25; border: 1px solid var(--border-strong);
  border-radius: 13px; padding: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.6);
  animation: pop .18s ease; max-height: 90vh; overflow: auto;
}
.modal.wide { width: min(560px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { font-family: var(--display); font-size: 17px; }
.modal-close { background: transparent; border: 0; color: var(--muted); font-size: 20px; line-height: 1; padding: 2px 6px; }
.modal-close:hover { color: var(--text); }
.modal-note { font-size: 12px; color: var(--text-2); margin: 0 0 12px; line-height: 1.5; }
.risk-box { background: #22222e; border-radius: 9px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.risk-box .n { font-size: 10.5px; color: var(--muted); margin-top: 3px; letter-spacing: .05em; }
.risk-box .v { font-family: var(--mono); font-size: 26px; font-weight: 700; }
.modal ul { margin: 6px 0 0; padding-left: 16px; }
.modal li { font-size: 12px; line-height: 1.6; color: var(--text-2); margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); font-size: 11.5px; }
.kv div { padding: 7px 4px; border-top: 1px solid var(--border); }
.kv .k { color: var(--text-2); word-break: break-word; }
.kv .k code { display: block; margin-top: 2px; color: var(--muted); font-family: var(--mono); font-size: 9.5px; }
.kv .v { color: var(--text); word-break: break-word; }

/* İşlem geçmişi */
.tx-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: -6px 0 16px; font-size: 11.5px; color: var(--muted); }
.summary-panel { position: relative; margin-bottom: 12px; min-height: 76px; }
.summary-panel p { margin: 10px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.6; padding-right: 44px; }
.summary-panel .btn.icon { position: absolute; top: 12px; right: 12px; }
.tx-tools { display: flex; gap: 10px; margin-bottom: 12px; }
.search {
  flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 0 12px;
}
.search svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; padding: 9px 0; font-size: 12.5px; color: var(--text); }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
.search:focus-within { border-color: var(--accent); }
.seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: transparent; padding: 0 12px; font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 5px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { color: var(--text); }
.seg button.on { color: #cfc6ff; box-shadow: inset 0 0 0 1px rgba(165,148,249,.6); background: var(--accent-soft); }
.seg svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.tx-chart { margin-bottom: 12px; }
.table-wrap { padding: 0; overflow: hidden; }
.table-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table-head .count { font-size: 11px; color: var(--muted); }
.table-scroll { max-height: 420px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
thead th {
  position: sticky; top: 0; background: #1d1d29; text-align: left; font-size: 10px; letter-spacing: .1em;
  color: var(--text-2); padding: 11px 16px; font-weight: 700;
}
tbody td { padding: 9px 16px; border-top: 1px solid #23232f; color: var(--text-2); }
tbody tr:hover td { background: rgba(255,255,255,.02); }
td.amt, th.amt { text-align: right; white-space: nowrap; }
td.amt { font-weight: 600; color: var(--text); }
td.amt.in { color: var(--ok); }

/* Toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px);
  display: flex; align-items: center; gap: 14px;
  background: #26263a; border: 1px solid var(--border-strong); color: var(--text);
  padding: 10px 12px 10px 16px; border-radius: 10px; font-size: 12.5px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px);
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.err { border-color: rgba(240,90,106,.6); }
.toast-action {
  border: 0; background: var(--accent-soft); color: #cfc6ff; font-weight: 700; font-size: 12px;
  padding: 5px 10px; border-radius: 6px; white-space: nowrap;
}
.toast-action:hover { background: rgba(165,148,249,.25); }

@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 1180px) {
  .kpis.five { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .b2b-grid { grid-template-columns: 1fr; }

  .subs-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .sub-line { column-gap: 14px; }
  .sub-line .sep { display: none; }
  .stack-col { position: static; }
  .stack { display: flex; gap: 10px; perspective: none; padding: 0; }
  .stack-item {
    flex: 1 1 0; width: auto; min-width: 0; height: auto; margin: 0; padding: 12px 16px;
    transform: none; box-shadow: 0 6px 16px rgba(0,0,0,.3);
  }
  .stack-item:hover { transform: translateY(-2px); }
  .stack-item.selected { transform: none; }
  .stack-item .nm { display: block; font-size: 16px; }
  .stack-item .am, .stack-item .ct { position: static; display: inline; margin-right: 6px; }
  .total-card { margin-top: 10px; padding: 12px 18px; }
}

@media (max-width: 860px) {
  .app { flex-direction: column; }

  .sidebar {
    position: sticky; top: 0; width: auto; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 10px;
    padding: 10px 16px 0; border-right: 0; border-bottom: 1px solid var(--border);
    background: rgba(18, 18, 27, .94); backdrop-filter: blur(10px);
  }
  .brand { padding: 0; flex: 1; }
  .brand-sub, .ai-badge, .copyright { display: none; }
  .sidebar-foot { margin: 0; flex-direction: row; align-items: center; gap: 8px; }
  .foot-row { gap: 8px; }
  .intro { flex-wrap: wrap; align-items: flex-start; }
  .intro-text { flex-basis: calc(100% - 48px); }
  .intro-actions { width: 100%; justify-content: flex-end; }
  .mode-badge { align-self: center; }
  .refresh-btn { padding: 7px 9px; }
  .refresh-btn .lbl { display: none; }
  .nav { order: 3; flex-basis: 100%; flex-direction: row; gap: 4px; margin: 0 -16px; padding: 0 16px 10px; overflow-x: auto; }
  .nav a { padding: 7px 12px; font-size: 12.5px; white-space: nowrap; }
  .nav a .long { display: none; }
  .nav a .short { display: inline; }

  .main { padding: 18px 16px 70px; }
  .page-head h1 { font-size: 22px; }
  .kpis, .kpis.five { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi .value { font-size: 17px; }
  .kpis.five .kpi.danger { grid-column: 1 / -1; }


  .subs-layout { gap: 14px; }
  .stack { gap: 8px; overflow-x: auto; padding: 2px 0 6px; scroll-snap-type: x mandatory; }
  .stack-item { flex: 1 0 auto; min-width: 150px; padding: 10px 14px; box-shadow: none; scroll-snap-align: start; }
  .stack-item:hover { transform: none; }
  .stack-item .nm { font-size: 15px; }
  .total-card { margin-top: 8px; padding: 12px 16px; }

  .sub-panel { grid-template-columns: 1fr; padding: 14px; }
  .status-badge { display: none; }
  .sub-name { padding-right: 0; }
  .vcard { max-width: 380px; }

  .b2b-bar { flex-direction: column; align-items: stretch; }
  .select { width: 100%; }
  .b2b-right { justify-content: space-between; }
  .tooltip { left: -120px; }

  .tx-tools { flex-direction: column; }
  .seg button { flex: 1; padding: 9px 0; }
  thead th, tbody td { padding: 9px 12px; }
  .col-type { display: none; }
  .table-scroll { max-height: 60vh; }
}

@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr; }
}
