/* Minecraft server panel — modern dark theme */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #0b0d12;
  --bg-2: #0f1218;
  --surface: #141821;
  --surface-2: #1a1f2a;
  --surface-3: #232a37;
  --hover: #252c3a;
  --border: #222836;
  --border-2: #2c3343;
  --text: #e8ebf1;
  --text-2: #a2aabb;
  --text-3: #6b7387;

  --accent: #22c55e;
  --accent-strong: #16a34a;
  --accent-text: #4ade80;
  --accent-soft: rgba(34, 197, 94, 0.13);
  --red: #ef4444;
  --red-strong: #dc2626;
  --red-text: #f87171;
  --red-soft: rgba(239, 68, 68, 0.12);
  --amber: #f59e0b;
  --amber-text: #fbbf24;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --blue: #3b82f6;
  --blue-text: #60a5fa;
  --blue-soft: rgba(59, 130, 246, 0.13);
  --violet-text: #a78bfa;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scrollbar-color: var(--surface-3) transparent; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
::selection { background: rgba(34, 197, 94, 0.3); }

.ic { display: inline-flex; flex: none; }
.ic svg { display: block; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 20px; align-content: start; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: 60px; padding: 0 28px;
  display: flex; align-items: center; gap: 18px;
  background: rgba(11, 13, 18, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; overflow: hidden; background: var(--surface-2); padding: 5px; }
.brand .logo svg { width: 100%; height: 100%; display: block; }
.brand small { font-weight: 450; color: var(--text-3); font-size: 13px; margin-left: 2px; }
.topbar .spacer { flex: 1; }
.host-pill {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
.host-pill .bar { width: 64px; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.host-pill .bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #22c55e, #0ea5e9); color: #04130a; font-weight: 700; font-size: 14px;
  border: 0; cursor: pointer;
}

.page-wrap { max-width: 1680px; margin: 0 auto; padding: 28px 32px 80px; }

/* ---------------- page heads ---------------- */
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.page-head .sub { color: var(--text-2); margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.back {
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; margin-bottom: 14px;
  padding: 4px 9px 4px 5px; border-radius: var(--r-sm);
}
.back:hover { color: var(--text); background: var(--surface); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  font-size: 13.5px; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.primary { background: var(--accent-strong); border-color: transparent; color: #fff; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.12); }
.btn.danger { background: var(--red-strong); border-color: transparent; color: #fff; }
.btn.danger:hover:not(:disabled) { filter: brightness(1.12); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.outline-danger { background: transparent; color: var(--red-text); }
.btn.outline-danger:hover:not(:disabled) { background: var(--red-soft); border-color: rgba(239, 68, 68, 0.4); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn.lg { height: 42px; padding: 0 18px; font-size: 14.5px; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 30px; }
.btn.block { width: 100%; }

/* ---------------- cards ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; min-height: 30px; }
.card-head > .ic { color: var(--text-3); }
.card-head h2, .card-title { font-size: 15px; font-weight: 620; letter-spacing: -0.01em; }
.card-head .count { color: var(--text-3); font-weight: 500; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card.flush .card-head { padding: 16px 16px 0 20px; }
.card.danger-zone { border-color: rgba(239, 68, 68, 0.22); }

.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.grid-3 { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.grid-4 { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }

/* ---------------- form controls ---------------- */
.field { display: grid; gap: 7px; align-content: start; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.help, .field .help { font-size: 12px; color: var(--text-3); }
.slider-top label { font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.toggle.inline { border: 0; padding: 0; gap: 10px; }
.toggle.inline .t-title { font-size: 13px; color: var(--text-2); font-weight: 550; }
.fields { display: grid; gap: 16px 18px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.form-stack { display: grid; gap: 18px; }

.input {
  height: 38px; width: 100%; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--border-2); background: var(--bg-2);
  color: var(--text); font: inherit; font-size: 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled { opacity: 0.55; }
.input.sm { height: 32px; font-size: 13px; border-radius: 8px; }
textarea.input { height: auto; padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; resize: vertical; }
select.input {
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a2aabb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select.input option { background: var(--surface-2); }
input[type="number"].input { -moz-appearance: textfield; }
input[type="number"].input::-webkit-inner-spin-button, input[type="number"].input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-icon { position: relative; }
.input-icon > .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 34px; }

/* switch */
.switch { position: relative; display: inline-flex; width: 40px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background 0.2s; }
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); transition: transform 0.2s;
}
.switch input:checked + .track { background: var(--accent-strong); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch input:disabled { cursor: default; }
.switch input:disabled + .track { opacity: 0.5; }
.toggles { display: grid; }
.toggle { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); cursor: pointer; }
.toggles .toggle:first-child { border-top: 0; padding-top: 0; }
.toggles .toggle:last-child { padding-bottom: 0; }
.toggle .t-text { flex: 1; min-width: 0; }
.toggle .t-title { font-weight: 520; }
.toggle .t-desc { color: var(--text-3); font-size: 12.5px; margin-top: 1px; }

/* range slider */
.range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; outline: none; cursor: pointer; margin: 8px 0 4px;
  background: linear-gradient(to right, var(--accent) 0, var(--accent) var(--pct, 50%), var(--surface-3) var(--pct, 50%), var(--surface-3) 100%);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  border: 4px solid var(--accent-strong); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18); cursor: grab;
}
.range::-moz-range-thumb {
  width: 10px; height: 10px; border-radius: 50%; background: #fff;
  border: 4px solid var(--accent-strong); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18); cursor: grab;
}
.range::-moz-range-track { background: transparent; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.3); }
.slider-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.slider-top .value { font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; }
.ticks { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 11px; max-width: 100%; overflow-x: auto; }
.seg button {
  height: 30px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2);
  font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.seg button .n { font-size: 11.5px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.seg button.on .n { background: var(--bg-2); }
.seg button .n.red { background: var(--red-soft); color: var(--red-text); }
.seg.block { display: flex; }
.seg.block button { flex: 1; }
.seg.lg button { height: 36px; padding: 0 16px; font-size: 13.5px; }

/* ---------------- badges & status ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2);
}
.badge.green { background: var(--accent-soft); color: var(--accent-text); }
.badge.red { background: var(--red-soft); color: var(--red-text); }
.badge.amber { background: var(--amber-soft); color: var(--amber-text); }
.badge.blue { background: var(--blue-soft); color: var(--blue-text); }
.status { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 11px 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); letter-spacing: 0; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.status.online { background: var(--accent-soft); color: var(--accent-text); }
.status.online::before { background: var(--accent); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25); }
.status.starting, .status.stopping { background: var(--amber-soft); color: var(--amber-text); }
.status.starting::before, .status.stopping::before { background: var(--amber); animation: pulse 1.2s ease-in-out infinite; }
.status.busy { background: var(--blue-soft); color: var(--blue-text); }
.status.busy::before { background: var(--blue); animation: pulse 1.2s ease-in-out infinite; }
.status.crashed { background: var(--red-soft); color: var(--red-text); }
.status.crashed::before { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* copy chip */
.copy {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 32px; padding: 0 5px 0 11px;
  border-radius: 9px; background: var(--bg-2); border: 1px solid var(--border-2);
  font-family: var(--mono); font-size: 12.5px; color: var(--text); cursor: pointer; transition: border-color 0.15s;
}
.copy:hover { border-color: var(--text-3); }
.copy .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy .cbtn { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: var(--text-3); flex: none; }
.copy:hover .cbtn { color: var(--text); background: var(--surface-3); }
.copy.done { border-color: rgba(34, 197, 94, 0.55); }
.copy.done .cbtn { color: var(--accent-text); }
.copy.lg { height: 44px; font-size: 15px; padding-left: 14px; border-radius: 11px; width: 100%; }
.copy.lg .txt { flex: 1; }
.copy.lg .cbtn { width: 32px; height: 32px; border-radius: 8px; }

/* progress */
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress > i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: inherit; transition: width 0.4s ease; }
.progress.amber > i { background: var(--amber); }
.progress.red > i { background: var(--red); }
.progress.busy > i { width: 35% !important; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { from { left: -35%; } to { left: 100%; } }

/* loader icon tile (pixel art) */
.tile-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; flex: none; }
.tile-ic .px-icon { width: 26px; height: 26px; }
.tile-ic.lg { width: 60px; height: 60px; border-radius: 16px; }
.tile-ic.lg .px-icon { width: 36px; height: 36px; }
.tile-ic.sm { width: 36px; height: 36px; border-radius: 10px; }
.tile-ic.sm .px-icon { width: 22px; height: 22px; }
.px-icon { display: inline-block; image-rendering: pixelated; }
.px-icon svg { width: 100%; height: 100%; display: block; }

/* alerts */
.alert { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface); margin-bottom: 20px; }
.alert .a-ic { color: var(--text-2); align-self: flex-start; margin-top: 2px; }
.alert .a-body { flex: 1; min-width: 0; }
.alert .a-title { font-weight: 600; }
.alert .a-text { color: var(--text-2); font-size: 13px; margin-top: 1px; }
.alert .a-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.alert.red { background: var(--red-soft); border-color: rgba(239, 68, 68, 0.3); }
.alert.red .a-ic { color: var(--red-text); }
.alert.amber { background: var(--amber-soft); border-color: rgba(245, 158, 11, 0.3); }
.alert.amber .a-ic { color: var(--amber-text); }
.alert.blue { background: var(--blue-soft); border-color: rgba(59, 130, 246, 0.3); }
.alert.blue .a-ic { color: var(--blue-text); }
.alert.green { background: var(--accent-soft); border-color: rgba(34, 197, 94, 0.3); }
.alert.green .a-ic { color: var(--accent-text); }
.alert pre { margin: 8px 0 0; font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 140px; overflow-y: auto; }

/* jobs */
.job-card { margin-bottom: 20px; }
.job-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.job-title { font-weight: 600; flex: 1; min-width: 0; }
.job-pct { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; }
.job-line { margin-top: 10px; color: var(--text-3); font-size: 12.5px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
pre.job-log { margin: 12px 0 0; padding: 12px; border-radius: 10px; background: var(--bg-2); font-family: var(--mono); font-size: 12px; color: var(--text-2); max-height: 180px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------- dashboard ---------------- */
.stat-tiles { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; display: flex; gap: 14px; align-items: center; min-width: 0; }
.st-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.st-ic.green { background: var(--accent-soft); color: var(--accent-text); }
.st-ic.blue { background: var(--blue-soft); color: var(--blue-text); }
.st-ic.violet { background: rgba(139, 92, 246, 0.13); color: var(--violet-text); }
.st-ic.amber { background: var(--amber-soft); color: var(--amber-text); }
.st-body { flex: 1; min-width: 0; }
.st-label { color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.st-val { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.st-val small { font-size: 13px; color: var(--text-3); font-weight: 500; }
.stat-tile .progress { margin-top: 8px; }

.srv-head, .srv-row {
  display: grid; align-items: center; gap: 20px;
  grid-template-columns: minmax(240px, 2.3fr) 118px minmax(220px, 1.6fr) 96px minmax(120px, 1fr) minmax(150px, 1.15fr) 112px;
}
.srv-head { padding: 0 20px 10px; color: var(--text-3); font-size: 12px; font-weight: 550; }
.srv-list { display: grid; gap: 10px; }
.srv-row {
  padding: 14px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.srv-row:hover { border-color: var(--border-2); background: #161b25; }
.srv-name { display: flex; align-items: center; gap: 14px; min-width: 0; }
.srv-name .n { font-weight: 620; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-name .v { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-metric { min-width: 0; }
.srv-metric .mv { font-variant-numeric: tabular-nums; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.srv-metric .mv small { color: var(--text-3); font-size: 12px; }
.srv-metric .progress { margin-top: 7px; height: 5px; }
.srv-players { display: flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.srv-players .ic { color: var(--text-3); }
.srv-actions { display: flex; justify-content: flex-end; gap: 6px; }
.dash { color: var(--text-3); }

.empty { text-align: center; padding: 72px 20px; }
.empty .tile-ic { margin: 0 auto 18px; }
.empty h2 { font-size: 18px; font-weight: 620; margin-bottom: 6px; }
.empty p { color: var(--text-2); margin-bottom: 22px; }
.empty .row { justify-content: center; }

/* ---------------- server page ---------------- */
.srv-header { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.srv-header .title { min-width: 0; flex: 1 1 320px; }
.srv-header h1 { font-size: 24px; font-weight: 680; letter-spacing: -0.02em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.srv-header .meta { color: var(--text-2); margin-top: 5px; display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; font-size: 13.5px; }
.srv-header .meta span { display: inline-flex; align-items: center; gap: 6px; }
.srv-header .meta .ic { color: var(--text-3); }
.power { display: flex; gap: 8px; flex-wrap: wrap; }

.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; }
.side { position: sticky; top: 84px; display: grid; gap: 2px; }
.side a {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 520; transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.side a:hover { background: var(--surface); color: var(--text); }
.side a.active { background: var(--surface-2); color: var(--text); }
.side a.active .ic { color: var(--accent-text); }
.side a .n { margin-left: auto; font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.side a .n.red { background: var(--red-soft); color: var(--red-text); }

/* two-column page with a fixed side card */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.btn.ghost.on { background: var(--surface-2); color: var(--text); }
code.mono { font-size: 12px; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }

/* console page */
.console-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.console-card { background: #07090d; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 250px); min-height: 460px; }
.console-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.console-bar .ctitle { font-weight: 600; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; margin-right: auto; }
.console-bar .input-icon { width: 220px; }
.console-bar .input { height: 30px; font-size: 12.5px; }
.console-wrap { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.console { flex: 1; overflow-y: auto; padding: 12px 16px; font: 12.5px/1.65 var(--mono); color: #c3cad6; }
.console.nowrap .ln { white-space: pre; }
.console-wrap .jump-btn { position: absolute; right: 18px; bottom: 14px; box-shadow: var(--shadow); }
.ln { white-space: pre-wrap; overflow-wrap: anywhere; }
.ln .ts { color: #545c6e; }
.ln.warn { color: #fbbf24; }
.ln.err { color: #f87171; }
.ln.pnl { color: #60a5fa; }
.ln.cmd { color: #4ade80; }
.ln.chat { color: #f1f5f9; }
.ln.join { color: #fde68a; }
.ln mark { background: rgba(250, 204, 21, 0.3); color: inherit; border-radius: 3px; }
.console-empty { color: var(--text-3); font-family: var(--font); padding: 40px 0; text-align: center; }
.console-input { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); padding: 7px 7px 7px 16px; background: var(--bg-2); }
.console-input .prompt { color: var(--accent-text); font-family: var(--mono); font-weight: 700; }
.console-input input { flex: 1; min-width: 0; height: 34px; background: none; border: 0; outline: none; color: var(--text); font: 13px var(--mono); }
.console-input input::placeholder { color: var(--text-3); }

.side-stats { display: grid; gap: 14px; }
.side-stats.wide-stats { grid-template-columns: minmax(320px, 1.5fr) repeat(3, minmax(190px, 1fr)); align-items: start; }
@media (max-width: 1180px) { .side-stats.wide-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .side-stats.wide-stats .card:first-child { grid-column: 1 / -1; } }
.side-stats .card { padding: 16px 18px; }
.mini-label { display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 12.5px; font-weight: 550; margin-bottom: 10px; }
.mini-label .right { margin-left: auto; color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.big-val { font-size: 22px; font-weight: 680; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.big-val small { font-size: 13px; color: var(--text-3); font-weight: 500; }
.spark { display: block; width: 100%; height: 44px; margin-top: 10px; overflow: visible; }
.sub-lines { display: grid; gap: 5px; margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.sub-lines span { display: flex; align-items: center; gap: 7px; }
.who { display: grid; gap: 2px; margin: 0 -6px; }
.who .p { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 8px; }
.head { width: 26px; height: 26px; border-radius: 6px; image-rendering: pixelated; background: var(--surface-3); flex: none; display: inline-block; }
.head.lg { width: 32px; height: 32px; border-radius: 8px; }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 550; color: var(--text-3); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.018); }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-2); }
.table .act { text-align: right; white-space: nowrap; width: 1%; }
.table tr.clickable { cursor: pointer; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { width: 280px; max-width: 100%; }
.toolbar .right { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* mods */
.mod-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mod-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); object-fit: cover; flex: none; }
.mod-ic.px { display: grid; place-items: center; padding: 9px; }
.mod-text { min-width: 0; }
.mod-name { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.mod-name .ver { color: var(--text-3); font-weight: 450; font-size: 12.5px; }
.mod-sub { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 560px; }
tr.mod-off .mod-text, tr.mod-off .mod-ic { opacity: 0.45; }
.mod-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

.mr-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.mr-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); min-width: 0; }
.modal .mr-card { background: var(--surface-2); }
.mr-card:hover { border-color: var(--border-2); }
.mr-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.mr-top img, .mr-top .noimg { width: 46px; height: 46px; border-radius: 11px; object-fit: cover; background: var(--surface-3); flex: none; display: grid; place-items: center; color: var(--text-3); }
.mr-title { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-by { color: var(--text-3); font-size: 12.5px; }
.mr-desc { color: var(--text-2); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.mr-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; color: var(--text-3); font-size: 12.5px; }
.mr-foot .btn { margin-left: auto; }

/* players */
.plist { display: grid; gap: 2px; margin: 0 -8px; }
.plist .p { display: flex; align-items: center; gap: 11px; padding: 6px 8px; border-radius: 9px; min-width: 0; }
.plist .p:hover { background: var(--surface-2); }
.plist .p .pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 520; }
.plist .p .btn { opacity: 0.0; }
.plist .p:hover .btn, .plist .p .btn:focus-visible { opacity: 1; }
@media (hover: none) { .plist .p .btn { opacity: 1; } }
.add-form { display: flex; gap: 8px; margin-bottom: 12px; }
.none { color: var(--text-3); font-size: 13px; padding: 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.pchip:hover { border-color: var(--border-2); background: var(--surface-3); }
.pchip .head { width: 24px; height: 24px; border-radius: 50%; }
.pchip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* files */
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 13.5px; min-width: 0; }
.crumbs a { padding: 3px 7px; border-radius: 7px; color: var(--text-2); cursor: pointer; }
.crumbs a:hover { background: var(--surface-2); color: var(--text); }
.crumbs a:last-child { color: var(--text); font-weight: 560; }
.crumbs .sep { color: var(--text-3); }
.fname { display: flex; align-items: center; gap: 11px; min-width: 0; }
.fname .ic { color: var(--text-3); }
.fname .ic.dir { color: var(--blue-text); }

/* create page */
.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.create-side { position: sticky; top: 84px; }
.loader-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.loader-opt {
  display: flex; align-items: center; gap: 13px; padding: 14px; text-align: left; min-width: 0;
  border-radius: 14px; border: 1px solid var(--border-2); background: var(--bg-2); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.loader-opt:hover { border-color: var(--text-3); }
.loader-opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.loader-opt .lo-name { font-weight: 620; }
.loader-opt .lo-desc { color: var(--text-3); font-size: 12.5px; }
.summary { display: grid; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.summary-row:first-child { border-top: 0; padding-top: 0; }
.summary-row .k { color: var(--text-3); }
.summary-row .v { font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.dropzone {
  border: 2px dashed var(--border-2); border-radius: var(--r-lg); padding: 56px 20px; text-align: center;
  color: var(--text-2); cursor: pointer; transition: border-color 0.15s, background 0.15s; display: grid; justify-items: center; gap: 6px;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone > .ic { color: var(--text-3); margin-bottom: 6px; }
.dropzone .dz-title { font-weight: 600; color: var(--text); font-size: 15px; }
.drop-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(5, 6, 9, 0.75); backdrop-filter: blur(4px); display: grid; place-items: center; pointer-events: none; }
.drop-overlay .card { border: 2px dashed var(--accent); text-align: center; padding: 40px 56px; display: grid; justify-items: center; gap: 6px; }
.drop-overlay .card .ic { color: var(--accent-text); margin-bottom: 8px; }

.uploads { display: grid; gap: 8px; margin-bottom: 16px; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px 52px; gap: 14px; align-items: center; font-size: 13px; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.upload-row .pct { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* unsaved changes bar */
.savebar {
  position: fixed; left: 50%; bottom: 22px; z-index: 45; transform: translate(-50%, 160%);
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: var(--shadow); transition: transform 0.25s ease;
}
.savebar { opacity: 0; pointer-events: none; }
.savebar.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.savebar .sb-text { font-weight: 550; white-space: nowrap; }

/* users & permissions */
.cb {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-2); background: var(--bg-2);
  display: inline-grid; place-items: center; padding: 0; cursor: pointer; color: transparent; transition: background 0.12s, border-color 0.12s;
}
.cb:hover:not(:disabled) { border-color: var(--text-3); }
.cb.on { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.cb:disabled { opacity: 0.45; cursor: default; }
.cb:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.user-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; cursor: default; flex: none; }
.avatar.gray { background: var(--surface-3); color: var(--text-2); }
.perm-table th.pc, .perm-table td.pc { text-align: center; width: 1%; padding-left: 6px; padding-right: 6px; }
.perm-table th.pc { font-size: 11.5px; }
.perm-table th.pc .ic { vertical-align: -2px; color: var(--amber-text); margin-left: 3px; }
.perm-table td { padding-top: 9px; padding-bottom: 9px; }
.perm-table select.input { width: 128px; height: 32px; font-size: 13px; border-radius: 8px; }
.perm-table tr.all-row td { background: var(--bg-2); }
.perm-table.locked { opacity: 0.45; pointer-events: none; }
.users-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.trust { display: flex; align-items: center; gap: 8px; color: var(--amber-text); font-size: 12.5px; }

/* ---------------- overlays ---------------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5, 6, 9, 0.62); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade 0.15s ease; }
.modal { width: min(520px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); padding: 24px; animation: pop 0.18s ease; }
.modal.wide { width: min(1120px, 100%); height: min(840px, 88vh); }
.modal.editor-modal { width: min(1120px, 100%); height: 86vh; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { font-size: 17px; font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { overflow-y: auto; min-height: 0; flex: 1; margin: 0 -24px; padding: 2px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal p.lead { color: var(--text-2); line-height: 1.55; }
.modal .editor { flex: 1; min-height: 0; resize: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.97) translateY(6px); } }

.menu { position: fixed; z-index: 100; min-width: 210px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: var(--shadow); animation: pop 0.12s ease; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; border: 0; background: none; color: var(--text); font-size: 13.5px; cursor: pointer; text-align: left; }
.menu-item .ic { color: var(--text-3); }
.menu-item:hover:not(:disabled) { background: var(--hover); }
.menu-item.danger, .menu-item.danger .ic { color: var(--red-text); }
.menu-item:disabled { color: var(--text-3); cursor: default; }
.menu-sep { height: 1px; background: var(--border-2); margin: 6px 4px; }
.menu-head { padding: 8px 10px 6px; font-size: 12.5px; color: var(--text-3); }

#toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: var(--shadow); animation: toast-in 0.25s ease; }
.toast .t-ic { color: var(--accent-text); margin-top: 1px; }
.toast.bad .t-ic { color: var(--red-text); }
.toast .t-title { font-weight: 600; }
.toast .t-body { color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.toast.leaving { animation: toast-out 0.2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

#jobs-float { position: fixed; left: 20px; bottom: 20px; z-index: 60; display: grid; gap: 10px; width: min(360px, calc(100vw - 40px)); }
#jobs-float .card { box-shadow: var(--shadow); padding: 14px 16px; }
#jobs-float .job-card { margin: 0; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 480px at 50% -10%, rgba(34, 197, 94, 0.12), transparent 70%), var(--bg); }
.login-card { width: min(390px, 100%); padding: 32px; border-radius: 22px; }
.login-card .logo { width: 52px; height: 52px; border-radius: 15px; background: var(--surface-2); padding: 10px; margin-bottom: 18px; }
.login-card .logo svg { width: 100%; height: 100%; display: block; }
.login-card h1 { font-size: 22px; font-weight: 680; letter-spacing: -0.02em; }
.login-card .sub { color: var(--text-2); margin: 4px 0 24px; }
.err { color: var(--red-text); font-size: 13px; }

/* ---------------- responsive ---------------- */
@media (max-width: 1360px) {
  .srv-head, .srv-row { grid-template-columns: minmax(220px, 2fr) 116px minmax(200px, 1.5fr) 90px minmax(140px, 1.1fr) 108px; }
  .srv-cpu { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .console-layout { grid-template-columns: minmax(0, 1fr); }
  .side-stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
  .side-stats .spark { display: none; }
  .console-card { height: 64vh; }
  .create-layout, .split, .users-layout { grid-template-columns: minmax(0, 1fr); }
  .create-side { position: static; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .srv-head { display: none; }
  .srv-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name status" "addr addr" "players mem" "act act"; gap: 12px 16px; }
  .srv-row > .c-name { grid-area: name; }
  .srv-row > .c-status { grid-area: status; justify-self: end; }
  .srv-row > .c-addr { grid-area: addr; }
  .srv-row > .c-players { grid-area: players; }
  .srv-row > .c-mem { grid-area: mem; }
  .srv-row > .c-act { grid-area: act; }
  .srv-actions { justify-content: flex-start; }
  .shell { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .side { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .side a { flex: none; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .loader-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar { padding: 0 16px; gap: 10px; }
  .host-pill, .brand small { display: none; }
  .page-wrap { padding: 20px 16px 80px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-tile { padding: 12px 14px; }
  .stat-tile .st-ic { display: none; }
  .st-val { font-size: 17px; }
  .alert { flex-wrap: wrap; }
  .alert .a-actions { width: 100%; padding-left: 30px; }
  .side-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .side-stats .card { padding: 12px 14px; }
  .side-stats .card:first-child { grid-column: 1 / -1; }
  .srv-header > .tile-ic { display: none; }
  .big-val { font-size: 18px; }
  .loader-grid { grid-template-columns: minmax(0, 1fr); }
  .power { width: 100%; }
  .power .btn { flex: 1; }
  .power .btn.icon { flex: none; }
  .toolbar .search { width: 100%; }
  .hide-sm { display: none; }
  .mod-sub { max-width: 200px; }
  .console-bar .input-icon { width: 130px; }
  .upload-row { grid-template-columns: minmax(0, 1fr) 52px; }
  .upload-row .progress { grid-column: 1 / -1; grid-row: 2; }
  .savebar { left: 16px; right: 16px; transform: translateY(160%); }
  .savebar.show { transform: none; opacity: 1; }
  .savebar .sb-text { flex: 1; }
}
