/* ============================================================
   layout.css — Shell, Header, Nav, Sidebar, Content
   ============================================================ */

.shell { position: relative; min-height: 100vh; display: flex; flex-direction: column; z-index: 1; }

/* ══════════════════════════════════════════════════════
   SITE HEADER
══════════════════════════════════════════════════════ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 7, 10, 0.75);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-5);
  box-shadow: 0 2px 24px rgba(0,0,0,0.55);
}
.site-header::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 35%, var(--accent-bright) 50%, var(--accent) 65%, transparent 100%);
  opacity: 0.5;
}

.header-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }

.brand { display: flex; flex-direction: column; gap: 2px; }
.brand-name {
  font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700;
  color: var(--accent); letter-spacing: 3px; line-height: 1;
  text-shadow: 0 0 24px var(--accent-dim);
}
.brand-sub {
  font-family: var(--font-mono); font-size: 0.58rem;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 4px;
}

.header-right { display: flex; align-items: center; gap: var(--space-3); }
#role-badge {
  font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 2px; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
}
#role-badge.staff { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-glow); }

.sim-btn {
  background: var(--red-dim); border: 1px solid rgba(255,68,85,0.25);
  color: var(--red); font-family: var(--font-mono); font-size: 0.62rem;
  padding: 4px 10px; letter-spacing: 1px; text-transform: uppercase;
  border-radius: var(--radius-sm); transition: all var(--transition-fast);
}
.sim-btn:hover { background: rgba(255,68,85,0.3); box-shadow: 0 0 10px var(--red-dim); }

/* Header Stats */
.header-stats {
  display: flex; padding: 10px 0; border-top: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.header-stats::-webkit-scrollbar { display: none; }
.hstat { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-5); flex-shrink: 0; }
.hstat:first-child { padding-left: 0; }
.hstat-num {
  font-family: var(--font-mono); font-size: 1.55rem; font-weight: 700;
  color: var(--text-pri); line-height: 1; min-width: 2ch; text-align: right;
}
.hstat-num.green { color: var(--accent); text-shadow: 0 0 14px var(--accent-dim); }
.hstat-num.amber { color: var(--amber); text-shadow: 0 0 14px var(--amber-dim); }
.hstat-num.muted { color: var(--text-muted); }
.hstat-label {
  font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-muted);
  text-transform: uppercase; line-height: 1.45; display: flex; flex-direction: column; letter-spacing: 1.5px;
}
.hstat-label span { color: var(--text-dim); font-size: 0.54rem; }
.hstat-sep { width: 1px; height: 30px; background: var(--border); flex-shrink: 0; align-self: center; }

/* ══════════════════════════════════════════════════════
   SITE NAV
══════════════════════════════════════════════════════ */
.site-nav {
  display: flex; padding: 0 var(--space-5);
  background: rgba(5, 7, 10, 0.5); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 92px; z-index: 99;
}
.nav-link {
  padding: 11px var(--space-4); font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px;
  border-bottom: 2px solid transparent; transition: all var(--transition-fast);
}
.nav-link:hover { color: var(--text-sec); }
.nav-link.active { color: var(--accent); border-bottom-color: var(--accent); text-shadow: 0 0 12px var(--accent-glow); }

/* ══════════════════════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════════════════════ */
.main-body { display: flex; flex: 1; }

/* ══════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════ */
.sidebar {
  width: 216px; flex-shrink: 0;
  background: linear-gradient(to right, rgba(5,8,12,0.65), rgba(5,8,12,0.15));
  border-right: 1px solid var(--border);
  padding: var(--space-3) 0 var(--space-6);
  position: sticky; top: 136px; height: calc(100vh - 136px);
  overflow-y: auto; scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); }

.sidebar-section { padding: var(--space-1) 0; }
.sidebar-heading {
  font-family: var(--font-mono); font-size: 0.57rem; color: var(--text-dim);
  text-transform: uppercase; padding: var(--space-3) var(--space-3) var(--space-2);
  letter-spacing: 2.5px;
}
.sidebar-link {
  position: relative; overflow: hidden;
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 7px var(--space-3);
  font-family: var(--font-mono); font-size: 0.73rem; color: var(--text-sec);
  transition: all var(--transition-fast); border-left: 2px solid transparent;
  text-align: left;
}
.sidebar-link:hover { background: rgba(255,255,255,0.03); color: var(--text-pri); padding-left: 18px; }
.sidebar-link.active {
  background: rgba(0,229,122,0.05); color: var(--accent);
  border-left-color: var(--accent); padding-left: 18px;
}
.sidebar-link.active::before {
  content: ''; position: absolute; left: 0; top: 20%; height: 60%; width: 2px;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
}
.sidebar-link.type-free { color: var(--accent); opacity: 0.8; }
.sidebar-link.type-free:hover, .sidebar-link.type-free.active { color: var(--accent-bright); opacity: 1; }
.sidebar-link.type-paid { color: var(--amber); opacity: 0.8; }
.sidebar-link.type-paid:hover, .sidebar-link.type-paid.active { opacity: 1; }
.sl-count {
  font-size: 0.57rem; opacity: 0.5; border: 1px solid var(--border);
  min-width: 20px; text-align: center; padding: 1px 4px;
  border-radius: 2px; background: rgba(0,0,0,0.2); flex-shrink: 0;
}
.sidebar-link.active .sl-count { opacity: 0.9; border-color: var(--accent-dim); background: var(--accent-glow); }
.sidebar-sep { height: 1px; background: var(--border); margin: var(--space-2) var(--space-3); }

/* ══════════════════════════════════════════════════════
   CONTENT AREA
══════════════════════════════════════════════════════ */
.content { flex: 1; padding: var(--space-5); min-width: 0; }

/* Search / Filter Bar */
.search-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  background: rgba(8, 11, 16, 0.88);
  border: 1px solid var(--border-mid);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.035);
  margin-bottom: var(--space-5);
}
.search-input {
  flex: 1; min-width: 140px;
  font-family: var(--font-mono); letter-spacing: 1px; text-transform: uppercase;
  font-size: 0.78rem; background: transparent; border: none; padding: 0; color: var(--text-pri);
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus { box-shadow: none; background: transparent; border: none; }

.bar-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }

.filter-pill {
  padding: 5px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600;
  color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase;
  background: rgba(255,255,255,0.03); transition: all var(--transition-fast);
}
.filter-pill:hover { background: var(--surface-2); color: var(--text-pri); border-color: var(--border-mid); }
.filter-pill.on {
  background: rgba(0, 229, 122, 0.1); color: var(--accent);
  border-color: rgba(0, 229, 122, 0.3); box-shadow: 0 0 10px var(--accent-glow);
}

.sort-select {
  background: transparent; border: none; font-family: var(--font-mono);
  font-size: 0.7rem; color: var(--text-sec); cursor: pointer; padding: 0 4px;
}
.sort-select option { background: #0d1117; }

.result-count {
  font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted);
  letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; margin-left: auto;
}

/* Plugin Grid */
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: var(--space-4);
}

/* Featured strip */
.featured-strip {
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  background: rgba(255,255,255,0.015);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.featured-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4); align-items: start;
}
.featured-heading {
  font-family: var(--font-mono); font-size: 0.63rem; color: var(--accent);
  margin-bottom: var(--space-3); letter-spacing: 2.5px; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.featured-heading::after { content: ''; flex: 1; height: 1px; background: var(--border); }
