:root {
  --bg-void: #06080f;
  --bg-sidebar: rgba(10, 13, 24, 0.92);
  --bg-topbar: rgba(9, 12, 22, 0.78);
  --bg-card: rgba(15, 19, 34, 0.76);
  --bg-card-solid: #101525;
  --bg-card-hover: rgba(22, 28, 48, 0.88);
  --bg-input: rgba(11, 14, 26, 0.9);

  --border-glass: rgba(148, 163, 184, 0.11);
  --border-accent: rgba(139, 92, 246, 0.34);

  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --text-dim: #64748b;

  --violet: #8b5cf6;
  --violet-bright: #a78bfa;
  --violet-grad: linear-gradient(135deg, #6d4aff 0%, #9b5cff 55%, #c084fc 100%);
  --gold: #f59e0b;
  --gold-soft: #fbbf24;
  --cyan: #38bdf8;
  --rose: #f43f5e;
  --indigo-glow: rgba(124, 92, 255, 0.32);
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-void);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hidden {
  display: none !important;
}

/* =========================================================
   1. ORBITAL PRISM LOADER (ROYAL VIOLET + AMBER GOLD)
   ========================================================= */
.loader-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(circle at 50% 45%, rgba(109, 74, 255, 0.16) 0%, transparent 48%),
    radial-gradient(circle at 60% 55%, rgba(245, 158, 11, 0.09) 0%, transparent 42%),
    #05070e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
}

.loader-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.orbital-core {
  position: relative;
  width: 118px;
  height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
}

.orbit-ring-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(139, 92, 246, 0.12);
  border-top-color: #9b5cff;
  border-left-color: #38bdf8;
  animation: orbitSpinCW 1.6s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.25);
}

.orbit-ring-inner {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 2px solid rgba(245, 158, 11, 0.1);
  border-bottom-color: #f59e0b;
  border-right-color: #c084fc;
  animation: orbitSpinCCW 1.25s linear infinite;
}

.orbit-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 20%, #c4b5fd 70%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes orbitSpinCW {
  to { transform: rotate(360deg); }
}
@keyframes orbitSpinCCW {
  to { transform: rotate(-360deg); }
}

.loader-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #cbd5e1;
  margin-bottom: 10px;
}

.loader-step-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-sub);
}

/* =========================================================
   2. CINEMATIC PENTHOUSE LOGIN PORTAL (NO GREEN / NO HANDS)
   ========================================================= */
.auth-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: #05070d;
}

.auth-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('/static/hero-bg.jpg');
  background-size: cover;
  background-position: center right;
  animation: kenBurnsZoom 24s ease-in-out infinite alternate;
  filter: saturate(1.08) contrast(1.04);
}

@keyframes kenBurnsZoom {
  0% { transform: scale(1.0); }
  100% { transform: scale(1.065); }
}

.auth-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 14, 0.92) 0%, rgba(7, 10, 20, 0.78) 38%, rgba(7, 10, 20, 0.22) 72%, rgba(5, 7, 14, 0.45) 100%),
    radial-gradient(circle at 20% 80%, rgba(124, 92, 255, 0.18), transparent 45%);
}

#particlesCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.auth-split-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.auth-glass-portal {
  width: 430px;
  max-width: 100%;
  background: rgba(11, 15, 28, 0.76);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 24px;
  padding: 36px 34px 32px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 50px rgba(109, 74, 255, 0.14);
}

.portal-top-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #c4b5fd;
  margin-bottom: 20px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: dotBlink 2s infinite;
}

@keyframes dotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.portal-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.portal-crest {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.28), rgba(245, 158, 11, 0.18));
  border: 1px solid rgba(196, 181, 253, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(109, 74, 255, 0.28);
}

.portal-heading {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(95deg, #ffffff 15%, #ddd6fe 68%, #fcd34d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-sub {
  font-size: 13.5px;
  color: var(--text-sub);
  margin-bottom: 26px;
  line-height: 1.5;
}

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

.field-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 7px;
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 13px;
  color: #64748b;
  pointer-events: none;
}

.field-control input {
  width: 100%;
  background: rgba(8, 11, 21, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 12.5px 40px 12.5px 40px;
  color: #f8fafc;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.field-control input:focus {
  border-color: var(--violet-bright);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
  background: rgba(12, 16, 30, 0.96);
}

.eye-btn {
  position: absolute;
  right: 11px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
}
.eye-btn:hover { color: #e2e8f0; }

.portal-submit-btn {
  width: 100%;
  margin-top: 10px;
  padding: 13.5px 18px;
  border: 1px solid rgba(196, 181, 253, 0.35);
  border-radius: 12px;
  background: var(--violet-grad);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(109, 74, 255, 0.42);
  transition: transform 0.14s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.portal-submit-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 16px 36px rgba(139, 92, 246, 0.56);
}

.portal-submit-btn:active {
  transform: translateY(1px);
}

.portal-error {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.38);
  color: #fda4af;
  font-size: 12.5px;
  text-align: center;
}

.portal-footer-meta {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #64748b;
}

.auth-right-hud {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 340px;
}

@media (max-width: 980px) {
  .auth-right-hud { display: none; }
  .auth-split-container { justify-content: center; }
}

.hud-float-card {
  background: rgba(10, 14, 26, 0.62);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-left: 3px solid var(--gold);
  border-radius: 14px;
  padding: 14px 18px;
}

.hud-float-card.violet {
  border-left-color: var(--violet);
}

.hud-float-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 4px;
}

.hud-float-val {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

/* =========================================================
   3. INTERNAL WORKSPACE ARCHITECTURE (OBSIDIAN + VIOLET + GOLD)
   ========================================================= */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(109, 74, 255, 0.11), transparent 48%),
    radial-gradient(ellipse at 92% 12%, rgba(245, 158, 11, 0.065), transparent 40%),
    var(--bg-void);
}

.nav-rail {
  width: 274px;
  min-width: 274px;
  height: 100vh;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  user-select: none;
}

.rail-logo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 18px;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 14px;
}

.rail-gem {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--violet-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
  flex-shrink: 0;
}

.rail-brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.1;
}

.rail-brand-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--gold-soft);
  letter-spacing: 0.08em;
  margin-top: 3px;
}

.rail-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

.rail-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #526077;
  padding: 14px 12px 6px;
}

.rail-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9.5px 12px;
  margin-bottom: 3px;
  border-radius: 11px;
  color: #94a3b8;
  font-size: 13.8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
}

.rail-link-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rail-icon {
  width: 17px;
  height: 17px;
  opacity: 0.78;
  flex-shrink: 0;
}

.rail-link:hover {
  color: #f1f5f9;
  background: rgba(148, 163, 184, 0.06);
}

.rail-link.active {
  color: #ffffff;
  font-weight: 600;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.04) 100%);
  border: 1px solid rgba(139, 92, 246, 0.28);
}

.rail-link.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 22%;
  height: 56%;
  width: 3px;
  border-radius: 4px;
  background: var(--gold-soft);
  box-shadow: 0 0 8px var(--gold);
}

.rail-link.active .rail-icon {
  opacity: 1;
  color: var(--violet-bright);
}

.rail-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(139, 92, 246, 0.18);
  color: #ddd6fe;
}

.rail-counter.gold {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.rail-user-dock {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(15, 20, 36, 0.85);
  border: 1px solid var(--border-glass);
}

.dock-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dock-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c5cff, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
  flex-shrink: 0;
}

.dock-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
}

.dock-role {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.dock-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

/* =========================================================
   4. CONTENT STAGE & TOP COMMAND BAR
   ========================================================= */
.stage-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  height: 62px;
  min-height: 62px;
  padding: 0 30px;
  background: var(--bg-topbar);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
}

.topbar-crumb strong {
  color: #ffffff;
  font-weight: 700;
}

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

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(15, 20, 36, 0.9);
  border: 1px solid var(--border-glass);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #cbd5e1;
}

.telemetry-pill b {
  color: var(--gold-soft);
}

.workspace {
  flex: 1;
  overflow-y: auto;
  padding: 26px 32px 54px;
}

/* =========================================================
   5. CARDS, BUTTONS, SEGMENTED TABS, BADGES & TABLES
   ========================================================= */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.page-subtitle {
  margin-top: 5px;
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.5;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(17, 22, 39, 0.9);
  color: #f1f5f9;
  font-family: inherit;
  transition: all 0.16s ease;
  text-decoration: none;
}

.btn:hover {
  background: rgba(28, 35, 60, 0.95);
  border-color: rgba(167, 139, 250, 0.4);
}

.btn-primary {
  background: var(--violet-grad);
  border-color: rgba(196, 181, 253, 0.4);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(109, 74, 255, 0.32);
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 26px rgba(139, 92, 246, 0.48);
}

.btn-gold {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border-color: rgba(253, 230, 138, 0.4);
  color: #090b12;
  font-weight: 700;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 18px 20px;
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.65), transparent);
}

.kpi-card.gold-top::after {
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.75), transparent);
}

.kpi-card.cyan-top::after {
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.75), transparent);
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.kpi-value.violet { color: #c4b5fd; }
.kpi-value.gold { color: #fbbf24; }
.kpi-value.cyan { color: #38bdf8; }
.kpi-value.danger { color: #fb7185; }

.kpi-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-sub);
}

.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 20px;
}

.panel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.panel-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(9, 12, 23, 0.75);
  border: 1px solid var(--border-glass);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  color: #f8fafc;
  border-color: rgba(167, 139, 250, 0.3);
}

.filter-tab.active {
  background: rgba(139, 92, 246, 0.22);
  color: #ffffff;
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow: 0 4px 14px rgba(109, 74, 255, 0.22);
}

/* Blogger / Trader Selector Cards */
.actor-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}

.actor-card-chip {
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(10, 14, 26, 0.72);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.16s ease;
}

.actor-card-chip:hover {
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(18, 24, 44, 0.85);
}

.actor-card-chip.active {
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.26), rgba(245, 158, 11, 0.12));
  border-color: rgba(167, 139, 250, 0.65);
}

.actor-chip-name {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}

.actor-chip-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-soft);
}

.std-input, .std-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #f8fafc;
  font-size: 13.5px;
  border-radius: 10px;
  padding: 9.5px 12px;
  outline: none;
  font-family: inherit;
}

.std-input:focus, .std-select:focus {
  border-color: var(--violet-bright);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

table.data-table th {
  text-align: left;
  padding: 11px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
}

table.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.065);
  color: #e2e8f0;
  vertical-align: middle;
}

table.data-table tr:hover td {
  background: rgba(139, 92, 246, 0.045);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-critical { background: rgba(244, 63, 94, 0.16); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.36); }
.pill-warning { background: rgba(245, 158, 11, 0.16); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.34); }
.pill-ok { background: rgba(139, 92, 246, 0.18); color: #ddd6fe; border: 1px solid rgba(167, 139, 250, 0.38); }
.pill-info { background: rgba(56, 189, 248, 0.14); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.3); }
.pill-gold { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.4); }
.pill-muted { background: rgba(100, 116, 139, 0.16); color: #94a3b8; }

a.ext-link {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 500;
}
a.ext-link:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(4, 6, 14, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  width: 550px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: #0e1324;
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.8);
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
}

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

.acl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.acl-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  background: rgba(9, 12, 23, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  font-size: 12.5px;
  cursor: pointer;
}

.toast-box {
  position: fixed;
  bottom: 24px;
  right: 26px;
  z-index: 9000;
  background: rgba(16, 21, 39, 0.96);
  border: 1px solid var(--violet-bright);
  color: #f8fafc;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 0 24px rgba(139, 92, 246, 0.25);
}

/* Collapsible Subgroups in Sidebar Rail */
.rail-chevron {
  width: 15px;
  height: 15px;
  opacity: 0.65;
  transition: transform 0.2s ease;
}
.rail-group.open .rail-chevron {
  transform: rotate(180deg);
}
.rail-sublist {
  display: none;
  margin-left: 20px;
  padding-left: 11px;
  border-left: 1px solid rgba(139, 92, 246, 0.22);
  margin-top: 2px;
  margin-bottom: 6px;
}
.rail-group.open .rail-sublist {
  display: block;
}
.rail-sublink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7.5px 10px;
  margin-bottom: 2px;
  border-radius: 9px;
  font-size: 12.8px;
  font-weight: 500;
  color: #8b9bb4;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rail-sublink:hover {
  color: #f1f5f9;
  background: rgba(148, 163, 184, 0.06);
}
.rail-sublink.active {
  color: #ffffff;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Weekly Plan Section Banners & Inline Controls */
.plan-section-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 11px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.plan-section-banner.cs_main {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.24), rgba(139, 92, 246, 0.04));
  border-left: 3px solid #a78bfa;
  color: #ede9fe;
}
.plan-section-banner.cs_neuro {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.03));
  border-left: 3px solid #38bdf8;
  color: #e0f2fe;
}
.plan-section-banner.binary {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.22), rgba(245, 158, 11, 0.03));
  border-left: 3px solid #fbbf24;
  color: #fef3c7;
}
.plan-section-banner.cs_shorts {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.22), rgba(244, 63, 94, 0.03));
  border-left: 3px solid #fb7185;
  color: #ffe4e6;
}

.status-inline-sel {
  background: rgba(9, 12, 24, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
.status-inline-sel.st-published { border-color: rgba(167, 139, 250, 0.55); color: #ddd6fe; background: rgba(139, 92, 246, 0.16); }
.status-inline-sel.st-ready { border-color: rgba(56, 189, 248, 0.5); color: #7dd3fc; background: rgba(56, 189, 248, 0.14); }
.status-inline-sel.st-uniq, .status-inline-sel.st-seo, .status-inline-sel.st-preview { border-color: rgba(245, 158, 11, 0.5); color: #fde68a; background: rgba(245, 158, 11, 0.14); }
.status-inline-sel.st-banned_swap { border-color: rgba(244, 63, 94, 0.55); color: #fda4af; background: rgba(244, 63, 94, 0.16); }

.std-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #f8fafc;
  font-size: 13px;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  font-family: inherit;
  resize: vertical;
  line-height: 1.45;
}
.std-textarea:focus {
  border-color: var(--violet-bright);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.modal-box.wide {
  width: 720px;
}
