/* Modern siyah yönetim paneli teması — dashboard.css'in üstüne yüklenir.
   Renkler değişkenlerden gelir; vurgu rengi Görünüm menüsünden seçilir (--accent). */
:root {
  --accent: #e5283a;
  --on-accent: #fff;
  --ink: #000000;
  --surface: #070708;
  --panel: #0e0e10;
  --panel2: #16161a;
  --panel3: #1d1d22;
  --line: rgba(255, 255, 255, 0.075);
  --line2: rgba(255, 255, 255, 0.13);
  --text: #f4f4f6;
  --muted: #9b9ba6;
  --red: var(--accent);
  --red-dim: color-mix(in srgb, var(--accent) 22%, #0e0e10);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --gold: #f5c451;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 16px;
  --side-w: 248px;
  --serif: 'SamuraiSans', 'Inter', system-ui, -apple-system, 'Segoe UI', 'SamuraiJP', sans-serif;
  --sans: 'SamuraiSans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ctl-h: 38px;
}
html, body { background: var(--ink); -webkit-font-smoothing: antialiased; }
body { font-size: 14px; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }
* { scrollbar-color: #2a2a30 transparent; scrollbar-width: thin; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── İskelet */
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px 14px; }
.brand { padding: 4px 8px 18px; }
.seal { background: var(--accent); color: var(--on-accent); border-radius: 12px; box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 35%, transparent); font: 800 15px var(--sans); letter-spacing: -0.02em; }
.brand b { letter-spacing: -0.01em; }
.side-group { margin: 16px 10px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6f6f7a; }
.side-nav a { color: #c3c3cc; border-radius: 10px; padding: 8px 10px; transition: background .12s, color .12s; }
.side-nav a .ico { color: #75757f; font-family: var(--sans); font-weight: 600; }
.side-nav a:hover { background: var(--panel2); color: #fff; }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.side-nav a[aria-current="page"] .ico { color: var(--accent); }
.me { background: var(--panel); border-color: var(--line); border-radius: 12px; }

.top { background: rgba(0, 0, 0, 0.72); border-bottom: 1px solid var(--line); padding: 10px 24px; backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); }
.chip { background: var(--panel); border-color: var(--line); font-size: 12px; padding: 4px 10px; }
.chip.ok i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.chip.bad i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent); }
.mode { border-color: var(--line2); border-radius: 10px; background: var(--panel); padding: 2px; gap: 2px; }
.seg { border-radius: 8px; padding: 6px 12px; }
.seg.active { background: var(--panel3); }
.seg[data-mode="live"].active { background: var(--accent); color: var(--on-accent); }
.top-right a.ghost { border-radius: 10px; height: var(--ctl-h); }

main { padding: 28px 32px 80px; max-width: 1240px; }
.view-head { margin-bottom: 20px; }
.view-head h1 { font-size: 28px; letter-spacing: -0.02em; font-weight: 700; }
.view-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-grid { gap: 18px; }

.dock { background: var(--surface); border-left: 1px solid var(--line); }
.no-dock .app { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.no-dock .dock { display: none; }
.no-dock .only-dock-narrow { display: none !important; }
.no-dock main { max-width: 1400px; }

/* ── Kartlar */
.card, .sub-card, .boss-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0) 120px), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 12px 40px rgba(0,0,0,0.35);
}
.kicks-card { box-shadow: inset 0 2px 0 #53fc18, 0 12px 40px rgba(0,0,0,0.35); }
h2 { font-size: 16px; letter-spacing: -0.01em; }
h2 small, label small { font-size: 12px; }
.card.folded > :not(h2):not(.card-head):not(.fold-btn) { display: none !important; }
.card.folded { padding-bottom: 8px; }
.card.folded > h2, .card.folded > .card-head { margin-bottom: 8px; }
.fold-btn { position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 13px; line-height: 1; transition: transform .15s, color .12s; z-index: 1; }
.fold-btn:hover { color: #fff; border-color: var(--line2); }
.card.folded .fold-btn { transform: rotate(-90deg); }
.card > h2, .card > .card-head { padding-right: 40px; }

.src, .don-source, .azure-box, .boss-status, .sub-info, .perf .client, .qitem, .sess li { background: var(--panel2); border-color: var(--line); border-radius: 12px; }
.boss-status, .sub-info { border-style: solid; }
.subhead { font-family: var(--sans); font-weight: 700; color: var(--text); }
.subhead::before { content: ''; display: inline-block; width: 3px; height: 13px; border-radius: 2px; background: var(--accent); margin-right: 8px; vertical-align: -1px; }
.txt-ed { border-color: var(--line); background: var(--panel2); border-radius: 12px; }

/* ── Form öğeleri: hepsi aynı yükseklik, net odak */
button.ghost, button.danger, button.primary, select, input[type="number"], input[type="text"], input[type="search"], input[type="url"], input[type="password"], input[type="email"], input[type="time"], input[type="datetime-local"], .txt, textarea, a.ghost, label.ghost {
  border-radius: 10px;
  font-size: 13.5px;
}
select, input[type="number"], input[type="text"], input[type="search"], input[type="url"], input[type="password"], input[type="email"], input[type="time"], input[type="datetime-local"], .txt, textarea {
  background: #0a0a0c; border: 1px solid var(--line2); color: var(--text); padding: 8px 11px; min-height: var(--ctl-h);
  transition: border-color .12s, box-shadow .12s, background .12s;
}
textarea { min-height: 64px; line-height: 1.45; }
select:hover, input:hover:not([type="checkbox"]):not([type="range"]):not([type="color"]), textarea:hover { border-color: rgba(255,255,255,0.22); }
select:focus, input:focus:not([type="checkbox"]):not([type="range"]), textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); background: #000; }
input::placeholder, textarea::placeholder { color: #5f5f69; }
button.ghost, a.ghost, label.ghost { background: var(--panel2); border: 1px solid var(--line2); color: var(--text); min-height: var(--ctl-h); padding: 7px 13px; transition: background .12s, border-color .12s; }
button.ghost:hover, a.ghost:hover, label.ghost:hover { background: var(--panel3); border-color: rgba(255,255,255,0.24); }
a.ghost, label.ghost { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; cursor: pointer; }
a.ghost.small { min-height: 30px; padding: 4px 10px; font-size: 12.5px; color: var(--muted); }
button.primary { background: var(--accent); color: var(--on-accent); min-height: var(--ctl-h); border-radius: 10px; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 28%, transparent); }
button.primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
button.danger, button.ghost.danger { background: color-mix(in srgb, var(--bad) 12%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); color: #fecaca; }
button.danger:hover, button.ghost.danger:hover { background: color-mix(in srgb, var(--bad) 25%, transparent); }
button.icon { min-height: var(--ctl-h); min-width: var(--ctl-h); padding: 6px 10px; }
input[type="checkbox"] { accent-color: var(--accent); }
input[type="range"] { accent-color: var(--accent); }
.grid2 { gap: 16px 20px; }
.grid2 label { color: var(--muted); font-size: 12.5px; }
label output { align-self: flex-start; display: inline-block; width: auto; }
label.range output { color: var(--text); background: var(--panel2); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; font-size: 12px; }

/* Kaydırıcı + elle yazılan kutu */
.rng-wrap { display: flex; align-items: center; gap: 10px; width: 100%; }
.rng-wrap input[type="range"] { flex: 1; min-width: 80px; }
input.rng-num { width: 84px !important; flex: none; text-align: right; font-variant-numeric: tabular-nums; min-height: 32px; padding: 5px 8px; }
label .rng-wrap { margin-top: 2px; }

/* Anahtar (switch) */
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #2a2a31; border: 1px solid var(--line2); transition: background .15s; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #d4d4da; transition: transform .15s, background .15s; }
.switch input:checked + i { background: var(--accent); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(18px); background: var(--on-accent); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Test / önizleme kutuları */
.tier, .mbtn { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; }
.tier:hover, .mbtn:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: var(--panel3); }
.tier .n, .mbtn .mn { font-family: var(--sans); font-weight: 800; color: #fff; }
.tier .name, .mbtn .mt { font-family: var(--sans); font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.tier .k, .mbtn .mk { color: var(--accent); opacity: .5; font-family: 'SamuraiJP', var(--sans); }
.mbtn.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mbtn.milestone { background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 14%, var(--panel2)), var(--panel2) 70%); border-color: color-mix(in srgb, var(--gold) 40%, transparent); }
.stage { border-radius: 12px; border-color: var(--line); }
.bg-checker { background: repeating-conic-gradient(#1a1a1e 0% 25%, #111114 0% 50%) 50% / 26px 26px; }

table.history th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #75757f; }
.history td { border-bottom-color: var(--line); }
.history tr:hover td { background: rgba(255,255,255,0.02); }
.qitem.playing { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.boss-bar { background: #1a1a1e; border-color: var(--line); }

.toast { background: rgba(22, 22, 26, 0.96); border: 1px solid var(--line2); border-left: 3px solid var(--accent); border-radius: 12px; padding: 12px 16px; z-index: 1100; backdrop-filter: blur(10px); box-shadow: 0 20px 50px rgba(0,0,0,.6); animation: toastIn .2s ease; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }
.ask-box { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; }

/* ── Üst çubuk eklentileri */
.savestate { font-size: 12.5px; color: var(--muted); white-space: nowrap; min-width: 0; }
.savestate.busy { color: var(--warn); }
.savestate.ok { color: var(--ok); }
.search-btn .ico-s, #btn-look { display: inline-grid; place-items: center; }
.search-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--muted) !important; min-width: 170px; justify-content: flex-start; }
.search-btn kbd { margin-left: auto; font: 600 11px var(--sans); color: #77777f; border: 1px solid var(--line2); border-radius: 6px; padding: 1px 6px; }
.pop-wrap { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 260px; padding: 14px; border-radius: 14px; background: #101013; border: 1px solid var(--line2); box-shadow: 0 24px 60px rgba(0,0,0,.7); display: grid; gap: 10px; }
.pop b { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pop .hint { margin: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.sw.on { border-color: #fff; }

/* ── Hızlı arama */
.pal-wrap { position: fixed; inset: 0; z-index: 1200; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; }
.pal { width: min(640px, 100%); background: #0f0f12; border: 1px solid var(--line2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.8); overflow: hidden; }
.pal input { width: 100%; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 16px; padding: 16px 18px; min-height: 54px; }
.pal ul { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow: auto; }
.pal li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.pal li small { margin-left: auto; color: #6f6f7a; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.pal li.on { background: var(--accent-soft); }
.pal li.empty { color: var(--muted); cursor: default; }
.pal-foot { padding: 8px 14px; border-top: 1px solid var(--line); }

/* Vurgulama (arama sonucu) */
@keyframes hl { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.hl { animation: hl 1.8s ease; border-radius: 10px; }

/* ── Genel bakış özet kartları */
.ov-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: inherit; transition: border-color .12s, background .12s; }
a.stat:hover { border-color: var(--line2); background: var(--panel2); }
.stat-l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: #75757f; }
.stat-v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-s { font-size: 12px; color: var(--muted); }
.stat.live { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: linear-gradient(160deg, var(--accent-soft), var(--panel) 70%); }
.stat.live .stat-v { color: #fff; }
.stat.ok .stat-v { color: var(--ok); }
.stat.warn .stat-s { color: var(--warn); }

/* ── Tüm ayarlar */
.all-tools { display: grid; gap: 12px; margin-bottom: 18px; position: sticky; top: calc(var(--top-h) + 8px); z-index: 4; background: rgba(14,14,16,.92); backdrop-filter: blur(12px); }
.all-tools input[type="search"] { width: 100%; font-size: 15px; min-height: 44px; }
.all-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { border: 1px solid var(--line2); background: var(--panel2); color: var(--muted); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 12.5px; }
.chipbtn small { color: #6a6a74; margin-left: 2px; }
.chipbtn.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.chipbtn.on small { color: inherit; opacity: .75; }
.all-body { display: grid; gap: 18px; }
.all-sec h2 { display: flex; align-items: center; gap: 10px; }
.sec-ico { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font: 700 14px 'SamuraiJP', var(--sans); }
.all-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 2px 26px; }
.frow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 190px); align-items: center; gap: 12px; padding: 9px 8px; border-bottom: 1px solid var(--line); border-radius: 8px; transition: background .2s; }
.frow:hover { background: rgba(255,255,255,0.02); }
.frow.wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr); }
.frow.wide .fctrl { align-items: stretch; }
.flabel { display: flex; flex-direction: column; gap: 1px; min-width: 0; cursor: pointer; }
.flabel span { color: var(--text); font-size: 13.5px; }
.flabel code { color: #5f5f6b; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fctrl { display: flex; align-items: center; gap: 6px; justify-content: flex-end; min-width: 0; }
.fctrl > select, .fctrl > input[type="text"], .fctrl > textarea, .fctrl > .json-ctrl, .fctrl > .num-ctrl, .fctrl > .color-ctrl { flex: 1; min-width: 0; width: 100%; }
.fctrl textarea { width: 100%; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; }
.num-ctrl { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.num-ctrl input { flex: 1; min-width: 60px; width: 60px !important; text-align: center; font-variant-numeric: tabular-nums; }
.num-ctrl button.icon { min-width: 30px; min-height: 30px; padding: 0; }
.num-ctrl .unit { flex-basis: 100%; text-align: right; font-size: 11px; color: #6f6f7a; }
.color-ctrl { display: flex; gap: 6px; align-items: center; }
.color-ctrl input[type="color"] { width: 38px; height: 38px; padding: 2px; border-radius: 10px; border: 1px solid var(--line2); background: #0a0a0c; cursor: pointer; flex: none; }
.color-ctrl input[type="text"] { flex: 1; font-family: ui-monospace, monospace; }
.json-ctrl { display: grid; gap: 6px; }
.factions { display: flex; flex: none; }
.goto { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: #6f6f7a; text-decoration: none; }
.goto:hover { color: #fff; background: var(--panel3); }
.frow.saving { background: color-mix(in srgb, var(--warn) 6%, transparent); }
@keyframes saved { 0% { background: color-mix(in srgb, var(--ok) 18%, transparent); } 100% { background: transparent; } }
@keyframes failed { 0% { background: color-mix(in srgb, var(--bad) 22%, transparent); } 100% { background: transparent; } }
.frow.saved { animation: saved 1.2s ease; }
.frow.failed { animation: failed 1.6s ease; }
.hint.bad { color: var(--bad); }
.file-btn { cursor: pointer; }

/* ── Sıkı yerleşim */
.compact { --ctl-h: 32px; }
.compact .card, .compact .sub-card, .compact .boss-card { padding: 14px 16px; }
.compact main { padding: 18px 20px 60px; }
.compact .view-head h1 { font-size: 22px; }
.compact .frow { padding: 5px 6px; }
.compact .side-nav a { padding: 6px 10px; }

@media (max-width: 860px) {
  main { padding: 18px 14px 60px; }
  .search-btn { min-width: 0; }
  .search-btn .lbl, .search-btn kbd { display: none; }
  .savestate { display: none; }
  .top-right { gap: 6px; flex-wrap: wrap; width: 100%; }
  .top-right a.ghost { padding: 0 10px !important; }
  .mode .seg { padding: 6px 9px; }
  .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-v { font-size: 20px; }
  .frow { grid-template-columns: minmax(0, 1fr); }
  .fctrl { justify-content: stretch; }
  .all-tools { position: static; }
}
@media (prefers-reduced-motion: reduce) { .hl, .frow.saved, .frow.failed, .toast { animation: none; } }
