/* CryptoPulse — Web3 design system */
:root {
  --bg: #030712;
  --bg-elevated: #0a0f1a;
  --bg-card: rgba(12, 18, 32, 0.72);
  --bg-card-hover: rgba(16, 24, 42, 0.85);
  --glass: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.07);
  --border-bright: rgba(255, 255, 255, 0.12);
  --text: #f1f5f9;
  --text-muted: #8b9cb3;
  --text-dim: #5c6b82;
  --accent-cyan: #22d3ee;
  --accent-violet: #a78bfa;
  --accent-blue: #3b82f6;
  --accent: var(--accent-cyan);
  --accent-soft: rgba(34, 211, 238, 0.12);
  --gradient-brand: linear-gradient(135deg, #22d3ee 0%, #818cf8 50%, #c084fc 100%);
  --gradient-btn: linear-gradient(135deg, #0891b2, #6366f1);
  --positive: #34d399;
  --negative: #f87171;
  --warning: #fbbf24;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 40px rgba(34, 211, 238, 0.08);
  --sidebar-width: 272px;
  --font-display: "Space Grotesk", "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: float 20s ease-in-out infinite;
}
.ambient-orb--cyan {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #0891b2 0%, transparent 70%);
  top: -12%; left: -8%;
}
.ambient-orb--violet {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  bottom: -15%; right: -5%;
  animation-delay: -8s;
}
.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent);
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, -16px) scale(1.05); }
}

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }

/* Layout */
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(4px);
}
body.sidebar-open .sidebar-overlay { display: block; }

.sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 1.35rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(6, 10, 20, 0.75);
  backdrop-filter: blur(20px) saturate(1.2);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.25rem 0.5rem;
  flex-shrink: 0;
}
.brand.centered { justify-content: center; text-align: center; flex-direction: column; }
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--gradient-brand);
  color: #030712;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.25);
}
.brand-mark.large { width: 64px; height: 64px; }
.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand-tag { margin: 0.1rem 0 0; color: var(--text-muted); font-size: 0.78rem; }

.nav-section {
  margin: 0.75rem 0 0.35rem;
  padding: 0 0.75rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s var(--ease);
}
.nav-icon {
  width: 1.1rem;
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.7;
}
.nav-soon {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.nav-link:hover {
  color: var(--text);
  background: var(--glass);
  border-color: var(--border);
}
.nav-link.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(34,211,238,0.12), rgba(129,140,248,0.1));
  border-color: rgba(34, 211, 238, 0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.nav-link.disabled { opacity: 0.4; pointer-events: none; }

.sidebar-footer {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  z-index: 2;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.sidebar-logout-form { margin: 0; }
.user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--border);
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--gradient-brand);
  color: #030712;
}
.user-name { margin: 0; font-weight: 600; font-size: 0.9rem; }
.user-role { margin: 0; }

.main-content {
  padding: 1.75rem 2rem 2.5rem;
  max-width: 1440px;
  width: 100%;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  margin-bottom: 1rem;
  backdrop-filter: blur(12px);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.page-header h1 {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-cyan);
}
.header-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.grid { display: grid; gap: 1.15rem; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1.15rem; }
.two-col { grid-template-columns: 1.25fr 0.75fr; }

/* Cards — glassmorphism */
.card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.card:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow), var(--shadow-glow);
}

.stat-card .card-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
}
.stat-card .stat-value {
  margin: 0.5rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.stat-card .stat-value.small { font-size: 1.15rem; }
.stat-unit { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; }
.stat-meta { color: var(--text-dim); margin: 0; font-size: 0.82rem; }

.gauge {
  margin-top: 0.75rem;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--gradient-brand);
  transition: width 0.6s var(--ease);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}
.card-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-empty { color: var(--text-muted); margin: 0; font-size: 0.92rem; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(8px);
}
.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.status-ok, .status-starting { color: var(--positive); border-color: rgba(52, 211, 153, 0.25); }
.status-offline, .status-stopped, .status-unknown { color: var(--text-muted); }
.status-error { color: var(--negative); border-color: rgba(248, 113, 113, 0.25); }

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
  border-radius: var(--radius-sm);
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left;
  padding: 0.85rem 0.65rem;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:last-child td { border-bottom: none; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: rgba(34, 211, 238, 0.04); }

.asset-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.asset-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient-brand);
}

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.list-row:hover { background: rgba(255,255,255,0.02); }
.list-row:last-child { border-bottom: none; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-buy { background: rgba(52, 211, 153, 0.12); color: var(--positive); border-color: rgba(52, 211, 153, 0.25); }
.badge-sell { background: rgba(248, 113, 113, 0.12); color: var(--negative); border-color: rgba(248, 113, 113, 0.25); }
.badge-neutral { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); border-color: var(--border); }

.asset-link { color: inherit; text-decoration: none; transition: color 0.15s; }
.asset-link:hover { color: var(--accent-cyan); }
.breadcrumb-link { color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.breadcrumb-link:hover { color: var(--accent-cyan); }
.link-subtle { color: var(--text-muted); text-decoration: none; font-weight: 500; transition: color 0.15s; }
.link-subtle:hover { color: var(--accent-cyan); }

.chart-image {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0a0f1a;
}

.indicator-grid { display: grid; gap: 1rem; margin: 0; }
.indicator-block {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--border);
}
.indicator-block dt { font-weight: 600; font-size: 0.82rem; margin-bottom: 0.35rem; color: var(--text); }
.indicator-block dd { margin: 0; color: var(--text-muted); line-height: 1.55; }

.reason-list { margin: 0; padding: 0; list-style: none; }
.reason-list li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.25rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.reason-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
}
.reason-list li:last-child { border-bottom: none; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.15rem; }
.filter-pill {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  background: var(--glass);
  transition: all 0.2s var(--ease);
}
.filter-pill:hover, .filter-pill.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: rgba(34, 211, 238, 0.3);
}
.filter-pill.filter-buy.active { border-color: rgba(52, 211, 153, 0.4); color: var(--positive); }
.filter-pill.filter-sell.active { border-color: rgba(248, 113, 113, 0.4); color: var(--negative); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.15rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-decoration: none;
}
.btn-primary {
  background: var(--gradient-btn);
  color: white;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.45);
}
.btn-secondary {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-bright); background: var(--bg-card-hover); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-bright); background: rgba(248, 113, 113, 0.08); color: #fca5a5; }
a.btn { text-decoration: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.82rem; }

/* Forms */
.form-stack, .form-card { display: flex; flex-direction: column; gap: 1.15rem; }
.form-section { display: flex; flex-direction: column; gap: 0.85rem; }
.form-section h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
label:not(.toggle-row) > span {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(6, 10, 20, 0.8);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
.checkbox-row { display: flex; flex-direction: column; gap: 0.5rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.6rem; color: var(--text); font-size: 0.9rem; }

/* Integration toggles */
.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.toggle-row:hover {
  border-color: var(--border-bright);
  background: rgba(34, 211, 238, 0.04);
}
.toggle-copy { flex: 1; min-width: 0; }
.toggle-title {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}
.toggle-desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.toggle {
  position: relative;
  flex-shrink: 0;
  display: inline-block;
  width: 52px;
  height: 28px;
  vertical-align: middle;
}
.toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  z-index: 2;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  display: block;
  margin: 0;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.35);
  transition: background 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
  pointer-events: none;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.22s var(--ease), background 0.22s var(--ease), border-color 0.22s var(--ease);
}
.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, #0891b2, #6366f1);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.22);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(24px);
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.8);
}
.toggle input:focus-visible + .toggle-slider {
  outline: 2px solid rgba(34, 211, 238, 0.55);
  outline-offset: 2px;
}
.hint { color: var(--text-dim); font-size: 0.84rem; margin: 0; line-height: 1.5; }
.hint a { color: var(--accent-cyan); }
.form-actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.input-sm { width: auto; max-width: 5rem; padding: 0.45rem 0.6rem; }

/* Flash messages */
.flash-stack { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.15rem; }
.flash {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
}
.flash-success { background: rgba(52, 211, 153, 0.1); color: var(--positive); border-color: rgba(52, 211, 153, 0.2); }
.flash-error { background: rgba(248, 113, 113, 0.1); color: var(--negative); border-color: rgba(248, 113, 113, 0.2); }
.flash-info { background: rgba(34, 211, 238, 0.08); color: var(--accent-cyan); border-color: rgba(34, 211, 238, 0.2); }

/* Content posts */
.post-card {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border);
}
.post-card:last-child { border-bottom: none; }
.post-meta { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.6rem; flex-wrap: wrap; }
.post-body {
  margin: 0 0 0.85rem;
  white-space: pre-wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
}
.post-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 0.15rem;
}
.post-action-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1rem;
  flex: 1;
  min-width: min(100%, 280px);
}
.post-action-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.65rem;
}
.post-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}
.post-field > span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.post-field select,
.post-field input {
  width: auto;
  min-width: 0;
}
.post-field select { min-width: 9.5rem; }
.post-field-inline input.input-sm { width: 4.5rem; text-align: center; }
.post-delete-form {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
}
.inline-form { display: inline-flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  color: var(--accent-cyan);
}

/* Login */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.5rem;
}
.login-shell {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
}
.login-card {
  padding: 2.25rem;
  border-radius: var(--radius-lg);
}
.login-card .brand { margin-bottom: 1.5rem; }
.login-tagline {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: -0.5rem 0 1.5rem;
}

/* Channel status cards */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.15rem;
}
.channel-status {
  text-align: center;
  padding: 1.25rem;
}
.channel-status .stat-value { font-size: 1.5rem; }

/* Responsive */
@media (max-width: 1024px) {
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease);
    width: min(var(--sidebar-width), 88vw);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex; }
  .main-content { padding: 1.25rem 1rem 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
