:root {
  --bg-0: #0b1118;
  --bg-1: #14252d;
  --bg-2: #263f3e;
  --panel: rgba(11, 23, 29, 0.84);
  --panel-border: rgba(205, 220, 155, 0.2);
  --surface: rgba(13, 29, 34, 0.76);
  --surface-strong: rgba(13, 31, 37, 0.92);
  --border: rgba(168, 195, 180, 0.2);
  --text: #edf2e8;
  --text-rgb: 237, 242, 232;
  --text-secondary: #a9bbb5;
  --muted: #a9bbb5;
  --accent: #d8e56a;
  --accent-rgb: 216, 229, 106;
  --accent-strong: #b7c94d;
  --primary: linear-gradient(110deg, #cfe85f, #ff9c73);
  --hover: rgba(216, 229, 106, 0.12);
  --danger: #ff786b;
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 12% 6%, rgba(92, 147, 129, 0.2), transparent 36%),
    radial-gradient(ellipse at 88% 72%, rgba(221, 124, 91, 0.12), transparent 32%),
    linear-gradient(145deg, var(--bg-1), var(--bg-0) 68%);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(120deg, rgba(242, 245, 222, 0.045) 0, transparent 45%),
    repeating-linear-gradient(90deg, rgba(242, 245, 222, 0.018) 0 1px, transparent 1px 36px);
  pointer-events: none;
  z-index: 0;
}

.shell {
  max-width: 1240px;
  margin: 28px auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login-card,
.dashboard {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(9px);
}

.login-card {
  max-width: 460px;
  margin: 10vh auto;
  padding: 24px;
}

#loginForm,
.auth-form {
  display: grid;
  gap: 9px;
}

#loginForm.hidden,
.auth-actions.hidden {
  display: none;
}

#loginForm label,
.auth-form label,
#adminAccountForm label {
  margin: 3px 0 -4px;
  color: var(--text-secondary);
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.auth-actions button,
.auth-form button {
  width: 100%;
}

.auth-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.auth-form h2 {
  margin: 0 0 3px;
  font-size: 1.05rem;
}

.auth-form.hidden {
  display: none;
}

.auth-form button.ghost {
  margin-top: 2px;
}

.admin-account-list {
  display: grid;
  gap: 8px;
}

.admin-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.admin-account-row span:last-child {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.account-server-access,
.account-server-options {
  display: grid;
  gap: 8px;
}

.account-server-access {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.account-server-options {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.account-server-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.account-server-options input[type="checkbox"] {
  width: auto;
}

.account-access-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  width: 100%;
}

[data-admin-only].hidden {
  display: none !important;
}

@media (max-width: 520px) {
  .login-card {
    padding: 18px;
  }

  .auth-actions,
  .admin-account-row {
    grid-template-columns: 1fr;
  }
}

h1,
h3,
h4,
p {
  margin-top: 0;
}

input,
select,
textarea,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(166, 207, 219, 0.2);
  background: rgba(8, 28, 38, 0.8);
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

select option,
select optgroup {
  background: #eaf4f9;
  color: #0c2432;
}

button {
  background: var(--primary);
  border: none;
  color: #222b18;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

button.ghost {
  background: transparent;
  border: 1px solid rgba(166, 207, 219, 0.35);
  color: var(--text);
}

button.danger {
  border-color: rgba(255, 105, 90, 0.5);
  color: var(--danger);
}

.hint,
#statusLine {
  color: var(--muted);
}

.dashboard {
  padding: 18px;
}

.hidden {
  display: none;
}

.panel.hidden,
#tabs button.hidden,
.tab-group.hidden {
  display: none !important;
}

.dashboard.hidden,
.login-card.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  align-items: flex-start;
  justify-content: center;
  border-radius: 14px;
}

.tab-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px;
  min-width: 200px;
  padding: 11px 14px;
  border-right: 1px solid var(--border);
  margin-right: 0;
}

.tab-group:last-child {
  border-right: none;
  margin-right: 0;
  padding-right: 12px;
}

.tab-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 0;
  margin: 0 0 2px;
  text-align: center;
  width: 100%;
}

.tabs button {
  padding: 12px 16px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.02rem;
  transition: all 0.2s;
  white-space: nowrap;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tabs button:hover {
  background: var(--hover);
  color: var(--text);
  transform: translateY(-1px);
}

.tabs button.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(76, 229, 167, 0.3);
  border: none;
}

.panel {
  display: none;
  margin-top: 14px;
  animation: fadeIn 0.2s ease;
}

.panel.active {
  display: block;
}

.minimized-panels-dock {
  position: sticky;
  top: 8px;
  z-index: 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.minimized-panels-dock.hidden {
  display: none !important;
}

.minimized-panels-dock > strong {
  color: var(--text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.minimized-panels-list {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
}

.minimized-panels-list button {
  width: auto;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
}

.minimizable-panel {
  position: relative;
}

.minimizable-panel.is-minimized {
  display: none !important;
}

.minimizable-panel > .modern-head,
.minimizable-panel > h4,
.minimizable-panel > .filezilla-pane-head {
  padding-right: 50px;
}

.config-section-heading > .panel-minimize-button {
  position: static;
  flex: 0 0 auto;
  align-self: center;
  margin-left: auto;
}

.panel-minimize-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: auto;
  min-width: 34px;
  min-height: 32px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1;
}

.panel-minimize-button:hover {
  color: var(--text);
  background: var(--hover);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

#playitPortsList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.port-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(166, 207, 219, 0.35);
  background: rgba(8, 28, 38, 0.7);
  color: var(--text);
}

.port-pill button {
  width: auto;
  min-width: 0;
  padding: 2px 6px;
  border-radius: 999px;
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 105, 90, 0.45);
}

.game-pages-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.game-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.game-action-btn {
  width: auto;
  min-width: 120px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.server-power {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 156, 115, 0.12), transparent 42%),
    linear-gradient(120deg, rgba(28, 48, 47, 0.96), rgba(14, 26, 32, 0.96));
}

.server-power h3,
.server-power p {
  margin-bottom: 0;
}

.server-power-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.76rem;
  font-family: "JetBrains Mono", monospace;
}

.server-power-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.server-power-actions button {
  width: auto;
}

.server-power-toggle {
  width: auto;
  min-width: 132px;
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1;
  white-space: nowrap;
  font-weight: 700;
}

.server-power-toggle.is-stopped {
  background: linear-gradient(100deg, #d8e56a, #f3d37e);
  color: #242a18;
}

.server-power-toggle.is-running {
  background: linear-gradient(100deg, #ffad7c, var(--danger));
  color: #34110c;
}

.server-power-toggle.is-unavailable,
.server-power-toggle:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.server-restart-toggle {
  width: auto;
  flex: 0 0 auto;
  min-width: 82px;
  padding: 8px 11px;
  white-space: nowrap;
}

@media (max-width: 460px) {
  .server-power {
    align-items: stretch;
    flex-direction: column;
  }

  .server-power-actions {
    justify-content: stretch;
  }

  .server-power-actions button {
    flex: 1 1 120px;
  }
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.playit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.playit-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(166, 207, 219, 0.18);
  background: linear-gradient(160deg, rgba(12, 33, 43, 0.96), rgba(8, 20, 28, 0.96));
}

.playit-summary-card {
  grid-column: 1 / -1;
}

.playit-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.playit-range-btn {
  width: auto;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(166, 207, 219, 0.35);
  background: transparent;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 600;
}

.playit-range-btn.active {
  background: rgba(44, 213, 143, 0.16);
  border-color: rgba(44, 213, 143, 0.7);
  color: #8ff3c8;
}

.playit-totals {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.78rem;
}

.playit-compare-layout {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 1.3fr) 1fr;
  gap: 8px;
  align-items: center;
}

.playit-port-side,
.playit-center-graph {
  display: grid;
  gap: 5px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(166, 207, 219, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.playit-port-side.left {
  text-align: left;
}

.playit-port-side.right {
  text-align: right;
}

.playit-port-side.right .playit-legend {
  justify-content: flex-end;
}

.playit-head h3,
.playit-head p {
  margin: 0;
}

.playit-head h3 {
  font-size: 0.98rem;
  line-height: 1.2;
}

.playit-head p {
  color: var(--muted);
  font-size: 0.76rem;
}

.playit-graph {
  width: 100%;
  height: 58px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(166, 207, 219, 0.1);
}

.playit-line-rx,
.playit-line-tx {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.playit-line-rx {
  stroke: #55d6ff;
}

.playit-line-tx {
  stroke: #2cd58f;
}

.playit-line-port-a,
.playit-line-port-b {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.playit-line-port-a {
  stroke: #55d6ff;
}

.playit-line-port-b {
  stroke: #2cd58f;
}

.playit-legend {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 0.7rem;
}

.playit-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.playit-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.playit-legend .dot.rx {
  background: #55d6ff;
}

.playit-legend .dot.tx {
  background: #2cd58f;
}

.playit-legend .dot.port-a {
  background: #55d6ff;
}

.playit-legend .dot.port-b {
  background: #2cd58f;
}

.playit-legend.compact {
  font-size: 0.66rem;
}

.playit-extra {
  color: var(--muted);
  font-size: 0.7rem;
}

.resource-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(166, 207, 219, 0.18);
  background: linear-gradient(160deg, rgba(12, 33, 43, 0.96), rgba(8, 20, 28, 0.96));
}

.resource-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.resource-card-head h3,
.resource-card-head p,
.resource-meta p,
.resource-meta h4 {
  margin: 0;
}

.resource-card-head p,
.resource-detail,
.resource-empty {
  color: var(--muted);
}

.resource-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-wheel {
  --usage: 0;
  --usage-color: #54d68b;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(8, 20, 28, 0.98) 0 56%, transparent 57%),
    conic-gradient(var(--usage-color) calc(var(--usage) * 1%), rgba(57, 83, 95, 0.9) 0);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(166, 207, 219, 0.16);
}

.resource-wheel.caution {
  --usage-color: #ecd35f;
}

.resource-wheel.warn {
  --usage-color: #ff9b54;
}

.resource-wheel.danger {
  --usage-color: #ff5e65;
}

.resource-wheel-inner {
  text-align: center;
}

.resource-wheel-inner strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
}

.resource-wheel-inner span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-family: "JetBrains Mono", monospace;
}

.resource-meta {
  display: grid;
  gap: 8px;
}

.resource-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.resource-split div {
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(166, 207, 219, 0.08);
}

.resource-split span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.resource-split strong,
.resource-detail,
.resource-empty {
  font-family: "JetBrains Mono", monospace;
}

.resource-empty {
  padding: 22px 14px;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed rgba(166, 207, 219, 0.16);
}

.status-card {
  background: rgba(16, 39, 52, 0.9);
  border: 1px solid rgba(166, 207, 219, 0.18);
  border-radius: 12px;
  padding: 12px;
}

.status-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-card-wide {
  grid-column: span 2;
}

.status-kv {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.status-kv-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(166, 207, 219, 0.14);
}

.status-kv-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.status-kv-key {
  color: var(--muted);
}

.status-kv-value {
  font-family: "JetBrains Mono", monospace;
  text-align: right;
}

.panel-head,
.row,
.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.inline-form.grow {
  flex: 1;
}

.users-grid,
.files-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.whitelist-online {
  color: #61eb8d;
  font-weight: 700;
}

.users-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.users-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-weight: 600;
}

.user-last-seen {
  color: var(--muted);
  font-size: 0.8rem;
}

.users-list li.empty {
  color: var(--muted);
}

.user-action {
  width: auto;
  border: none;
  background: transparent;
  color: var(--danger);
  font-weight: 700;
  padding: 0 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1px);
}

.users-list li:hover .user-action,
.users-list li:focus-within .user-action {
  opacity: 1;
  pointer-events: auto;
}

.user-action:hover {
  filter: brightness(1.15);
  transform: translateY(0);
}

.files-wrap-filezilla {
  grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
  align-items: start;
}

.filezilla-explorer {
  display: grid;
  gap: 12px;
}

.filezilla-explorer.is-drop-target {
  outline: 2px dashed rgba(124, 228, 181, 0.78);
  outline-offset: 2px;
}

.filezilla-toolbar,
.filezilla-sidebar,
.filezilla-main,
.filezilla-editor,
.filezilla-table {
  border: 1px solid rgba(166, 207, 219, 0.18);
  border-radius: 12px;
  background: rgba(9, 22, 30, 0.92);
}

.filezilla-toolbar,
.filezilla-sidebar,
.filezilla-main,
.filezilla-editor {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.filezilla-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(42, 63, 76, 0.95), rgba(18, 34, 44, 0.95));
}

.filezilla-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filezilla-pathbar {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.filezilla-label {
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.75rem;
}

.filezilla-breadcrumbs {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 36px;
}

.crumb,
.tree-toggle,
.tree-label {
  width: auto;
}

.crumb {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(166, 207, 219, 0.22);
  background: rgba(8, 26, 35, 0.88);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
}

.crumb.active {
  border-color: rgba(76, 229, 167, 0.8);
  color: #d5ffe8;
}

.crumb-separator {
  color: rgba(166, 207, 219, 0.5);
  font-family: "JetBrains Mono", monospace;
}

.filezilla-sidebar,
.filezilla-main {
  min-width: 0;
}

.filezilla-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 620px;
}

.filezilla-main {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.filezilla-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(166, 207, 219, 0.12);
  background: linear-gradient(180deg, rgba(30, 48, 59, 0.9), rgba(14, 28, 36, 0.9));
}

.filezilla-pane-head h4 {
  margin: 0;
}

.directory-tree {
  max-height: 560px;
  overflow: auto;
  padding: 8px;
}

.tree-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding-left: calc(var(--tree-depth, 0) * 14px);
  margin-bottom: 2px;
}

.tree-toggle,
.tree-label {
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(166, 207, 219, 0.12);
  background: rgba(8, 22, 30, 0.86);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
}

.tree-toggle {
  text-align: center;
}

.tree-label {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-row.active .tree-label,
.tree-row:hover .tree-label,
.tree-row:hover .tree-toggle {
  border-color: rgba(76, 229, 167, 0.35);
  background: rgba(28, 67, 84, 0.72);
}

.tree-row.expanded .tree-label,
.tree-row.expanded .tree-toggle {
  border-color: rgba(102, 196, 255, 0.5);
  background: rgba(33, 71, 104, 0.72);
  color: #d9efff;
}

.tree-row.expanded .tree-toggle {
  color: #8fd0ff;
}

.tree-empty,
.filezilla-empty {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  padding: 10px 12px;
}

.filezilla-table {
  overflow: hidden;
}

.filezilla-table-head {
  border-bottom: 1px solid rgba(166, 207, 219, 0.12);
}

.filezilla-table-body {
  max-height: 320px;
  overflow: auto;
}

.filezilla-row {
  display: grid;
  grid-template-columns: 44px minmax(220px, 2fr) 120px 120px minmax(180px, 1.7fr);
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.84rem;
}

.filezilla-cell-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-select-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #48d9a7;
  cursor: pointer;
}

.filezilla-row-head {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.73rem;
  background: rgba(16, 32, 42, 0.96);
}

.filezilla-row-item {
  border-bottom: 1px solid rgba(166, 207, 219, 0.08);
  cursor: pointer;
  position: relative;
}

.filezilla-row-item[draggable="true"] {
  cursor: grab;
}

.filezilla-row-item[draggable="true"]:active {
  cursor: grabbing;
}

.filezilla-row-item:hover,
.filezilla-row-item.active {
  background: rgba(36, 78, 97, 0.68);
}

.filezilla-row-item.directory {
  background: linear-gradient(90deg, rgba(28, 74, 100, 0.25), rgba(13, 38, 52, 0.08));
}

.filezilla-row-item.file {
  background: linear-gradient(90deg, rgba(17, 40, 54, 0.2), rgba(11, 28, 39, 0.05));
}

.filezilla-row-item.directory:hover,
.filezilla-row-item.directory.active {
  border-left: 3px solid rgba(102, 197, 255, 0.88);
}

.filezilla-row-item.file:hover,
.filezilla-row-item.file.active {
  border-left: 3px solid rgba(99, 232, 172, 0.88);
}

.filezilla-row-item.selected {
  box-shadow: inset 0 0 0 1px rgba(73, 219, 168, 0.35);
}

.filezilla-row-item.parent-row {
  border-left: 3px solid rgba(255, 210, 118, 0.82);
  background: linear-gradient(90deg, rgba(96, 73, 22, 0.35), rgba(28, 23, 8, 0.08));
}

.filezilla-row-item.dragging {
  opacity: 0.45;
}

.filezilla-row-item.drop-target {
  outline: 2px dashed rgba(124, 228, 181, 0.9);
  outline-offset: -2px;
}

.filezilla-row-item.drop-target::after {
  content: attr(data-drop-label);
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  font-family: "JetBrains Mono", monospace;
  color: #d5ffe8;
  background: rgba(7, 37, 25, 0.86);
  border: 1px solid rgba(124, 228, 181, 0.55);
  border-radius: 999px;
  padding: 3px 8px;
  pointer-events: none;
}

.filezilla-table-body.drop-target-current {
  box-shadow: inset 0 0 0 2px rgba(132, 193, 213, 0.7);
  border-radius: 8px;
  position: relative;
}

.filezilla-table-body.drop-target-current::before {
  content: attr(data-drop-label);
  position: sticky;
  top: 6px;
  left: 10px;
  display: inline-block;
  margin: 6px;
  z-index: 2;
  font-size: 0.74rem;
  font-family: "JetBrains Mono", monospace;
  color: #def4ff;
  background: rgba(17, 44, 63, 0.9);
  border: 1px solid rgba(132, 193, 213, 0.65);
  border-radius: 999px;
  padding: 4px 9px;
}

.toast-stack {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 8px;
  z-index: 9999;
}

.toast-item {
  min-width: 190px;
  max-width: min(80vw, 360px);
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(132, 193, 213, 0.4);
  background: rgba(9, 29, 42, 0.9);
  color: #eaf4f9;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast-item.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-item.success {
  border-color: rgba(124, 228, 181, 0.65);
  background: rgba(7, 35, 24, 0.9);
  color: #d7ffe9;
}

.toast-item.error {
  border-color: rgba(255, 128, 128, 0.65);
  background: rgba(52, 18, 20, 0.92);
  color: #ffd8d8;
}

.filezilla-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filezilla-cell-name {
  font-weight: 600;
}

.filezilla-cell-type,
.filezilla-cell-size {
  color: var(--muted);
}

.filezilla-entry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.filezilla-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(76, 229, 167, 0.12);
  border: 1px solid rgba(76, 229, 167, 0.28);
  color: #7ff0be;
  font-size: 0.72rem;
}

.filezilla-kind-icon {
  font-size: 0.96rem;
  width: 1.2rem;
  text-align: center;
}

.filezilla-row-item.directory .filezilla-badge {
  background: rgba(74, 160, 226, 0.2);
  border-color: rgba(132, 196, 245, 0.45);
  color: #b8ddff;
}

.filezilla-row-item.file .filezilla-badge {
  background: rgba(44, 213, 143, 0.12);
  border-color: rgba(76, 229, 167, 0.28);
  color: #7ff0be;
}

.filezilla-editor {
  display: grid;
  gap: 12px;
  padding-bottom: 12px;
}

.editor-shell {
  position: relative;
  margin: 0 12px;
  min-height: 220px;
  height: 260px;
  border-radius: 10px;
  border: 1px solid rgba(166, 207, 219, 0.18);
  background: rgba(6, 18, 24, 0.98);
  overflow: hidden;
}

.editor-highlight,
.filezilla-editor textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  font-family: "JetBrains Mono", monospace;
  line-height: 1.5;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.editor-highlight {
  z-index: 2;
  pointer-events: none;
  background: transparent;
  color: #d9f2ff;
}

.filezilla-editor textarea {
  z-index: 1;
  resize: vertical;
  background: transparent;
  color: transparent;
  caret-color: #edf7ff;
  outline: none;
}

.filezilla-editor textarea::selection {
  background: rgba(76, 229, 167, 0.32);
}

.filezilla-editor .row {
  padding: 0 12px;
}

.token-key { color: #8ed8ff; }
.token-string { color: #9ae6b4; }
.token-number { color: #f7d98a; }
.token-boolean { color: #f8b4d9; }
.token-comment { color: #6b8da2; }
.token-tag { color: #7dd3fc; }
.token-attr { color: #b5e7ff; }
.token-value { color: #f3f7ff; }

.terminal,
textarea,
.mono {
  font-family: "JetBrains Mono", monospace;
}

textarea {
  min-height: 180px;
}

.terminal {
  background: rgba(7, 20, 28, 0.95);
  border-radius: 12px;
  border: 1px solid rgba(166, 207, 219, 0.18);
  padding: 12px;
  max-height: 450px;
  overflow: auto;
  white-space: pre-wrap;
  margin: 0;
}

.terminal .terminal-link {
  color: #7dd3fc;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.terminal .terminal-link:hover {
  color: #bae6fd;
}

.modern-content .terminal {
  border: none;
  border-radius: 0;
  background: transparent;
  max-height: 100%;
}

.file-upload {
  display: inline-flex;
  width: auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid rgba(166, 207, 219, 0.35);
  cursor: pointer;
}

.file-upload input {
  display: none;
}

.modern-panel {
  border: 1px solid rgba(166, 207, 219, 0.18);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(12, 33, 43, 0.96), rgba(8, 20, 28, 0.96));
  overflow: hidden;
  display: grid;
  gap: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

/* Visual refresh and mobile polish */
.login-card,
.dashboard,
.modern-panel,
.server-pane,
.resource-card,
.playit-card,
.status-card,
.filezilla-toolbar,
.filezilla-sidebar,
.filezilla-main,
.filezilla-editor,
.filezilla-table,
.terminal,
textarea,
input,
select {
  backdrop-filter: blur(10px);
}

.dashboard {
  background:
    linear-gradient(165deg, rgba(13, 27, 33, 0.88), rgba(17, 31, 35, 0.84)),
    radial-gradient(circle at 100% -10%, rgba(216, 229, 106, 0.09), transparent 42%),
    radial-gradient(circle at 0 100%, rgba(221, 124, 91, 0.07), transparent 38%);
}

.topbar {
  background:
    radial-gradient(circle at 100% 0, rgba(216, 229, 106, 0.1), transparent 38%),
    linear-gradient(120deg, rgba(28, 49, 49, 0.82), rgba(16, 29, 35, 0.68));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.topbar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.server-switcher {
  position: relative;
  flex: 0 1 188px;
  min-width: 160px;
}

.server-switcher-btn {
  width: 100%;
  min-width: 0;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1;
  white-space: nowrap;
  text-align: left;
  color: var(--text);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1050;
  width: min(360px, 86vw);
  border: 1px solid rgba(132, 193, 213, 0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(8, 26, 38, 0.98), rgba(7, 20, 31, 0.98));
  box-shadow: 0 14px 36px rgba(4, 14, 22, 0.52);
  padding: 8px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.server-switcher.open .server-switcher-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.server-switcher-list {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.server-switcher-item {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 2px;
  border-radius: 10px;
  border: 1px solid rgba(132, 193, 213, 0.2);
  background: rgba(8, 27, 38, 0.72);
  padding: 8px 10px;
  color: var(--text);
}

.server-switcher-item:hover {
  border-color: rgba(120, 237, 184, 0.45);
  background: rgba(11, 38, 52, 0.86);
}

.server-switcher-item.is-active {
  border-color: rgba(120, 237, 184, 0.55);
  box-shadow: inset 0 0 0 1px rgba(120, 237, 184, 0.2);
}

.server-switcher-item:disabled {
  opacity: 1;
  cursor: default;
}

.server-switcher-name {
  font-size: 0.84rem;
  font-weight: 700;
}

.server-switcher-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.server-switcher-foot {
  margin-top: 8px;
  border-top: 1px solid rgba(132, 193, 213, 0.18);
  padding-top: 8px;
}

.server-switcher-manage {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(132, 193, 213, 0.34);
  background: rgba(12, 38, 52, 0.64);
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
}

.server-switcher-manage:hover {
  border-color: rgba(120, 237, 184, 0.45);
  background: rgba(15, 46, 63, 0.86);
}

.mobile-nav-toggle,
.tabs-mobile-head {
  display: none;
}

#logoutBtn {
  width: auto;
  min-width: 76px;
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1;
  white-space: nowrap;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.75rem);
  letter-spacing: 0.02em;
}

#statusLine {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.tabs {
  margin-top: 12px;
  background:
    linear-gradient(180deg, rgba(17, 45, 62, 0.92), rgba(9, 26, 39, 0.86)),
    radial-gradient(circle at 10% -20%, rgba(95, 202, 220, 0.15), transparent 45%);
  border: 1px solid var(--border);
}

.tab-group {
  border-right-color: rgba(143, 197, 215, 0.14);
}

.tabs button {
  border: 1px solid transparent;
  border-radius: 10px;
}

.tabs button.active {
  background: var(--primary);
  color: #222b18;
  border-color: rgba(230, 229, 151, 0.48);
  box-shadow: 0 8px 20px rgba(224, 172, 103, 0.18);
}

.modern-head,
.filezilla-pane-head,
.filezilla-toolbar {
  background:
    linear-gradient(180deg, rgba(29, 63, 82, 0.82), rgba(14, 32, 44, 0.82)),
    radial-gradient(circle at 15% -40%, rgba(126, 201, 219, 0.22), transparent 50%);
}

.modern-head h3,
.server-pane h4,
.panel-head h3 {
  letter-spacing: 0.01em;
}

button {
  border-radius: 12px;
}

button.ghost {
  background: rgba(22, 39, 43, 0.72);
  border: 1px solid rgba(177, 196, 171, 0.34);
}

button.danger {
  background: rgba(93, 26, 27, 0.35);
  border: 1px solid rgba(255, 130, 116, 0.46);
  color: #ffb9ad;
}

input,
select,
textarea {
  background: linear-gradient(180deg, rgba(9, 29, 42, 0.9), rgba(8, 23, 34, 0.9));
  border-color: rgba(126, 185, 205, 0.28);
  border-radius: 11px;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.82);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.19);
}

.panel.active {
  animation: panelLift 0.26s ease;
}

@keyframes panelLift {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.server-chip,
.setting-card,
.status-card,
.resource-split div {
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.server-chip:hover,
.setting-card:hover,
.status-card:hover,
.resource-split div:hover {
  border-color: rgba(119, 219, 182, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(7, 20, 30, 0.32);
}

@media (max-width: 980px) {
  body {
    overflow: hidden;
    height: 100dvh;
  }

  .shell,
  .dashboard {
    height: 100%;
  }

  .dashboard {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    width: auto;
    min-width: 118px;
    justify-content: center;
    align-items: center;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(230, 229, 151, 0.72);
    background: var(--primary);
    color: #222b18;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 18px rgba(224, 172, 103, 0.26);
  }

  .tabs {
    position: fixed;
    inset: 0;
    z-index: 1000;
    margin: 0;
    border-radius: 0;
    border: none;
    display: grid !important;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 10px;
    padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    overflow-y: auto;
    background:
      linear-gradient(180deg, rgba(8, 24, 37, 0.98), rgba(7, 20, 31, 0.97)),
      radial-gradient(circle at 0% 0%, rgba(89, 199, 212, 0.2), transparent 45%);
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  body.mobile-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  body.mobile-nav-open .tabs {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .tabs-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(132, 193, 213, 0.22);
    border-radius: 12px;
    background: rgba(9, 33, 47, 0.78);
    padding: 10px 12px;
    color: var(--text);
  }

  .tabs-mobile-head strong {
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.76rem;
  }

  .tabs-mobile-head button {
    width: auto;
    min-width: 84px;
  }

  .tab-group {
    width: 100%;
    min-width: 0;
    border-right: none;
    border: 1px solid rgba(132, 193, 213, 0.2);
    border-radius: 12px;
    background: rgba(8, 26, 38, 0.65);
  }

  .panel.active {
    margin-top: 10px;
    height: calc(100dvh - 170px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
  }

  .modern-content {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .shell {
    margin: 8px auto;
    padding: 10px;
  }

  .dashboard {
    padding: 10px;
    border-radius: 16px;
  }

  .topbar {
    padding: 12px;
    gap: 10px;
  }

  .topbar-actions {
    width: 100%;
    max-width: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .topbar-actions button {
    width: auto;
  }

  .server-switcher {
    flex: 1 1 140px;
    min-width: 0;
  }

  .server-switcher-btn {
    width: 100%;
    min-width: 0;
  }

  .server-switcher-menu {
    right: 0;
    width: min(92vw, 360px);
  }

  #logoutBtn {
    padding: 7px 9px;
    font-size: 0.8rem;
  }

  .config-grid,
  .status-grid,
  .resource-grid,
  .playit-grid,
  .servers-quick-list,
  .server-page-grid,
  .config-settings-grid,
  .users-grid,
  .files-wrap,
  .files-wrap-filezilla,
  .playit-compare-layout {
    grid-template-columns: 1fr;
  }

  .filezilla-main,
  .filezilla-toolbar,
  .filezilla-pane-head,
  .modern-form {
    padding: 10px;
  }

  .filezilla-row {
    grid-template-columns: 36px minmax(140px, 1.4fr) 80px 86px;
    font-size: 0.78rem;
    padding: 8px 9px;
  }

  .terminal {
    max-height: 260px;
    font-size: 0.78rem;
  }

  .resource-wheel {
    width: 116px;
    height: 116px;
  }

  .resource-wheel-inner strong {
    font-size: 1.45rem;
  }
}

@media (max-width: 460px) {
  .tab-group {
    min-width: 205px;
    padding: 9px;
  }

  .tabs button {
    min-height: 42px;
    font-size: 0.9rem;
    padding: 9px 10px;
  }

}

.modern-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(166, 207, 219, 0.12);
  background: linear-gradient(180deg, rgba(30, 48, 59, 0.9), rgba(14, 28, 36, 0.9));
}

.modern-head h3,
.modern-head p {
  margin: 0;
}

.modern-head p {
  color: var(--muted);
  font-size: 0.85rem;
}

.modern-content {
  padding: 12px;
  overflow: auto;
  max-height: 520px;
}

.modern-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(166, 207, 219, 0.08);
}

.modern-form:last-child,
.modern-form:only-child {
  border-bottom: none;
}

.modern-form input {
  width: 100%;
}

.modern-form button {
  width: 100%;
}

.server-page-shell {
  gap: 0;
}

.server-quick-nav {
  padding: 12px;
  border-bottom: 1px solid rgba(166, 207, 219, 0.12);
  background: linear-gradient(180deg, rgba(13, 35, 46, 0.9), rgba(10, 26, 34, 0.9));
  display: grid;
  gap: 10px;
}

.servers-quick-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.server-chip {
  border: 1px solid rgba(166, 207, 219, 0.2);
  border-radius: 10px;
  background: rgba(8, 27, 36, 0.75);
  padding: 8px;
  display: grid;
  gap: 5px;
}

.server-chip.is-active {
  border-color: rgba(120, 237, 184, 0.55);
  box-shadow: inset 0 0 0 1px rgba(120, 237, 184, 0.25);
}

.server-chip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.server-chip-title {
  font-size: 0.86rem;
  font-weight: 700;
}

.server-chip-badge {
  font-size: 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(166, 207, 219, 0.35);
  padding: 1px 7px;
  color: var(--muted);
}

.server-chip-meta {
  font-size: 0.72rem;
  color: rgba(210, 233, 239, 0.86);
}

.server-chip button {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.78rem;
}

.server-page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
}

.server-pane {
  border: 1px solid rgba(166, 207, 219, 0.14);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(17, 40, 52, 0.75), rgba(10, 24, 32, 0.75));
  padding: 12px;
}

.server-pane h4 {
  margin: 0;
  font-size: 0.98rem;
}

.server-pane p {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.compact-form {
  padding: 0;
  border-bottom: none;
}

.danger-pane {
  margin: 0 12px 12px;
  border-color: rgba(255, 105, 90, 0.25);
}

.config-shell .modern-head {
  border-bottom-color: rgba(166, 207, 219, 0.22);
}

.config-like-image-form {
  border-bottom: none;
  padding: 12px;
}

.config-filter-wrap {
  margin-bottom: 2px;
}

.config-filter-wrap input {
  width: 100%;
}

.config-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
  gap: 10px;
}

.server-icon-panel {
  margin-top: 12px;
}

.server-icon-content {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
}

.server-icon-preview {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  object-fit: contain;
  image-rendering: pixelated;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #10191d;
}

.server-icon-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.server-icon-controls .hint {
  flex-basis: 100%;
  margin: 0;
}

@media (max-width: 520px) {
  .server-icon-content {
    align-items: flex-start;
    flex-direction: column;
  }
}

.setting-card {
  border: 1px solid rgba(166, 207, 219, 0.2);
  border-radius: 10px;
  background: linear-gradient(165deg, rgba(17, 46, 59, 0.88), rgba(12, 30, 39, 0.88));
  padding: 10px;
  display: grid;
  gap: 6px;
}

.setting-card.is-hidden {
  display: none;
}

.setting-card label {
  margin: 0;
  font-size: 0.82rem;
  color: #d8f6ff;
  font-weight: 700;
}

.setting-card input,
.setting-card select {
  margin: 0;
}

.setting-help {
  margin: 0;
  color: rgba(204, 228, 235, 0.78);
  font-size: 0.72rem;
  line-height: 1.35;
}

.modern-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.modern-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(166, 207, 219, 0.08);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
}

.modern-list li:last-child {
  border-bottom: none;
}

.modern-list li.empty {
  color: var(--muted);
  text-align: center;
  padding: 28px 12px;
}

.modern-list .whitelist-online {
  color: #7ff0be;
  font-weight: 600;
}

.modern-list .user-action {
  width: auto;
  border: none;
  background: transparent;
  color: var(--danger);
  font-weight: 700;
  padding: 6px 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1px);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
}

.modern-list li:hover .user-action,
.modern-list li:focus-within .user-action {
  opacity: 1;
  pointer-events: auto;
}

.modern-list .user-action:hover {
  filter: brightness(1.15);
  transform: translateY(0);
}

.all-players-panel {
  margin-top: 14px;
  overflow: hidden;
}

.all-players-head {
  align-items: center;
}

.all-players-head h3 {
  margin-bottom: 5px;
}

.all-players-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.player-count {
  padding: 6px 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  white-space: nowrap;
}

.all-players-toolbar {
  padding: 12px 14px 0;
}

.all-players-toolbar input {
  max-width: 360px;
  background: rgba(8, 24, 31, 0.82);
}

.all-players-list {
  max-height: 480px;
  overflow-y: auto;
  padding: 8px 14px 14px;
}

.all-players-list li {
  min-height: 58px;
  padding-inline: 12px;
}

.all-players-list li.is-hidden {
  display: none;
}

.all-players-list .user-last-seen {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
}

.config-shell {
  overflow: hidden;
  border-color: rgba(var(--accent-rgb), 0.2);
}

.config-shell .modern-head.config-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 132px;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.17);
  background:
    radial-gradient(ellipse at 90% 0, rgba(216, 229, 106, 0.14), transparent 44%),
    linear-gradient(110deg, rgba(20, 45, 48, 0.72), rgba(15, 29, 34, 0.3));
}

.config-hero-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.19), rgba(255, 156, 115, 0.1));
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.15);
}

.config-hero > div:nth-child(2) {
  min-width: 0;
}

.config-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.config-shell .config-hero h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  letter-spacing: -0.035em;
}

.config-shell .config-hero p {
  max-width: 600px;
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
}

.config-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid rgba(127, 240, 190, 0.18);
  border-radius: 999px;
  background: rgba(127, 240, 190, 0.06);
  color: #a7e8ca;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.63rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.config-live-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7ff0be;
  box-shadow: 0 0 10px rgba(127, 240, 190, 0.75);
}

.config-like-image-form {
  display: block;
  padding: 18px 22px 0;
}

.config-filter-wrap {
  position: relative;
  margin-bottom: 18px;
}

.config-filter-wrap > span {
  position: absolute;
  top: 50%;
  left: 13px;
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
  transform: translateY(-55%);
  pointer-events: none;
}

.config-filter-wrap input {
  min-height: 44px;
  padding-left: 40px;
  border-color: rgba(var(--accent-rgb), 0.16);
  background: rgba(4, 17, 22, 0.62);
}

.config-filter-wrap input:focus {
  border-color: rgba(var(--accent-rgb), 0.58);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.08);
}

.config-sections {
  display: grid;
  gap: 14px;
}

.config-section {
  padding: 15px;
  border: 1px solid rgba(166, 207, 219, 0.1);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(10, 25, 30, 0.48), rgba(13, 30, 35, 0.23));
}

.config-section.is-hidden {
  display: none;
}

.config-section-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.config-section-number {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border-radius: 9px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
}

.config-section-heading h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.config-section-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.71rem;
}

.config-section .config-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.config-section .setting-card {
  min-width: 0;
  padding: 13px;
  border-color: rgba(166, 207, 219, 0.12);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(19, 40, 45, 0.76), rgba(9, 24, 29, 0.84));
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.config-section .setting-card:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-rgb), 0.3);
  background: linear-gradient(145deg, rgba(22, 46, 49, 0.88), rgba(9, 24, 29, 0.9));
}

.config-section .setting-card label {
  color: #e6ecdc;
  font-size: 0.78rem;
}

.config-section .setting-card input,
.config-section .setting-card select {
  min-height: 40px;
  border-color: rgba(166, 207, 219, 0.15);
  background: rgba(5, 17, 21, 0.72);
}

.config-section .setting-help {
  min-height: 2em;
  color: rgba(204, 228, 219, 0.65);
  font-size: 0.68rem;
}

.config-card-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 2px;
}

.config-card-actions button {
  flex: 1 1 110px;
  width: auto;
  padding: 8px;
  font-size: 0.74rem;
}

.config-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px -22px 0;
  padding: 15px 22px;
  border-top: 1px solid rgba(166, 207, 219, 0.1);
  background: rgba(5, 16, 20, 0.55);
}

.config-save-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.config-save-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 165px;
  padding: 11px 16px;
  box-shadow: 0 5px 18px rgba(var(--accent-rgb), 0.13);
}

.config-save-bar button span {
  font-size: 1rem;
}

.config-save-status {
  margin: 0;
  padding: 0 22px 14px;
  color: var(--muted);
  font-size: 0.72rem;
}

.config-extras-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.config-extras-grid > .modern-panel {
  min-width: 0;
  margin-top: 0 !important;
}

.config-extras-grid .modern-head {
  min-height: 72px;
}

.resource-pack-panel .modern-head p,
.server-icon-panel .modern-head p {
  max-width: 600px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.resource-pack-panel .modern-content {
  padding: 14px;
}

.resource-pack-panel .hint {
  font-size: 0.72rem;
  line-height: 1.5;
}

.resource-pack-panel .hint:last-child {
  margin-bottom: 0;
}

.config-shell .config-hero + .modern-form {
  border-bottom: 0;
}

.hytale-config .config-shell > .modern-form {
  padding: 18px 22px 20px;
}

.hytale-config .config-shell > .modern-form > div:last-child {
  margin: 16px -22px -20px;
  padding: 15px 22px !important;
  border-top: 1px solid rgba(166, 207, 219, 0.1) !important;
  background: rgba(5, 16, 20, 0.55);
}

.hytale-config .config-shell > .modern-form > div:last-child button {
  width: auto !important;
  min-width: 165px;
}

.hytale-config .config-shell > .modern-form > div:last-child #hytaleConfigInfo {
  display: inline-block;
  margin: 0 0 0 12px !important;
  text-align: left !important;
}

@media (max-width: 760px) {
  .config-extras-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .config-shell .modern-head.config-hero {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 18px;
  }

  .config-live-badge {
    margin-left: 68px;
  }

  .config-like-image-form {
    padding: 14px 14px 0;
  }

  .config-section {
    padding: 11px;
  }

  .config-section .config-settings-grid {
    grid-template-columns: 1fr;
  }

  .config-save-bar {
    align-items: stretch;
    flex-direction: column;
    margin-inline: -14px;
    padding-inline: 14px;
  }

  .config-save-bar button {
    width: 100%;
  }

  .config-save-status {
    padding-inline: 14px;
  }

  .all-players-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hytale-config .config-shell > .modern-form {
    padding: 14px;
  }

  .hytale-config .config-shell > .modern-form > div:last-child {
    margin: 16px -14px -14px;
    padding: 14px !important;
  }

  .hytale-config .config-shell > .modern-form > div:last-child button {
    width: 100% !important;
  }

  .hytale-config .config-shell > .modern-form > div:last-child #hytaleConfigInfo {
    display: block;
    margin: 9px 0 0 !important;
  }
}

/* Schedule Task List */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
}

.schedule-table thead {
  background: rgba(var(--accent-rgb), 0.1);
  border-bottom: 2px solid var(--accent);
}

.schedule-table th {
  padding: 10px;
  text-align: left;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
}

.schedule-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
}

.schedule-table tbody tr:hover {
  background: rgba(var(--accent-rgb), 0.05);
}

.schedule-table .time-cell {
  color: var(--accent);
  font-weight: 500;
}

.schedule-table .status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.schedule-table .status-enabled {
  background: rgba(76, 175, 80, 0.2);
  color: #4cb050;
}

.schedule-table .status-disabled {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

.schedule-table .action-btn {
  padding: 4px 8px;
  margin: 0 2px;
  font-size: 0.8rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s;
}

.schedule-table .action-btn:hover {
  background: var(--accent);
  color: var(--bg-0);
}

.schedule-table .action-btn.delete:hover {
  background: #f44336;
  border-color: #f44336;
  color: white;
}

.motd-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.placeholder {
  text-align: center;
  padding: 24px;
  color: rgba(var(--text-rgb), 0.5);
  font-style: italic;
}

/* Bootstrap-style Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal {
  background: linear-gradient(160deg, rgba(12, 33, 43, 0.98), rgba(8, 20, 28, 0.98));
  border: 1px solid rgba(166, 207, 219, 0.28);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  max-width: 420px;
  width: 90%;
  max-height: 80vh;
  overflow: auto;
  display: grid;
  gap: 0;
  animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(166, 207, 219, 0.12);
  background: linear-gradient(180deg, rgba(30, 48, 59, 0.9), rgba(14, 28, 36, 0.9));
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--text);
}

.modal-body {
  padding: 16px 20px;
  color: var(--text);
}

.modal-body p {
  margin: 0;
  line-height: 1.5;
  font-size: 0.95rem;
}

.modal-footer {
  padding: 12px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid rgba(166, 207, 219, 0.08);
  background: linear-gradient(180deg, rgba(14, 28, 36, 0.6), rgba(8, 20, 28, 0.6));
}

.modal-footer button {
  width: auto;
  min-width: 100px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.modal.info .modal-header {
  border-bottom-color: rgba(85, 214, 255, 0.25);
  background: linear-gradient(180deg, rgba(20, 50, 70, 0.9), rgba(14, 35, 50, 0.9));
}

.modal.success .modal-header {
  border-bottom-color: rgba(124, 228, 181, 0.25);
  background: linear-gradient(180deg, rgba(15, 50, 30, 0.9), rgba(10, 38, 22, 0.9));
}

.modal.warning .modal-header {
  border-bottom-color: rgba(255, 178, 107, 0.25);
  background: linear-gradient(180deg, rgba(60, 40, 15, 0.9), rgba(45, 28, 8, 0.9));
}

.modal.danger .modal-header {
  border-bottom-color: rgba(255, 105, 90, 0.3);
  background: linear-gradient(180deg, rgba(70, 25, 25, 0.9), rgba(52, 18, 20, 0.9));
}

.modal.info .modal-header h2 {
  color: #a7e8ff;
}

.modal.success .modal-header h2 {
  color: #a7f5d8;
}

.modal.warning .modal-header h2 {
  color: #ffd99f;
}

.modal.danger .modal-header h2 {
  color: #ffb9ad;
}

.btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--primary);
  color: #063323;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(41, 200, 142, 0.3);
}

.btn-secondary {
  background: rgba(12, 38, 52, 0.6);
  border: 1px solid rgba(132, 193, 213, 0.35);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(20, 50, 65, 0.8);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(200, 50, 50, 0.3);
  border: 1px solid rgba(255, 105, 90, 0.5);
  color: #ffb9ad;
}

.btn-danger:hover {
  background: rgba(220, 60, 60, 0.5);
  transform: translateY(-1px);
}

/* Form Labels */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--accent);
}

#scheduleForm div[style*="grid"] {
  margin-bottom: 12px;
}

@media (max-width: 920px) {
  .shell {
    margin: 12px auto;
    padding: 12px;
  }

  .users-grid,
  .files-wrap,
  .files-wrap-filezilla {
    grid-template-columns: 1fr;
  }

  .filezilla-toolbar {
    align-items: stretch;
  }

  .filezilla-sidebar {
    min-height: 280px;
  }

  .filezilla-row {
    grid-template-columns: 36px minmax(160px, 1.8fr) 90px 90px minmax(120px, 1.2fr);
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-head,
  .inline-form,
  .row {
    flex-direction: column;
    align-items: stretch;
  }

  .resource-split {
    grid-template-columns: 1fr;
  }

  .server-page-grid,
  .config-settings-grid {
    grid-template-columns: 1fr;
  }

  .tabs button {
    font-size: 0.94rem;
    min-height: 40px;
    padding: 9px 12px;
  }

  .tab-group-label {
    font-size: 0.65rem;
  }

  .tab-group {
    min-width: 170px;
  }

  .terminal {
    max-height: 280px;
    font-size: 0.82rem;
  }
}

@media (max-width: 640px) {
  .dashboard {
    padding: 12px;
  }

  .login-card {
    margin: 5vh auto;
    padding: 16px;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .filezilla-row {
    grid-template-columns: 34px minmax(150px, 1.6fr) 88px 88px;
  }

  .filezilla-cell-path,
  .filezilla-row-head .filezilla-cell-path,
  .filezilla-row-head .filezilla-cell-select {
    display: none;
  }
}

/* Mobile no-side-scroll overrides */
@media (max-width: 980px) {
  html,
  body,
  .shell,
  .dashboard {
    overflow-x: hidden !important;
  }

  .tabs {
    overflow-x: hidden !important;
  }

  .tab-group {
    min-width: 0 !important;
    width: 100%;
    margin: 0;
    border-right: none;
    padding: 8px;
  }

  .tab-group-label {
    margin-bottom: 6px;
  }

  .tabs button {
    width: 100%;
    min-width: 0;
    white-space: normal;
    text-wrap: balance;
    line-height: 1.2;
    padding: 8px 10px;
    min-height: 42px;
  }

  .modern-content,
  .directory-tree,
  .filezilla-table-body,
  .terminal {
    overflow-x: hidden;
  }

  .filezilla-row {
    grid-template-columns: 30px minmax(120px, 1fr) 72px 82px !important;
  }
}

@media (max-width: 620px) {
  .dashboard {
    padding: 8px;
  }

  .topbar {
    padding: 10px;
  }

  .modern-head,
  .modern-content,
  .modern-form,
  .server-quick-nav,
  .server-page-grid {
    padding: 8px;
  }

  .config-grid,
  .resource-grid,
  .status-grid,
  .servers-quick-list,
  .config-settings-grid,
  .users-grid,
  .files-wrap,
  .files-wrap-filezilla,
  .playit-grid,
  .playit-compare-layout,
  .resource-split {
    gap: 8px;
  }

  .terminal {
    max-height: 220px;
    padding: 9px;
    font-size: 0.76rem;
  }
}

:root {
  --bg-0: #091117;
  --bg-1: #102129;
  --bg-2: #1b3439;
  --panel: rgba(12, 24, 30, 0.94);
  --panel-border: rgba(192, 210, 170, 0.18);
  --surface: rgba(18, 35, 41, 0.84);
  --surface-strong: rgba(12, 27, 33, 0.98);
  --border: rgba(167, 193, 184, 0.18);
  --text-secondary: #b1c1bb;
  --muted: #9eafa9;
  --accent: #dce879;
  --accent-rgb: 220, 232, 121;
  --accent-strong: #c4d45a;
  --hover: rgba(220, 232, 121, 0.1);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
}

body {
  background:
    radial-gradient(ellipse at 9% 0, rgba(91, 147, 130, 0.16), transparent 34%),
    radial-gradient(ellipse at 100% 85%, rgba(221, 124, 91, 0.09), transparent 35%),
    linear-gradient(145deg, var(--bg-1), var(--bg-0) 72%);
  background-attachment: fixed;
}

.bg {
  opacity: 0.55;
  background-image:
    linear-gradient(120deg, rgba(242, 245, 222, 0.035) 0, transparent 48%),
    repeating-linear-gradient(90deg, rgba(242, 245, 222, 0.012) 0 1px, transparent 1px 42px);
}

.shell {
  max-width: 1400px;
  margin: clamp(12px, 2.5vw, 30px) auto;
  padding: clamp(10px, 2vw, 20px);
}

.login-card,
.dashboard {
  border-color: var(--panel-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.dashboard {
  padding: clamp(12px, 2vw, 22px);
  background:
    linear-gradient(155deg, rgba(14, 28, 34, 0.97), rgba(11, 23, 29, 0.96)),
    radial-gradient(circle at 100% 0, rgba(var(--accent-rgb), 0.07), transparent 35%);
}

.topbar {
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(var(--accent-rgb), 0.09), transparent 34%),
    linear-gradient(120deg, rgba(25, 45, 47, 0.88), rgba(14, 27, 33, 0.9));
}

.topbar h1 {
  font-size: clamp(1.25rem, 2.3vw, 1.8rem);
  letter-spacing: -0.035em;
}

#statusLine {
  max-width: 70ch;
  font-size: 0.84rem;
  line-height: 1.5;
}

.panel {
  margin-top: 16px;
}

.modern-panel,
.server-pane,
.resource-card,
.playit-card,
.status-card,
.filezilla-toolbar,
.filezilla-sidebar,
.filezilla-main,
.filezilla-editor,
.filezilla-table {
  border-color: rgba(167, 193, 184, 0.15);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.modern-panel {
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(17, 34, 40, 0.97), rgba(10, 22, 28, 0.98));
}

.modern-head,
.filezilla-pane-head {
  padding: 15px 18px;
  border-bottom-color: rgba(167, 193, 184, 0.13);
  background: linear-gradient(180deg, rgba(27, 47, 51, 0.96), rgba(17, 33, 39, 0.94));
}

.modern-head h3,
.panel-head h3,
.server-pane h4 {
  letter-spacing: -0.02em;
}

.modern-head h3 {
  font-size: 1rem;
}

.modern-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.modern-content,
.modern-form {
  padding: 14px 16px;
}

.server-pane {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(19, 39, 45, 0.88), rgba(11, 25, 31, 0.9));
}

.setting-card,
.status-card,
.resource-card,
.playit-card {
  border-color: rgba(167, 193, 184, 0.15);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(22, 42, 46, 0.88), rgba(13, 27, 32, 0.92));
}

.setting-card {
  gap: 8px;
  padding: 14px;
}

.setting-card label,
label {
  color: #cad7ce;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height: 42px;
  border-color: rgba(167, 193, 184, 0.22);
  border-radius: 10px;
  background: rgba(6, 18, 23, 0.82);
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
  color: #71847e;
}

button {
  border-radius: 10px;
  font-weight: 650;
}

button:not(.ghost):not(.danger):not(.panel-minimize-button):not(.user-action):not(.action-btn) {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: none;
  transform: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.82);
  outline-offset: 2px;
}

.ghost {
  border-color: rgba(167, 193, 184, 0.26);
  background: rgba(19, 36, 41, 0.8);
}

.danger-pane {
  border-color: rgba(255, 120, 107, 0.28);
}

.modern-list li {
  border-bottom-color: rgba(167, 193, 184, 0.1);
}

.modern-list li:not(.empty):hover {
  background: rgba(220, 232, 121, 0.045);
}

.config-shell {
  border-color: rgba(var(--accent-rgb), 0.21);
}

.config-shell .modern-head.config-hero {
  min-height: 138px;
  padding: 24px 26px;
  background:
    radial-gradient(ellipse at 88% 0, rgba(var(--accent-rgb), 0.14), transparent 45%),
    linear-gradient(115deg, rgba(24, 45, 45, 0.96), rgba(13, 27, 32, 0.96));
}

.config-section {
  padding: 16px;
  border-color: rgba(167, 193, 184, 0.14);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(17, 34, 38, 0.86), rgba(12, 26, 31, 0.76));
}

.config-section-heading {
  min-height: 36px;
  gap: 12px;
  margin-bottom: 14px;
}

.config-section-heading h4 {
  font-size: 0.94rem;
  letter-spacing: -0.01em;
}

.config-section-heading p {
  font-size: 0.74rem;
}

.config-section-number {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  background: rgba(var(--accent-rgb), 0.08);
}

button.panel-minimize-button,
.config-section-heading > button.panel-minimize-button {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(167, 193, 184, 0.23);
  border-radius: 9px;
  background: rgba(8, 20, 25, 0.78);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 1.15rem;
  line-height: 1;
  box-shadow: none;
}

.config-section-heading > button.panel-minimize-button {
  position: static;
  align-self: center;
  margin-left: auto;
}

button.panel-minimize-button:hover {
  border-color: rgba(var(--accent-rgb), 0.44);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.config-section .setting-card {
  padding: 14px;
  border-radius: 12px;
}

.config-section .setting-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.28);
}

.config-save-bar {
  border-top-color: rgba(167, 193, 184, 0.12);
  background: rgba(7, 18, 22, 0.65);
}

.config-save-bar button {
  min-height: 42px;
  border-radius: 11px;
}

.config-extras-grid {
  gap: 14px;
}

.minimized-panels-dock {
  border-color: rgba(var(--accent-rgb), 0.2);
  background: rgba(10, 23, 28, 0.97);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
}

.minimized-panels-list button {
  min-height: 34px;
  border-radius: 9px;
  font-weight: 600;
}

.minimized-panels-list button:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--accent);
}

.toast-item {
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.account-form-heading,
.account-server-access-heading,
.account-list-heading,
.admin-account-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-form-heading h4,
.account-form-heading p,
.account-server-access-heading span,
.account-list-heading h4,
.account-list-heading p {
  margin: 0;
}

.account-form-heading h4,
.account-list-heading h4 {
  font-size: 0.96rem;
}

.account-form-heading p,
.account-list-heading p,
.account-server-access-heading span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.admin-account-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.admin-account-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

#adminAccountForm label {
  margin: 0;
  color: #cad7ce;
  font-size: 0.8rem;
}

#adminAccountForm button[type="submit"] {
  align-self: flex-end;
  width: auto;
  min-width: 180px;
}

.account-server-access {
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(7, 19, 24, 0.48);
}

.account-server-access-heading {
  flex-direction: column;
  gap: 0;
}

.account-server-options {
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
}

.account-server-options label {
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(167, 193, 184, 0.15);
  border-radius: 9px;
  background: rgba(18, 35, 41, 0.7);
  color: var(--text-secondary);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.account-server-options label:has(input:checked) {
  border-color: rgba(var(--accent-rgb), 0.32);
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--text);
}

.account-access-editor {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.account-access-editor > button {
  justify-self: start;
  width: auto;
  min-width: 180px;
}

#adminAccountsList {
  display: grid;
  gap: 14px;
}

.account-list-heading {
  align-items: center;
}

.account-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 650;
}

.admin-account-list {
  display: grid;
  gap: 10px;
}

.admin-account-card {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(167, 193, 184, 0.15);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(20, 39, 43, 0.78), rgba(11, 25, 30, 0.78));
}

.admin-account-identity {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-account-identity strong,
.account-email {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-role-badge,
.account-all-servers {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
}

.account-role-badge.is-admin {
  border-color: rgba(255, 156, 115, 0.3);
  background: rgba(255, 156, 115, 0.09);
  color: #ffc0a6;
}

.account-role-badge.is-user {
  border-color: rgba(var(--accent-rgb), 0.25);
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--accent);
}

.account-created {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
}

.account-email {
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.account-permissions {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(167, 193, 184, 0.12);
}

.account-permissions-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-all-servers {
  border-color: rgba(var(--accent-rgb), 0.2);
  background: rgba(var(--accent-rgb), 0.07);
  color: var(--accent);
}

.account-empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(167, 193, 184, 0.24);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.files-wrap-filezilla {
  align-items: start;
}

.filezilla-sidebar {
  height: min(620px, calc(100dvh - 280px));
  min-height: 280px;
  max-height: 620px;
  overflow: hidden;
}

.directory-tree {
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 920px) {
  .filezilla-sidebar {
    height: min(380px, 42dvh);
    min-height: 200px;
    max-height: 380px;
  }
}

@media (max-width: 760px) {
  .shell {
    margin: 8px auto;
    padding: 10px;
  }

  .dashboard {
    padding: 10px;
    border-radius: 16px;
  }

  .topbar {
    padding: 13px;
  }

  .tab-group {
    min-width: 0;
  }

  .filezilla-sidebar {
    height: min(340px, 42dvh);
    min-height: 180px;
    max-height: 340px;
  }

  .config-shell .modern-head.config-hero {
    gap: 12px;
    padding: 18px;
  }

  .config-live-badge {
    margin-left: 0;
  }

  .config-section {
    padding: 12px;
  }

  .config-section .config-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .config-section-heading > button.panel-minimize-button {
    align-self: flex-start;
  }

  .config-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .config-save-bar button {
    width: 100%;
  }

  .minimized-panels-dock {
    align-items: flex-start;
    flex-direction: column;
  }

  .minimized-panels-list {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .panel {
    margin-top: 10px;
  }

  .admin-account-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  #adminAccountForm button[type="submit"],
  .account-access-editor > button {
    width: 100%;
  }

  .account-server-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-account-card-heading {
    flex-direction: column;
  }

  .account-list-heading {
    align-items: flex-start;
  }
}

@media (max-width: 460px) {
  .filezilla-sidebar {
    height: min(300px, 38dvh);
    min-height: 160px;
    max-height: 300px;
  }
}

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