﻿:root {
  /* Background colors */
  --bg: #0a0e13;
  --bg-subtle: #0f1419;
  --panel: #151b23;
  --panel-hover: #1a2129;
  --panel-2: #1e2731;

  /* Border colors */
  --line: #2d3946;
  --line-subtle: #1f2937;
  --line-hover: #374151;

  /* Text colors */
  --text: #f3f4f6;
  --text-bright: #ffffff;
  --muted: #9ca3af;
  --muted-dark: #6b7280;

  /* Accent colors */
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-light: #d1fae5;
  --accent-glow: rgba(16, 185, 129, 0.15);

  --accent-2: #f59e0b;
  --accent-2-hover: #d97706;

  /* Status colors */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --success-border: rgba(16, 185, 129, 0.3);

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.3);

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.3);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.7);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 18px 44px;
}

html,
body {
  min-height: 100%;
  background:
    radial-gradient(circle at 90% 8%, var(--accent-glow), transparent 25%),
    radial-gradient(circle at 10% 92%, rgba(245, 158, 11, 0.08), transparent 25%),
    linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg) 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.page-shell {
  max-width: 980px;
  margin: 0 auto;
}

.flash-message {
  margin: 0 0 20px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--success-border);
  background: var(--success-bg);
  color: var(--accent-light);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  animation: slideDown var(--transition-base);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: 1 1 260px;
}

.brand {
  font-size: 24px;
  font-weight: 700;
}

.menu-toggle {
  display: none;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  flex: 2 1 620px;
}

.nav-links a {
  padding: 10px 16px;
  border: 1px solid var(--line-subtle);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  transition: all var(--transition-fast);
  font-weight: 500;
}

.nav-links a:hover,
.nav-btn:hover,
.btn:hover {
  transform: translateY(-2px);
  border-color: var(--line-hover);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-sm);
}

.nav-user {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.inline-form {
  margin: 0;
}

.nav-btn {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(213, 84, 84, 0.12);
  cursor: pointer;
}

.hero,
.panel {
  background: rgba(21, 27, 35, 0.6);
  border: 1px solid var(--line-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  transition: all var(--transition-base);
}

.hero:hover,
.panel:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-xl);
}

.hero {
  padding: 32px;
}

.hero h1 {
  margin: 0;
  font-size: 48px;
  line-height: 1.1;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-bright) 0%, var(--text) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  margin: 14px 0 0;
  color: var(--muted);
  max-width: 760px;
  font-size: 16px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid var(--line);
  transition: all var(--transition-fast);
  cursor: pointer;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-2px);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line-hover);
}

.btn.danger {
  background: var(--danger-bg);
  color: #fecaca;
  border-color: var(--danger-border);
}

.btn.danger:hover {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.panel {
  padding: 18px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.stat-card {
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--line-subtle);
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  backdrop-filter: blur(8px);
  transition: all var(--transition-base);
}

.stat-card:hover {
  border-color: var(--line);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-bright);
}

.metric-row,
.server-row,
.health-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.metric-row:first-child,
.server-row:first-child,
.health-row:first-child {
  border-top: 0;
}

.metric-row-stack {
  display: block;
}

.metric-row-stack span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition-fast);
}

.pill.ok {
  color: var(--accent-light);
  background: var(--success-bg);
  border: 1px solid var(--success-border);
}

.pill.warn {
  color: #fde68a;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
}

.pill.bad {
  color: #fecaca;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
}

.pill.neutral {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-subtle);
}

.codebox {
  padding: 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line-subtle);
  overflow-x: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.codebox.compact {
  margin-top: 12px;
  font-size: 13px;
  padding: 12px;
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.list.ordered {
  padding-left: 22px;
}

.subsection {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.subsection:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.subsection-title {
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-2);
}

.toolbar {
  margin-bottom: 14px;
}

.toolbar input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-subtle);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  transition: all var(--transition-fast);
  outline: none;
}

.toolbar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.toolbar input::placeholder {
  color: var(--muted-dark);
}

.btn.ghost {
  background: #10161c;
  color: var(--text);
}

.backup-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(150px, 0.65fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.backup-toolbar-full {
  margin-bottom: 18px;
}

.backup-inline-form {
  min-width: 0;
}

.backup-actions {
  display: contents;
}

.backup-toolbar .btn,
.backup-toolbar .backup-select,
.backup-toolbar .backup-search {
  min-height: 46px;
}

.backup-search {
  min-width: 0;
  width: auto;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #10161c;
  color: var(--text);
  outline: none;
}

.backup-search:focus {
  border-color: var(--accent);
}

.backup-select {
  min-width: 0;
  width: auto;
  padding: 12px 44px 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #10161c;
  color: var(--text);
  outline: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.backup-select:focus {
  border-color: var(--accent);
}

.backup-actions .btn {
  white-space: nowrap;
}

.user-card {
  border: 1px solid var(--line-subtle);
  border-radius: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  transition: all var(--transition-base);
}

.user-card:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-md);
}

.server-form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.subscription-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.compact-actions {
  margin-top: 10px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.profile-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.subscription-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.device-slot-grid {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 10px;
  margin-top: 12px;
}

.span-all {
  grid-column: 1 / -1;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.server-card {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--line-subtle);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  transition: all var(--transition-base);
}

.server-card:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-md);
}

.server-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.server-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.center-panel {
  grid-column-start: 4;
}

.auth-layout {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.auth-panel {
  width: 100%;
  max-width: 560px;
}

.device-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.device-card:first-of-type {
  border-top: 0;
}

.device-meta,
.device-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.empty-box {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  color: var(--muted);
  font-size: 14px;
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-subtle);
  background: var(--bg);
  color: var(--text);
  outline: none;
  font-size: 15px;
  transition: all var(--transition-fast);
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-form input::placeholder {
  color: var(--muted-dark);
}

.full {
  width: 100%;
}

.error-box {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(213, 84, 84, 0.35);
  border-radius: 14px;
  background: rgba(213, 84, 84, 0.12);
  color: #ffd8d8;
}

.admin-form {
  margin: 0;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.password-grid {
  grid-template-columns: 1fr auto;
  margin-top: 10px;
}

.admin-form input,
.admin-form select {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-subtle);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  transition: all var(--transition-fast);
  outline: none;
}

.admin-form input:focus,
.admin-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.admin-form input::placeholder {
  color: var(--muted-dark);
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.users-head {
  margin-bottom: 10px;
}

.users-head .muted {
  margin-top: 6px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .backup-toolbar {
    grid-template-columns: 1fr;
  }

  .backup-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .backup-search,
  .backup-select {
    width: 100%;
  }

  .backup-actions .btn,
  .backup-inline-form {
    width: 100%;
  }
}

.admin-create-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 18px;
}

.admin-user-list {
  display: grid;
  gap: 18px;
}

.user-workspace {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.user-summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.user-summary-title {
  font-size: 28px;
  font-weight: 700;
}

.user-summary-subtitle {
  color: var(--muted);
  margin-top: 4px;
}

.user-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  flex: 1 1 640px;
}

.summary-pill {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.summary-pill span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-pill strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.tab-shell {
  display: grid;
  gap: 16px;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-btn {
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--line-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.tab-btn.is-active {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--accent-light);
  box-shadow: 0 0 12px var(--accent-glow);
}

.tab-btn.danger.is-active {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #fecaca;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.workspace-card {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--line-subtle);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  transition: all var(--transition-base);
}

.workspace-card:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.workspace-card.narrow-card {
  max-width: 540px;
}

.workspace-card-head {
  margin-bottom: 10px;
}

.workspace-card-head h3 {
  margin: 0;
  font-size: 17px;
}

.workspace-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.stacked-form {
  display: grid;
  gap: 8px;
}

.stacked-form label > span {
  display: block;
  margin-bottom: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.toggle-line.with-frame {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #10161c;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-stat {
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  min-height: 60px;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  margin-top: 1px;
}

.mini-stat strong {
  display: block;
  margin-top: 0;
  font-size: clamp(11px, 1vw, 13px);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  align-self: center;
}

.embedded-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 8px;
}

.embedded-actions-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-2);
}

.embedded-danger-actions .btn {
  min-width: 0;
}

.inline-number-form {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.inline-number-form input {
  width: 140px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #10161c;
  color: var(--text);
}

.inline-number-form.long input {
  width: 280px;
}

.danger-card {
  border-color: rgba(213, 84, 84, 0.22);
  background: rgba(213, 84, 84, 0.05);
}

.user-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  grid-auto-flow: dense;
  align-items: start;
}

.user-tile {
  border-radius: 16px;
  border: 1px solid var(--line-subtle);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow);
}

.user-tile:hover {
  border-color: var(--line-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.user-tile.is-open {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-xl);
}

.user-tile.expand-left,
.user-tile.expand-center,
.user-tile.expand-right {
  grid-column: 1 / -1;
}

.user-tile-head {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 18px;
  display: grid;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  align-items: start;
}

.user-tile-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: break-word;
  word-break: normal;
}

.user-tile-subtitle {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.user-tile-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.user-tile-metric {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-subtle);
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
  text-align: center;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
  min-height: 60px;
  transition: all var(--transition-fast);
}

.user-tile-metric:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
}

.user-tile-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  align-self: start;
  margin-top: 1px;
}

.user-tile-metric strong {
  display: block;
  margin-top: 0;
  font-size: clamp(11px, 1vw, 13px);
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: keep-all;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: center;
  align-self: center;
}

.user-tile-arrow {
  display: none;
}

.status-metric.is-active {
  background: var(--success-bg);
  border-color: var(--success-border);
  box-shadow: 0 0 12px var(--accent-glow);
}

.status-metric.is-active span,
.status-metric.is-active strong {
  color: var(--accent-light);
}

.status-metric.is-inactive {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.status-metric.is-inactive span,
.status-metric.is-inactive strong {
  color: #fecaca;
}

.user-tile-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s cubic-bezier(.22,.8,.2,1);
}

.user-tile-body-inner {
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.user-tile.is-open .user-tile-body {
  grid-template-rows: 1fr;
}

.user-tile.is-open .user-tile-body-inner {
  opacity: 1;
  transform: translateY(0);
}

.user-tile .workspace-grid {
  padding: 0 18px 18px;
}

.user-tile.is-open .workspace-grid {
  padding-top: 6px;
}

[data-device-custom][hidden] {
  display: none !important;
}

@media (max-width: 920px) {
  .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 {
    grid-column: span 12;
  }

  .metric-grid,
  .metric-grid.compact,
  .server-grid {
    grid-template-columns: 1fr;
  }

  .center-panel {
    grid-column-start: auto;
  }

  .hero h1 {
    font-size: 32px;
  }

  .inline-grid,
  .password-grid,
  .subscription-edit-grid,
  .device-slot-grid,
  .server-form-grid,
  .profile-grid,
  .workspace-grid,
  .two-col,
  .three-col-desktop,
  .user-summary-metrics,
  .mini-stats,
  .user-card-grid,
  .user-tile-metrics {
    grid-template-columns: 1fr;
  }

  .user-tile.expand-left,
  .user-tile.expand-center,
  .user-tile.expand-right {
    grid-column: span 1;
  }

  .auth-panel {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .wrap {
    padding: 18px 14px 34px;
  }

  .page-shell {
    max-width: 100%;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    gap: 12px;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a,
  .nav-user,
  .nav-btn {
    width: 100%;
    text-align: center;
  }

  .nav-links {
    gap: 8px;
  }

  .hero {
    padding: 18px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .panel {
    padding: 16px;
  }

  .server-card-top,
  .metric-row,
  .health-row,
  .device-card,
  .user-summary,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .server-badges {
    width: 100%;
  }

  .device-actions,
  .device-meta {
    justify-content: flex-start;
  }

  .tab-bar,
  .hero-actions.compact-actions {
    width: 100%;
  }

  .tab-btn,
  .inline-number-form,
  .inline-number-form.long {
    width: 100%;
  }

  .inline-number-form input,
  .inline-number-form.long input {
    width: 100%;
  }
}

