:root {
    color-scheme: dark;
    --bg: #090d10;
    --panel: #11171c;
    --panel-soft: #151d23;
    --border: #263139;
    --text: #edf3f6;
    --muted: #8d9ba5;
    --accent: #d6ff3f;
    --accent-dark: #19220d;
    --danger: #ff6b6b;
    --warning: #ffc857;
    --success: #61e294;
    --sidebar: 250px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
code { color: #c9e6f2; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 28px 22px;
    background: #0c1115; border-right: 1px solid var(--border); display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 44px; }
.brand-mark, .login-logo {
    display: grid; place-items: center; background: var(--accent); color: #090d10; font-weight: 900;
    box-shadow: 0 0 28px rgba(214, 255, 63, .18);
}
.brand-mark { width: 42px; height: 42px; border-radius: 12px; }
.brand strong { display: block; font-size: 18px; letter-spacing: .03em; }
.brand small { display: block; color: var(--muted); margin-top: 2px; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a { padding: 12px 14px; border-radius: 9px; color: #bcc8ce; }
.sidebar nav a:hover { background: var(--panel-soft); color: var(--text); }
.sidebar-footer { margin-top: auto; padding-top: 22px; border-top: 1px solid var(--border); }
.user-name { display: block; font-weight: 700; margin-bottom: 5px; }
.link-button { border: 0; padding: 0; color: var(--muted); background: none; cursor: pointer; }
.link-button:hover { color: var(--text); }

.content-shell { margin-left: var(--sidebar); padding: 42px clamp(24px, 4vw, 64px); max-width: 1700px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.035em; }
h2 { margin-bottom: 8px; }
.eyebrow { margin-bottom: 9px; color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .16em; }
.muted { color: var(--muted); line-height: 1.55; }

.button {
    display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 10px 16px;
    border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 750;
}
.button-primary { background: var(--accent); color: #0b0f10; }
.button-primary:hover { background: #e1ff74; }
.button-secondary { background: #202a31; border-color: #33414a; color: var(--text); }
.button-ghost { background: transparent; border-color: var(--border); color: #c4cfd5; }
.button-small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.button-wide { width: 100%; }

.server-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-bottom: 24px; }
.server-card, .panel { background: linear-gradient(145deg, #12191e, #0f1519); border: 1px solid var(--border); border-radius: 15px; }
.server-card { padding: 22px; }
.server-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 23px; }
.server-card-top .pill { margin-left: auto; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status-online { background: var(--success); box-shadow: 0 0 12px rgba(97, 226, 148, .55); }
.status-stopped { background: var(--danger); }
.status-label { color: var(--muted); font-size: 13px; }
.server-slug { color: var(--muted); font-size: 14px; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0; }
.metrics div { padding: 14px; border-radius: 10px; background: #0b1115; border: 1px solid #1d272e; }
.metrics strong, .metrics span { display: block; }
.metrics strong { font-size: 22px; }
.metrics span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.pill { display: inline-flex; padding: 5px 9px; border-radius: 99px; background: #202a30; color: #aab8c0; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.pill-active { color: var(--accent); background: var(--accent-dark); }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { padding: 24px; margin-bottom: 22px; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.list { display: grid; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; }
.list-row strong, .list-row span, .list-row time { display: block; }
.list-row span, .list-row time { color: var(--muted); font-size: 12px; margin-top: 4px; }
.list-meta { text-align: right; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-stack { display: grid; gap: 17px; }
label { display: grid; gap: 7px; color: #c7d2d8; font-size: 13px; font-weight: 700; }
label small { color: var(--muted); font-weight: 400; }
input {
    width: 100%; min-height: 44px; padding: 10px 12px; color: var(--text); background: #0a1014;
    border: 1px solid #2a3740; border-radius: 8px; outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(214, 255, 63, .08); }
.span-2 { grid-column: 1 / -1; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 18px; }
.checkbox { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; }
.checkbox input { width: 17px; min-height: 17px; accent-color: var(--accent); }
.checkbox-compact { align-self: end; padding-bottom: 13px; }
.form-actions { display: flex; justify-content: flex-end; }
.inline-form { display: grid; align-items: end; gap: 12px; padding-top: 20px; border-top: 1px solid var(--border); }
.mod-form { grid-template-columns: 1fr 1.25fr 1.25fr auto auto; }

.table-wrap { overflow-x: auto; margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.drag-column { width: 92px; }
.drag-cell { width: 92px; text-align: center; }
.drag-handle {
    width: 38px; height: 34px; padding: 0; border: 1px solid #34434d; border-radius: 8px;
    color: var(--muted); background: #11191e; cursor: grab; font-size: 22px; line-height: 1;
}
.drag-handle:hover, .drag-handle:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.drag-handle:active { cursor: grabbing; }
[data-mod-sort-row] { transition: background-color .15s ease, opacity .15s ease; }
[data-mod-sort-row].is-dragging { opacity: .45; background: var(--accent-dark); }
.workshop-link { color: #d8e5ea; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.workshop-link:hover, .workshop-link:focus-visible { color: var(--accent); text-decoration-color: currentColor; outline: none; }
.workshop-id { display: inline-flex; align-items: center; gap: 6px; }
.workshop-id span { color: var(--muted); font-size: 12px; }
.sort-form { margin: -6px 0 20px; }
.sort-form input { display: none; }
.sort-status { color: var(--muted); font-size: 12px; }
.sort-status.is-saving { color: var(--accent); }

.flash { padding: 13px 15px; margin-bottom: 18px; border: 1px solid; border-radius: 10px; }
.flash-error { color: #ffaaaa; border-color: #6f3131; background: #291516; }
.flash-success { color: #a7f3c4; border-color: #275b3b; background: #10271a; }
.flash-warning { color: #ffe0a0; border-color: #665024; background: #29220f; }
.empty-state { text-align: center; padding: 60px 24px; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 50%; background: var(--accent-dark); color: var(--accent); font-size: 25px; font-weight: 900; }

.login-page { background: radial-gradient(circle at 50% 0%, #202b19 0%, var(--bg) 42%); }
.login-shell { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 36px; border: 1px solid var(--border); border-radius: 18px; background: rgba(15, 21, 25, .94); box-shadow: 0 28px 80px rgba(0, 0, 0, .42); }
.login-logo { width: 58px; height: 58px; margin-bottom: 27px; border-radius: 15px; font-size: 25px; }

@media (max-width: 900px) {
    :root { --sidebar: 0px; }
    .sidebar { position: static; width: auto; min-height: auto; padding: 17px 20px; flex-direction: row; align-items: center; }
    .brand { margin: 0 auto 0 0; }
    .sidebar nav { display: none; }
    .sidebar-footer { margin: 0; padding: 0; border: 0; }
    .user-name { display: none; }
    .content-shell { margin-left: 0; padding: 28px 18px; }
    .two-column, .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .mod-form { grid-template-columns: 1fr; }
    .checkbox-compact { padding: 0; }
}

@media (max-width: 560px) {
    .page-header { display: grid; }
    .server-grid { grid-template-columns: 1fr; }
    .login-card { padding: 27px 22px; }
}
