:root {
  --bg: #0c0c0d;
  --surface: #121214;
  --surface-2: #171719;
  --line: rgba(255,255,255,.075);
  --text: #f4f2ed;
  --muted: rgba(255,255,255,.39);
  --faint: rgba(255,255,255,.22);
  --orange: #f39a2e;
  --green: #48cf8b;
  --red: #ea6474;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
code { font-family: "SFMono-Regular", Consolas, monospace; }

.auth-body { background: #09090a; }
.auth-body::before { content: ""; position: fixed; inset: 0; background-image: linear-gradient(rgba(255,255,255,.026) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.026) 1px, transparent 1px); background-size: 34px 34px; mask-image: radial-gradient(circle at 50% 48%, black, transparent 75%); pointer-events: none; }
.auth-body::after { content: ""; position: fixed; width: 420px; height: 420px; left: calc(50% - 210px); top: calc(50% - 260px); border-radius: 50%; background: rgba(243,154,46,.09); filter: blur(120px); pointer-events: none; }
.auth-shell { position: relative; z-index: 1; display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 430px); border: 1px solid var(--line); border-radius: 22px; background: rgba(18,18,20,.94); padding: 34px; box-shadow: 0 30px 90px rgba(0,0,0,.38); }
.setup-shell { align-items: start; padding-block: 48px; }
.setup-card { width: min(100%, 720px); }
.brand-mark { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 13px; background: var(--orange); color: #17130f; font: 800 18px "SFMono-Regular", Consolas, monospace; box-shadow: 0 0 32px rgba(243,154,46,.18); }
.brand-mark.small { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; font-size: 13px; }
.eyebrow { margin: 30px 0 9px; color: var(--orange); font-size: 10px; font-weight: 800; letter-spacing: .19em; }
.auth-card h1 { margin: 0; font-family: "Arial Narrow", Inter, sans-serif; font-size: 28px; letter-spacing: -.03em; }
.auth-copy { margin: 10px 0 26px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.login-form, .setup-form { display: grid; gap: 16px; }
.login-form label, .setup-form label { display: grid; gap: 7px; color: rgba(255,255,255,.56); font-size: 11px; font-weight: 650; }
.login-form input, .setup-form input { width: 100%; height: 44px; border: 1px solid rgba(255,255,255,.10); border-radius: 9px; outline: 0; background: rgba(0,0,0,.24); padding: 0 12px; color: white; transition: .18s; }
.login-form input:focus, .setup-form input:focus { border-color: rgba(243,154,46,.5); box-shadow: 0 0 0 3px rgba(243,154,46,.08); }
.setup-form fieldset { display: grid; gap: 14px; margin: 0; border: 1px solid var(--line); border-radius: 13px; padding: 17px; }
.setup-form legend { padding: 0 7px; color: rgba(255,255,255,.78); font-size: 12px; font-weight: 700; }
.setup-form small { color: var(--faint); font-size: 10px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 150px; gap: 12px; }
.primary-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 9px; background: var(--orange); padding: 0 18px; color: #17130f; font-size: 12px; font-weight: 800; transition: .18s; }
.primary-button:hover { background: #ffab46; transform: translateY(-1px); }
.primary-button.compact { min-height: 42px; white-space: nowrap; }
.secure-note { display: flex; align-items: center; gap: 8px; margin-top: 22px; color: var(--faint); font-size: 10px; }
.secure-note span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.alert { margin: 0 0 18px; border: 1px solid; border-radius: 9px; padding: 11px 13px; font-size: 11px; line-height: 1.5; }
.alert-error { border-color: rgba(234,100,116,.18); background: rgba(234,100,116,.07); color: #f08d99; }
.alert-success { border-color: rgba(72,207,139,.18); background: rgba(72,207,139,.07); color: #7ddfa9; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: 248px; flex-direction: column; border-right: 1px solid var(--line); background: #0f0f11; padding: 16px 13px; }
.sidebar-brand { display: flex; height: 58px; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); padding: 0 12px; }
.sidebar-brand strong { display: block; font-family: "Arial Narrow", Inter, sans-serif; font-size: 13px; letter-spacing: .02em; }
.sidebar-brand span { display: block; margin-top: 4px; color: var(--faint); font-size: 8px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.sidebar nav { flex: 1; padding-top: 28px; }
.sidebar nav > p { margin: 0 10px 10px; color: rgba(255,255,255,.22); font-size: 9px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.nav-button { display: flex; width: 100%; height: 42px; align-items: center; gap: 11px; border: 0; border-radius: 9px; background: transparent; padding: 0 12px; color: rgba(255,255,255,.42); font-size: 12px; font-weight: 570; text-align: left; transition: .16s; }
.nav-button:hover { background: rgba(255,255,255,.04); color: rgba(255,255,255,.8); }
.nav-button.active { background: rgba(243,154,46,.095); color: #ffad49; }
.nav-button > span { width: 18px; color: inherit; font-family: Consolas, monospace; font-weight: 700; text-align: center; }
.nav-button b { margin-left: auto; border-radius: 4px; background: rgba(255,255,255,.05); padding: 2px 5px; color: var(--muted); font: 500 9px Consolas, monospace; }
.sidebar-server { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.2); padding: 12px; }
.sidebar-server > i, .connection-pill i, .connection-status > i { display: block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(72,207,139,.06); }
.sidebar-server > i.offline, .connection-pill.offline i, .connection-status.offline > i { background: var(--red); box-shadow: 0 0 0 4px rgba(234,100,116,.06); }
.sidebar-server strong { display: block; color: rgba(255,255,255,.71); font: 600 10px Consolas, monospace; }
.sidebar-server span { display: block; margin-top: 4px; color: var(--faint); font-size: 9px; }

.main-area { width: calc(100% - 248px); min-width: 0; margin-left: 248px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; height: 72px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(12,12,13,.9); padding: 0 28px; backdrop-filter: blur(15px); }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title small { display: block; color: rgba(255,255,255,.25); font-size: 10px; }
.topbar-title small span { color: rgba(255,255,255,.48); }
.topbar-title h1 { overflow: hidden; max-width: 50vw; margin: 4px 0 0; font-family: "Arial Narrow", Inter, sans-serif; font-size: 18px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.connection-pill { display: flex; align-items: center; gap: 8px; border: 1px solid rgba(72,207,139,.13); border-radius: 999px; background: rgba(72,207,139,.045); padding: 7px 11px; color: #74dca4; font-size: 10px; font-weight: 700; }
.connection-pill i { width: 6px; height: 6px; flex-basis: 6px; }
.connection-pill.offline { border-color: rgba(234,100,116,.14); background: rgba(234,100,116,.045); color: #eb8290; }
.secondary-button { min-height: 34px; border: 1px solid rgba(255,255,255,.09); border-radius: 8px; background: rgba(255,255,255,.025); padding: 0 12px; color: rgba(255,255,255,.56); font-size: 11px; font-weight: 650; transition: .16s; }
.secondary-button:hover { background: rgba(255,255,255,.06); color: white; }
.menu-button { display: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); color: var(--muted); }

.content { width: min(100%, 1540px); margin: auto; padding: 26px; }
.view { display: none; }
.view.active { display: block; animation: view-in .18s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(3px); } }
.server-hero { position: relative; display: flex; overflow: hidden; min-height: 145px; align-items: center; justify-content: space-between; gap: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: #121214; padding: 24px; }
.server-hero::before { content: ""; position: absolute; inset: 0; opacity: .35; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 27px 27px; mask-image: linear-gradient(90deg, black, transparent 70%); }
.server-hero::after { content: ""; position: absolute; width: 280px; height: 280px; right: -90px; top: -160px; border-radius: 50%; background: rgba(243,154,46,.10); filter: blur(90px); }
.server-hero > * { position: relative; z-index: 1; }
.hero-tags { display: flex; gap: 7px; }
.hero-tags span { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); padding: 4px 8px; color: rgba(255,255,255,.35); font: 700 8px Consolas, monospace; letter-spacing: .1em; }
.hero-tags .live-tag { border-color: rgba(72,207,139,.14); background: rgba(72,207,139,.05); color: #6fd99f; }
.server-hero h2 { margin: 15px 0 0; font-family: "Arial Narrow", Inter, sans-serif; font-size: 27px; letter-spacing: -.035em; }
.server-hero h2 em { color: rgba(255,255,255,.16); font-style: normal; font-weight: 400; }
.server-hero p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.hero-kpis { display: flex; align-items: flex-end; gap: 28px; padding-right: 18px; }
.hero-kpis > span { width: 1px; height: 42px; background: var(--line); }
.hero-kpis small { display: block; color: var(--faint); font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero-kpis strong { display: block; margin-top: 5px; font-family: "Arial Narrow", Inter, sans-serif; font-size: 31px; }
.hero-kpis strong em { color: rgba(255,255,255,.2); font-size: 15px; font-style: normal; }
.orange { color: var(--orange) !important; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.metrics article { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 16px; }
.metrics small { display: block; color: rgba(255,255,255,.25); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.metrics strong { display: block; overflow: hidden; margin-top: 12px; color: rgba(255,255,255,.86); font-family: "Arial Narrow", Inter, sans-serif; font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }
.metrics span { display: block; margin-top: 5px; color: var(--faint); font-size: 9px; }
.dashboard-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; margin-top: 14px; }
.panel, .console-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel > header, .console-card > header { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(255,255,255,.06); padding: 13px 18px; }
.panel h3, .view-heading h2 { margin: 0; font-family: "Arial Narrow", Inter, sans-serif; letter-spacing: -.02em; }
.panel h3 { font-size: 14px; }
.panel header p { margin: 5px 0 0; color: var(--faint); font-size: 9px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px; }
.quick-action { display: flex; min-height: 88px; flex-direction: column; align-items: flex-start; justify-content: space-between; border: 1px solid rgba(255,255,255,.06); border-radius: 10px; background: rgba(255,255,255,.015); padding: 11px; color: rgba(255,255,255,.47); font-size: 10px; font-weight: 650; text-align: left; transition: .16s; }
.quick-action i { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 8px; background: rgba(243,154,46,.08); color: var(--orange); font-style: normal; }
.quick-action:hover { border-color: rgba(243,154,46,.24); background: rgba(243,154,46,.04); color: rgba(255,255,255,.82); transform: translateY(-1px); }
.quick-action.danger i { background: rgba(234,100,116,.08); color: #ee8190; }
.map-control { display: flex; gap: 10px; padding: 18px 15px 12px; }
.map-control select { min-width: 0; flex: 1; height: 42px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; outline: 0; background: rgba(0,0,0,.22); padding: 0 11px; color: rgba(255,255,255,.69); font: 11px Consolas, monospace; }
.hint { margin: 0 15px 16px; border: 1px solid rgba(255,255,255,.05); border-radius: 8px; background: rgba(0,0,0,.18); padding: 10px; color: var(--faint); font-size: 9px; }
.players-panel { margin-top: 14px; }
.text-button { border: 0; background: none; color: var(--muted); font-size: 10px; }
.text-button:hover { color: white; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
th { height: 40px; color: rgba(255,255,255,.22); font-size: 8px; letter-spacing: .12em; text-align: left; text-transform: uppercase; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
td { height: 49px; border-top: 1px solid rgba(255,255,255,.05); color: rgba(255,255,255,.5); }
td:first-child { min-width: 170px; }
td strong { color: rgba(255,255,255,.75); font-weight: 600; }
td code { color: rgba(255,255,255,.34); font-size: 9px; }
.avatar { display: inline-grid; width: 28px; height: 28px; margin-right: 9px; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.025); color: var(--muted); font-size: 8px; font-weight: 800; vertical-align: middle; }
.state-badge { border: 1px solid rgba(72,207,139,.14); border-radius: 5px; background: rgba(72,207,139,.05); padding: 3px 6px; color: #70d89f; font: 700 8px Consolas, monospace; text-transform: uppercase; }
.empty { height: 90px; color: var(--faint); text-align: center; }
.kick-button { border: 1px solid rgba(234,100,116,.13); border-radius: 6px; background: rgba(234,100,116,.045); padding: 5px 8px; color: #e98a95; font-size: 8px; }
.kick-button:hover { background: rgba(234,100,116,.1); }

.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 17px; }
.view-heading h2 { font-size: 23px; }
.view-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.console-card { background: #09090a; }
.console-card > header { background: #111113; }
.console-card > header span { color: rgba(255,255,255,.65); font-size: 11px; font-weight: 700; }
.console-card > header small { display: flex; align-items: center; gap: 7px; color: var(--faint); font: 700 8px Consolas, monospace; }
.console-card > header small i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.console-output { height: min(58vh, 560px); overflow-y: auto; padding: 17px; background-image: radial-gradient(circle at 15% 20%, rgba(243,154,46,.028), transparent 30%), repeating-linear-gradient(0deg, rgba(255,255,255,.006) 0, rgba(255,255,255,.006) 1px, transparent 1px, transparent 3px); scrollbar-color: rgba(255,255,255,.13) transparent; }
.console-output p { display: flex; gap: 16px; margin: 0; color: rgba(255,255,255,.45); font: 10px/1.8 Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.console-output time { flex: 0 0 auto; color: rgba(255,255,255,.16); }
.console-output .command { color: #f4a849; }
.console-output .error { color: #ed7e8c; }
.console-card form { display: flex; gap: 9px; border-top: 1px solid var(--line); background: #111113; padding: 12px; }
.console-card form label { position: relative; flex: 1; }
.console-card form label b { position: absolute; left: 12px; top: 50%; color: var(--orange); font: 800 13px Consolas, monospace; transform: translateY(-50%); }
.console-card form input { width: 100%; height: 42px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; outline: 0; background: rgba(0,0,0,.25); padding: 0 11px 0 28px; color: white; font: 10px Consolas, monospace; }
.console-card form input:focus { border-color: rgba(243,154,46,.4); }
.command-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.command-presets button { display: flex; height: 42px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.015); padding: 0 13px; color: var(--muted); font: 9px Consolas, monospace; }
.command-presets button:hover { border-color: rgba(243,154,46,.2); color: rgba(255,255,255,.7); }
.connection-panel, .security-panel { max-width: 760px; }
.connection-status { display: flex; align-items: center; gap: 13px; margin: 17px; border: 1px solid rgba(72,207,139,.12); border-radius: 11px; background: rgba(72,207,139,.04); padding: 14px; }
.connection-status.offline { border-color: rgba(234,100,116,.12); background: rgba(234,100,116,.04); }
.connection-status strong { display: block; color: rgba(255,255,255,.72); font-size: 11px; }
.connection-status span { display: block; margin-top: 4px; color: var(--faint); font-size: 9px; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 17px 17px; }
.info-grid article { border: 1px solid rgba(255,255,255,.055); border-radius: 9px; background: rgba(255,255,255,.012); padding: 12px; }
.info-grid small { display: block; color: var(--faint); font-size: 8px; letter-spacing: .1em; }
.info-grid strong { display: block; margin-top: 6px; color: rgba(255,255,255,.58); font: 500 9px Consolas, monospace; }
.security-panel { margin-top: 14px; }
.security-panel ul { display: grid; gap: 11px; margin: 0; padding: 17px 17px 19px 39px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.security-panel li::marker { color: var(--green); }

.logout-form { position: fixed; z-index: 35; right: 17px; bottom: 15px; }
.logout-form button { border: 1px solid rgba(255,255,255,.07); border-radius: 8px; background: #151517; padding: 8px 11px; color: rgba(255,255,255,.32); font-size: 9px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.logout-form button:hover { color: white; }
.toast-stack { position: fixed; right: 18px; bottom: 58px; z-index: 80; display: grid; gap: 8px; width: min(330px, calc(100vw - 36px)); }
.toast { border: 1px solid rgba(72,207,139,.13); border-radius: 10px; background: #17191a; padding: 12px 14px; color: #7edfaa; font-size: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.28); opacity: 0; transform: translateY(8px); transition: .22s; }
.toast.error { border-color: rgba(234,100,116,.15); color: #ec8c98; }
.toast.show { opacity: 1; transform: translateY(0); }
.mobile-overlay { display: none; }
.working .primary-button, .working .quick-action, .working .secondary-button { pointer-events: none; opacity: .6; }

@media (max-width: 1050px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-area { width: 100%; margin-left: 0; }
  .menu-button { display: block; }
  .mobile-overlay { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }
  .mobile-overlay.show { display: block; }
  .topbar { padding: 0 14px; }
  .topbar-title h1 { max-width: 44vw; font-size: 15px; }
  .connection-pill { display: none; }
  .content { padding: 14px; }
  .server-hero { align-items: flex-start; flex-direction: column; padding: 19px; }
  .hero-kpis { padding-right: 0; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .auth-card { padding: 25px 20px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics article { padding: 13px; }
  .metrics strong { font-size: 17px; }
  .server-hero h2 { font-size: 22px; }
  .hero-kpis strong { font-size: 27px; }
  .command-presets { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .console-card form { flex-direction: column; }
  .topbar-actions .secondary-button span { display: none; }
  .map-control { flex-direction: column; }
}
