@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  color-scheme: dark;
  --bg: #030410;
  --bg-alt: #050718;
  --plasma-a: rgba(82, 43, 255, 0.55);
  --plasma-b: rgba(0, 214, 233, 0.35);
  --surface: rgba(9, 11, 30, 0.92);
  --surface-strong: rgba(13, 16, 42, 0.96);
  --panel: linear-gradient(145deg, rgba(8, 10, 28, 0.95), rgba(5, 8, 24, 0.98));
  --panel-glass: linear-gradient(145deg, rgba(16, 21, 52, 0.85), rgba(7, 9, 28, 0.9));
  --border: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.08);
  --divider: rgba(255, 255, 255, 0.06);
  --text: #f4f5ff;
  --muted: rgba(244, 245, 255, 0.7);
  --accent: #9e6bff;
  --accent-strong: #38f3ff;
  --accent-soft: rgba(158, 107, 255, 0.18);
  --accent-soft-2: rgba(56, 243, 255, 0.2);
  --success: #56f0c0;
  --warning: #f2c653;
  --danger: #ff6c9c;

body.is-electron {
  padding-top: 42px;
}

.electron-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 14px;
  background: linear-gradient(90deg, rgba(12, 14, 30, 0.9), rgba(8, 10, 22, 0.95));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  z-index: 50;
  -webkit-app-region: drag;
}

.chrome-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.chrome-dots {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chrome-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.15);
}

.chrome-dot.red {
  background: #ff6c9c;
  border-color: rgba(255, 108, 156, 0.7);
}

.chrome-dot.amber {
  background: #f2c653;
  border-color: rgba(242, 198, 83, 0.7);
}

.chrome-dot.green {
  background: #56f0c0;
  border-color: rgba(86, 240, 192, 0.7);
}

.chrome-title {
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.chrome-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  -webkit-app-region: no-drag;
}

.chrome-btn {
  width: 34px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  padding: 0;
  transition: border 140ms ease, background 140ms ease;
}

.chrome-btn:hover {
  border-color: rgba(158, 107, 255, 0.5);
  background: rgba(158, 107, 255, 0.12);
}

.chrome-btn.close:hover {
  border-color: rgba(255, 108, 156, 0.6);
  background: rgba(255, 108, 156, 0.18);
}

.view-app {
  position: relative;
}

.is-electron .view,
.is-electron .view-app {
  min-height: calc(100vh - 42px);
}
  --shadow-xl: 0 40px 120px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 18px 44px rgba(2, 4, 18, 0.45);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, filter 160ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Chakra Petch', 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(0.7rem, 0.72vw, 0.85rem);
  letter-spacing: 0.01em;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  filter: saturate(1.05);
}

.plasma-bg {
  position: fixed;
  inset: -30% -30% auto;
  height: 120vh;
  background: radial-gradient(circle at 20% 30%, var(--plasma-a), transparent 55%),
    radial-gradient(circle at 75% 20%, var(--plasma-b), transparent 60%);
  filter: blur(80px);
  opacity: 0.6;
  pointer-events: none;
  z-index: -2;
}

a,
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.muted-text {
  color: var(--muted);
}

.workspace.no-selection {
  user-select: auto;
  grid-template-columns: minmax(0, 1fr);
}

.workspace.has-selection {
  grid-template-columns: minmax(0, 1fr);
}

/**************** AUTH ****************/

.view {
  width: 100%;
  min-height: 100vh;
}

.view-auth {
  min-height: calc(100vh - 2rem);
  padding: clamp(1.2rem, 3vw, 2.4rem) clamp(1rem, 4vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 18% 20%, rgba(158, 107, 255, 0.08), transparent 50%),
    radial-gradient(circle at 80% 10%, rgba(56, 243, 255, 0.08), transparent 55%), var(--bg);
}

.auth-shell {
  width: min(520px, 95vw);
  display: grid;
  gap: 1.2rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: 30px;
  border: 1px solid var(--border);
  background: linear-gradient(150deg, rgba(12, 14, 30, 0.9), rgba(6, 8, 20, 0.96));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
}

.auth-preview {
  display: none;
}

.pulse-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 243, 255, 0.5);
  background: rgba(56, 243, 255, 0.12);
  letter-spacing: 0.2em;
  font-size: 0.78rem;
}

.auth-preview h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4.6vw, 3.8rem);
  letter-spacing: -0.015em;
}

.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.feature-grid li {
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
}

.auth-card {
  border-radius: 24px;
  padding: clamp(1.2rem, 3vw, 2rem);
  background: linear-gradient(175deg, rgba(9, 11, 26, 0.94), rgba(5, 7, 18, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.auth-card h2 {
  margin: 0.2rem 0;
  letter-spacing: 0.04em;
}

.auth-form label {
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-form input,
input,
textarea {
  width: 100%;
  padding: 0.95rem 1.2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: border 150ms ease, box-shadow 150ms ease;
}

.auth-form input:focus,
form input:focus,
textarea:focus {
  border-color: rgba(56, 243, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(56, 243, 255, 0.16);
}

button.primary,
.primary {
  border-radius: 999px;
  padding: 1rem 1.6rem;
  background: linear-gradient(120deg, #b98cff, #4cf1ff);
  color: #050814;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  box-shadow: 0 14px 34px rgba(76, 241, 255, 0.28);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 160ms ease;
}

button.primary:hover,
.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 38px rgba(76, 241, 255, 0.32);
  filter: saturate(1.05);
}

.login-btn {
  width: 100%;
  text-align: center;
  border-radius: 14px;
  padding: 0.95rem 1.2rem;
}

.ghost,
.ghost-chip,
.text-btn,
.ghost-btn,
.ghost button {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.75rem 1.4rem;
}

.ghost-chip {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.danger {
  border-radius: 18px;
  background: rgba(255, 108, 156, 0.12);
  border: 1px solid rgba(255, 108, 156, 0.4);
  color: var(--danger);
}

.auth-hint {
  margin: 0;
  color: var(--muted);
}

/**************** APP LAYOUT ****************/

.view-app {
  display: none;
}

.view-app:not(.hidden) {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 0;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  background: var(--surface-strong);
  box-shadow: var(--shadow-xl);
}

.neon-nav {
  position: relative;
  padding: 1.25rem 1.6rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: linear-gradient(180deg, rgba(10, 12, 28, 0.96), rgba(6, 8, 20, 0.98));
  border-right: 1px solid var(--border);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.neon-nav::after {
  content: '';
  position: absolute;
  inset: 10% -20% auto;
  height: 240px;
  background: radial-gradient(circle, rgba(158, 107, 255, 0.25), transparent 60%);
  filter: blur(36px);
  opacity: 0.6;
  pointer-events: none;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
  z-index: 1;
}

.brand-wordmark {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #f4f5ff;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.nav-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.75rem;
  z-index: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  transition: border 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.nav-btn .nav-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

.nav-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-hint {
  font-size: 0.74rem;
  color: var(--muted);
}

.nav-btn:hover {
  border-color: var(--accent);
}

.nav-btn.active {
  border-color: rgba(158, 107, 255, 0.65);
  background: rgba(158, 107, 255, 0.18);
  box-shadow: 0 18px 40px rgba(158, 107, 255, 0.25);
}

.nav-btn.danger {
  margin-top: auto;
  border-color: rgba(255, 108, 156, 0.5);
  background: rgba(255, 108, 156, 0.12);
  color: var(--danger);
}

.server-stack {
  margin-top: 0.5rem;
  padding: 1.25rem;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(10, 13, 30, 0.92), rgba(5, 7, 18, 0.96));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.server-stack::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 80% -10%, rgba(158, 107, 255, 0.15), transparent 55%);
  pointer-events: none;
}

.server-stack header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.server-list::-webkit-scrollbar {
  width: 0.3rem;
}

.server-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.server-list-empty {
  margin: 0;
  padding: 0.8rem 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  font-size: 0.82rem;
  text-align: center;
  color: var(--muted);
}

.sidebar-server {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.8rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  transition: border 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.sidebar-server:hover,
.sidebar-server:focus-visible {
  border-color: rgba(158, 107, 255, 0.65);
  background: rgba(158, 107, 255, 0.08);
  box-shadow: 0 12px 28px rgba(158, 107, 255, 0.2);
}

.sidebar-server.active {
  border-color: rgba(56, 243, 255, 0.75);
  background: rgba(56, 243, 255, 0.08);
  box-shadow: 0 14px 34px rgba(56, 243, 255, 0.22);
}

.sidebar-server-name {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sidebar-server-status {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.12rem 0.8rem;
}

.sidebar-server-status[data-state='online'] {
  border-color: rgba(56, 243, 255, 0.4);
  color: rgba(56, 243, 255, 0.95);
}

.sidebar-server-status[data-state='starting'],
.sidebar-server-status[data-state='updating'] {
  border-color: rgba(255, 196, 0, 0.5);
  color: rgba(255, 196, 0, 0.9);
}

.sidebar-server-status[data-state='offline'],
.sidebar-server-status[data-state='stopping'] {
  border-color: rgba(255, 108, 156, 0.4);
  color: rgba(255, 108, 156, 0.9);
}


.workspace,
.content {
  padding: clamp(1.1rem, 2.25vw, 1.8rem);
  background: radial-gradient(circle at 25% 15%, rgba(62, 205, 255, 0.08), transparent 60%), var(--bg-alt);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  grid-auto-rows: min-content;
  grid-auto-flow: row dense;
  gap: 1.1rem;
  min-height: 0;
  height: 100%;
  min-width: 0;
  overflow-y: auto;
  align-content: start;
}

.workspace-head,
.full-span {
  grid-column: 1 / -1;
}

.workspace-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel {
  border-radius: 32px;
  padding: clamp(0.9rem, 2vw, 1.6rem);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-height: 0;
}

.panel.glass {
  background: linear-gradient(150deg, rgba(6, 8, 22, 0.9), rgba(4, 6, 16, 0.92));
  backdrop-filter: blur(12px);
  isolation: isolate;
}

#add-server-panel {
  position: relative;
  z-index: 2;
  overflow: visible;
}

@media (min-width: 1024px) {
  #dashboard-section,
  #server-section {
    min-height: calc(100vh - 200px);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
  }
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.metrics-grid,
.server-card-grid,
.palworld-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.metric-card,
.summary-card {
  border-radius: 26px;
  padding: 1.2rem;
  background: linear-gradient(160deg, rgba(9, 13, 34, 0.9), rgba(6, 9, 24, 0.95));
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.metric-label,
.summary-label {
  display: inline-flex;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--muted);
}

.metric-card h3,
.summary-value {
  margin: 0.4rem 0 0.2rem;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.metric-meta,
.summary-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

#dashboard-cards .server-card,
.server-card-grid .server-card {
  position: relative;
  isolation: isolate;
  border-radius: 22px;
  padding: 1.3rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(150deg, rgba(6, 8, 20, 0.95), rgba(4, 6, 16, 0.92));
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42), 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, filter 160ms ease;
  width: 100%;
  height: 100%;
  text-align: left;
}

#dashboard-cards .server-card:hover,
.server-card-grid .server-card:hover {
  border-color: rgba(158, 107, 255, 0.55);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(158, 107, 255, 0.22) inset,
    0 0 18px rgba(158, 107, 255, 0.25),
    0 0 32px rgba(56, 243, 255, 0.18);
}

#dashboard-cards .server-card::before,
.server-card-grid .server-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  opacity: 0;
  transform: none;
  transition: opacity 220ms ease;
  pointer-events: none;
  z-index: -1;
}

#dashboard-cards .server-card::after,
.server-card-grid .server-card::after {
  content: '';
  position: absolute;
  inset: auto auto -65% -40%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(158, 107, 255, 0.16), transparent 55%);
  opacity: 0;
  transform: rotate(-10deg);
  transition: opacity 220ms ease;
  pointer-events: none;
  z-index: -1;
}


.server-card .card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.server-card .card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.server-card .card-description {
  margin: 0;
  color: var(--muted);
}

.server-card .card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.server-card .stat-block {
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-soft);
  display: grid;
  gap: 0.2rem;
}

.server-card .stat-block span {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.server-card .stat-block strong {
  font-size: 1.05rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  white-space: nowrap;
}

.status-chip[data-state='online'] {
  color: var(--success);
  border-color: rgba(86, 240, 192, 0.6);
  background: rgba(86, 240, 192, 0.08);
}

.status-chip[data-state='starting'],
.status-chip[data-state='updating'] {
  color: var(--accent-strong);
  border-color: rgba(56, 243, 255, 0.55);
  background: rgba(56, 243, 255, 0.07);
}

.status-chip[data-state='offline'],
.status-chip[data-state='stopping'],
.status-chip[data-state='delete'] {
  color: var(--danger);
  border-color: rgba(255, 108, 156, 0.6);
  background: rgba(255, 108, 156, 0.08);
}

.adding-server .server-card-grid,
.adding-server #dashboard-cards {
  display: none;
}


.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1.4rem 0.45rem 1.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
}

.status-pill::before {
  content: '';
  position: absolute;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 12px currentColor;
  background: currentColor;
}

.status-pill[data-state='online'] {
  color: var(--success);
  border-color: rgba(86, 240, 192, 0.6);
}

.status-pill[data-state='starting'] {
  color: var(--accent-strong);
  border-color: rgba(56, 243, 255, 0.5);
}

.status-pill[data-state='offline'],
.status-pill[data-state='stopping'],
.status-pill[data-state='delete'] {
  color: var(--danger);
  border-color: rgba(255, 108, 156, 0.5);
}

.status-pill[data-state='updating'] {
  color: var(--warning);
  border-color: rgba(242, 198, 83, 0.45);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.inline-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inline-toggle input[type='checkbox'] {
  width: auto;
}

.full-line {
  grid-column: 1 / -1;
}

.alert-field,
.env-field-head,
.palworld-fields,
.env-editor {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.alert-field,
.palworld-fields {
  padding: 1rem;
  border-radius: 22px;
  border: 1px dashed var(--border);
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.env-editor .env-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.env-editor .env-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/**************** SERVER DETAIL ****************/

.server-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.server-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.server-heading-meta {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.1rem;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(7, 9, 24, 0.9), rgba(4, 6, 18, 0.95));
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.action-btn::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  opacity: 0.35;
  background: var(--action-gradient, rgba(255, 255, 255, 0.06));
  mix-blend-mode: normal;
  transition: opacity 180ms ease, transform 200ms ease;
  z-index: 0;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.action-btn:hover::after {
  opacity: 0.55;
  transform: scale(1.02);
}

.action-emblem {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.03);
  position: relative;
  z-index: 1;
}

.action-text {
  display: flex;
  flex-direction: column;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 1;
}

.action-btn .action-emblem,
.action-btn .action-text {
  position: relative;
  z-index: 1;
}

.action-btn[data-loading='true'] {
  pointer-events: none;
  opacity: 0.9;
}

.action-btn[data-loading='true'] .action-label::after {
  content: '...';
  margin-left: 0.35rem;
  font-weight: 600;
  opacity: 0.85;
}

.action-label {
  font-size: 1rem;
  font-weight: 600;
}

.action-btn[data-action='start'] {
  --action-gradient: linear-gradient(130deg, rgba(86, 240, 192, 0.35), rgba(56, 243, 255, 0.25));
  border-color: rgba(86, 240, 192, 0.4);
  box-shadow: 0 12px 30px rgba(86, 240, 192, 0.12);
}

.action-btn[data-action='stop'] {
  --action-gradient: linear-gradient(130deg, rgba(255, 108, 156, 0.3), rgba(255, 96, 96, 0.2));
  border-color: rgba(255, 108, 156, 0.45);
  box-shadow: 0 12px 30px rgba(255, 108, 156, 0.12);
}

.action-btn[data-action='restart'] {
  --action-gradient: linear-gradient(130deg, rgba(158, 107, 255, 0.35), rgba(56, 243, 255, 0.25));
  box-shadow: 0 12px 30px rgba(158, 107, 255, 0.12);
}

.action-btn[data-action='update'] {
  --action-gradient: linear-gradient(130deg, rgba(56, 243, 255, 0.3), rgba(120, 255, 210, 0.2));
  box-shadow: 0 12px 30px rgba(56, 243, 255, 0.12);
}

.action-btn[data-action='backup'] {
  --action-gradient: linear-gradient(130deg, rgba(242, 198, 83, 0.35), rgba(255, 157, 83, 0.2));
  border-color: rgba(242, 198, 83, 0.4);
  box-shadow: 0 12px 30px rgba(242, 198, 83, 0.12);
}

.action-btn[data-action='delete'] {
  --action-gradient: linear-gradient(130deg, rgba(255, 108, 156, 0.45), rgba(255, 54, 120, 0.3));
  border-color: rgba(255, 54, 120, 0.45);
  box-shadow: 0 20px 50px rgba(255, 54, 120, 0.25);
}

.action-feedback {
  min-height: 1rem;
  color: var(--muted);
}

.server-tabs {
  display: inline-flex;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  gap: 0.35rem;
}

.tab-btn {
  border-radius: 999px;
  border: none;
  background: transparent;
  padding: 0.45rem 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.78rem;
  color: var(--muted);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.tab-panels {
  width: 100%;
}

.tab-panel {
  display: none;
  margin-top: 1.2rem;
}

.tab-panel.active {
  display: block;
}

.server-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 1.4rem;
}

.kv-grid {
  display: grid;
  gap: 0.75rem;
}

.kv-grid .kv-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--divider);
}

.history-list {
  display: grid;
  gap: 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  max-height: 220px;
  overflow-y: auto;
}

.history-item {
  padding: 0.75rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
}

.log-viewer {
  border-radius: 20px;
  border: 1px solid rgba(56, 243, 255, 0.4);
  background: radial-gradient(circle at 15% 0%, rgba(56, 243, 255, 0.2), transparent 65%), #040714;
  padding: 1rem;
  font-family: 'Space Grotesk', 'JetBrains Mono', monospace;
  white-space: pre-wrap;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: inset 0 20px 40px rgba(0, 0, 0, 0.65);
}

/**************** PALWORLD ****************/

.palworld-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem;
}

.palworld-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.palworld-column {
  border-radius: 28px;
  border: 1px solid var(--border);
  padding: 1.2rem;
  background: var(--panel-glass);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.palworld-actions {
  gap: 1rem;
}

.player-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.player-list li {
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
}

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.stacked-form textarea {
  min-height: 120px;
}

/**************** TOAST ****************/

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1.1rem 1.4rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(6, 7, 18, 0.9);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 99;
}

.toast:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

/**************** RESPONSIVE ****************/

@media (max-width: 1280px) {
  body {
    overflow-y: auto;
  }

  .view-app:not(.hidden) {
    grid-template-columns: 260px 1fr;
    width: 100%;
    min-height: auto;
    max-height: none;
  }

  .workspace {
    padding: 1.2rem;
  }
}

@media (max-width: 980px) {
  .view-app:not(.hidden) {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }

  .neon-nav {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
  }

  .server-stack,
  #logout-btn,
  .nav-stack {
    width: 100%;
  }

  .workspace,
  .content {
    display: flex;
    flex-direction: column;
    overflow-y: visible;
    height: auto;
  }

  .server-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    border-radius: 28px;
  }

  .panel,
  .palworld-column,
  .metric-card,
  .summary-card {
    border-radius: 24px;
  }

  .actions {
    grid-template-columns: 1fr;
  }
}
