:root {
  --bg: #0b100d;
  --bg-soft: #101713;
  --panel: rgba(20, 29, 23, 0.92);
  --panel-2: #18221b;
  --line: rgba(195, 220, 202, 0.12);
  --text: #eef6ef;
  --muted: #9aaa9e;
  --green: #73e29b;
  --green-deep: #2f9e5b;
  --gold: #e9c46a;
  --red: #ff7a7a;
  --orange: #f0a35c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% 0%, rgba(68, 140, 88, .15), transparent 35%), var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
code { padding: .18rem .42rem; border: 1px solid var(--line); border-radius: .4rem; background: #0c130e; color: #b9f0ca; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .14; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(to bottom, black, transparent 80%); }
[hidden] { display: none !important; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.eyebrow { margin: 0 0 .45rem; color: var(--green); font-size: .7rem; font-weight: 800; letter-spacing: .16em; }
.muted { color: var(--muted); }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #718077; box-shadow: 0 0 0 5px rgba(113,128,119,.1); }
.status-dot.good { background: var(--green); box-shadow: 0 0 0 5px rgba(115,226,155,.1); }
.status-dot.bad { background: var(--red); box-shadow: 0 0 0 5px rgba(255,122,122,.1); }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.login-card { width: min(460px, 100%); padding: 2.5rem; text-align: center; }
.brand-mark { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 1.5rem; background: linear-gradient(145deg, #82eca5, #2b8f51); color: #07110a; font-weight: 950; letter-spacing: -.08em; border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 12px 30px rgba(47,158,91,.24); }
.brand-mark.small { width: 42px; height: 42px; margin: 0; border-radius: 10px; font-size: .85rem; }
.login-card h1 { margin: 0; font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.055em; }
.login-copy { line-height: 1.75; margin: 1rem 0 1.5rem; }
.login-admin-label { display: block; text-align: left; margin-bottom: .42rem; }
.login-admin-select { margin-bottom: .75rem; }
.verify-form { margin-top: 1rem; text-align: left; }
.verify-form label { display: block; margin-bottom: .5rem; color: var(--muted); font-size: .8rem; }
.code-row { display: flex; gap: .7rem; }
.code-row input { flex: 1; letter-spacing: .35em; text-align: center; font-size: 1.35rem; font-weight: 800; }
.inline-message { min-height: 1.3rem; color: var(--gold); font-size: .85rem; }
.login-security { margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }

.button { border: 1px solid transparent; border-radius: 10px; padding: .72rem 1rem; font-weight: 750; cursor: pointer; transition: .18s ease; background: #263229; }
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button:disabled { opacity: .48; cursor: wait; transform: none; }
.button.primary { background: var(--green); color: #0a160d; }
.button.success { background: rgba(115,226,155,.14); color: #9bf1b7; border-color: rgba(115,226,155,.28); }
.button.warning { background: rgba(240,163,92,.12); color: #ffc58f; border-color: rgba(240,163,92,.27); }
.button.danger { background: rgba(255,122,122,.12); color: #ffaaaa; border-color: rgba(255,122,122,.26); }
.button.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.button.compact { padding: .5rem .78rem; font-size: .8rem; }
.button.wide { width: 100%; }
.button-row { display: flex; gap: .65rem; flex-wrap: wrap; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 1.3rem; border-right: 1px solid var(--line); background: rgba(11, 16, 13, .93); display: flex; flex-direction: column; z-index: 3; }
.brand { display: flex; align-items: center; gap: .85rem; padding: .25rem .3rem 1.5rem; }
.brand strong, .brand span { display: block; }
.brand span { color: var(--muted); font-size: .72rem; margin-top: .15rem; }
.nav-list { display: grid; gap: .35rem; }
.nav-item { width: 100%; border: 0; background: transparent; color: var(--muted); padding: .82rem .9rem; border-radius: 10px; text-align: left; cursor: pointer; font-weight: 700; display: flex; gap: .8rem; align-items: center; }
.nav-item span { width: 20px; color: #7c9984; font-family: ui-monospace, monospace; }
.nav-item:hover { background: rgba(255,255,255,.03); color: var(--text); }
.nav-item.active { color: #b7f7ca; background: rgba(115,226,155,.11); box-shadow: inset 3px 0 0 var(--green); }
.sidebar-bottom { margin-top: auto; }
.admin-chip { display: flex; align-items: center; gap: .65rem; padding: .8rem .2rem; border-top: 1px solid var(--line); }
.admin-chip strong, .admin-chip small { display: block; }
.admin-chip small { color: var(--muted); margin-top: .1rem; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #24442e; color: var(--green); font-weight: 900; }

.main { padding: 1.8rem clamp(1rem, 3vw, 3rem) 4rem; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.6rem; }
.topbar h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.1rem); letter-spacing: -.04em; }
.top-status { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .84rem; }
.tab-page { display: none; animation: page-in .2s ease; }
.tab-page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }

.hero { padding: 1.45rem 1.6rem; display: flex; justify-content: space-between; align-items: center; background: linear-gradient(110deg, rgba(35,64,43,.92), rgba(18,27,21,.92)); }
.hero h2 { margin: 0; font-size: 1.8rem; letter-spacing: -.04em; }
.hero p:last-child { margin-bottom: 0; }
.server-address { text-align: right; }
.server-address span { display: block; color: var(--muted); font-size: .72rem; margin-bottom: .35rem; }
.server-address button { border: 0; background: transparent; color: #bcf6cc; cursor: pointer; font-weight: 800; font-size: 1rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1rem 0; }
.metric-card { padding: 1.15rem 1.2rem; min-width: 0; }
.metric-label { color: var(--muted); font-size: .75rem; display: block; }
.metric-card strong { display: block; margin: .6rem 0 .22rem; font-size: 1.5rem; letter-spacing: -.035em; overflow: hidden; text-overflow: ellipsis; }
.metric-card small { color: #819087; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.section-card { padding: 1.25rem; margin-bottom: 1rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading h3 { margin: 0; font-size: 1.1rem; }
.section-heading .eyebrow { margin-bottom: .25rem; }
.tag { padding: .3rem .55rem; border-radius: 999px; color: var(--muted); background: #101711; border: 1px solid var(--line); font-size: .7rem; white-space: nowrap; }
.stack-form { display: grid; gap: .7rem; }
textarea, input, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #0c120e; color: var(--text); padding: .72rem .8rem; outline: none; }
textarea:focus, input:focus, select:focus { border-color: rgba(115,226,155,.55); box-shadow: 0 0 0 3px rgba(115,226,155,.08); }
textarea { resize: vertical; }
.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.resource-grid span { display: block; margin-bottom: .55rem; font-size: .8rem; }
.resource-grid small { color: var(--muted); }
.progress { height: 7px; border-radius: 99px; background: #0a0f0c; overflow: hidden; margin-bottom: .42rem; }
.progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--green-deep), var(--green)); transition: width .4s ease; }

.player-list { display: grid; gap: .65rem; }
.player-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; padding: .85rem; border-radius: 11px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.player-identity { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.player-face { width: 36px; height: 36px; border-radius: 7px; display: grid; place-items: center; background: #263e2c; color: var(--green); font-weight: 900; }
.player-identity small { display: block; color: var(--muted); margin-top: .15rem; }
.player-tool-form { display: grid; grid-template-columns: 1fr 1fr 2fr auto; gap: .8rem; align-items: end; }
label { color: var(--muted); font-size: .78rem; }
label input, label select { margin-top: .42rem; }
.tip { font-size: .78rem; margin: 1rem 0 0; }
.empty-state { padding: 2rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }

.console-panel { padding: 1.2rem; }
.console-output { min-height: 520px; max-height: calc(100vh - 265px); overflow: auto; margin: 0; padding: 1rem; border-radius: 10px; border: 1px solid #26362a; background: #060906; color: #b9c8bc; font: 12px/1.55 "SFMono-Regular", Consolas, "Liberation Mono", monospace; white-space: pre-wrap; word-break: break-word; }
.command-form { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .65rem; margin-top: .8rem; }
.command-form span { color: var(--green); font-family: monospace; font-weight: 900; }

.backup-note { padding: .8rem 1rem; margin-bottom: .8rem; border-radius: 9px; background: rgba(233,196,106,.08); border: 1px solid rgba(233,196,106,.16); color: #d6c896; font-size: .78rem; }
.backup-note span { color: var(--gold); font-weight: 800; margin-right: .5rem; }
.backup-list { display: grid; gap: .55rem; }
.backup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: .9rem; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.backup-row strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.backup-row small { color: var(--muted); display: block; margin-top: .25rem; }
.backup-actions { display: flex; gap: .45rem; }
.backup-actions a { text-decoration: none; }

.protected-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: 1rem; }
.protected-item { padding: .75rem; border-radius: 9px; background: #0d140f; border: 1px solid var(--line); }
.protected-item span, .protected-item strong { display: block; }
.protected-item span { color: var(--muted); font-size: .7rem; margin-bottom: .28rem; }
.protected-item strong { color: #b4ecc4; font-size: .85rem; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem 1rem; }
.span-two { grid-column: span 2; }
.settings-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-top: .5rem; }
.settings-actions p { margin: 0; font-size: .78rem; }

.toast { position: fixed; right: 1.2rem; bottom: 1.2rem; max-width: min(420px, calc(100vw - 2.4rem)); padding: .85rem 1rem; border-radius: 10px; background: #edf9f0; color: #102216; font-weight: 700; box-shadow: var(--shadow); transform: translateY(120px); opacity: 0; transition: .25s ease; z-index: 20; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #ffe3e3; color: #481414; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .player-tool-form { grid-template-columns: 1fr 1fr; }
  .player-tool-form .grow { grid-column: span 2; }
  .protected-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; height: auto; padding: .5rem; border-right: 0; border-top: 1px solid var(--line); flex-direction: row; z-index: 10; }
  .brand, .sidebar-bottom { display: none; }
  .nav-list { width: 100%; display: grid; grid-template-columns: repeat(6, 1fr); gap: .2rem; }
  .nav-item { justify-content: center; padding: .65rem .2rem; font-size: .68rem; display: grid; text-align: center; gap: .15rem; }
  .nav-item span { width: auto; }
  .nav-item.active { box-shadow: inset 0 3px 0 var(--green); }
  .main { padding: 1rem 1rem 6rem; }
  .topbar { align-items: end; }
  .top-status { font-size: .7rem; }
  .hero, .two-column { display: grid; grid-template-columns: 1fr; }
  .server-address { text-align: left; margin-top: 1rem; }
  .metric-grid, .resource-grid, .protected-grid, .settings-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: span 1; }
  .player-tool-form { grid-template-columns: 1fr; }
  .player-tool-form .grow { grid-column: span 1; }
  .settings-actions { align-items: stretch; flex-direction: column; }
  .settings-actions .button { width: 100%; }
  .console-output { min-height: 55vh; }
  .backup-row { grid-template-columns: 1fr; }
}

.cheat-target-bar { padding: 1rem 1.2rem; display: grid; grid-template-columns: auto minmax(180px, 340px) 1fr; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.cheat-target-bar h3 { margin: 0; }
.quick-targets { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.cheat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cheat-card { padding: 1.15rem; }
.cheat-card-title { display: flex; gap: .75rem; align-items: center; padding-bottom: .9rem; margin-bottom: .9rem; border-bottom: 1px solid var(--line); }
.cheat-card-title > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: rgba(115,226,155,.1); color: var(--green); font: 700 .75rem ui-monospace, monospace; }
.cheat-card-title h3, .cheat-card-title p { margin: 0; }
.cheat-card-title p { color: var(--muted); font-size: .72rem; margin-top: .18rem; }
.mode-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.cheat-actions { margin-top: .8rem; }
.inline-grid { display: grid; gap: .55rem; align-items: end; margin-bottom: .7rem; }
.inline-grid.three { grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr) auto; }
.inline-grid.two { grid-template-columns: 1fr auto; margin-top: .8rem; }
.coordinate-form { display: grid; grid-template-columns: minmax(130px, 1.4fr) repeat(3, minmax(62px, .7fr)) auto; gap: .5rem; align-items: end; }
.compact-coordinates { grid-template-columns: repeat(3, minmax(62px, .7fr)) auto; margin-top: .8rem; }
.effect-form { display: grid; grid-template-columns: minmax(130px, 1.5fr) .7fr .7fr auto auto; gap: .5rem; align-items: end; }
.checkbox-label { min-height: 42px; display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.checkbox-label input { width: auto; margin: 0; accent-color: var(--green); }
.preset-kits, .world-buttons { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-top: .75rem; }
.preset-kits span, .world-buttons span { color: var(--muted); font-size: .72rem; min-width: 42px; }
.summon-form { display: grid; grid-template-columns: minmax(140px, 2fr) repeat(3, minmax(62px, .6fr)) auto; gap: .5rem; align-items: end; }

@media (max-width: 1180px) {
  .cheat-target-bar { grid-template-columns: auto 1fr; }
  .quick-targets { grid-column: span 2; }
  .cheat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .cheat-target-bar { grid-template-columns: 1fr; align-items: stretch; }
  .quick-targets { grid-column: span 1; }
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .inline-grid.three, .inline-grid.two, .coordinate-form, .compact-coordinates, .effect-form, .summon-form { grid-template-columns: 1fr 1fr; }
  .wide-field { grid-column: span 2; }
  .inline-grid button, .coordinate-form button, .effect-form button, .summon-form button { grid-column: span 2; }
}
