:root {
  --bg: #0a1e3c;
  --panel: #11294d;
  --panel2: #163564;
  --line: rgba(255, 255, 255, 0.10);
  --text: #ffffff;
  --muted: #a9b8d0;
  --blue: #0b4ea2;
  --sky: #1e88e5;
  --green: #7cc242;
  --yellow: #ffd400;
  --red: #e53935;
  --pink: var(--green);
  --violet: var(--sky);
  --gold: var(--yellow);
  --ok: var(--green);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  background: linear-gradient(180deg, #0b2a55 0, var(--bg) 320px);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 16px; align-items: center;
  padding: 14px 22px; backdrop-filter: blur(16px);
  background: var(--blue); border-bottom: 3px solid var(--green);
}
.brand { font-weight: 800; letter-spacing: 0.08em; }
.brand span { color: var(--yellow); }
.search { flex: 1; background: #ffffff; color: #0a1e3c !important; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 10px 14px; }
.btn {
  border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer; font-weight: 700;
  background: var(--yellow); color: #0a1e3c;
}
.btn:hover { filter: brightness(1.06); }
.btn.green { background: var(--green); color: #0a1e3c; }
.btn.red { background: var(--red); color: #fff;
}
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.5); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 64px); }
.side { padding: 18px 12px; border-right: 1px solid var(--line); }
.side a, .chip {
  display: block; padding: 10px 12px; border-radius: 12px; color: var(--muted); margin-bottom: 4px;
}
.side a.active, .chip.active, .side a:hover { background: var(--green); color: #0a1e3c; }
.main { padding: 22px; }
.hero {
  display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 16px; margin-bottom: 22px;
}
.card {
  background: linear-gradient(160deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: 22px; padding: 22px;
}
.kicker { color: var(--gold); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { margin: 8px 0; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.game {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer;
}
.thumb { height: 120px; display: grid; place-items: end start; padding: 10px; font-weight: 800; }
.meta { padding: 10px 12px 12px; }
.meta small { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 18px; }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.62); display: none; place-items: center; padding: 20px;
}
.modal.on { display: grid; }
.sheet { width: min(520px, 100%); background: var(--panel); border-radius: 20px; padding: 20px; border: 1px solid var(--line); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select {
  width: 100%; background: #ffffff; color: #0a1e3c; border: 1px solid var(--line); border-radius: 12px; padding: 10px;
}
.stats { display: flex; gap: 18px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 22px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tag { font-size: 11px; background: var(--green); color: #0a1e3c; padding: 2px 8px; border-radius: 999px; }
.warn { font-size: 12px; color: var(--gold); }
@media (max-width: 900px) {
  .layout, .hero, .tiles { grid-template-columns: 1fr; }
  .side { display: none; }
}

.side { background: var(--panel); }
.chip { background: var(--panel2); border: 0; color: var(--text); cursor: pointer; display: inline-block; }
th { color: var(--yellow); font-weight: 700; }
tr:hover td { background: rgba(255,255,255,.03); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 16px; }
.tabs button { background: var(--panel2); color: #fff; border: 0; padding: 9px 16px; border-radius: 8px; cursor: pointer; font-weight: 700; }
.tabs button.active { background: var(--green); color: #0a1e3c; }
.tile b { font-size: 22px; color: var(--yellow); }
.st-active { color: var(--green); font-weight: 700; }
.st-blocked { color: var(--red); font-weight: 700; }
.tree { list-style: none; padding-left: 0; margin: 0; }
.tree ul { list-style: none; padding-left: 22px; border-left: 2px solid var(--panel2); margin: 4px 0 4px 10px; }
.node { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; flex-wrap: wrap; }
.node:hover, .node.sel { background: var(--panel2); }
.node .k { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--sky); font-weight: 700; }
.node .k.agency { background: var(--yellow); color: #0a1e3c; }
.node .k.agent { background: var(--green); color: #0a1e3c; }
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.perm { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.switch { position: relative; width: 42px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #4a5b78; border-radius: 22px; transition: .2s; cursor: pointer; }
.switch span:before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span:before { transform: translateX(20px); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; align-items: end; }
textarea { width: 100%; min-height: 120px; background: #fff; color: #0a1e3c; border-radius: 12px; padding: 10px; border: 0; font-family: ui-monospace, monospace; }
pre { white-space: pre-wrap; background: var(--bg); padding: 10px; border-radius: 10px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
