:root {
    --bg: #080d1b;
    --sidebar: #07101f;
    --surface: #10192a;
    --surface-2: #151f33;
    --surface-3: #0b1424;
    --border: rgba(129, 144, 170, 0.18);
    --border-strong: rgba(129, 144, 170, 0.3);
    --text: #e8eef9;
    --muted: #8190aa;
    --cyan: #22d3ee;
    --violet: #8b5cf6;
    --violet-light: #a78bfa;
    --success: #5ed266;
    --danger: #ff4f5e;
    --blue: #4294ff;
    --warning: #f8b84e;
    --sidebar-width: 220px;
    --radius: 10px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.025);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 74% -10%, rgba(139, 92, 246, 0.09), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-size: 14px;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

button,
a,
input {
    outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.3);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mobile-only {
    display: none;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brand-mark {
    position: relative;
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--cyan);
    font-size: 0;
    font-weight: 900;
}

.brand-mark::before,
.brand-mark::after {
    content: "";
    position: absolute;
}

.brand-mark::before {
    width: 24px;
    height: 24px;
    border-right: 4px solid var(--cyan);
    border-top: 4px solid var(--cyan);
    transform: rotate(-45deg) skew(7deg, 7deg);
}

.brand-mark::after {
    width: 16px;
    height: 4px;
    background: var(--cyan);
    transform: translateY(6px) skew(-28deg);
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.3);
}

.brand-name {
    color: #f7f9fd;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 12px rgba(94, 210, 102, 0.55);
}

.status-dot.is-offline {
    background: var(--danger);
    box-shadow: 0 0 12px rgba(255, 79, 94, 0.4);
}

.status-dot.is-loading {
    background: var(--warning);
    animation: pulse 1.1s infinite;
}

@keyframes pulse {
    50% { opacity: 0.35; }
}

/* Login */
.auth-body {
    overflow-x: hidden;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(360px, 520px) 1fr;
}

.login-panel {
    position: relative;
    z-index: 2;
    display: flex;
    padding: clamp(38px, 6vw, 82px);
    border-right: 1px solid var(--border);
    background: rgba(7, 16, 31, 0.94);
    flex-direction: column;
    justify-content: center;
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.28);
}

.login-brand {
    position: absolute;
    top: 42px;
    left: clamp(38px, 6vw, 82px);
    display: flex;
    align-items: center;
    gap: 13px;
}

.login-brand > div:last-child {
    display: grid;
    gap: 2px;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brand-mark-large {
    width: 42px;
    height: 42px;
}

.brand-mark-large::before {
    width: 29px;
    height: 29px;
}

.login-copy h1 {
    margin: 0 0 12px;
    color: #f5f8ff;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.login-copy > p:last-child {
    max-width: 360px;
    margin: 0 0 28px;
    color: var(--muted);
    line-height: 1.65;
}

.form-alert {
    padding: 11px 13px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 79, 94, 0.35);
    border-radius: 8px;
    background: rgba(255, 79, 94, 0.08);
    color: #ffb4bb;
    font-size: 13px;
}

.login-form {
    display: grid;
    max-width: 370px;
    gap: 16px;
}

.login-form label {
    display: grid;
    gap: 8px;
}

.login-form label > span {
    color: #bdc8da;
    font-size: 12px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: rgba(10, 20, 36, 0.9);
    color: var(--text);
    transition: border-color 160ms, background 160ms;
}

.login-form input:hover,
.login-form input:focus {
    border-color: rgba(34, 211, 238, 0.48);
    background: #0c1728;
}

.login-form input::placeholder {
    color: #526079;
}

.primary-button,
.secondary-button,
.danger-button {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

.primary-button {
    background: linear-gradient(135deg, #7650eb, #5f38d2);
    color: white;
    box-shadow: 0 12px 30px rgba(102, 61, 214, 0.25);
}

.login-button {
    margin-top: 4px;
}

.login-security {
    display: flex;
    max-width: 370px;
    margin-top: 18px;
    align-items: center;
    gap: 8px;
    color: #64738d;
    font-size: 11px;
    line-height: 1.4;
}

.login-security .status-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
}

.login-atmosphere {
    position: relative;
    display: grid;
    overflow: hidden;
    min-height: 100vh;
    place-items: center;
    background:
        radial-gradient(circle at 52% 46%, rgba(34, 211, 238, 0.09), transparent 22%),
        radial-gradient(circle at 53% 48%, rgba(139, 92, 246, 0.17), transparent 42%),
        #080d1b;
}

.atmosphere-grid {
    position: absolute;
    inset: 0;
    opacity: 0.28;
    background-image:
        linear-gradient(rgba(129, 144, 170, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(129, 144, 170, 0.08) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, black, transparent 75%);
}

.atmosphere-core {
    position: relative;
    z-index: 2;
    display: grid;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 34px;
    place-items: center;
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--cyan);
    font-size: 74px;
    font-weight: 900;
    box-shadow: 0 0 80px rgba(34, 211, 238, 0.12), inset 0 0 50px rgba(139, 92, 246, 0.08);
    transform: rotate(-6deg);
}

.atmosphere-orbit {
    position: absolute;
    border: 1px solid rgba(129, 144, 170, 0.15);
    border-radius: 50%;
}

.orbit-one {
    width: 350px;
    height: 350px;
    border-color: rgba(139, 92, 246, 0.22);
    animation: slow-spin 18s linear infinite;
}

.orbit-two {
    width: 520px;
    height: 240px;
    transform: rotate(-24deg);
    border-color: rgba(34, 211, 238, 0.18);
}

@keyframes slow-spin {
    to { transform: rotate(360deg); }
}

.login-atmosphere > p {
    position: absolute;
    bottom: 52px;
    color: rgba(232, 238, 249, 0.18);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6em;
}

.setup-screen {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
}

.setup-card {
    width: min(520px, 100%);
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}

.setup-card h1 {
    margin: 16px 0 10px;
}

.setup-card p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.6;
}

.setup-card code {
    display: block;
    padding: 13px;
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #050a13;
    color: var(--cyan);
}

/* App shell */
.app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--sidebar-width);
    padding: 24px 10px 14px;
    border-right: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(7, 16, 31, 0.98), rgba(5, 12, 24, 0.98));
    flex-direction: column;
}

.brand {
    display: flex;
    height: 52px;
    padding: 0 12px;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.sidebar-nav {
    display: grid;
    margin-top: 24px;
    gap: 7px;
}

.nav-item {
    display: flex;
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 7px;
    align-items: center;
    gap: 13px;
    background: transparent;
    color: #9eabc0;
    cursor: pointer;
    text-align: left;
    transition: 160ms ease;
}

.nav-item svg,
.icon-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item:hover {
    background: rgba(129, 144, 170, 0.06);
    color: #d8e0ed;
}

.nav-item.is-active {
    border-color: rgba(139, 92, 246, 0.6);
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.22), rgba(139, 92, 246, 0.1));
    color: #f2efff;
    box-shadow: inset 3px 0 0 var(--violet);
}

.sidebar-footer {
    display: flex;
    padding: 16px 6px 0;
    margin-top: auto;
    border-top: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
}

.sidebar-user {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.sidebar-user > span:last-child {
    display: grid;
    min-width: 0;
}

.sidebar-user b {
    overflow: hidden;
    max-width: 98px;
    font-size: 12px;
    text-overflow: ellipsis;
}

.sidebar-user small {
    color: var(--muted);
    font-size: 9px;
}

.user-avatar {
    display: grid;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(34, 211, 238, 0.25);
    border-radius: 8px;
    place-items: center;
    background: rgba(34, 211, 238, 0.08);
    color: var(--cyan);
    font-size: 12px;
    font-weight: 900;
}

.icon-button {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    place-items: center;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.icon-button:hover {
    color: var(--danger);
}

.workspace {
    min-width: 0;
    padding: 10px 12px 20px;
    grid-column: 2;
}

.server-header {
    display: grid;
    min-height: 80px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    align-items: center;
    grid-template-columns: minmax(190px, 1.3fr) repeat(4, minmax(105px, 0.8fr)) auto;
    background: linear-gradient(180deg, rgba(16, 25, 42, 0.92), rgba(10, 19, 34, 0.92));
    box-shadow: var(--shadow);
}

.server-identity,
.server-fact {
    display: flex;
    min-width: 0;
    min-height: 42px;
    padding: 0 18px;
    border-right: 1px solid var(--border-strong);
    align-items: center;
    gap: 12px;
}

.server-identity {
    padding-left: 6px;
}

.server-identity > div,
.server-fact {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
}

.server-fact strong,
.server-identity strong {
    overflow: hidden;
    max-width: 100%;
    color: #f5f7fc;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-label {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.server-rack {
    display: grid;
    width: 32px;
    height: 32px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #0a1323;
    gap: 3px;
}

.server-rack i {
    position: relative;
    display: block;
    height: 4px;
    border-radius: 1px;
    background: #a7b3c7;
}

.server-rack i::after {
    content: "";
    position: absolute;
    top: 1px;
    right: 2px;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--cyan);
}

.status-value {
    display: flex;
    align-items: center;
    gap: 7px;
}

.last-update {
    padding-left: 12px;
    color: #55627a;
    font-size: 9px;
    white-space: nowrap;
}

.page-section {
    display: none;
    padding-top: 10px;
}

.page-section.is-active {
    display: block;
    animation: section-in 180ms ease-out;
}

@keyframes section-in {
    from { opacity: 0; transform: translateY(4px); }
}

.section-heading {
    display: flex;
    min-height: 68px;
    padding: 4px 3px;
    align-items: center;
    justify-content: space-between;
}

.section-heading h1 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -0.025em;
}

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

.metric-card,
.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(17, 27, 45, 0.98), rgba(12, 21, 37, 0.98));
    box-shadow: var(--shadow);
}

.metric-card {
    min-height: 158px;
    padding: 15px 16px 13px;
}

.card-title-row {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title-row h2 {
    overflow: hidden;
    margin: 0;
    color: #f0f4fa;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.metric-caption {
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-body {
    display: grid;
    height: 105px;
    align-items: center;
    gap: 10px;
    grid-template-columns: 82px minmax(0, 1fr);
}

.metric-ring {
    --p: 0;
    position: relative;
    display: grid;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    place-items: center;
    background: conic-gradient(from 200deg, var(--violet-light) calc(var(--p) * 1%), #22304b 0);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.12);
}

.metric-ring::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: inherit;
    background: #101a2d;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.35);
}

.metric-ring span {
    position: relative;
    z-index: 1;
    max-width: 60px;
    color: white;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.12;
    text-align: center;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.sparkline {
    width: 100%;
    height: 66px;
}

.dashboard-middle {
    display: grid;
    margin-top: 8px;
    gap: 8px;
    grid-template-columns: minmax(220px, 0.78fr) minmax(250px, 0.98fr) minmax(360px, 1.52fr);
}

.dashboard-middle .panel {
    min-height: 286px;
    padding: 15px;
}

.subtle-badge,
.large-badge {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--muted);
    font-size: 9px;
}

.large-badge {
    padding: 8px 12px;
    font-size: 12px;
}

.control-stack {
    display: grid;
    margin-top: 14px;
    gap: 10px;
}

.server-action {
    display: grid;
    min-height: 66px;
    padding: 10px 14px;
    border: 1px solid currentColor;
    border-radius: 7px;
    align-items: center;
    grid-template-columns: 34px 1fr;
    grid-template-rows: 1fr 1fr;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: transform 150ms, background 150ms, box-shadow 150ms;
}

.server-action:hover:not(:disabled) {
    transform: translateY(-1px);
}

.server-action > span {
    grid-row: 1 / 3;
    font-size: 18px;
    text-align: center;
}

.server-action b {
    font-size: 13px;
}

.server-action small {
    color: var(--muted);
    font-size: 9px;
}

.server-action.start {
    border-color: rgba(94, 210, 102, 0.55);
    color: var(--success);
}

.server-action.start:hover:not(:disabled) {
    background: rgba(94, 210, 102, 0.07);
    box-shadow: 0 8px 22px rgba(94, 210, 102, 0.08);
}

.server-action.stop {
    border-color: rgba(255, 79, 94, 0.6);
    color: var(--danger);
}

.server-action.stop:hover:not(:disabled) {
    background: rgba(255, 79, 94, 0.07);
}

.server-action.restart {
    border-color: rgba(66, 148, 255, 0.6);
    color: var(--blue);
}

.server-action.restart:hover:not(:disabled) {
    background: rgba(66, 148, 255, 0.07);
}

.server-action.is-pending {
    animation: action-pending 1s infinite alternate;
}

@keyframes action-pending {
    to { opacity: 0.55; }
}

.text-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--violet-light);
    font-size: 9px;
    cursor: pointer;
}

.players-list {
    display: grid;
    margin-top: 10px;
    gap: 5px;
}

.player-row {
    display: flex;
    min-height: 39px;
    padding: 5px 8px;
    border: 1px solid rgba(129, 144, 170, 0.13);
    border-radius: 6px;
    align-items: center;
    gap: 9px;
    background: rgba(5, 12, 23, 0.24);
}

.player-avatar {
    display: grid;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 4px;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(139, 92, 246, 0.2)),
        #18243b;
    color: #e8faff;
    font-size: 9px;
    font-weight: 900;
    overflow: hidden;
}

.player-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.player-row strong {
    overflow: hidden;
    min-width: 0;
    flex: 1;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.signal {
    display: flex;
    height: 16px;
    align-items: flex-end;
    gap: 2px;
}

.signal i {
    display: block;
    width: 2px;
    background: var(--success);
}

.signal i:nth-child(1) { height: 5px; }
.signal i:nth-child(2) { height: 8px; }
.signal i:nth-child(3) { height: 12px; }
.signal i:nth-child(4) { height: 16px; }

.empty-state {
    display: grid;
    min-height: 190px;
    place-items: center;
    align-content: center;
    color: var(--muted);
    text-align: center;
}

.empty-state p {
    margin: 8px 0 0;
    font-size: 11px;
}

.empty-icon {
    display: grid;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    place-items: center;
    color: var(--violet-light);
}

.performance-panel {
    display: grid;
    grid-template-rows: auto repeat(3, 1fr);
}

.chart-block {
    position: relative;
    min-height: 65px;
    margin-top: 4px;
    border-top: 1px solid rgba(129, 144, 170, 0.1);
}

.chart-block span {
    position: absolute;
    z-index: 2;
    top: 7px;
    left: 0;
    color: #9eabc0;
    font-size: 9px;
}

.chart-block canvas {
    position: absolute;
    inset: 18px 0 0;
    width: 100%;
    height: calc(100% - 18px);
}

.console-panel {
    overflow: hidden;
    padding: 14px;
}

.dashboard-console {
    margin-top: 8px;
}

.console-state {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 9px;
}

.console-state i {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--warning);
    animation: pulse 1.2s infinite;
}

.console-state.is-connected i,
.console-state i.is-connected {
    background: var(--success);
    animation: none;
}

.console-state.is-error i,
.console-state i.is-error {
    background: var(--danger);
    animation: none;
}

.console-output {
    overflow: auto;
    height: 180px;
    padding: 11px 12px;
    margin-top: 10px;
    border: 1px solid rgba(129, 144, 170, 0.22);
    border-radius: 6px 6px 0 0;
    background: #050a13;
    color: #cbd5e5;
    font-family: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
    font-size: 10.5px;
    line-height: 1.55;
    scrollbar-color: #3a4964 #08101d;
}

.console-line {
    min-height: 16px;
    word-break: break-word;
    white-space: pre-wrap;
}

.console-line .line-time {
    margin-right: 8px;
    color: #596780;
}

.console-line.is-warn { color: #f6c76d; }
.console-line.is-error { color: #ff808b; }
.console-line.is-info { color: #bfcadd; }
.console-line.is-command { color: #a78bfa; }
.console-line.is-response { color: #6fe3ef; }

.command-form {
    display: grid;
    height: 43px;
    border: 1px solid var(--border-strong);
    border-top: 0;
    border-radius: 0 0 6px 6px;
    align-items: center;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    background: #0a1424;
}

.command-form .prompt {
    color: var(--violet-light);
    font-family: monospace;
    font-size: 20px;
    text-align: center;
}

.command-form input {
    min-width: 0;
    height: 100%;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 11px;
}

.command-form input::placeholder {
    color: #56647c;
}

.command-form button {
    height: 32px;
    padding: 0 16px;
    margin-right: 5px;
    border: 1px solid rgba(167, 139, 250, 0.5);
    border-radius: 5px;
    background: linear-gradient(135deg, #7650eb, #5f38d2);
    color: white;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.console-full .console-output {
    height: calc(100vh - 245px);
    min-height: 470px;
}

.players-page-panel {
    padding: 16px;
}

.players-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
}

.players-grid .player-row {
    min-height: 58px;
    padding: 9px 11px;
}

.players-grid .player-avatar {
    width: 36px;
    height: 36px;
}

.players-grid .player-row strong {
    font-size: 13px;
}

.player-management-row {
    display: grid;
    min-height: 72px !important;
    grid-template-columns: 42px minmax(120px, 1fr) auto auto;
}

.player-management-row .signal { margin-right: 12px; }

.player-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.player-action-button {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: #0b1424;
    color: #bac5d8;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}

.player-action-button.is-positive { border-color: rgba(94, 210, 102, .35); color: #87e58e; }
.player-action-button.is-warning { border-color: rgba(248, 184, 78, .4); color: #ffd083; }
.player-action-button.is-danger { border-color: rgba(255, 79, 94, .42); color: #ff9ba4; }
.player-action-button:hover:not(:disabled) { background: rgba(129, 144, 170, .1); }
.player-action-button:disabled { opacity: .42; cursor: wait; }

/* server.properties */
.properties-panel { padding: 22px; }
.settings-warning { display: flex; padding: 15px 17px; border: 1px solid rgba(248, 184, 78, .28); border-radius: 8px; align-items: center; gap: 13px; background: rgba(248, 184, 78, .06); }
.settings-warning > span { display: grid; width: 32px; height: 32px; border: 1px solid rgba(248, 184, 78, .45); border-radius: 50%; place-items: center; color: var(--warning); font-weight: 900; }
.settings-warning b { color: #ffe1a9; font-size: 12px; }
.settings-warning p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.properties-form { display: grid; margin-top: 18px; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.property-field { display: grid; min-height: 106px; padding: 15px; border: 1px solid var(--border); border-radius: 8px; align-content: center; gap: 6px; background: rgba(5, 12, 23, .25); }
.property-field > span { font-size: 12px; font-weight: 800; }
.property-field > small { color: var(--muted); font-size: 9px; }
.property-field input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 6px; background: #091322; color: var(--text); }
.property-field.wide, .switch-field.wide { grid-column: 1 / -1; }
.switch-field { display: flex; min-height: 106px; padding: 15px; border: 1px solid var(--border); border-radius: 8px; align-items: center; justify-content: space-between; gap: 16px; background: rgba(5, 12, 23, .25); cursor: pointer; }
.switch-field > span { display: grid; gap: 6px; }
.switch-field b { font-size: 12px; }
.switch-field small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.switch-field input { position: absolute; opacity: 0; pointer-events: none; }
.switch-field i { position: relative; width: 46px; height: 25px; flex: 0 0 auto; border: 1px solid var(--border-strong); border-radius: 999px; background: #091322; transition: .16s; }
.switch-field i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #68758b; transition: .16s; }
.switch-field input:checked + i { border-color: rgba(94, 210, 102, .5); background: rgba(94, 210, 102, .15); }
.switch-field input:checked + i::after { background: var(--success); transform: translateX(21px); }
.properties-footer { display: flex; padding-top: 7px; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 16px; }
.properties-footer > span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

/* Plugin files */
.large-badge.is-danger { border-color: rgba(255, 79, 94, .5); color: #ff9ba4; }
.files-layout { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.files-layout:has(.file-editor:not(.is-hidden)) { grid-template-columns: minmax(420px, 1.12fr) minmax(340px, .88fr); }
.files-browser, .file-editor { padding: 16px; min-width: 0; }
.files-toolbar { display: flex; min-height: 48px; align-items: center; gap: 10px; }
.file-back { border: 1px solid var(--border); border-radius: 7px; }
.file-back:disabled { opacity: .3; }
.files-breadcrumb { display: flex; min-width: 0; flex: 1; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; }
.files-breadcrumb b { overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
.files-toolbar .secondary-button { min-height: 36px; font-size: 10px; }
.file-upload-form { display: grid; padding: 13px; margin: 10px 0; border: 1px dashed rgba(139, 92, 246, .35); border-radius: 8px; align-items: center; gap: 10px; grid-template-columns: minmax(220px, 1fr) auto auto; }
.file-picker { position: relative; display: grid; min-height: 70px; padding-left: 58px; align-content: center; gap: 2px; cursor: pointer; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker > span { position: absolute; left: 8px; display: grid; width: 38px; height: 38px; border: 1px solid rgba(34, 211, 238, .35); border-radius: 8px; place-items: center; color: var(--cyan); font-size: 22px; }
.file-picker b { font-size: 11px; }
.file-picker small, .overwrite-check { color: var(--muted); font-size: 9px; }
.overwrite-check { display: flex; align-items: center; gap: 6px; }
.file-upload-form .primary-button { min-height: 38px; font-size: 10px; }
.files-list { display: grid; gap: 5px; }
.file-row { display: grid; min-height: 56px; padding: 7px 9px; border: 1px solid rgba(129, 144, 170, .13); border-radius: 7px; align-items: center; gap: 10px; grid-template-columns: 38px minmax(0, 1fr) auto; background: rgba(5, 12, 23, .22); }
.file-icon { display: grid; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 6px; place-items: center; color: var(--violet-light); font-size: 8px; font-weight: 900; }
.file-icon.is-directory { color: var(--warning); }
.file-info { display: grid; min-width: 0; padding: 0; border: 0; gap: 4px; background: none; color: inherit; text-align: left; cursor: pointer; }
.file-info:disabled { cursor: default; }
.file-info b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.file-info small { color: var(--muted); font-size: 9px; }
.file-controls { display: flex; gap: 5px; }
.file-controls button { min-height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 5px; background: #0b1424; color: #b7c2d5; font-size: 8px; cursor: pointer; }
.file-controls button.is-delete { border-color: rgba(255, 79, 94, .35); color: #ff9ba4; }
.file-editor.is-hidden { display: none; }
.file-editor .card-title-row h2 { margin-top: 4px; font-size: 14px; text-transform: none; }
.file-editor textarea { width: 100%; height: min(60vh, 620px); min-height: 420px; padding: 14px; border: 1px solid var(--border); border-radius: 7px; background: #050b14; color: #d9e3f3; font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; tab-size: 4; }
.editor-footer { display: flex; margin-top: 10px; align-items: center; justify-content: space-between; gap: 12px; }
.editor-footer span { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.editor-footer .primary-button { min-height: 38px; flex: 0 0 auto; font-size: 10px; }

/* Audit */
.audit-panel { padding: 12px; }
.audit-head, .audit-row { display: grid; padding: 0 12px; align-items: center; gap: 12px; grid-template-columns: 150px 140px minmax(260px, 1fr) 80px; }
.audit-head { min-height: 34px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.audit-list { display: grid; gap: 4px; }
.audit-row { min-height: 52px; border: 1px solid rgba(129, 144, 170, .13); border-radius: 6px; background: rgba(5, 12, 23, .22); }
.audit-row time { color: var(--muted); font-size: 9px; }
.audit-row b { color: var(--cyan); font-size: 10px; }
.audit-row > span { font-size: 10px; line-height: 1.4; }
.audit-row i { color: var(--success); font-size: 9px; font-style: normal; font-weight: 800; }
.audit-row.is-failed { border-color: rgba(255, 79, 94, .22); }
.audit-row.is-failed i { color: var(--danger); }

.inventory-dialog { width: min(850px, calc(100vw - 30px)); padding: 20px; border: 1px solid var(--border-strong); border-radius: 10px; background: #0b1424; color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.6); }
.inventory-dialog::backdrop { background: rgba(2, 6, 14, .78); backdrop-filter: blur(5px); }
.inventory-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; }
.inventory-dialog h2 { margin: 0 0 12px; }
.inventory-dialog-head > button { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 50%; background: none; color: var(--text); font-size: 20px; cursor: pointer; }
.inventory-dialog pre { max-height: 60vh; padding: 14px; overflow: auto; border: 1px solid var(--border); border-radius: 7px; background: #050b14; color: #c8d5e8; font: 11px/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

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

.system-card {
    display: grid;
    min-height: 150px;
    padding: 18px;
    align-content: center;
    gap: 8px;
}

.system-card > span {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.system-card > strong {
    overflow: hidden;
    font-size: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.system-card > small {
    color: #67758f;
    font-size: 10px;
}

.security-card {
    display: flex;
    min-height: 150px;
    padding: 18px;
    border-color: rgba(94, 210, 102, 0.24);
    align-items: center;
    gap: 14px;
    background: linear-gradient(145deg, rgba(94, 210, 102, 0.07), rgba(12, 21, 37, 0.98));
}

.security-icon {
    display: grid;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(94, 210, 102, 0.35);
    border-radius: 50%;
    place-items: center;
    color: var(--success);
    flex: 0 0 auto;
}

.security-card strong {
    font-size: 14px;
}

.security-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.confirm-dialog {
    width: min(420px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: #10192a;
    color: var(--text);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
}

.confirm-dialog::backdrop {
    background: rgba(2, 6, 14, 0.75);
    backdrop-filter: blur(4px);
}

.confirm-dialog form {
    display: grid;
    padding: 26px;
    justify-items: center;
    text-align: center;
}

.dialog-icon {
    display: grid;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(66, 148, 255, 0.35);
    border-radius: 50%;
    place-items: center;
    background: rgba(66, 148, 255, 0.08);
    color: var(--blue);
    font-size: 24px;
}

.confirm-dialog h2 {
    margin: 17px 0 8px;
    font-size: 20px;
}

.confirm-dialog p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.dialog-actions {
    display: grid;
    width: 100%;
    margin-top: 24px;
    gap: 9px;
    grid-template-columns: 1fr 1fr;
}

.secondary-button {
    border-color: var(--border-strong);
    background: #0b1424;
    color: #bac5d8;
}

.danger-button {
    background: var(--danger);
    color: white;
}

.toast-region {
    position: fixed;
    z-index: 100;
    right: 18px;
    bottom: 18px;
    display: grid;
    width: min(360px, calc(100vw - 36px));
    gap: 8px;
}

.toast {
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #131e31;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    color: #dce4f0;
    font-size: 12px;
    animation: toast-in 180ms ease-out;
}

.toast.is-success { border-color: rgba(94, 210, 102, 0.4); }
.toast.is-error { border-color: rgba(255, 79, 94, 0.5); color: #ffb4bb; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 1180px) {
    :root { --sidebar-width: 184px; }
    .brand-name { font-size: 12px; }
    .server-header { grid-template-columns: minmax(150px, 1.2fr) repeat(4, minmax(90px, 0.75fr)); }
    .last-update { display: none; }
    .metric-body { grid-template-columns: 70px minmax(0, 1fr); }
    .metric-ring { width: 66px; height: 66px; }
    .dashboard-middle { grid-template-columns: minmax(200px, 0.72fr) minmax(230px, 0.9fr) minmax(300px, 1.3fr); }
}

@media (max-width: 980px) {
    :root { --sidebar-width: 72px; }
    .sidebar { padding-inline: 8px; }
    .brand { justify-content: center; padding-inline: 0; }
    .brand .brand-name,
    .nav-item span,
    .sidebar-user > span:last-child { display: none; }
    .nav-item { padding: 0; justify-content: center; }
    .nav-item.is-active { box-shadow: inset 0 -3px 0 var(--violet); }
    .sidebar-footer { display: grid; justify-content: center; gap: 8px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-middle { grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr); }
    .performance-panel { grid-column: 1 / -1; min-height: 280px; }
    .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .files-layout:has(.file-editor:not(.is-hidden)) { grid-template-columns: 1fr; }
    .file-upload-form { grid-template-columns: 1fr auto; }
    .file-picker { grid-row: span 2; }
    .audit-head, .audit-row { grid-template-columns: 125px 100px minmax(200px, 1fr) 65px; }
}

@media (max-width: 760px) {
    :root { --sidebar-width: 0px; }
    .app-shell { display: block; }
    .sidebar {
        position: fixed;
        top: auto;
        right: 10px;
        bottom: 10px;
        left: 10px;
        display: grid;
        width: auto;
        height: 60px;
        padding: 5px;
        border: 1px solid var(--border-strong);
        border-radius: 12px;
        grid-template-columns: 1fr auto;
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    }
    .brand,
    .sidebar-user { display: none; }
    .sidebar-nav { display: grid; margin: 0; overflow-x: auto; gap: 3px; grid-auto-columns: 52px; grid-auto-flow: column; grid-template-columns: none; scrollbar-width: none; }
    .nav-item { width: 52px; height: 48px; }
    .sidebar-footer { display: block; padding: 0; border: 0; }
    .icon-button { width: 48px; height: 48px; }
    .workspace { padding: 8px 8px 90px; }
    .server-header { grid-template-columns: 1fr 1fr; gap: 0; }
    .server-identity { grid-column: 1 / -1; border-bottom: 1px solid var(--border); }
    .server-identity,
    .server-fact { min-height: 54px; padding: 8px 10px; }
    .server-fact:nth-of-type(even) { border-right: 0; }
    .mobile-only { display: flex; }
    .metric-grid,
    .dashboard-middle,
    .system-grid { grid-template-columns: 1fr; }
    .performance-panel { grid-column: auto; }
    .metric-card { min-height: 144px; }
    .metric-body { grid-template-columns: 80px minmax(0, 1fr); }
    .dashboard-middle .panel { min-height: auto; }
    .console-output { height: 260px; }
    .console-full .console-output { height: calc(100vh - 300px); min-height: 380px; }
    .player-management-row { grid-template-columns: 42px 1fr auto; }
    .player-management-row .player-actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: 5px; }
    .properties-form { grid-template-columns: 1fr; }
    .property-field.wide, .switch-field.wide { grid-column: auto; }
    .properties-footer { grid-column: auto; align-items: stretch; flex-direction: column; }
    .file-upload-form { grid-template-columns: 1fr; }
    .file-picker { grid-row: auto; }
    .audit-head { display: none; }
    .audit-row { padding: 12px; grid-template-columns: 1fr auto; }
    .audit-row > span { grid-column: 1 / -1; }
    .login-shell { display: block; }
    .login-panel { min-height: 100vh; border: 0; }
    .login-atmosphere { display: none; }
}

@media (max-width: 430px) {
    .login-panel { padding: 32px 24px; }
    .login-brand { top: 30px; left: 24px; }
    .server-header { padding: 6px 10px; }
    .metric-body { grid-template-columns: 72px minmax(0, 1fr); }
    .metric-ring { width: 68px; height: 68px; }
    .command-form button { padding-inline: 10px; }
    .players-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
