:root {
  --bg: #0b1110;
  --bg-soft: #111a18;
  --panel: rgba(18, 28, 26, 0.88);
  --panel-strong: #15201d;
  --panel-border: rgba(170, 233, 197, 0.12);
  --text: #edf7f2;
  --muted: #94a9a1;
  --accent: #8fe870;
  --accent-strong: #68d34a;
  --warning: #ffb84d;
  --danger: #ff6b6b;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --radius: 22px;
  --radius-small: 14px;
  --code: "Cascadia Mono", "JetBrains Mono", "Consolas", monospace;
  --ui: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(143, 232, 112, 0.18), transparent 28%),
    radial-gradient(circle at right 20%, rgba(100, 160, 120, 0.18), transparent 24%),
    linear-gradient(135deg, #08100f 0%, #0d1513 45%, #121c18 100%);
  color: var(--text);
  font-family: var(--ui);
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(237, 247, 242, 0.12);
  background: rgba(8, 13, 12, 0.65);
  color: var(--text);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 180px;
  font-family: var(--code);
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(143, 232, 112, 0.65);
  box-shadow: 0 0 0 3px rgba(143, 232, 112, 0.12);
}

button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.88rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

button.primary,
.link-button.primary,
.primary {
  background: linear-gradient(135deg, var(--accent), #b7ff8a);
  color: #102011;
}

button.secondary,
.secondary,
.link-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

button.warning,
.warning {
  background: rgba(255, 184, 77, 0.16);
  color: #ffd18b;
}

button.danger,
.danger {
  background: rgba(255, 107, 107, 0.16);
  color: #ffc0c0;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100vh;
  padding: 1.5rem;
  background: rgba(7, 12, 11, 0.82);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand.solo {
  margin-bottom: 1.2rem;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #6ed857, #c8ff84);
  color: #122113;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-title {
  font-size: 1.18rem;
  font-weight: 800;
}

.brand-subtitle,
.page-subtitle,
.metric-label,
.muted,
.help-text,
.breadcrumb,
.kv-grid span,
.file-entry-sub {
  color: var(--muted);
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-links a {
  padding: 0.86rem 1rem;
  border-radius: 16px;
  color: #d5e8dd;
}

.nav-links a.active,
.nav-links a:hover {
  background: linear-gradient(135deg, rgba(143, 232, 112, 0.18), rgba(143, 232, 112, 0.05));
  color: #f5fff8;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.server-state,
.status-pill,
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  width: fit-content;
  font-weight: 700;
}

.server-state.online,
.status-pill.online,
.status-tag {
  background: rgba(143, 232, 112, 0.14);
  color: #ceffb9;
}

.server-state.offline,
.status-pill.offline {
  background: rgba(255, 107, 107, 0.12);
  color: #ffc0c0;
}

.state-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 18px currentColor;
}

.logout-link {
  color: #ffd3d3;
}

.content {
  padding: 2rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.topbar h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.topbar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.8rem;
}

.power-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.power-bar form,
.button-row form,
.table-actions form,
.action-stack form {
  margin: 0;
}

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

.card {
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.metric-card strong {
  font-size: 1.3rem;
}

.card-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.card-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid.two,
.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.button-row,
.table-actions,
.inline-form,
.chip-wrap,
.quick-links,
.action-stack {
  display: flex;
  gap: 0.75rem;
}

.button-row.wrap,
.inline-form.multi-line,
.chip-wrap,
.quick-links,
.action-stack,
.table-actions {
  flex-wrap: wrap;
}

.inline-form input[type="text"],
.inline-form input[type="url"] {
  flex: 1 1 260px;
}

.stack-form,
.auth-form,
.path-card,
.rename-box {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.stack-form.narrow {
  max-width: 540px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.kv-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kv-grid div {
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.95rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  color: #d0e3da;
  font-size: 0.92rem;
}

.file-entry-name {
  font-weight: 700;
  word-break: break-word;
}

.file-entry-sub {
  margin-top: 0.35rem;
  font-family: var(--code);
  font-size: 0.84rem;
  word-break: break-all;
}

.console-box {
  padding: 1rem;
  border-radius: 18px;
  background: #081010;
  border: 1px solid rgba(143, 232, 112, 0.12);
  color: #d7ffd0;
  font-family: var(--code);
  white-space: pre-wrap;
  overflow: auto;
  max-height: 500px;
  line-height: 1.45;
}

.console-box.large {
  min-height: 560px;
}

.chip {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(143, 232, 112, 0.11);
  color: #d9ffca;
  font-weight: 700;
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.flash-stack.compact {
  margin-bottom: 1.2rem;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid transparent;
}

.flash.success {
  background: rgba(143, 232, 112, 0.12);
  border-color: rgba(143, 232, 112, 0.2);
}

.flash.error {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.2);
}

.login-body {
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-card {
  width: min(460px, 100%);
  padding: 2rem;
}

.auth-form button {
  margin-top: 0.4rem;
}

.breadcrumb {
  font-family: var(--code);
  word-break: break-all;
}

.help-text {
  margin-top: 0.85rem;
}

.status-pill {
  min-width: 180px;
  justify-content: space-between;
}

.quick-links .link-button,
.table-actions .link-button,
.table-actions button,
.action-stack .link-button,
.action-stack button {
  padding: 0.68rem 0.95rem;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .content {
    padding-top: 0;
  }

  .card-grid.three,
  .card-grid.two,
  .form-grid.two,
  .kv-grid {
    grid-template-columns: 1fr;
  }

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

  .topbar-actions {
    align-items: flex-start;
    width: 100%;
  }

  .power-bar {
    justify-content: flex-start;
  }
}
