/* ═══════════════════════════════════════════════════════════
   HORRORGEN — APP SHELL DESIGN SYSTEM
   Dark industrial editorial — confident, premium, cinematic
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Mono:wght@300;400;500&display=swap');

:root {
  --bg:        #060606;
  --bg2:       #0c0c0c;
  --bg3:       #111111;
  --border:    #1c1c1c;
  --border2:   #242424;
  --red:       #d10000;
  --red-dim:   rgba(209,0,0,0.12);
  --red-glow:  rgba(209,0,0,0.35);
  --red-muted: #6b0000;
  --text:      #e0dbd5;
  --text2:     #8a8480;
  --text3:     #444;
  --mono:      'DM Mono', monospace;
  --display:   'Bebas Neue', sans-serif;
  --sidebar-w: 220px;
  --radius:    2px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  cursor: default;
}

/* ── NOISE OVERLAY ──────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; opacity: 0.7;
}

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-text {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 2px;
  line-height: 1;
  color: var(--text);
}
.sidebar-logo-text span { color: var(--red); }

.sidebar-logo-sub {
  font-size: 9px;
  color: var(--text3);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section {
  padding: 0 12px;
  margin-bottom: 24px;
}

.nav-section-label {
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--text3);
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text2);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.05em;
  transition: all 0.15s;
  position: relative;
}

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

.nav-item.active {
  background: var(--red-dim);
  color: var(--text);
  border-left: 2px solid var(--red);
  padding-left: 8px;
}

.nav-icon {
  width: 16px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* ── SIDEBAR BOTTOM — USER PANEL ───────────────────────── */
.sidebar-bottom {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-panel {
  background: var(--bg3);
  border: 1px solid var(--border2);
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.user-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 2px;
  margin-bottom: 8px;
}
.user-plan-badge.free {
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--text2);
}
.user-plan-badge.pro {
  background: rgba(209,0,0,0.15);
  border: 1px solid var(--red-muted);
  color: var(--red);
}

.user-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-quota {
  font-size: 10px;
  color: var(--text2);
}

.quota-bar {
  height: 2px;
  background: var(--border2);
  border-radius: 1px;
  margin-top: 8px;
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  background: var(--red);
  border-radius: 1px;
  transition: width 0.3s;
}

.sidebar-logout {
  display: block;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text3);
  text-decoration: none;
  padding: 6px;
  transition: color 0.15s;
}
.sidebar-logout:hover { color: var(--red); }

/* ── MAIN CONTENT ───────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.page-header {
  padding: 32px 40px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-title {
  font-family: var(--display);
  font-size: 42px;
  letter-spacing: 3px;
  color: var(--text);
  line-height: 1;
}

.page-subtitle {
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.15em;
  margin-top: 4px;
}

.page-body {
  padding: 32px 40px;
}

/* ── STATS GRID ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg2);
  padding: 24px;
  transition: background 0.15s;
}
.stat-card:hover { background: var(--bg3); }

.stat-value {
  font-family: var(--display);
  font-size: 48px;
  letter-spacing: 2px;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-value.red { color: var(--red); }

.stat-label {
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--text2);
  text-transform: uppercase;
}

.stat-sub {
  font-size: 10px;
  color: var(--text3);
  margin-top: 4px;
}

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 16px;
}

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

.card-title {
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--text2);
  text-transform: uppercase;
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  border-radius: var(--radius);
}

.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-primary:hover { background: #aa0000; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-secondary:hover { border-color: var(--red); color: var(--text); }

.btn-danger {
  background: transparent;
  border: 1px solid var(--red-muted);
  color: var(--red);
}
.btn-danger:hover { background: var(--red-dim); }

.btn-sm {
  padding: 6px 12px;
  font-size: 10px;
}

/* ── INPUTS ─────────────────────────────────────────────── */
.input-group { margin-bottom: 20px; }

.input-label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text2);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.input, select.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
  border-radius: var(--radius);
  appearance: none;
}
.input:focus, select.input:focus { border-color: var(--red); }
.input::placeholder { color: var(--text3); }

/* ── TAGS ───────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid var(--border2);
  color: var(--text2);
  border-radius: var(--radius);
}
.tag.red { border-color: var(--red-muted); color: var(--red); }

/* ── DIVIDERS ───────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ── ALERTS ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  font-size: 12px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.alert-error {
  background: rgba(209,0,0,0.08);
  border: 1px solid rgba(209,0,0,0.3);
  color: #ff5555;
}
.alert-success {
  background: rgba(0,200,100,0.06);
  border: 1px solid rgba(0,200,100,0.2);
  color: #55cc88;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .page-body, .page-header { padding: 20px; }
}

/* ── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.4s ease both; }
.fade-up-2 { animation: fadeUp 0.4s ease 0.08s both; }
.fade-up-3 { animation: fadeUp 0.4s ease 0.16s both; }
.fade-up-4 { animation: fadeUp 0.4s ease 0.24s both; }
