:root {
    color-scheme: dark;
    --bg: #0b1018;
    --sidebar: #0d131d;
    --surface: #121a25;
    --surface-2: #17212e;
    --border: #243041;
    --text: #edf3fa;
    --muted: #8b9aaf;
    --faint: #5f6f83;
    --green: #48d597;
    --green-dark: #143d31;
    --blue: #63a6ff;
    --violet: #a78bfa;
    --orange: #f8b65c;
    --red: #f87171;
    --radius: 12px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .42; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; letter-spacing: -.7px; line-height: 1.25; }
h2 { font-size: 20px; letter-spacing: -.35px; }
h3 { font-size: 15px; letter-spacing: -.15px; }
.muted { color: var(--muted); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 252px; display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid #1e2937; }
.brand { height: 75px; display: flex; align-items: center; gap: 11px; padding: 0 24px; font-size: 21px; font-weight: 750; letter-spacing: -.6px; }
.brand > span > span { color: var(--green); }
.brand-mark { width: 30px; height: 30px; position: relative; transform: rotate(-3deg); flex: none; }
.brand-mark span { position: absolute; display: block; }
.brand-mark span:nth-child(1) { width: 22px; height: 10px; left: 4px; top: 1px; background: #69e5ab; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.brand-mark span:nth-child(2) { width: 11px; height: 19px; left: 4px; top: 7px; background: #2c9e6d; clip-path: polygon(0 0, 100% 23%, 100% 100%, 0 75%); }
.brand-mark span:nth-child(3) { width: 11px; height: 19px; right: 4px; top: 7px; background: #43c68b; clip-path: polygon(0 23%, 100% 0, 100% 75%, 0 100%); }
.brand-mark.large { transform: scale(1.65); margin-bottom: 24px; }
.server-switcher { margin: 4px 14px 24px; padding: 12px; display: flex; align-items: center; gap: 10px; background: #131c27; border: 1px solid #223043; border-radius: 9px; }
.server-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: none; background: linear-gradient(145deg, #375d44, #20372b); border: 1px solid #4c7256; border-radius: 7px; color: #b8e4c5; font-size: 11px; font-weight: 800; }
.server-switcher > div:nth-child(2) { min-width: 0; flex: 1; }
.server-switcher strong, .server-switcher span { display: block; }
.server-switcher strong { font-size: 12px; white-space: nowrap; }
.server-switcher div > span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #64748b; box-shadow: 0 0 0 3px #64748b15; }
.status-dot.small { width: 7px; height: 7px; }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 3px #48d59715; }
.status-dot.starting { background: var(--orange); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.main-nav { padding: 0 12px; }
.nav-label { padding: 0 12px 8px; color: #5e6c7e; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; }
.nav-label.second { padding-top: 23px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #91a0b4; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 7px; text-align: left; font-size: 13px; transition: .15s ease; }
.nav-item:hover { color: var(--text); background: #141e2a; }
.nav-item.active { background: #193429; color: #75e6b2; font-weight: 600; }
.nav-icon { width: 19px; color: currentColor; font-size: 18px; line-height: 1; text-align: center; }
.sidebar-bottom { margin-top: auto; padding: 18px 16px; }
.resource-mini { padding: 0 8px 19px; }
.resource-mini > div:first-child { display: flex; justify-content: space-between; margin-bottom: 8px; }
.resource-mini span { color: var(--faint); font-size: 9px; letter-spacing: 1px; }
.resource-mini strong { color: var(--muted); font-size: 10px; }
.user-row { border-top: 1px solid var(--border); padding-top: 16px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; background: #26364a; border-radius: 50%; color: #c5d4e6; font-weight: 700; }
.user-row > div:nth-child(2) { flex: 1; }
.user-row strong, .user-row span { display: block; }
.user-row strong { font-size: 12px; }
.user-row span { color: var(--muted); font-size: 10px; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 18px; padding: 6px; }
.icon-button:hover { color: var(--text); }
.main-content { min-height: 100vh; margin-left: 252px; display: flex; flex-direction: column; background: radial-gradient(circle at 90% 0, #15231f45, transparent 26%), var(--bg); }
.topbar { height: 64px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #1d2734; background: #0c121bbb; }
.breadcrumb { display: flex; gap: 10px; font-size: 12px; }
.breadcrumb span, .breadcrumb b { color: var(--faint); font-weight: 400; }
.breadcrumb strong { font-weight: 500; color: #b4c0cf; }
.top-status { display: flex; align-items: center; gap: 8px; color: #aab8c8; font-size: 12px; }
.menu-button { display: none; border: 0; background: transparent; color: var(--text); font-size: 21px; }
.content-wrap { width: 100%; max-width: 1500px; margin: 0 auto; padding: 34px; flex: 1; }
.view { display: none; animation: fade-in .2s ease; }
.view.active { display: block; }
@keyframes fade-in { from { opacity: .5; transform: translateY(3px); } }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-heading p { color: var(--muted); margin-top: 7px; font-size: 13px; }
.eyebrow { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: 1.8px; margin-bottom: 7px; }
.version-badge { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--border); background: #111923; border-radius: 20px; color: #aab8c7; font-size: 11px; }
.version-badge > span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.card { background: linear-gradient(145deg, #131c27, #111923); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 25px #0000000a; }
.server-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 24px; margin-bottom: 18px; }
.hero-main { display: flex; align-items: center; gap: 17px; }
.grass-icon { width: 56px; height: 56px; flex: none; position: relative; border-radius: 11px; background: linear-gradient(#6c9f55 0 25%, #557b43 25% 32%, #6b4e36 32% 100%); box-shadow: inset 0 0 0 1px #ffffff13, 0 5px 16px #00000035; overflow: hidden; }
.grass-icon:after { content: ""; position: absolute; inset: 19px 0 0; opacity: .25; background: repeating-linear-gradient(90deg, transparent 0 12px, #2b1d15 12px 20px); }
.hero-title { display: flex; align-items: center; gap: 12px; }
.hero-main p { color: var(--muted); font-size: 11px; margin-top: 3px; }
.pill { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 20px; background: #273140; color: #a5b2c2; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.pill.online { background: var(--green-dark); color: var(--green); }
.pill.offline { background: #2b303a; color: #a4afbe; }
.address-copy { margin-top: 9px; display: flex; align-items: center; gap: 8px; padding: 0; background: none; border: 0; color: #b8c8da; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.address-copy b { color: var(--faint); font-family: Inter, sans-serif; font-weight: 500; font-size: 9px; }
.address-copy:hover b { color: var(--green); }
.power-controls { display: flex; gap: 8px; }
.button { border: 1px solid transparent; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 8px 14px; color: var(--text); font-size: 11px; font-weight: 650; transition: .15s ease; white-space: nowrap; }
.button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.button.primary { background: var(--green); color: #082419; border-color: var(--green); }
.button.success { background: #1f9d68; border-color: #2ab97c; color: white; }
.button.secondary { background: #1b2634; border-color: #314054; color: #c7d3e0; }
.button.danger-ghost { background: #241a20; border-color: #4b2d36; color: #ef9b9b; }
.button.small { min-height: 30px; padding: 5px 10px; font-size: 10px; }
.button.full { width: 100%; min-height: 44px; justify-content: space-between; padding: 10px 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { padding: 18px 19px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.stat-top > span:first-child { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .8px; }
.stat-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 6px; font-size: 14px; }
.stat-icon.green { color: var(--green); background: #48d59712; }
.stat-icon.blue { color: var(--blue); background: #63a6ff12; }
.stat-icon.violet { color: var(--violet); background: #a78bfa12; }
.stat-icon.orange { color: var(--orange); background: #f8b65c12; }
.stat-value { display: block; font-size: 25px; line-height: 1.2; letter-spacing: -.7px; }
.stat-value small { color: var(--faint); font-size: 13px; font-weight: 500; }
.stat-card p { margin-top: 6px; color: var(--faint); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 4px; overflow: hidden; background: #273140; border-radius: 10px; }
.progress > span { display: block; width: 0; height: 100%; background: var(--green); border-radius: 10px; transition: width .4s ease; }
.progress.large { margin-top: 12px; height: 5px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; }
.activity-card { min-width: 0; padding: 20px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.card-heading p { color: var(--muted); font-size: 10px; margin-top: 4px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--green); font-size: 10px; }
.text-button:hover { text-decoration: underline; }
.mini-console { height: 242px; overflow: hidden; padding: 15px; margin: 0; border: 1px solid #202c3b; border-radius: 8px; background: #0a1018; color: #8193a8; font: 10px/1.85 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.side-stack { display: grid; gap: 18px; }
.system-card, .info-card { padding: 19px; }
.healthy-badge { color: var(--green); font-size: 9px; }
.resource-row { margin-top: 14px; }
.resource-row > div:first-child { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 10px; color: var(--muted); }
.resource-row strong { color: #b9c7d7; font-weight: 600; }
dl { margin: 0; }
dl > div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 10px; }
dt { color: var(--muted); }
dd { margin: 0; color: #c1cdd9; }
.secure-text { color: var(--green); font-size: 10px; }
.footer { display: flex; justify-content: space-between; padding: 15px 34px; border-top: 1px solid #1a2430; color: #4f5f72; font-size: 9px; }

.terminal-card { overflow: hidden; }
.terminal-head { min-height: 47px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 17px; border-bottom: 1px solid var(--border); color: var(--muted); font: 10px ui-monospace, monospace; }
.terminal-head > div { display: flex; gap: 6px; }
.terminal-head > button { justify-self: end; }
.terminal-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.terminal-dot.red { background: #e66b6b; }
.terminal-dot.yellow { background: #d9ae56; }
.terminal-dot.green { background: #52bb82; }
.console-output { height: min(58vh, 600px); margin: 0; padding: 20px; overflow: auto; background: #080e15; color: #a9bbcd; font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.console-form { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--border); background: #101823; }
.console-form > span { color: var(--green); font: 20px ui-monospace, monospace; }
.console-form input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: 12px ui-monospace, monospace; }
.hint-box { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; margin: 16px 0; border: 1px solid #284338; border-radius: 8px; background: #13261f66; color: #8da89b; font-size: 11px; }
.hint-box strong { color: #a4d9be; white-space: nowrap; }
.player-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 18px; }
.player-grid > .card, .operator-card { padding: 21px; }
.operator-card { margin-top: 18px; }
.count-badge { min-width: 25px; height: 25px; display: grid; place-items: center; background: #213528; border-radius: 6px; color: var(--green); font-size: 11px; }
.inline-form { display: flex; gap: 9px; margin: 5px 0 17px; }
.inline-form input { flex: 1; min-width: 0; }
.player-list { display: grid; gap: 3px; }
.player-list.horizontal { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.player-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 45px; padding: 6px 7px; border-bottom: 1px solid #202b38; }
.player-identity { display: flex; align-items: center; gap: 10px; }
.player-identity strong { font-size: 11px; font-weight: 550; }
.player-avatar { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; background: #293b4d; color: #bcd0e4; font-size: 10px; font-weight: 700; }
.danger-text { color: #dc8888; }
.empty-state { color: var(--faint) !important; font-size: 11px !important; padding: 15px 0; }
.table-card { padding: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--faint); font-size: 9px; text-transform: uppercase; letter-spacing: .8px; }
td { padding: 14px 12px; border-bottom: 1px solid #1f2a38; color: var(--muted); font-size: 11px; }
td strong { color: #c6d2df; font-weight: 550; }
td:first-child { min-width: 230px; }
.file-icon { color: var(--green); margin-right: 9px; }
.align-right { text-align: right; }
.action-cell { min-width: 165px; }
.action-cell .button + .button { margin-left: 6px; }
.settings-card { padding: 0 24px; }
.settings-section { display: grid; grid-template-columns: 1fr 2fr; gap: 35px; padding: 26px 0; border-bottom: 1px solid var(--border); }
.settings-section > div:first-child p { color: var(--muted); font-size: 11px; margin-top: 6px; }
.settings-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-fields label { color: #c2ceda; font-size: 11px; }
.settings-fields label:first-child { grid-column: 1 / -1; }
.settings-fields small { display: block; color: var(--faint); margin-top: 6px; font-size: 9px; }
input, select { width: 100%; margin-top: 7px; padding: 10px 12px; border: 1px solid #2d3b4e; outline: none; border-radius: 7px; background: #0d151f; color: var(--text); font-size: 12px; transition: border .15s; }
input:focus, select:focus { border-color: #49b783; box-shadow: 0 0 0 3px #48d5970c; }
.toggle-label { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.toggle-label > span { grid-column: 1; }
.toggle { appearance: none; width: 36px; height: 20px; flex: none; padding: 0; margin: 0; border-radius: 20px; background: #344154; position: relative; cursor: pointer; }
.toggle:after { content: ""; position: absolute; width: 14px; height: 14px; top: 2px; left: 3px; border-radius: 50%; background: #9baaba; transition: .15s; }
.toggle:checked { background: #267d57; border-color: #329b6c; }
.toggle:checked:after { left: 17px; background: #bcf1d7; }
.settings-footer { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }
.settings-footer > span { color: var(--muted); font-size: 10px; }

.toast { position: fixed; right: 25px; bottom: 25px; z-index: 100; max-width: 390px; padding: 13px 18px; border: 1px solid #36644f; border-radius: 9px; background: #142a21; box-shadow: 0 12px 40px #0008; color: #b5e5ce; font-size: 12px; opacity: 0; transform: translateY(15px); pointer-events: none; transition: .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: #2e191d; border-color: #69343e; color: #f2b0b0; }
.sidebar-overlay { display: none; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 15% 15%, #163e2c55, transparent 30%), radial-gradient(circle at 90% 90%, #1c304955, transparent 28%), #090f16; }
.login-shell { width: min(960px, 100%); display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #253243; border-radius: 18px; overflow: hidden; background: #0f1721; box-shadow: 0 30px 100px #0007; }
.login-brand { min-height: 520px; padding: 55px 48px; background: linear-gradient(145deg, #12271e99, transparent), repeating-linear-gradient(135deg, transparent 0 20px, #ffffff03 20px 21px); display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--border); }
.login-brand h1 { font-size: 43px; line-height: 1.13; letter-spacing: -1.6px; margin: 9px 0 20px; }
.login-brand p { color: var(--muted); max-width: 320px; }
.login-feature { display: flex; align-items: center; gap: 8px; margin-top: 45px; color: #82968c; font-size: 10px; }
.feature-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 50px; }
.login-card h2 { font-size: 23px; margin-bottom: 8px; }
.stack-form { margin-top: 26px; }
.stack-form label { display: block; margin: 16px 0 0; color: #bac7d5; font-size: 11px; }
.stack-form input { margin-top: 7px; min-height: 43px; }
.stack-form .button { margin-top: 24px; }
.login-foot { color: var(--faint); text-align: center; margin-top: 24px; font-size: 9px; }
.mobile-brand { display: none; }
.alert { padding: 11px 13px; margin-top: 18px; border-radius: 7px; font-size: 11px; }
.alert.error { background: #341d23; border: 1px solid #61313d; color: #f0a8b1; }
.error-card { max-width: 450px; padding: 45px; text-align: center; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.error-card .brand-mark { margin-left: auto; margin-right: auto; }
.error-card p { margin: 12px 0 24px; }

@media (min-width: 1500px) {
    .content-wrap { padding: 40px 45px; }
    .stat-card { padding: 22px; }
}
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .side-stack { grid-template-columns: 1fr 1fr; }
    .mini-console { height: 200px; }
    .player-grid { grid-template-columns: 1fr; }
    .settings-section { grid-template-columns: 1fr 2fr; gap: 20px; }
}
@media (max-width: 800px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.visible { display: block; position: fixed; inset: 0; z-index: 20; background: #0009; backdrop-filter: blur(2px); }
    .main-content { margin-left: 0; }
    .menu-button { display: block; }
    .topbar { padding: 0 20px; gap: 15px; }
    .breadcrumb { margin-right: auto; }
    .content-wrap { padding: 25px 20px; }
    .server-hero { align-items: flex-start; flex-direction: column; }
    .power-controls { width: 100%; }
    .power-controls .button { flex: 1; }
    .login-shell { grid-template-columns: 1fr; max-width: 480px; }
    .login-brand { display: none; }
    .mobile-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 40px; font-size: 19px; }
    .settings-section { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    h1 { font-size: 25px; }
    .content-wrap { padding: 22px 14px; }
    .topbar { padding: 0 14px; }
    .breadcrumb span, .breadcrumb b { display: none; }
    .page-heading { align-items: flex-start; }
    .version-badge { display: none; }
    .stat-grid { gap: 10px; }
    .stat-card { padding: 15px; }
    .stat-value { font-size: 22px; }
    .side-stack { grid-template-columns: 1fr; }
    .server-hero { padding: 18px; }
    .grass-icon { width: 45px; height: 45px; }
    .hero-main { gap: 12px; }
    .hero-title { display: block; }
    .hero-title h2 { font-size: 17px; }
    .hero-title .pill { margin-top: 5px; }
    .power-controls .button { padding: 8px; }
    .power-controls .button span { display: none; }
    .footer { padding: 14px; }
    .footer span:last-child { display: none; }
    .terminal-head { grid-template-columns: 1fr 1fr; }
    .terminal-head > span { display: none; }
    .console-form { flex-wrap: wrap; }
    .console-form input { min-width: 80%; }
    .console-form .button { width: 100%; }
    .console-output { font-size: 10px; padding: 13px; }
    .hint-box { display: block; }
    .hint-box strong { display: block; margin-bottom: 4px; }
    .settings-fields { grid-template-columns: 1fr; }
    .settings-fields label:first-child { grid-column: auto; }
    .settings-footer { gap: 15px; }
    .settings-footer > span { max-width: 160px; }
    .login-body { padding: 15px; }
    .login-card { padding: 35px 28px; }
    .toast { left: 14px; right: 14px; bottom: 14px; }
}
