:root {
  --bg: #07080c;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.12);
  --border2: rgba(255,255,255,0.09);
  --text: rgba(229,231,235,0.92);
  --muted: rgba(229,231,235,0.65);
  --brand: #2dfb6f;
  --brand2: rgba(45,251,111,0.14);
  --danger: #ef4444;
  --shadow: 0 24px 80px rgba(0,0,0,0.45);
  --radius: 16px;
  --radius2: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(45,251,111,0.10), transparent 60%),
              radial-gradient(900px 500px at 85% 0%, rgba(59,130,246,0.10), transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: rgba(0,0,0,0.55); border-bottom: 1px solid var(--border); }
.top .inner { width: 100%; max-width: none; margin: 0; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { font-weight: 800; color: var(--brand); letter-spacing: 0.2px; }
.user { font-size: 13px; color: var(--muted); white-space: nowrap; }

.layout { display: grid; grid-template-columns: 260px 1fr; width: 100%; max-width: none; margin: 0; padding: 14px; gap: 14px; align-items: start; transition: grid-template-columns 220ms ease; }
.layout.no-anim { transition: none; }
.layout.is-collapsed { grid-template-columns: 74px 1fr; }

.sidebar {
  position: sticky;
  top: 62px;
  border-radius: 0;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: none;
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100vh - 62px - 14px);
}

.side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 10px; border-bottom: 1px solid rgba(255,255,255,0.10); }
.side-head .title { display: inline-block; max-width: 180px; overflow: hidden; white-space: nowrap; font-weight: 800; color: rgba(229,231,235,0.92); letter-spacing: 0.2px; transition: max-width 220ms ease, opacity 160ms ease, transform 160ms ease; }
.layout.is-collapsed .side-head .title { max-width: 0; opacity: 0; transform: translateX(-6px); pointer-events: none; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04); color: rgba(229,231,235,0.82); cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,0.10); }
#btnCollapse svg { transition: transform 220ms ease; }
.layout.is-collapsed #btnCollapse svg { transform: rotate(180deg); }

.nav { padding: 8px 11px 14px; }
.layout.is-collapsed .nav { padding-left: 10px; padding-right: 10px; }

.group { margin: 10px 0 12px; }
.group .glabel { padding: 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: rgba(229,231,235,0.45); text-transform: uppercase; margin-bottom: 6px; }
.layout.is-collapsed .group .glabel { display: none; }

.item { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 12px; min-height: 34px; color: rgba(229,231,235,0.74); text-decoration: none; border: 1px solid transparent; cursor: pointer; user-select: none; }
.item:hover { background: rgba(255,255,255,0.06); border-color: transparent; color: rgba(229,231,235,0.96); }
.item.active { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.10); color: rgba(229,231,235,0.96); }
.item.expander { width: 100%; background: transparent; outline: none; text-align: left; font: inherit; }

.item .label { display: inline-block; max-width: 180px; overflow: hidden; white-space: nowrap; font-weight: 650; letter-spacing: 0.1px; font-size: 15px; line-height: 1; transition: max-width 220ms ease, opacity 160ms ease, transform 160ms ease; }
.layout.is-collapsed .item .label { max-width: 0; opacity: 0; transform: translateX(-6px); pointer-events: none; }

.item .ic { width: 18px; height: 18px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; color: currentColor; flex: none; opacity: 0.55; }
.item.active .ic { opacity: 0.7; }

.menu-content { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 250ms ease, opacity 160ms ease; margin: 0; }
.menu-content.is-open { grid-template-rows: 1fr; margin-bottom: 10px; }
.menu-content > div { overflow: hidden; }

.subnav { position: relative; margin: 2px 0 0; padding: 0 0 0 18px; display: grid; grid-template-columns: 1fr; gap: 6px; }
.subnav:before { content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 1px; background: rgba(255,255,255,0.14); }

.sub-item { display: flex; align-items: center; padding: 7px 10px; border-radius: 12px; min-height: 34px; text-decoration: none; color: rgba(229,231,235,0.70); font-size: 14px; font-weight: 600; }
.sub-item:hover { background: rgba(255,255,255,0.06); color: rgba(229,231,235,0.96); }
.sub-item.active { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10); color: rgba(229,231,235,0.96); }

.expander-arrow { opacity: 0.70; transition: transform 200ms ease; flex: none; margin-left: auto; }
.item.is-open .expander-arrow { transform: rotate(90deg); }

.layout.is-collapsed .expander-arrow { opacity: 0; pointer-events: none; }
.layout.is-collapsed .menu-content { opacity: 0; pointer-events: none; }

.nv-details-body { overflow: hidden; }

.Scrubber {
  position: fixed;
  right: 14px;
  top: 50%;
  z-index: 30;
  width: 24px;
  height: 25vh;
  min-height: 180px;
  max-height: 340px;
  transform: translateY(-50%);
  display: none;
  user-select: none;
}

.Scrubber.is-visible { display: block; }

.Scrubber a { display: none; }

.Scrubber-scrollbar {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: transparent;
  border: 0;
}

.Scrubber-scrollbar:before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: rgba(255,255,255,0.16);
}

.Scrubber:hover .Scrubber-scrollbar:before { background: rgba(255,255,255,0.22); }

.Scrubber-before,
.Scrubber-after { display: none; }

.Scrubber-handle {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(45,251,111,0.85);
  box-shadow: 0 0 0 4px rgba(45,251,111,0.16);
  border: 1px solid rgba(0,0,0,0.35);
  cursor: grab;
  top: 0%;
}

.Scrubber-handle:active { cursor: grabbing; }

.Scrubber-bar { display: none; }

.Scrubber-info {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 180px;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  transform: translateY(-50%) translateX(6px);
}

.Scrubber:hover .Scrubber-info {
  opacity: 1;
  transform: translateY(-50%) translateX(0px);
}

.Scrubber-info strong {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  display: block;
}

.Scrubber-description {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1100px) {
  .Scrubber { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .layout { transition: none; }
  #btnCollapse svg { transition: none; }
  .side-head .title,
  .item .label { transition: none; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background-color: rgba(229,231,235,0.20); border-radius: 3px; }

.content { min-width: 0; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.card h2 { margin: 0 0 10px; font-size: 16px; color: rgba(229,231,235,0.92); letter-spacing: 0.2px; }
.card h3 { margin: 0 0 10px; font-size: 14px; color: rgba(229,231,235,0.92); letter-spacing: 0.2px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
}

.table th {
  text-align: left;
  font-size: 12px;
  color: rgba(229,231,235,0.55);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.15);
}

.table td {
  padding: 12px;
  font-size: 13px;
  color: rgba(229,231,235,0.86);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.table tbody tr:hover { background: rgba(255,255,255,0.04); }
.embed { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 16px; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,0.45); }
.embed iframe { width: 100%; height: calc(100vh - 170px); min-height: 720px; border: 0; display: block; background: #0b0c10; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(45,251,111,0.35);
  background: rgba(45,251,111,0.12);
  color: var(--brand);
  text-decoration: none;
  font-weight: 650;
  cursor: pointer;
  gap: 8px;
}

.btn:hover { background: rgba(45,251,111,0.18); }

.btn.ghost { border-color: rgba(255,255,255,0.14); background: rgba(255,255,255,0.06); color: rgba(229,231,235,0.92); }
.btn.ghost:hover { background: rgba(255,255,255,0.10); }

.btn.danger { border-color: rgba(239,68,68,0.30); background: rgba(239,68,68,0.12); color: #fca5a5; }
.btn.danger:hover { background: rgba(239,68,68,0.18); }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 15px; }

.input {
  width: 100%;
  padding: 11px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: rgba(229,231,235,0.92);
  font-size: 13px;
  outline: none;
}

.input:focus {
  border-color: rgba(45,251,111,0.32);
  box-shadow: 0 0 0 3px rgba(45,251,111,0.10);
}

.input::placeholder { color: rgba(229,231,235,0.40); }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: #2dfb6f; font-weight: 500; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 11px 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; color: rgba(229,231,235,0.92); font-size: 13px; outline: none; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: rgba(45,251,111,0.32); box-shadow: 0 0 0 3px rgba(45,251,111,0.10); }
.msg { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; }
.msg.error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.msg.ok { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 30px; }
.stat-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 20px; text-align: center; }
.stat-number { font-size: 24px; font-weight: 700; color: #2dfb6f; margin-bottom: 5px; }
.stat-label { color: rgba(229,231,235,0.75); font-size: 13px; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  align-items: start;
}

.settings-grid .form-group { margin-bottom: 0; }
.settings-grid .span-2 { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .span-2 { grid-column: auto; }
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .layout.is-collapsed { grid-template-columns: 1fr; }
  .layout.is-collapsed .side-head .title { display: inline; }
  .layout.is-collapsed .group .glabel,
  .layout.is-collapsed .item .label { display: inline; }
  .embed iframe { height: calc(100vh - 220px); min-height: 520px; }
}

label.nv-checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  user-select: none;
  cursor: pointer;
  color: rgba(229,231,235,0.85);
  font-weight: 500;
  margin: 0;
}

label.nv-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

label.nv-checkbox .checkmark {
  position: relative;
  box-shadow: rgb(255, 84, 0) 0px 0px 0px 2px;
  background-color: rgba(16, 16, 16, 0.5);
  height: 20px;
  width: 20px;
  margin-right: 10px;
  flex-shrink: 0;
  margin-top: -1px;
  transition: all 0.2s ease 0s;
  cursor: pointer;
  transform-origin: 0px 10px;
  border-radius: 4px;
  margin: -1px 10px 0px 0px;
  padding: 0px;
  box-sizing: border-box;
}

label.nv-checkbox input:checked ~ .checkmark {
  box-shadow: rgb(255, 84, 0) 0px 0px 0px 2px;
  background-color: rgba(245, 24, 24, 0.5);
  height: 20px;
  width: 20px;
  margin-right: 10px;
  flex-shrink: 0;
  margin-top: -1px;
  transition: all 0.2s ease 0s;
  cursor: pointer;
  transform-origin: 0px 10px;
  border-radius: 4px;
  margin: -1px 10px 0px 0px;
  padding: 0px;
  box-sizing: border-box;
}

label.nv-checkbox .checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

label.nv-checkbox input:checked ~ .checkmark:after {
  display: block;
}

label.nv-checkbox .checkmark:after {
  left: 0.45em;
  top: 0.25em;
  width: 0.25em;
  height: 0.5em;
  border: solid white;
  border-width: 0 0.15em 0.15em 0;
  transform: rotate(45deg);
  transition: all 500ms ease-in-out;
}

.nv-checkbox-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

@media (max-width: 900px) {
  .nv-checkbox-list { grid-template-columns: 1fr; }
}
