:root {
  --bg-0: #090d14;
  --bg-1: #0f1520;
  --bg-2: #131b28;
  --side-0: #0b1018;
  --side-1: #101622;
  --panel: #151d2a;
  --panel-2: #1a2231;
  --line: rgba(153, 169, 196, 0.22);
  --line-soft: rgba(153, 169, 196, 0.12);
  --text: #f2f6ff;
  --muted: #93a2bc;
  --main: #34ef67;
  --main-2: #12be55;
  --ok: #64ff96;
  --warn: #ffcf73;
  --err: #ff8780;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Sora', 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(1400px 780px at 120% -20%, rgba(64, 93, 146, 0.26), transparent 62%),
    radial-gradient(1200px 680px at -20% 120%, rgba(33, 55, 91, 0.24), transparent 62%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg-0) 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  filter: blur(66px);
  opacity: 0.12;
  pointer-events: none;
}

.glow-a {
  top: -150px;
  left: -120px;
  background: #43ca73;
}

.glow-b {
  right: -160px;
  bottom: -170px;
  background: #3a5e99;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1820px, 98vw);
  margin: 14px auto;
  display: grid;
  grid-template-columns: 276px 1fr;
  gap: 16px;
}

.card {
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: linear-gradient(184deg, #161e2d, #101723);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 20px 38px rgba(8, 12, 18, 0.42);
}

.sidebar {
  min-height: calc(100vh - 28px);
  height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: start;
  padding: 22px 14px;
  gap: 18px;
  position: sticky;
  top: 14px;
  overflow-y: auto;
  background: linear-gradient(190deg, var(--side-1), var(--side-0));
}

.brand h2 {
  margin: 0;
  font-family: 'Rajdhani', 'Sora', sans-serif;
  font-size: 34px;
  line-height: 0.9;
  letter-spacing: 0.2px;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.menu {
  display: grid;
  gap: 8px;
  align-content: start;
}

.menu-btn {
  text-align: left;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 9px 12px;
  color: var(--text);
  background: linear-gradient(145deg, #151d2b, #101824);
  font-family: 'Rajdhani', 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, filter 120ms ease;
}

.menu-btn:hover {
  transform: translateX(2px);
  border-color: rgba(86, 255, 140, 0.45);
  filter: brightness(1.05);
}

.menu-btn.active {
  border-color: rgba(52, 239, 103, 0.65);
  color: #09180e;
  background: linear-gradient(96deg, var(--main), var(--main-2));
  box-shadow: 0 10px 24px rgba(18, 190, 85, 0.26);
}

.side-foot {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.content {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(185deg, #161f2d, #101724);
}

.topbar h1 {
  margin: 0 0 6px;
  font-family: 'Rajdhani', 'Sora', sans-serif;
  font-size: 34px;
  line-height: 0.9;
}

.status-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  min-height: 1.35em;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(147, 162, 188, 0.08);
}

.status-line.success {
  color: var(--ok);
  border-color: rgba(100, 255, 150, 0.28);
  background: rgba(100, 255, 150, 0.08);
}

.status-line.error {
  color: var(--err);
  border-color: rgba(255, 135, 128, 0.32);
  background: rgba(255, 135, 128, 0.1);
}

.status-line.warn {
  color: var(--warn);
  border-color: rgba(255, 207, 115, 0.32);
  background: rgba(255, 207, 115, 0.1);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: 'Rajdhani', 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: filter 120ms ease;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.btn-main {
  background: linear-gradient(95deg, var(--main), var(--main-2));
  border-color: rgba(52, 239, 103, 0.68);
  color: #0a1a11;
}

.btn-danger {
  color: #fff;
  background: linear-gradient(95deg, #cf5648, #f37f66);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid rgba(167, 204, 222, 0.22);
  background: linear-gradient(145deg, #20293b, #141c29);
}

.infra-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.infra-card {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(145deg, #1d2636, #131b29);
  padding: 9px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.chip.ok {
  background: rgba(100, 255, 150, 0.2);
  color: #bcffd3;
}

.chip.warn {
  background: rgba(255, 207, 115, 0.2);
  color: #ffe0a9;
}

.chip.err {
  background: rgba(255, 135, 128, 0.2);
  color: #ffc3be;
}

.chip.neutral {
  background: rgba(166, 201, 220, 0.18);
  color: #dbe8f7;
}

.view {
  padding: 14px 14px 16px;
  animation: slideIn 180ms ease;
  min-width: 0;
  overflow-x: hidden;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metrics.players-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sync-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.sync-summary-grid .metric {
  min-height: 84px;
}

.overview-panels {
  margin: 12px 0;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
}

.overview-panel {
  align-content: start;
}

.overview-bars-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(5, 14, 24, 0.72);
}

.overview-bars {
  min-width: 780px;
  min-height: 224px;
  padding: 10px 10px 8px;
}

.overview-bars.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.overview-chart-shell {
  display: grid;
  gap: 8px;
}

.overview-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 12px;
}

.overview-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.legend-peak {
  background: #46c4ff;
  box-shadow: 0 0 0 2px rgba(70, 196, 255, 0.24);
}

.legend-avg {
  background: #66ff9f;
  box-shadow: 0 0 0 2px rgba(68, 214, 143, 0.24);
}

.overview-chart-svg {
  width: 100%;
  height: 210px;
  display: block;
}

.overview-chart-grid line {
  stroke: rgba(152, 170, 196, 0.18);
  stroke-width: 1;
}

.overview-chart-tick text {
  fill: var(--muted);
  font-size: 11px;
  text-anchor: end;
}

.overview-chart-axis {
  stroke: rgba(152, 170, 196, 0.4);
  stroke-width: 1;
}

.overview-chart-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overview-chart-line-peak {
  stroke: rgba(70, 196, 255, 0.95);
}

.overview-chart-line-avg {
  stroke: rgba(102, 255, 159, 0.95);
}

.overview-chart-peak-marker {
  stroke: rgba(253, 211, 125, 0.72);
  stroke-width: 1.3;
  stroke-dasharray: 4 3;
}

.overview-chart-peak-label {
  fill: rgba(253, 211, 125, 0.96);
  font-size: 11px;
  font-weight: 700;
}

.overview-chart-dot {
  fill: rgba(70, 196, 255, 0.86);
}

.overview-chart-xaxis text {
  fill: var(--muted);
  font-size: 10px;
  text-anchor: middle;
}

.metric {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(145deg, #1d2636, #131b29);
  padding: 10px;
}

.metric p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.metric h3 {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: 700;
  min-height: 24px;
  overflow-wrap: anywhere;
}

.table-wrap {
  margin-top: 10px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(0, 8, 14, 0.28);
}

.compact-table {
  max-height: 280px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 8px;
  text-align: left;
  font-size: 12px;
  vertical-align: top;
}

th {
  color: #a9b8d4;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(18, 28, 43, 0.95);
}

.table-wrap td .actions .btn {
  font-size: 14px;
  padding: 6px 9px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(165, 202, 219, 0.18);
  background: linear-gradient(145deg, #111929, #0d1422);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
}

select {
  color-scheme: normal;
  color: #edf5ff;
  background-color: #0f1726;
}

select:focus {
  outline: none;
  border-color: rgba(107, 197, 242, 0.62);
  box-shadow: 0 0 0 2px rgba(70, 196, 255, 0.16);
}

select option,
select optgroup {
  color: #f3f9ff;
  background: #111b2a;
}

textarea {
  resize: vertical;
}

.stack {
  display: grid;
  gap: 8px;
}

.console {
  margin: 8px 0 0;
  min-height: 70px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 12px;
  border: 1px solid rgba(167, 206, 224, 0.2);
  background: rgba(0, 8, 14, 0.7);
  padding: 10px;
  color: #d0edf7;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
}

.settings-form {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 8px;
  align-items: center;
}

.tabs-wrap {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs-wrap .tab-btn .muted {
  font-size: 11px;
  margin-left: 4px;
}

.tab-btn {
  border: 1px solid rgba(167, 204, 222, 0.24);
  border-radius: 999px;
  background: rgba(150, 192, 215, 0.12);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
}

.tab-btn.active {
  border-color: rgba(70, 196, 255, 0.45);
  background: linear-gradient(95deg, rgba(70, 196, 255, 0.27), rgba(0, 150, 211, 0.2));
}

.setting-input {
  width: 100%;
}

.setting-input.invalid {
  border-color: rgba(255, 110, 103, 0.85);
  box-shadow: inset 0 0 0 1px rgba(255, 110, 103, 0.45);
}

.setting-help {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.setting-help strong {
  color: #d6eaf5;
}

.setting-key {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
  color: #d6eaf5;
}

.setting-row-error td {
  background: rgba(255, 110, 103, 0.06);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.section-head .actions > input,
.section-head .actions > select {
  min-width: 220px;
}

#view-overview table {
  min-width: 640px;
}

#view-players table {
  min-width: 920px;
}

#view-chests table {
  min-width: 940px;
}

#view-vehicles table {
  min-width: 860px;
}

#view-sync table {
  min-width: 1060px;
}

#view-settings table {
  min-width: 1120px;
}

#view-settings .setting-key .muted {
  display: block;
  font-size: 11px;
  margin-top: 3px;
}

#view-runtime table {
  min-width: 900px;
}

.runtime-actions-grid {
  margin-bottom: 8px;
}

.runtime-target-list {
  min-height: 38px;
  border: 1px solid rgba(165, 202, 219, 0.18);
  border-radius: 10px;
  background: rgba(12, 22, 34, 0.62);
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.runtime-target-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(96, 175, 220, 0.3);
  border-radius: 999px;
  background: rgba(25, 56, 88, 0.34);
  padding: 4px 8px;
  font-size: 12px;
}

.runtime-target-chip .btn {
  min-width: 0;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1;
}

.runtime-history-target {
  min-width: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
}

.vehicles-filters-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.vehicles-filters-grid > * {
  min-width: 0;
}

.section-head h2,
.view h2 {
  margin: 0;
  font-size: 20px;
}

.section-head.compact {
  margin-top: 14px;
}

.section-head h3 {
  margin: 0;
  font-size: 17px;
}

.subcard {
  border: 1px solid rgba(160, 201, 220, 0.2);
  border-radius: 12px;
  background: rgba(2, 12, 18, 0.55);
  padding: 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.subcard h3 {
  margin: 0;
  font-size: 16px;
}

.bot-recovery-card {
  border: 1px dashed rgba(146, 188, 209, 0.34);
  background: rgba(18, 31, 46, 0.58);
  border-radius: 12px;
  padding: 10px;
}

.bot-recovery-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.bot-layout {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.bot-layout > * {
  min-width: 0;
}

.bot-subtabs {
  margin-top: 8px;
  margin-bottom: 6px;
  gap: 8px;
}

.bot-domain-tab.active {
  border-color: rgba(95, 221, 187, 0.9);
  color: #7af6cf;
}

#view-bots {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  overflow-x: hidden;
}

#view-bots .subcard {
  min-width: 0;
}

#view-bots table {
  min-width: 760px;
  table-layout: auto;
}

#view-bots .compact-table table {
  min-width: 700px;
}

#view-bots th,
#view-bots td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

#view-bots .actions {
  flex-wrap: wrap;
  align-items: center;
}

#view-bots .actions > * {
  min-width: 0;
}

#view-bots .actions > input,
#view-bots .actions > select {
  flex: 1 1 220px;
}

#view-bots .console {
  display: none;
  min-height: 0;
  max-height: 200px;
}

#view-bots .console:not(:empty) {
  display: block;
}

#view-bots .table-wrap {
  max-width: 100%;
}

.bot-grid-top {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.bot-grid-ops,
.bot-grid-management {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.bot-grid-top,
.bot-grid-ops,
.bot-grid-management {
  grid-auto-rows: minmax(0, auto);
}

.bot-grid-top .bot-col-4,
.bot-grid-ops .bot-col-4,
.bot-grid-management .bot-col-4 {
  grid-column: span 4;
}

.bot-grid-top .bot-col-6,
.bot-grid-ops .bot-col-6,
.bot-grid-management .bot-col-6 {
  grid-column: span 6;
}

.bot-grid-top .bot-col-12,
.bot-grid-ops .bot-col-12,
.bot-grid-management .bot-col-12 {
  grid-column: 1 / -1;
}

.bot-col-4 {
  grid-column: span 4;
}

.bot-col-6 {
  grid-column: span 6;
}

.bot-col-12 {
  grid-column: 1 / -1;
}

#spawnCommandStatusChip {
  display: inline-flex;
  margin-top: 8px;
}

#shopPackagesRows .actions,
#shopOrdersRows .actions {
  justify-content: flex-start;
}

.players-layout {
  margin-top: 12px;
}

.players-layout > .subcard {
  grid-column: span 4;
}

.players-layout > .players-bans-card,
.players-layout > .players-squads-card {
  grid-column: span 6;
}

.players-layout-tools > .players-map-card {
  grid-column: 1 / -1;
}

.players-layout-tools > .players-bio-card {
  grid-column: 1 / -1;
}

.players-layout-tools > .players-inventory-card {
  grid-column: 1 / -1;
}

.players-map-card-bottom {
  margin-top: 14px;
}

#view-players .table-wrap {
  margin-top: 8px;
}

#view-players .players-table {
  table-layout: fixed;
}

#view-players .players-table-main {
  min-width: 980px;
}

#view-players .players-table-main th:nth-child(1) {
  width: 30%;
}

#view-players .players-table-main th:nth-child(2) {
  width: 19%;
}

#view-players .players-table-main th:nth-child(3) {
  width: 18%;
}

#view-players .players-table-main th:nth-child(4) {
  width: 33%;
}

#view-players .players-table-positions {
  min-width: 980px;
}

#view-players .players-table-positions th:nth-child(1) {
  width: 24%;
}

#view-players .players-table-positions th:nth-child(2) {
  width: 17%;
}

#view-players .players-table-positions th:nth-child(3) {
  width: 29%;
}

#view-players .players-table-positions th:nth-child(4) {
  width: 18%;
}

#view-players .players-table-positions th:nth-child(5) {
  width: 12%;
}

#view-players .players-table-bans {
  min-width: 700px;
  table-layout: auto;
}

#view-players .players-table-squads {
  min-width: 620px;
  table-layout: auto;
}

#view-players .players-row-actions {
  gap: 6px;
}

#view-players .players-row-actions .btn {
  font-size: 12px;
  padding: 5px 8px;
  line-height: 1.05;
  border-radius: 8px;
  min-width: 76px;
}

#view-players .players-row-actions .btn[data-player-action='map'] {
  min-width: 64px;
}

#view-players .players-table-main td,
#view-players .players-table-positions td {
  vertical-align: middle;
}

#view-players .players-map-card .section-head .actions {
  gap: 6px;
}

#view-players .players-map-card .check-row {
  border: 1px solid rgba(154, 196, 220, 0.24);
  border-radius: 8px;
  padding: 5px 9px;
  background: rgba(12, 27, 41, 0.52);
}

#view-players .players-map-actions-buttons .btn {
  font-size: 13px;
  padding: 6px 9px;
}

#view-players .status-chip-stack .chip {
  min-width: 58px;
  font-size: 10px;
  padding: 3px 8px;
}

#view-players .players-portal-card {
  margin-top: 14px;
}

#view-players .portal-accounts-metrics {
  margin-bottom: 10px;
}

#view-players .players-table-portal {
  min-width: 1180px;
  table-layout: auto;
}

#view-players .players-table-portal td {
  vertical-align: middle;
}

.finance-actions {
  align-items: center;
}

#view-finance .finance-table {
  min-width: 1380px;
  table-layout: auto;
}

#view-finance .finance-table td {
  vertical-align: middle;
}

.finance-note-form {
  margin-top: 12px;
}

.portal-account-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.portal-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(165, 202, 219, 0.28);
  background: rgba(8, 17, 27, 0.88);
}

.portal-avatar-fallback {
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  color: #08120d;
  background: linear-gradient(135deg, #5fe39b, #8ef0bb);
}

.players-map-canvas {
  position: relative;
  min-height: 500px;
  aspect-ratio: 1 / 1;
  width: min(100%, 860px);
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(182, 214, 228, 0.34);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(8, 19, 29, 0.92), rgba(4, 10, 18, 0.98));
}

.players-map-canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(200, 229, 243, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(200, 229, 243, 0.14) 1px, transparent 1px);
  background-size: 20% 20%;
  pointer-events: none;
}

.players-map-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.98;
  z-index: 0;
}

.players-map-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  background: radial-gradient(800px 320px at 50% 0%, rgba(72, 133, 170, 0.22), rgba(9, 18, 29, 0.94));
  z-index: 3;
}

.players-map-sectors {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.players-map-sector-cell {
  position: absolute;
  border: 1px solid rgba(206, 232, 245, 0.28);
  box-sizing: border-box;
}

.players-map-sector-label {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(232, 245, 252, 0.9);
  text-shadow: 0 1px 3px rgba(1, 7, 12, 0.88);
}

.players-map-points {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.players-map-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(12, 21, 33, 0.72);
  background: #7ba6c4;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.players-map-dot:hover {
  transform: translate(-50%, -50%) scale(1.2);
  filter: brightness(1.2);
}

.players-map-dot.online {
  background: #4ed172;
  box-shadow: 0 0 0 4px rgba(78, 209, 114, 0.26);
}

.players-map-dot.bot {
  background: #f6d05f;
  box-shadow: 0 0 0 4px rgba(246, 208, 95, 0.26);
}

.players-map-dot.offline {
  background: #d98a7a;
  box-shadow: 0 0 0 4px rgba(217, 138, 122, 0.22);
}

.players-map-dot.selected {
  width: 16px;
  height: 16px;
  z-index: 4;
  background: #ff4f4f;
  box-shadow: 0 0 0 4px rgba(255, 79, 79, 0.42), 0 0 0 8px rgba(255, 255, 255, 0.14);
}

.players-map-dot.bot.selected {
  background: #f6d05f;
  box-shadow: 0 0 0 4px rgba(246, 208, 95, 0.45), 0 0 0 8px rgba(255, 79, 79, 0.18);
}

.players-map-dot.chest {
  background: #4fc8ff;
  box-shadow: 0 0 0 4px rgba(79, 200, 255, 0.28);
}

.players-map-dot.chest.unowned {
  background: #ffbf72;
  box-shadow: 0 0 0 4px rgba(255, 191, 114, 0.28);
}

.players-map-dot.vehicle {
  background: #5fe39b;
  box-shadow: 0 0 0 4px rgba(95, 227, 155, 0.28);
}

.players-map-dot.vehicle.inactive {
  background: #d98a7a;
  box-shadow: 0 0 0 4px rgba(217, 138, 122, 0.24);
}

.players-map-label {
  position: absolute;
  transform: translate(-50%, calc(-100% - 10px));
  background: rgba(6, 16, 26, 0.9);
  color: #d6ecfb;
  border: 1px solid rgba(152, 188, 208, 0.28);
  border-radius: 8px;
  padding: 3px 6px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
}

.players-map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  font-size: 13px;
  background: linear-gradient(180deg, rgba(7, 17, 28, 0.25), rgba(7, 17, 28, 0.58));
}

.players-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 12px;
}

.players-map-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.players-map-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.players-map-legend-dot.online {
  background: #58f58b;
}

.players-map-legend-dot.offline {
  background: #e08a7b;
}

.players-map-legend-dot.selected {
  background: #ff4f4f;
}

.players-map-legend-dot.bot {
  background: #f4d15f;
}

.players-map-actions {
  width: min(100%, 860px);
  margin: 0 auto;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(127, 166, 189, 0.24);
  background: rgba(9, 22, 34, 0.48);
}

.players-map-actions-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.status-chip-stack {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.players-map-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.players-bio-skill-select {
  min-width: 140px;
}

.players-mode-field {
  min-width: 160px;
}

.player-name-chip,
.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(99, 157, 192, 0.34);
  border-radius: 999px;
  background: rgba(24, 44, 63, 0.72);
  color: #d4ecfb;
  font-size: 12px;
  line-height: 1.2;
  padding: 4px 10px;
  cursor: pointer;
}

.player-name-chip:hover,
.copy-chip:hover {
  border-color: rgba(117, 195, 236, 0.6);
  background: rgba(31, 64, 92, 0.78);
}

.player-name-chip.bot {
  border-color: rgba(235, 206, 110, 0.56);
  background: rgba(74, 58, 19, 0.68);
  color: #ffefbf;
}

.players-id-line {
  margin-top: 6px;
}

.inventory-item-name {
  font-weight: 700;
  color: #d9eefb;
}

.inventory-item-class {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.inventory-health {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid rgba(146, 188, 209, 0.28);
  background: rgba(27, 46, 66, 0.55);
  font-size: 12px;
}

.inventory-health.good {
  border-color: rgba(88, 245, 139, 0.4);
  color: #bbf5cc;
}

.inventory-health.warn {
  border-color: rgba(255, 204, 114, 0.45);
  color: #ffe0ad;
}

.inventory-health.danger {
  border-color: rgba(255, 121, 116, 0.45);
  color: #ffb8b4;
}

.bot-runtime-grid {
  display: grid;
  gap: 8px;
}

.bot-session-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 1px dashed rgba(146, 188, 209, 0.28);
  border-radius: 10px;
  padding: 8px;
  background: rgba(13, 25, 39, 0.45);
}

.bot-session-grid .runtime-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

#botClientSessionStatus {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#view-bots .is-busy {
  opacity: 0.72;
}

.runtime-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.inline-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: 'JetBrains Mono', Consolas, monospace;
}

.table-row-selected td {
  background: rgba(70, 196, 255, 0.2);
  border-top: 1px solid rgba(70, 196, 255, 0.28);
  border-bottom: 1px solid rgba(70, 196, 255, 0.28);
}

.table-row-selected .player-name-chip {
  border-color: rgba(70, 196, 255, 0.64);
  background: rgba(33, 75, 106, 0.85);
}

.table-row-selected .player-name-chip.bot {
  border-color: rgba(247, 190, 59, 0.7);
  background: rgba(94, 72, 20, 0.8);
}

#view-chests .chests-table {
  min-width: 980px;
}

#view-vehicles .vehicles-table {
  min-width: 980px;
}

#view-chests .players-map-canvas,
#view-vehicles .players-map-canvas {
  width: min(100%, 960px);
  min-height: 520px;
}

#view-chests .players-map-actions,
#view-vehicles .players-map-actions {
  width: min(100%, 960px);
}

.chest-modal-metrics .metric h3 {
  font-size: 16px;
}

.hidden {
  display: none !important;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 11, 16, 0.78);
  backdrop-filter: blur(5px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 11, 16, 0.76);
  backdrop-filter: blur(6px);
}

.modal-shell {
  width: min(980px, 96vw);
  max-height: 92vh;
}

.modal-shell-wide {
  width: min(1240px, 97vw);
}

.modal-card {
  border: 1px solid rgba(159, 201, 223, 0.25);
  border-radius: 16px;
  background: linear-gradient(186deg, #172131, #0f1724);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.52);
  padding: 14px;
  display: grid;
  gap: 12px;
  max-height: 92vh;
  overflow: auto;
}

.modal-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.modal-metric {
  min-height: 88px;
}

.modal-metric h3 {
  font-size: 18px;
  line-height: 1.1;
  word-break: break-word;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-head h3 {
  margin: 0;
}

.modal-close-btn {
  min-width: 96px;
}

.login-card {
  width: min(420px, 92vw);
  border: 1px solid rgba(165, 205, 223, 0.23);
  border-radius: 16px;
  background: rgba(6, 22, 31, 0.92);
  padding: 20px;
  display: grid;
  gap: 8px;
}

.login-card h1 {
  margin: 0;
}

.login-card p {
  margin: 0 0 6px;
  color: var(--muted);
}

.login-card label {
  font-size: 12px;
  color: var(--muted);
}

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

  .sidebar {
    min-height: auto;
    height: auto;
    overflow: visible;
  }

  .infra-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics.players-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sync-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .modal-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-panels {
    grid-template-columns: 1fr;
  }

  .settings-form {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head .actions {
    width: 100%;
  }

  .section-head .actions > input,
  .section-head .actions > select {
    min-width: 0;
    flex: 1 1 220px;
  }

  .bot-grid-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bot-grid-ops,
  .bot-grid-management {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bot-grid-top .bot-col-4,
  .bot-grid-top .bot-col-6,
  .bot-grid-top .bot-col-12,
  .bot-grid-ops .bot-col-4,
  .bot-grid-ops .bot-col-6,
  .bot-grid-management .bot-col-4,
  .bot-grid-management .bot-col-6 {
    grid-column: span 1;
  }

  .bot-grid-ops .bot-col-12,
  .bot-grid-management .bot-col-12 {
    grid-column: 1 / -1;
  }

  .players-layout > .subcard {
    grid-column: 1 / -1;
  }

  .inline-grid.three,
  .inline-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bot-session-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sync-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vehicles-filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .bot-grid-top,
  .bot-grid-ops,
  .bot-grid-management {
    grid-template-columns: 1fr;
  }

  .bot-grid-top .bot-col-4,
  .bot-grid-top .bot-col-6,
  .bot-grid-top .bot-col-12,
  .bot-grid-ops .bot-col-4,
  .bot-grid-ops .bot-col-6,
  .bot-grid-ops .bot-col-12,
  .bot-grid-management .bot-col-4,
  .bot-grid-management .bot-col-6,
  .bot-grid-management .bot-col-12 {
    grid-column: 1 / -1;
  }

  .inline-grid,
  .inline-grid.two,
  .inline-grid.three,
  .inline-grid.four {
    grid-template-columns: 1fr;
  }

  .players-map-canvas {
    min-height: 340px;
    width: 100%;
  }

  .players-map-actions {
    width: 100%;
  }

  #view-chests .players-map-canvas,
  #view-vehicles .players-map-canvas {
    min-height: 340px;
    width: 100%;
  }

  #view-chests .players-map-actions,
  #view-vehicles .players-map-actions {
    width: 100%;
  }

  #view-players .players-table-main,
  #view-players .players-table-positions {
    min-width: 860px;
  }

  #view-players .players-row-actions .btn {
    min-width: 68px;
  }

  .vehicles-filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .bot-session-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .infra-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .metrics.players-metrics {
    grid-template-columns: 1fr;
  }

  .sync-summary-grid {
    grid-template-columns: 1fr;
  }

  .modal-metrics-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .overview-bars {
    min-width: 700px;
  }

  .overview-chart-svg {
    height: 190px;
  }

  .btn {
    font-size: 16px;
  }

  .table-wrap td .actions .btn {
    font-size: 13px;
    padding: 6px 8px;
  }

  #view-players .players-table-main,
  #view-players .players-table-positions {
    min-width: 760px;
  }

  #view-players .players-row-actions .btn {
    min-width: 0;
    flex: 1 1 auto;
  }

  .vehicles-filters-grid {
    grid-template-columns: 1fr;
  }
}
