/* ═══════════════════════════════════════════════════════════════════════════
   WebToApp Activation Server — Admin Dashboard
   Design: dark glassmorphism, indigo→violet accent, unified across all views
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Palette */
  --bg-0: #0a0c14;
  --bg-1: #0f1220;
  --bg-2: #161a2e;
  --bg-3: #1d2238;
  --surface: rgba(29, 34, 56, 0.72);
  --surface-hover: rgba(38, 44, 72, 0.8);
  --border: rgba(99, 102, 241, 0.15);
  --border-strong: rgba(99, 102, 241, 0.35);

  --text: #e8eaf6;
  --text-dim: #9ca3c4;
  --text-muted: #5c6388;

  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-grad: linear-gradient(135deg, #6366f1, #8b5cf6);

  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.12);
  --orange: #fbbf24;
  --orange-bg: rgba(251, 191, 36, 0.12);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.12);
  --blue: #60a5fa;
  --blue-bg: rgba(96, 165, 250, 0.12);
  --purple: #c084fc;
  --purple-bg: rgba(192, 132, 252, 0.12);
  --cyan: #22d3ee;
  --cyan-bg: rgba(34, 211, 238, 0.12);

  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.15);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-0);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -20%;
  width: 70%;
  height: 120%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  bottom: -30%;
  right: -10%;
  width: 50%;
  height: 80%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#app {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-grad);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.nav-item svg {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse 2s infinite;
}

.status-dot.online {
  background: var(--green);
}

.status-dot.offline {
  background: var(--red);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Main ────────────────────────────────────────────────────────────────── */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 18, 32, 0.6);
  backdrop-filter: blur(12px);
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

/* ── Views ───────────────────────────────────────────────────────────────── */

.view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

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

/* ── Stat Cards ──────────────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
  backdrop-filter: blur(8px);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-blue   { background: var(--blue-bg);   color: var(--blue); }
.stat-green  { background: var(--green-bg);  color: var(--green); }
.stat-orange { background: var(--orange-bg); color: var(--orange); }
.stat-red    { background: var(--red-bg);    color: var(--red); }
.stat-purple { background: var(--purple-bg); color: var(--purple); }
.stat-cyan   { background: var(--cyan-bg);   color: var(--cyan); }

.stat-body {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 22px;
}

.card-body.no-pad {
  padding: 0;
}

/* ── Table ───────────────────────────────────────────────────────────────── */

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

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  padding: 14px 22px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 14px 22px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  white-space: nowrap;
}

.table tbody tr {
  transition: background var(--transition);
}

.table tbody tr:hover {
  background: var(--surface-hover);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-primary {
  background: var(--accent-grad);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-icon.danger:hover {
  color: var(--red);
  background: var(--red-bg);
}

/* ── Toolbar / Search ────────────────────────────────────────────────────── */

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 36px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  width: 220px;
  transition: all var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ── Log List ────────────────────────────────────────────────────────────── */

.log-list {
  display: flex;
  flex-direction: column;
}

.log-list.full {
  max-height: 70vh;
  overflow-y: auto;
}

.log-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  font-size: 13px;
}

.log-item:last-child {
  border-bottom: none;
}

.log-time {
  color: var(--text-muted);
  font-size: 12px;
  min-width: 140px;
}

.log-code {
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-weight: 600;
  min-width: 100px;
}

.log-device {
  color: var(--text-dim);
  flex: 1;
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 12px;
}

.log-result {
  min-width: 80px;
  text-align: right;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Settings ────────────────────────────────────────────────────────────── */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  font-size: 14px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-dim);
}

.info-value {
  font-weight: 500;
  text-align: right;
  max-width: 260px;
  word-break: break-all;
}

.code-block {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--green);
  overflow-x: auto;
  margin: 12px 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── Form ────────────────────────────────────────────────────────────────── */

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Switch ──────────────────────────────────────────────────────────────── */

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
  border-radius: 24px;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: var(--transition);
}

.switch input:checked + .slider {
  background: var(--accent-grad);
  border-color: transparent;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
  background: white;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */

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

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 520px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Toast ───────────────────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 280px;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }

/* ── Utilities ───────────────────────────────────────────────────────────── */

.hidden { display: none !important; }

.mono {
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.4);
}

/* ── Login Overlay ───────────────────────────────────────────────────────── */

.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-0);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.login-overlay.hidden {
  display: none;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 400px;
  max-width: 90vw;
  text-align: center;
  box-shadow: var(--shadow), var(--shadow-glow);
  backdrop-filter: blur(12px);
}

.login-brand {
  margin-bottom: 28px;
}

.login-brand-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
}

.login-brand h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.login-brand p {
  font-size: 14px;
  color: var(--text-dim);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-input {
  text-align: center;
  font-size: 15px;
  padding: 12px 16px;
}

.login-error {
  color: var(--red);
  font-size: 13px;
  padding: 8px 12px;
  background: var(--red-bg);
  border-radius: var(--radius-sm);
}

.login-btn {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 15px;
}

/* ── Spinner ──────────────────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Setup Wizard ─────────────────────────────────────────────────────────── */

.setup-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 460px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow), var(--shadow-glow);
  backdrop-filter: blur(12px);
}

.setup-step.hidden {
  display: none;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.setup-form .form-group {
  margin-bottom: 18px;
}

.setup-form .input {
  font-size: 14px;
}

.setup-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.setup-toggle-info {
  flex: 1;
}

.setup-toggle-info label {
  margin-bottom: 2px;
}

.setup-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Step 2: success */

.setup-success {
  text-align: center;
  margin-bottom: 24px;
}

.setup-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border: 2px solid var(--green);
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.2);
}

.setup-success h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.setup-success p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

.setup-result {
  margin-bottom: 20px;
}

.setup-result label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.setup-result .code-block {
  margin: 0 0 8px 0;
  max-height: 120px;
  overflow-y: auto;
}

.setup-copy-btn {
  width: 100%;
  justify-content: center;
}

.setup-restart-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--orange-bg);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  color: var(--orange);
  font-size: 13px;
}

.setup-restart-notice svg {
  flex-shrink: 0;
}

.setup-restart-notice.hidden {
  display: none;
}

/* ── Settings Page additions ──────────────────────────────────────────────── */

.btn-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn-danger-sm {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red-bg);
  transition: all var(--transition);
}
.btn-danger-sm:hover {
  background: var(--red-bg);
  border-color: var(--red);
}

.copyable {
  cursor: pointer;
  transition: color var(--transition);
  user-select: all;
}
.copyable:hover {
  color: var(--accent-light);
}

.aes-switch-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.aes-switch-wrap .hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.aes-switch-wrap .hint.on {
  color: var(--green);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

.settings-grid > .card:nth-child(1),
.settings-grid > .card:nth-child(3),
.settings-grid > .card:nth-child(4) {
  grid-column: span 1;
}
.settings-grid > .card:nth-child(5) {
  grid-column: span 1;
}

/* AES card inner - disabled state */
#aesCardInner.disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.6);
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .settings-grid > .card {
    grid-column: span 1 !important;
  }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar {
    width: 64px;
  }
  .sidebar-brand .brand-text,
  .nav-item span,
  .server-status .status-text {
    display: none;
  }
  .sidebar-brand {
    justify-content: center;
    padding: 0 0 20px;
  }
  .nav-item {
    justify-content: center;
  }
  .content {
    padding: 20px 16px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}
