:root {
  --bg: #0c0c0e;
  --bg-2: #121214;
  --bg-3: #1a1a1a;
  --nav: rgba(12, 12, 14, 0.92);
  --side: rgba(18, 18, 20, 0.92);
  --line: #434343;
  --text: rgba(255, 255, 255, 0.85);
  --muted: rgba(255, 255, 255, 0.45);
  --faint: rgba(255, 255, 255, 0.62);
  --red: #c93436;
  --red-2: #a61d24;
  --red-soft: rgba(201, 52, 54, 0.18);
  --coral: #e57373;
  --ok: #52c41a;
  --ok-bg: #162312;
  --warn: #d89614;
  --danger: #cf1322;
  --side-w: 224px;
  --top-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}
#app {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

/* Themed scrollbars (Firefox + Chromium) */
* {
  scrollbar-width: thin;
  scrollbar-color: #4a4a4e transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #3a3a3e;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: #5a5a60; background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 11px, rgba(255,255,255,0.018) 11px, rgba(255,255,255,0.018) 12px),
    repeating-linear-gradient(-45deg, transparent, transparent 11px, rgba(255,255,255,0.018) 11px, rgba(255,255,255,0.018) 12px);
  min-height: 100%;
}
button, input, textarea, select { font: inherit; color: inherit; }

/* Modern text fields — black gradient, white text + placeholder */
:root {
  --input-bg: linear-gradient(165deg, #1a1a1e 0%, #0e0e12 48%, #08080a 100%);
  --input-bg-solid: #0e0e12;
  --input-border: #3a3a42;
  --input-border-focus: var(--red);
  --input-text: #ffffff;
  --input-placeholder: rgba(255, 255, 255, 0.72);
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="tel"],
input:not([type]),
textarea,
select {
  background: var(--input-bg-solid);
  background-image: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--input-text) !important;
  caret-color: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder,
input[type="search"]::placeholder,
input[type="url"]::placeholder,
input[type="number"]::placeholder,
input[type="tel"]::placeholder,
input:not([type])::placeholder,
textarea::placeholder {
  color: var(--input-placeholder) !important;
  opacity: 1;
}
input[type="text"]::-webkit-input-placeholder,
input[type="password"]::-webkit-input-placeholder,
input[type="email"]::-webkit-input-placeholder,
input[type="search"]::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: var(--input-placeholder) !important;
  opacity: 1;
}
input[type="text"]::-moz-placeholder,
input[type="password"]::-moz-placeholder,
textarea::-moz-placeholder {
  color: var(--input-placeholder) !important;
  opacity: 1;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input:not([type]):focus,
textarea:focus,
select:focus {
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 2px rgba(201, 52, 54, 0.28);
  color: #ffffff !important;
}
select {
  background-color: var(--input-bg-solid);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"),
    var(--input-bg);
  background-repeat: no-repeat, no-repeat;
  background-position: right 12px center, 0 0;
  background-size: 12px, auto;
  padding-right: 36px;
  cursor: pointer;
}
select option {
  background: #121214;
  color: #ffffff;
}
/* Autofill stay dark */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff;
  box-shadow: 0 0 0 1000px #0e0e12 inset !important;
  transition: background-color 99999s ease-out;
}

a { color: var(--coral); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
button { cursor: pointer; }
svg { flex-shrink: 0; }

/* AUTH */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
}
.lang-pill {
  position: absolute;
  top: 16px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1c1c1e;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--faint);
  font-size: 13px;
}
.auth-card {
  width: min(440px, 100%);
  background: #1c1c1e;
  border: 1px solid #2a2a2c;
  border-radius: 16px;
  padding: 28px 28px 22px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
}
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand-row img { width: 36px; height: 36px; border-radius: 50%; }
.brand-row strong { font-size: 16px; font-weight: 600; color: #fff; }
.auth-card h1 { font-size: 22px; font-weight: 700; margin: 0 0 8px; color: #fff; }
.auth-card .sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--faint); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
}
.check { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 13px; margin: 4px 0 16px; }
.check input { accent-color: var(--red); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-sizing: border-box;
  height: 32px; min-height: 32px;
  padding: 0 15px;
  border: 1px solid transparent; border-radius: 12px;
  font-size: 14px; font-weight: 500; line-height: 1;
  cursor: pointer; transition: 0.12s ease; background: transparent;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-login {
  width: 100%; height: 32px; min-height: 32px;
  background: var(--coral); color: #1a0c0c; font-weight: 600; border-radius: 12px;
}
.btn-login:hover:not(:disabled) { filter: brightness(1.06); }
.tkt-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.tkt-page-head .page-title { margin: 0 0 4px; }
.tkt-page-sub { margin: 0; color: var(--muted); font-size: 13px; }
.tkt-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tkt-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.tkt-stat {
  background: #161618;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 0;
}
.tkt-stat-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.tkt-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.tkt-stat-val.open { color: #e8a838; }
.tkt-stat-val.answered { color: #d89614; }
.tkt-stat-val.resolved { color: #52c41a; }
.tkt-stat-val.closed { color: #8a8a8e; }
.tkt-filters {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 180px) minmax(140px, 180px);
  gap: 10px;
  margin-bottom: 14px;
}
.tkt-filters .tkt-search,
.tkt-filters select {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 14px;
  width: 100%;
}
.tkt-list-panel {
  background: #141416;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 280px;
  overflow: hidden;
}
.tkt-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}
.tkt-empty-ico {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: rgba(220, 105, 102, 0.12);
  border: 1px solid rgba(220, 105, 102, 0.28);
  display: grid; place-items: center;
  color: var(--coral);
}
.tkt-card-list { display: flex; flex-direction: column; }
.tkt-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #2a2a2c;
  cursor: pointer;
  background: transparent;
  text-align: left;
  width: 100%;
  border-left: 0; border-right: 0; border-top: 0;
  color: inherit;
  font: inherit;
}
.tkt-card:last-child { border-bottom: 0; }
.tkt-card:hover { background: rgba(255, 255, 255, 0.03); }
.tkt-card-title { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: #fff; }
.tkt-card-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tkt-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; justify-content: center; }
.tkt-modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, 0.62);
  display: grid; place-items: center;
  padding: 16px;
}
.tkt-modal {
  width: min(920px, 100%);
  max-height: min(92vh, 820px);
  overflow: auto;
  background: #161618;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
}
.tkt-modal-main { padding: 20px 22px 18px; border-right: 1px solid #2a2a2c; }
.tkt-modal-side { padding: 20px 18px; background: #121214; }
.tkt-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.tkt-modal-head h2 { margin: 0; font-size: 18px; color: #fff; }
.tkt-modal-close {
  width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid var(--line); background: #202020; color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.tkt-modal-close:hover { background: #2a2a2c; }
.tkt-modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; flex-wrap: wrap;
}
.tkt-side-title {
  margin: 0 0 12px; font-size: 14px; font-weight: 600; color: #fff;
}
.tkt-article {
  padding: 10px 0;
  border-bottom: 1px solid #2a2a2c;
}
.tkt-article:last-child { border-bottom: 0; }
.tkt-article strong { display: block; color: #fff; font-size: 13px; margin-bottom: 4px; }
.tkt-article p { margin: 0 0 6px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.tkt-tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(80, 120, 200, 0.18); color: #9eb6e8;
}
.tkt-req { color: var(--coral); }
.tkt-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.tkt-detail-title { flex: 1; min-width: 180px; }
.tkt-admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tkt-thread { display: flex; flex-direction: column; gap: 12px; }
.tkt-msg {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #141416;
}
.tkt-msg.admin {
  border-color: rgba(62, 207, 142, 0.28);
  background: rgba(62, 207, 142, 0.06);
}
.tkt-msg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}
.tkt-role {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3ecf8e;
  background: rgba(62, 207, 142, 0.12);
  border-radius: 999px;
  padding: 2px 8px;
}
.tkt-msg-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  color: #e8e8ea;
  font-size: 14px;
}
.tkt-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.tkt-img {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a0a0c;
}
.tkt-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tkt-reply-box { margin-top: 12px; }
@media (max-width: 900px) {
  .tkt-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tkt-filters { grid-template-columns: 1fr; }
  .tkt-modal { grid-template-columns: 1fr; }
  .tkt-modal-main { border-right: 0; border-bottom: 1px solid #2a2a2c; }
}
@media (max-width: 560px) {
  .tkt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.auth-switch {
  margin: 16px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.auth-switch .linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--coral);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-ghost {
  background: #202020; border: 1px solid var(--line); color: #fff; border-radius: 12px;
}
.btn-ghost:hover:not(:disabled) { background: #2a2a2c; }
.auth-card .btn-ghost {
  width: 100%; margin-top: 10px;
}
.btn-red {
  background: #dc6966; color: #fff; border-color: #dc6966;
}
.btn-red:hover:not(:disabled) { filter: brightness(1.08); }
.btn-green {
  background: #2e9e5b; color: #fff; border-color: #2e9e5b;
}
.btn-green:hover:not(:disabled) { filter: brightness(1.08); }
.btn-outline-red {
  background: transparent; color: #fff; border: 1px solid var(--red);
}
.btn-danger {
  background: var(--danger); color: #fff; border-color: var(--danger);
}
.btn-warn {
  background: var(--warn); color: #1a1200; border-color: var(--warn);
}
.btn-ok {
  background: var(--ok); color: #0a1a05; border-color: var(--ok);
}
.btn-sm {
  height: 32px; min-height: 32px; padding: 0 15px; font-size: 14px; border-radius: 12px;
}
.error {
  background: rgba(207,19,34,0.12); border: 1px solid rgba(207,19,34,0.35);
  color: #ffb3b3; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px;
}

/* SHELL */
.shell {
  height: 100vh; min-height: 100vh;
  width: 100%; max-width: 100%; min-width: 0;
  display: grid; grid-template-rows: var(--top-h) 1fr;
  overflow: hidden;
}
.top {
  display: flex; align-items: center; gap: 4px; padding: 0 16px;
  background: var(--nav); border-bottom: 1px solid #222;
  position: sticky; top: 0; z-index: 100;
  width: 100%; max-width: 100%; min-width: 0;
  /* visible so account menu can drop below the bar (was overflow:hidden → clipped / under panel) */
  overflow: visible;
}
.top .brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff;
  font-weight: 600; font-size: 15px; margin-right: 8px; white-space: nowrap;
}
.top .brand img { width: 28px; height: 28px; border-radius: 50%; }
.top-nav { display: flex; align-items: stretch; height: 100%; gap: 2px; }
.top-nav button, .top-nav a, .top-nav .nav-drop-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: none; color: var(--text);
  padding: 0 14px; height: 100%; font-size: 14px; text-decoration: none;
  border-radius: 0;
}
.top-nav button:hover, .top-nav a:hover, .top-nav .nav-drop-btn:hover {
  background: rgba(255,255,255,0.04); color: #fff; text-decoration: none;
}
.top-nav button.active, .top-nav .nav-drop-btn.active, .top-nav .nav-drop.active > .nav-drop-btn {
  background: var(--red-soft); color: #fff;
  box-shadow: inset 0 -2px 0 var(--red);
}
.nav-drop {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 100%;
}
.nav-drop-panel {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% - 2px);
  min-width: 280px;
  max-width: min(360px, 92vw);
  background: #1c1c1e;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  z-index: 220;
  padding: 10px 0 8px;
  overflow: hidden;
}
.nav-drop:hover .nav-drop-panel,
.nav-drop:focus-within .nav-drop-panel {
  display: block;
}
.nav-drop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 14px 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--muted);
}
.nav-drop-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}
.nav-drop-list {
  max-height: min(320px, 50vh);
  overflow: auto;
}
.nav-drop-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: auto !important;
  padding: 10px 14px !important;
  text-align: left;
  background: transparent !important;
  border: none;
  color: #fff !important;
  box-shadow: none !important;
}
.nav-drop-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}
.nav-drop-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #555;
}
.nav-drop-dot.on { background: #3ecf8e; box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.18); }
.nav-drop-dot.off { background: #666; }
.nav-drop-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.nav-drop-text strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-drop-text .muted {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-drop-empty {
  margin: 0;
  padding: 8px 14px 12px;
  font-size: 13px;
}
.nav-drop-footer {
  display: block !important;
  width: 100%;
  height: auto !important;
  margin-top: 4px;
  padding: 10px 14px !important;
  text-align: left !important;
  background: transparent !important;
  border: none;
  border-top: 1px solid var(--line);
  color: var(--coral) !important;
  font-size: 13px !important;
  font-weight: 600;
  box-shadow: none !important;
}
.nav-drop-footer:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #fff !important;
}
.top-right {
  margin-left: auto; display: flex; align-items: center; gap: 2px; height: 100%;
  position: relative;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 100%; padding: 0 12px; background: transparent; border: none; color: var(--faint);
}
.icon-btn:hover { color: #fff; background: rgba(255,255,255,0.04); }
.account-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; height: 100%;
  background: transparent; border: none; color: var(--text);
}
.account-chip:hover { background: rgba(255,255,255,0.04); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #5b8def, #7ed3a8);
}

.layout {
  display: grid; grid-template-columns: var(--side-w) 1fr;
  height: calc(100vh - var(--top-h));
  width: 100%; max-width: 100%;
  min-height: 0; min-width: 0;
  overflow: hidden;
}
.side {
  background: var(--side); border-right: 1px solid #222;
  padding: 8px 0 24px; overflow: auto;
}
.back-link {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: transparent; border: none; color: var(--muted);
  padding: 10px 16px 6px; font-size: 11px; letter-spacing: 0.06em; font-weight: 600;
}
.back-link:hover { color: #fff; }
.side-name {
  padding: 2px 16px 10px; font-weight: 600; color: #fff; font-size: 14px;
  display: flex; align-items: center; gap: 10px;
}
.side-name .game-icon { width: 28px; height: 28px; border-radius: 6px; }
.status-game { display: inline-flex; }
.status-game .game-icon { width: 22px; height: 22px; border-radius: 5px; }
.side .sec {
  margin: 8px 0 0;
  padding: 12px 16px 4px;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--red); font-weight: 600;
}
.side button.nav-item, .side a.nav-item {
  display: flex; align-items: center; gap: 10px; width: calc(100% - 16px);
  margin: 1px 8px; text-align: left; background: transparent; border: none;
  color: var(--faint); padding: 8px 10px; border-radius: 8px; font-size: 13px;
}
.side button.nav-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.side button.nav-item.active {
  background: var(--red-soft); color: #fff;
  box-shadow: inset 3px 0 0 var(--red);
}
.main {
  padding: 16px 20px 32px;
  overflow-x: hidden;
  overflow-y: auto;
  height: 100%;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
.main:has(.console-page),
.main:has(.files-page) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 12px;
}
.console-page,
.files-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.console-page .status-strip,
.files-page .status-strip { flex-shrink: 0; padding-bottom: 8px; margin-bottom: 0; }
.page-title { font-size: 20px; font-weight: 600; margin: 0 0 4px; color: #fff; }
.page-sub { margin: 0 0 16px; color: var(--muted); }

.grid { display: grid; gap: 12px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: none; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .top-nav { display: none; }
}

.card {
  background: rgba(18,18,20,0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.card h3 {
  margin: 0 0 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.stat { font-size: 18px; font-weight: 600; margin: 0; color: #fff; word-break: break-all; }
.muted { color: var(--muted); font-size: 13px; }
.card-ico {
  position: absolute; right: 10px; bottom: -6px; opacity: 0.08; pointer-events: none;
}

/* DASHBOARD HOME */
.home-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.home-card { min-height: 148px; display: flex; flex-direction: column; }
.home-card .ico-wrap {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; background: var(--red-soft); color: var(--red); margin-bottom: 10px;
}
.home-card h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: #fff; }
.home-card p { margin: 0 0 auto; color: var(--muted); font-size: 13px; }
.home-card .actions { margin-top: 14px; }
@media (max-width: 900px) { .home-cards { grid-template-columns: 1fr; } }

.servers-head { font-size: 16px; font-weight: 600; margin: 8px 0 10px; color: #fff; }

.server-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) 1fr 1fr 1fr auto;
  align-items: center; gap: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #2c2c2e;
  background: rgba(20,20,22,0.85);
  cursor: pointer;
  position: relative;
}
.server-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #3a3a3a;
}
.server-row.running::before { background: var(--ok); }
.server-row.starting::before { background: var(--warn); }
.server-row:hover { border-color: #555; }
.server-row .ident { display: flex; align-items: center; gap: 12px; min-width: 0; }
.server-row .mark {
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  background: #222; color: var(--faint); overflow: hidden; flex-shrink: 0;
}
.server-row .mark-game { padding: 0; background: transparent; }
.game-icon { width: 36px; height: 36px; border-radius: 8px; display: block; object-fit: cover; }
.server-row .name { font-weight: 600; margin: 0; color: #fff; }
.ping-line { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 5px; }
.ping-good { color: #52c41a; }
.ping-ok { color: #d89614; }
.ping-high { color: #ff7875; }
.ping-unknown { color: var(--muted); }
.ping-from { font-size: 10px; font-weight: 500; opacity: 0.75; letter-spacing: 0.04em; }
.metric { min-width: 0; }
.metric .val { font-size: 12px; color: var(--faint); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.bar { height: 3px; background: #2a2a2c; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 1000px) {
  .server-row { grid-template-columns: 1fr 1fr; }
  .row-right { align-items: flex-start; }
}

.badge-on, .badge-off, .badge-run, .badge-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; height: 20px; border-radius: 6px;
  font-size: 12px; font-weight: 500;
}
.badge-on, .badge-run, .badge-status.st-running { background: var(--ok-bg); color: var(--ok); }
.badge-off, .badge-status.st-stopped { background: #2a1215; color: #ff4d4f; }
.badge-status.st-starting { background: #2b2110; color: #faad14; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.status-strip {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  padding: 8px 4px 14px; margin-bottom: 6px;
}
.status-strip strong { color: #fff; font-weight: 600; }
.status-strip .m { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-size: 13px; }
.status-strip .addr { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; }

.hdr-controls {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(18, 18, 20, 0.85);
  border: 1px solid #2a2a2c;
  border-radius: 12px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.hdr-ip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  padding-right: 2px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.hdr-icon-btn {
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--faint); border-radius: 8px;
}
.hdr-icon-btn:hover { color: #fff; background: rgba(255,255,255,0.06); }
.hdr-round-btn {
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid #3a3a3c;
  background: #1a1a1c;
  color: #e8e8ea;
}
.hdr-round-btn:hover:not(:disabled) { border-color: #666; color: #fff; background: #222; }
.hdr-round-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.hdr-round-btn.hdr-pwr-start {
  background: #2e9e5b; border-color: #2e9e5b; color: #fff;
}
.hdr-round-btn.hdr-pwr-start:hover:not(:disabled) { filter: brightness(1.08); }
.hdr-round-btn.hdr-pwr-stop {
  background: var(--red); border-color: var(--red); color: #fff;
}
.hdr-round-btn.hdr-pwr-stop:hover:not(:disabled) { filter: brightness(1.08); }

.mc-page { display: flex; flex-direction: column; gap: 12px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mc-head .page-title { display: inline-flex; align-items: center; gap: 10px; margin: 0; color: var(--coral); }
.mc-count { color: var(--muted); font-weight: 500; font-size: 0.85em; }
.mc-section-title {
  margin: 8px 0 4px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--coral); font-weight: 700;
}
.mc-filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 10px 12px; background: #141416; border: 1px solid var(--line); border-radius: 12px;
}
.mc-filters select, .mc-filters input {
  height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px;
}
.mc-filters input { flex: 1; min-width: 180px; }
.mc-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: stretch;
}
@media (max-width: 1100px) { .mc-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .mc-grid { grid-template-columns: 1fr; } }
.mc-card {
  display: flex; flex-direction: column; gap: 10px;
  background: #161618; border: 1px solid #2a2a2c; border-radius: 12px; padding: 14px;
  min-height: 168px; min-width: 0; overflow: hidden;
}
.mc-card--installed { min-height: 168px; }
.mc-card--active { border-color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); }
.mc-card-ico, .mc-letter-ico.mc-card-ico {
  width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #222; flex-shrink: 0;
}
.mc-letter-ico {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: #fff; line-height: 1;
  background: hsl(var(--mc-hue, 200) 42% 38%);
  border-radius: 50% !important;
  user-select: none;
}
.mc-letter-ico.mc-soft-logo { width: 44px; height: 44px; font-size: 18px; }
.mc-letter-ico.mc-ver-logo { width: 36px; height: 36px; font-size: 15px; }
.mc-card-body { flex: 1; min-width: 0; }
.mc-card-body strong {
  display: block; color: #fff; margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mc-card-body p {
  margin: 0; font-size: 12px; color: var(--muted); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mc-card-action {
  align-self: stretch; width: 100%; margin-top: auto; flex-shrink: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-empty--span { grid-column: 1 / -1; }
.mc-meta-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 12px; color: var(--muted); margin-top: 4px;
}
.mc-badge-ok {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: rgba(82, 196, 26, 0.15); color: var(--ok); font-size: 11px; font-weight: 600;
  vertical-align: middle;
}
.mc-badge-warn {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
  background: rgba(250, 173, 20, 0.15); color: #ffd666; font-size: 11px; font-weight: 600;
}
.mc-empty {
  padding: 28px 16px; text-align: center; color: var(--muted);
  background: #141416; border: 1px dashed #2a2a2c; border-radius: 12px;
}
.mc-pager {
  display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap;
}
.mc-page-btn {
  min-width: 36px; height: 34px; padding: 0 10px; border-radius: 8px;
  border: 1px solid #2a2a2c; background: #161618; color: #ddd; cursor: pointer; font-size: 13px;
}
.mc-page-btn:hover:not(:disabled) { border-color: #555; color: #fff; }
.mc-page-btn.active { border-color: var(--coral); color: #fff; background: rgba(220, 50, 50, 0.18); }
.mc-page-btn:disabled { opacity: 0.35; cursor: default; }
.mc-installed { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mc-installed-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; background: #141416; border-radius: 8px; font-family: var(--mono); font-size: 12px;
}
.mc-modal { width: min(480px, 100%); }
.mc-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-warn {
  margin: 10px 0; padding: 10px 12px; border-radius: 8px;
  background: rgba(250, 173, 20, 0.12); border: 1px solid rgba(250, 173, 20, 0.35);
  color: #ffd666; font-size: 13px;
}
.mc-current { display: flex; flex-direction: column; gap: 14px; }
.mc-current-row { display: flex; align-items: center; gap: 14px; }
.mc-soft-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.mc-soft-card {
  text-align: left; padding: 14px; border-radius: 12px;
  border: 1px solid #2a2a2c; background: #141416; color: #fff;
  display: flex; flex-direction: row; align-items: center; gap: 12px; cursor: pointer;
}
.mc-soft-card:hover { border-color: #555; }
.mc-soft-card.active { border-color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); }
.mc-soft-logo {
  width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #1c1c1e; flex-shrink: 0;
}
.mc-ver-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.mc-ver-card {
  text-align: left; padding: 12px; border-radius: 12px;
  border: 1px solid #2a2a2c; background: #161618; color: #fff;
  display: flex; flex-direction: row; align-items: center; gap: 12px; cursor: pointer;
}
.mc-ver-logo {
  width: 36px; height: 36px; border-radius: 8px; object-fit: contain; background: #1c1c1e; flex-shrink: 0;
}
.mc-soft-card > div, .mc-ver-card > div { min-width: 0; }
.mc-soft-card strong, .mc-ver-card strong {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mc-ver-card.active { border-color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); }
.mc-ver-card:hover { border-color: #555; }

.ov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 1100px) { .ov-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .ov-grid { grid-template-columns: 1fr; } }

.ov-card { min-height: 101px; }
.ov-card .stat { font-size: 16px; }
.view-link { color: var(--coral); font-size: 12px; margin-left: 6px; cursor: pointer; background: none; border: none; padding: 0; }
.running-line { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 10px; font-weight: 600; }
.running-line.st-running { color: var(--ok); }
.running-line.st-starting { color: #faad14; }
.running-line.st-stopped { color: #ff4d4f; }
.pwr-row { display: flex; gap: 8px; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
@media (max-width: 800px) { .cfg-grid { grid-template-columns: 1fr; } }
.cfg-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 8px; }
.console-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cons-btn { min-width: 96px; height: 32px !important; }
.pwr {
  height: 28px; min-width: 82px; border-radius: 12px; font-size: 11px;
  border: 1px solid var(--line); background: #1a1a1a; color: var(--faint); padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.pwr-start.on { background: #389e0d; border-color: #389e0d; color: #fff; }
.pwr-restart.on { background: var(--warn); border-color: var(--warn); color: #fff; }
.pwr-stop.on { background: var(--danger); border-color: var(--danger); color: #fff; }

.fold {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: rgba(18,18,20,0.72); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-top: 12px; color: #fff;
}
.fold:hover { border-color: #666; }
.fold.open { border-color: #444; border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 0; }
.fold .grow { flex: 1; }
.fold .sub { color: var(--muted); font-size: 13px; font-weight: 400; }

.perf-fold-wrap { margin-top: 12px; }
.perf-fold-wrap > .fold { margin-top: 0; }
.perf-panel {
  background: rgba(18,18,20,0.72);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 14px 16px 18px;
}
.perf-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 980px) {
  .perf-tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .perf-tiles { grid-template-columns: 1fr; }
}
.perf-tile {
  background: #161618;
  border: 1px solid #2a2a2c;
  border-radius: 10px;
  padding: 12px 14px;
  border-bottom: 2px solid rgba(201, 52, 54, 0.35);
}
.perf-tile-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.perf-tile-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
}
.perf-tile-ico { color: var(--red); opacity: 0.9; }
.perf-tile-val { font-size: 18px; font-weight: 600; color: #fff; line-height: 1.2; }
.perf-tile-max { font-size: 13px; font-weight: 500; color: var(--faint); }
.perf-net { display: flex; flex-direction: column; gap: 4px; font-size: 15px; font-weight: 600; }
.net-in { color: #5b9fd4; }
.net-out { color: #d4a15b; }
.perf-graphs-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 0 10px;
}
.perf-range {
  background: #141416; border: 1px solid var(--line); color: #fff;
  border-radius: 12px; height: 32px; padding: 0 12px; font-size: 14px;
}
.perf-graphs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 900px) {
  .perf-graphs { grid-template-columns: 1fr; }
}
.perf-graph-card {
  background: #161618;
  border: 1px solid #2a2a2c;
  border-radius: 10px;
  padding: 12px 14px 10px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}
.perf-graph-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.perf-graph-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 8px;
}
.perf-graph-top h4 {
  margin: 0; font-size: 14px; font-weight: 600; color: #fff;
}
.perf-legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: flex-end; }
.perf-leg { display: flex; align-items: flex-start; gap: 8px; }
.perf-swatch {
  width: 12px; height: 12px; border-radius: 2px; margin-top: 3px; flex-shrink: 0;
}
.perf-leg-label { font-size: 11px; color: var(--muted); font-weight: 500; }
.perf-leg-val { font-size: 13px; color: #fff; font-weight: 600; margin-top: 1px; }
.perf-svg {
  width: 100%; height: 160px; display: block; flex: 1;
}
.perf-chart-empty {
  flex: 1; display: grid; place-items: center;
  color: var(--muted); font-size: 13px; min-height: 140px;
}

.console {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0a0a0c;
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.console-top {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 12px;
  border-bottom: 1px solid #222; background: #141416; flex-shrink: 0;
}
.console-top h3 { margin: 0; flex: 1; font-size: 14px; font-weight: 600; }
.console-out {
  flex: 1; margin: 0; padding: 12px; font-family: var(--mono); font-size: 12px;
  line-height: 1.45; white-space: pre-wrap; overflow: auto; color: #d9d9d9; min-height: 0;
}
.console-in { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #222; background: #121214; flex-shrink: 0; }
.console-in input {
  flex: 1; padding: 9px 12px; font-family: var(--mono); border-radius: 10px;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 6px; border-bottom: 1px solid #2a2a2c; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; }

.files-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(18, 18, 20, 0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.files-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #2a2a2c;
  background: #141416;
  flex-shrink: 0;
}
.files-toolbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
  align-items: center;
}
.files-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 128px;
  height: 32px;
  padding: 0 15px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
  flex-shrink: 0;
}
.files-btn-file {
  background: rgba(64, 150, 255, 0.18);
  border-color: rgba(64, 150, 255, 0.45);
  color: #7eb6ff;
}
.files-btn-file:hover {
  background: rgba(64, 150, 255, 0.28);
  color: #fff;
}
.files-btn-folder {
  background: rgba(250, 173, 20, 0.16);
  border-color: rgba(250, 173, 20, 0.42);
  color: #ffc53d;
}
.files-btn-folder:hover {
  background: rgba(250, 173, 20, 0.28);
  color: #fff;
}
.files-loc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  font-family: var(--mono);
  font-size: 12px;
  min-width: 0;
}
.files-crumb {
  background: transparent;
  border: none;
  color: var(--coral);
  padding: 2px 4px;
  border-radius: 4px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files-crumb:hover { background: rgba(255,255,255,0.06); color: #fff; }
.files-crumb-sep { color: var(--muted); user-select: none; }
.files-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.files-empty { padding: 24px; text-align: center; }
.file-card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #121214;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 52px;
}
.file-card:hover { border-color: #666; }
.file-card.open { border-color: #777; z-index: 5; }
.file-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px 0 0 10px;
  cursor: pointer;
}
.file-card-main:hover { background: rgba(255,255,255,0.03); }
.file-card-up .file-card-main { border-radius: 10px; }
.file-card-ico {
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center;
  background: #1a1a1a; border: 1px solid #2e2e30; color: var(--faint);
}
.file-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.file-card-name {
  font-weight: 560; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-card-meta { font-size: 12px; color: var(--muted); }
.file-card-more-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 6px;
  border-left: 1px solid #2a2a2c;
}
.file-more {
  width: 36px; height: 36px; border-radius: 8px;
  border: none; background: transparent; color: var(--muted);
  display: grid; place-items: center;
}
.file-more:hover { background: rgba(255,255,255,0.06); color: #fff; }
.file-menu {
  position: absolute;
  right: 4px;
  top: calc(100% - 4px);
  z-index: 20;
  min-width: 200px;
  background: #1c1c1e;
  border: 1px solid #3a3a3c;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.55);
}
.file-menu-title {
  padding: 8px 10px 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.file-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: none;
  color: #fff;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.file-menu-item:hover { background: rgba(255,255,255,0.06); }
.file-menu-item.danger { color: #e57373; }
.file-menu-item.danger:hover { background: rgba(201, 52, 54, 0.16); }
.file-menu-sep {
  height: 1px;
  background: #2e2e30;
  margin: 4px 6px;
}
.files-edit .files-toolbar { gap: 12px; }
.files-edit-name {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.files-editor {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  border-radius: 0;
  resize: none;
  background: #0a0a0c;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
}
.editor {
  width: 100%; min-height: 460px; background: #0a0a0c; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; font-family: var(--mono); font-size: 12px; resize: vertical; outline: none;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.chip {
  font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px; background: #121214;
}
.price { font-size: 22px; font-weight: 700; margin: 6px 0; color: #fff; }
.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  background: #1c1c1e; border: 1px solid var(--line); padding: 11px 14px; border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45); max-width: 360px;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.textarea {
  width: 100%; min-height: 110px; padding: 10px 12px; border-radius: 10px; resize: vertical;
}
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #1c1c1e; border: 1px solid var(--line); border-radius: 10px;
  min-width: 200px; z-index: 200; padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.menu-pop button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.menu-pop button:hover { background: rgba(255,255,255,0.06); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.55);
  display: grid; place-items: center; padding: 20px;
}
.modal-card {
  width: min(420px, 100%);
  background: #1c1c1e;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.modal-card h2 { margin: 0 0 6px; font-size: 18px; color: #fff; }


/* ===== Mobile / tablet shell ===== */
.menu-toggle { display: none; }
.side-backdrop { display: none; }
.act-prog { color: var(--coral); font-weight: 600; margin-left: 6px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 1100px) {
  .menu-toggle { display: inline-flex; flex-shrink: 0; }
  .layout { grid-template-columns: 1fr; position: relative; width: 100%; max-width: 100%; }
  .side {
    display: block;
    position: fixed;
    z-index: 35;
    top: var(--top-h);
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    max-width: 100%;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 32px rgba(0,0,0,0.45);
  }
  .shell.side-open .side { transform: translateX(0); }
  .side-backdrop {
    display: none;
    position: fixed;
    inset: var(--top-h) 0 0 0;
    background: rgba(0,0,0,0.45);
    z-index: 34;
  }
  .shell.side-open .side-backdrop { display: block; }
  .main { padding: 12px 12px 28px; width: 100%; max-width: 100%; }
  .card, .files-panel, .console, .perf-graph-card, .mc-card, .server-row {
    max-width: 100%;
    min-width: 0;
  }
  .status-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    max-width: 100%;
    min-width: 0;
  }
  .status-strip .m,
  .status-strip .addr { margin-left: 0; max-width: 100%; min-width: 0; flex-wrap: wrap; }
  .hdr-controls {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .hdr-ip {
    flex: 1 1 auto;
    font-size: 11px;
    word-break: break-all;
    overflow-wrap: anywhere;
  }
  .top-right { flex-shrink: 0; min-width: 0; }
  .top-nav {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: none;
  }
  .top-nav button, .top-nav a { padding: 0 10px; font-size: 13px; white-space: nowrap; }
  .account-name { display: none; }
  .mc-head { flex-direction: column; align-items: stretch; }
  .mc-filters { flex-direction: column; align-items: stretch; max-width: 100%; }
  .mc-filters input, .mc-filters select { width: 100%; min-width: 0; max-width: 100%; }
  .server-row {
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 100%;
  }
  .row-right { align-items: flex-start; }
  .files-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .files-toolbar-actions {
    margin-left: 0;
    width: 100%;
    justify-content: stretch;
  }
  .files-btn {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
  }
  .files-loc { max-width: 100%; }
  .console-top, .console-in { max-width: 100%; min-width: 0; }
  .console-in input { min-width: 0; width: 100%; }
  .console-out {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .table-wrap { max-width: 100%; }
  .cfg-grid, .ov-grid, .perf-tiles, .perf-graphs, .mc-grid, .home-cards, .grid, .grid-2, .grid-3 {
    max-width: 100%;
    min-width: 0;
  }
  .row { max-width: 100%; }
  pre, code { max-width: 100%; overflow-x: auto; }
}

@media (max-width: 700px) {
  .top { padding: 0 8px; gap: 2px; }
  .top .brand span, .top .brand { font-size: 13px; }
  .top .brand { margin-right: 4px; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; }
  .top-nav { max-width: none; }
  .main { padding: 10px 10px 24px; }
  .page-title { font-size: 18px; word-break: break-word; }
  .ov-grid { grid-template-columns: 1fr; }
  .mc-grid { grid-template-columns: 1fr; }
  .mc-soft-row { grid-template-columns: 1fr; }
  .toast { left: 12px; right: 12px; max-width: none; bottom: 12px; }
  .hdr-round-btn { width: 40px; height: 40px; flex-shrink: 0; }
  .modal-backdrop { padding: 12px; }
  .modal-card { width: 100%; max-width: 100%; }
}

/* ===== Server Settings (categorized) ===== */
.ss-page { display: flex; flex-direction: column; gap: 12px; max-width: 100%; min-width: 0; }
.ss-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.ss-head .page-title { margin: 0; display: inline-flex; align-items: center; gap: 10px; color: var(--coral); }
.ss-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ss-search {
  height: 32px; min-width: 180px; max-width: 260px; width: 100%;
  background: #141416; border: 1px solid var(--line); border-radius: 12px;
  color: #fff; padding: 0 12px; font-size: 14px;
}
.ss-banner {
  background: rgba(64, 150, 255, 0.12);
  border: 1px solid rgba(64, 150, 255, 0.35);
  color: #b8d4ff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
}
.ss-banner code { font-size: 12px; color: #e8e8ea; }
.ss-form { display: flex; flex-direction: column; gap: 10px; max-width: 100%; }
.ss-cat {
  background: rgba(18, 18, 20, 0.85);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  max-width: 100%;
}
.ss-cat-head {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: transparent; border: none; color: #fff;
  text-align: left; font-size: 14px; font-weight: 600;
}
.ss-cat-head:hover { background: rgba(255,255,255,0.03); }
.ss-cat-ico { color: var(--red); display: inline-flex; }
.ss-chev { margin-left: auto; color: var(--muted); }
.ss-cat-body { display: none; border-top: 1px solid #2a2a2c; padding: 4px 0; }
.ss-cat.open .ss-cat-body { display: block; }
.ss-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 12px 14px;
  border-bottom: 1px solid #222;
  max-width: 100%;
}
.ss-row:last-child { border-bottom: none; }
.ss-meta { min-width: 0; flex: 1 1 220px; }
.ss-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ss-label { font-weight: 600; color: #fff; font-size: 14px; }
.ss-key { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.ss-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 999px;
  background: #1c1c1e; border: 1px solid #3a3a3c; color: var(--faint);
}
.ss-help { color: var(--muted); display: inline-flex; }
.ss-ctrl {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  justify-content: flex-end;
  flex: 0 1 auto;
  min-width: 0;
  --ss-field-w: 160px;
}
.ss-input {
  height: 32px;
  width: var(--ss-field-w);
  min-width: var(--ss-field-w);
  max-width: var(--ss-field-w);
  box-sizing: border-box;
  padding: 0 10px; font-size: 14px; border-radius: 12px;
}
.ss-toggle {
  width: var(--ss-field-w);
  min-width: var(--ss-field-w);
  max-width: var(--ss-field-w);
  height: 32px;
  border-radius: 999px; border: none;
  background: #3a3a3c; position: relative; padding: 0; flex-shrink: 0;
  box-sizing: border-box;
  transition: background 0.15s ease;
}
.ss-toggle.on { background: var(--red); }
.ss-knob {
  position: absolute; top: 4px; left: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; transition: transform 0.15s ease;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.ss-toggle.on .ss-knob { transform: translateX(128px); }
.ss-add-default {
  width: var(--ss-field-w);
  min-width: var(--ss-field-w);
  max-width: var(--ss-field-w);
  height: 32px;
  box-sizing: border-box;
  justify-content: center;
  white-space: nowrap;
  padding: 0 8px;
}
.ss-empty { padding: 12px 14px; }
.ss-exec-list { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; }
.ss-exec-row { display: flex; gap: 8px; align-items: center; }
.ss-exec-row .ss-input { flex: 1; max-width: none; width: 100%; }
#ssExecAdd { margin: 0 14px 12px; }

@media (max-width: 700px) {
  .ss-head-actions { width: 100%; }
  .ss-search { max-width: none; }
  .ss-ctrl {
    width: 100%;
    justify-content: flex-start;
    --ss-field-w: 100%;
  }
  .ss-input, .ss-toggle, .ss-add-default {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .ss-toggle.on .ss-knob { left: auto; right: 5px; transform: none; }
}

/* ===== Admins & Slots ===== */
.admins-page { display: flex; flex-direction: column; gap: 12px; max-width: 100%; }
.admins-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
}
.admins-head .page-title { margin: 0; color: var(--coral); display: inline-flex; align-items: center; gap: 10px; }
.admins-banner {
  background: rgba(64, 150, 255, 0.12);
  border: 1px solid rgba(64, 150, 255, 0.35);
  color: #b8d4ff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
}
.admins-banner strong { color: #fff; display: block; margin-bottom: 4px; }
.admins-table-wrap { overflow-x: auto; }
.admins-flags { font-family: var(--mono); font-size: 12px; color: var(--coral); }

.admin-backdrop {
  z-index: 60;
  padding: 16px;
  align-items: center;
  background: rgba(0, 0, 0, 0.65);
}
.admin-modal {
  width: min(520px, 100%);
  max-height: min(92vh, 780px);
  display: flex;
  flex-direction: column;
  background: #1a1a1c;
  border: 1px solid #3a3a3c;
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}
.admin-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #2a2a2c;
  flex-shrink: 0;
}
.admin-modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  color: #fff;
}
.admin-modal-x {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
}
.admin-modal-x:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-modal-body {
  padding: 14px 18px 8px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.admin-field { margin-bottom: 14px; }
.admin-label {
  display: block;
  font-size: 13px;
  font-weight: 560;
  color: var(--faint);
  margin-bottom: 7px;
}
.admin-input {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 10px;
}
.admin-select-wrap { position: relative; }
.admin-select {
  padding-right: 36px;
}
.admin-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.admin-auth-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-auth-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--faint);
  font-size: 13px;
  cursor: pointer;
}
.admin-auth-item:hover { background: rgba(255,255,255,0.03); }
.admin-auth-item input {
  accent-color: var(--red);
  width: 16px;
  height: 16px;
  margin: 0;
}
.admin-flags-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 8px;
  max-height: 200px;
  overflow: auto;
  padding: 10px;
  background: #121214;
  border: 1px solid #2e2e30;
  border-radius: 10px;
}
.admin-flag-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 4px;
  font-size: 12px;
  color: var(--faint);
  cursor: pointer;
  min-width: 0;
}
.admin-flag-item span { line-height: 1.3; }
.admin-flag-item b { color: #fff; font-weight: 650; }
.admin-flag-item input {
  accent-color: var(--red);
  margin-top: 1px;
  flex-shrink: 0;
}
.admin-flag-item.checked span { color: #e8e8ea; }
.admin-flags-summary {
  margin-top: 8px;
  min-height: 16px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--coral);
  letter-spacing: 0.02em;
}
.admin-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid #2a2a2c;
  flex-shrink: 0;
  background: #1a1a1c;
}
.admin-btn {
  height: 32px;
  min-width: 110px;
  padding: 0 15px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
}
.admin-btn-cancel {
  background: transparent;
  border-color: #555;
  color: #fff;
}
.admin-btn-cancel:hover { background: rgba(255,255,255,0.04); border-color: #777; }
.admin-btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.admin-btn-primary:hover { filter: brightness(1.08); }

@media (max-width: 560px) {
  .admin-flags-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-modal-foot { flex-wrap: wrap; }
  .admin-btn { flex: 1; }
}

/* ===== Managed MOTD ===== */
.motd-page { display: flex; flex-direction: column; gap: 12px; max-width: 100%; }
.motd-head { display: flex; flex-direction: column; gap: 4px; }
.motd-title-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.motd-title-row .page-title { margin: 0; color: var(--coral); display: inline-flex; align-items: center; gap: 10px; }
.motd-path { margin: 0; font-size: 13px; }
.motd-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.motd-badge.ok { background: rgba(46, 160, 90, 0.18); color: #7dffb0; border-color: rgba(46, 160, 90, 0.4); }
.motd-badge.info { background: rgba(64, 150, 255, 0.15); color: #9ec5ff; border-color: rgba(64, 150, 255, 0.35); }
.motd-badge.warn { background: rgba(222, 155, 53, 0.15); color: #ffc86b; border-color: rgba(222, 155, 53, 0.4); }
.motd-badge.bad { background: rgba(201, 52, 54, 0.18); color: #ff8f91; border-color: rgba(201, 52, 54, 0.45); }
.motd-badge.muted { background: rgba(255,255,255,0.06); color: var(--muted); border-color: var(--line); }
.motd-alert {
  border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.45;
}
.motd-alert strong { display: block; margin-bottom: 4px; color: #fff; }
.motd-alert.bad { background: rgba(201, 52, 54, 0.14); border: 1px solid rgba(201, 52, 54, 0.4); color: #ffb0b2; }
.motd-alert.warn { background: rgba(222, 155, 53, 0.12); border: 1px solid rgba(222, 155, 53, 0.35); color: #ffd089; }
.motd-alert.info { background: rgba(64, 150, 255, 0.12); border: 1px solid rgba(64, 150, 255, 0.35); color: #b8d4ff; }
.motd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.motd-card { padding: 16px; }
.motd-card-title { margin: 0 0 14px; font-size: 16px; font-weight: 650; color: #fff; }
.motd-count { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.motd-textarea {
  height: auto !important;
  min-height: 84px;
  padding: 10px 12px !important;
  resize: vertical;
  line-height: 1.4;
}
.motd-section { margin-top: 8px; }
.motd-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px;
}
.motd-section-head strong { color: #fff; font-size: 13px; }
.motd-rules, .motd-links { display: flex; flex-direction: column; gap: 8px; }
.motd-rule, .motd-link-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}
.motd-link-row { grid-template-columns: 1fr 2fr auto; }
.motd-drag {
  color: var(--muted);
  cursor: grab;
  user-select: none;
  font-size: 12px;
  letter-spacing: -2px;
  padding: 0 2px;
}
.motd-icon-btn { padding: 6px 8px !important; min-width: 0; }
.motd-footer-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(64, 150, 255, 0.1);
  border: 1px solid rgba(64, 150, 255, 0.28);
  color: #b8d4ff;
  font-size: 12px;
}
.motd-bytes { font-size: 12px; color: var(--muted); white-space: nowrap; }
.motd-bytes.over { color: #ff8f91; font-weight: 600; }
.motd-iframe {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111;
}
.motd-actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
@media (max-width: 960px) {
  .motd-grid { grid-template-columns: 1fr; }
  .motd-iframe { min-height: 320px; }
}
@media (max-width: 560px) {
  .motd-link-row { grid-template-columns: 1fr; }
  .motd-rule { grid-template-columns: auto 1fr auto; }
}

/* Maps / chat / radar / firewall */
.maps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.map-card strong { display: block; word-break: break-word; }
.chat-log {
  max-height: 420px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  padding: 12px;
}
.chat-line { margin-bottom: 6px; word-break: break-word; }
.chat-player { color: #f0c674; font-weight: 600; }
.chat-msg { color: var(--text); }
.radar-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}
.radar-svg {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  background: #0c1016;
}
.radar-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  max-height: 480px;
  overflow: auto;
}
.radar-leg {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.radar-leg span:first-child {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fw-rules { overflow-x: auto; }
@media (max-width: 700px) {
  .radar-wrap { justify-content: center; }
}
