:root {
  --cc-bg: #0c0e13;
  --cc-bg-elevated: #12151c;
  --cc-bg-card: #161a23;
  --cc-border: #232735;
  --cc-primary: #dc2626;
  --cc-primary-soft: rgba(220, 38, 38, 0.15);
  --cc-secondary: #38bdf8;
  --cc-secondary-soft: rgba(56, 189, 248, 0.15);
  --cc-text: #e6e8ee;
  --cc-text-muted: #8b93a7;
  --bs-body-bg: var(--cc-bg);
  --bs-body-color: var(--cc-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  background:
    radial-gradient(circle at 15% 0%, rgba(220, 38, 38, 0.14), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.14), transparent 40%),
    var(--cc-bg);
  min-height: 100vh;
}

.fw-800 { font-weight: 800; }
.fw-700 { font-weight: 700; }

a { text-decoration: none; }
.footer-link { color: var(--cc-text-muted); }
.footer-link:hover { color: var(--cc-primary); }

/* ---------- Buttons ---------- */
.btn-primary {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #f87171, #dc2626); }
.btn-outline-light { border-color: var(--cc-border); }

/* ---------- Navbar ---------- */
.cc-navbar {
  background: rgba(12, 14, 19, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cc-border);
  padding-top: .75rem;
  padding-bottom: .75rem;
}
.cc-navbar .nav-link { color: var(--cc-text-muted); font-weight: 500; }
.cc-navbar .nav-link:hover { color: var(--cc-text); }

.cc-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .8rem;
}

/* ---------- Hero ---------- */
.cc-hero {
  padding: 6rem 0 5rem;
  position: relative;
  overflow: hidden;
}
.cc-hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--cc-primary-soft);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, .35);
  padding: .35rem .9rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}
.cc-hero h1 { font-size: 3.2rem; font-weight: 800; letter-spacing: -0.02em; }
.cc-hero .lead { color: var(--cc-text-muted); font-size: 1.15rem; }

/* ---------- Cards ---------- */
.cc-card {
  background: var(--cc-bg-card);
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  transition: border-color .2s ease, transform .2s ease;
}
.cc-card:hover { border-color: rgba(220, 38, 38, .4); }
.cc-card-flat {
  background: var(--cc-bg-elevated);
  border: 1px solid var(--cc-border);
  border-radius: 14px;
}

.cc-icon-tile {
  width: 48px; height: 48px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cc-primary-soft);
  color: #fca5a5;
  font-size: 1.3rem;
}

.cc-stat { font-size: 2rem; font-weight: 800; }
.cc-stat-label { color: var(--cc-text-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Pricing ---------- */
.cc-pricing-card {
  background: var(--cc-bg-card);
  border: 1px solid var(--cc-border);
  border-radius: 18px;
  padding: 2rem;
  height: 100%;
  transition: transform .2s ease, border-color .2s ease;
}
.cc-pricing-card:hover { transform: translateY(-4px); border-color: rgba(220, 38, 38, .45); }
.cc-pricing-card.featured {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 1px var(--cc-primary), 0 20px 40px rgba(220, 38, 38, .15);
}
.cc-price { font-size: 2.4rem; font-weight: 800; }

/* ---------- Footer ---------- */
.cc-footer {
  background: var(--cc-bg-elevated);
  border-top: 1px solid var(--cc-border);
}

/* ---------- Auth ---------- */
.cc-auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.cc-auth-card {
  width: 100%; max-width: 420px;
  background: var(--cc-bg-card);
  border: 1px solid var(--cc-border);
  border-radius: 18px;
  padding: 2.25rem;
}

/* ---------- Sidebar / dashboard shell ---------- */
.cc-app-shell { display: flex; min-height: 100vh; }
.cc-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--cc-bg-elevated);
  border-right: 1px solid var(--cc-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.cc-sidelink {
  display: flex; align-items: center; gap: .65rem;
  color: var(--cc-text-muted);
  padding: .55rem .8rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: .92rem;
}
.cc-sidelink i { font-size: 1.05rem; width: 20px; text-align: center; }
.cc-sidelink:hover { background: var(--cc-bg-card); color: var(--cc-text); }
.cc-sidelink.active { background: var(--cc-primary-soft); color: #fca5a5; }

.cc-main { flex: 1; padding: 2rem; min-width: 0; }

@media (max-width: 991px) {
  .cc-app-shell { flex-direction: column; }
  .cc-sidebar { width: 100%; height: auto; position: relative; }
  .cc-main { padding: 1.25rem; }
}

/* ---------- Breadcrumbs ---------- */
.cc-breadcrumb {
  background: transparent;
  padding: 0;
  font-size: .875rem;
}
.cc-breadcrumb a { color: var(--cc-text-muted); }
.cc-breadcrumb .active { color: var(--cc-text); }
.cc-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--cc-text-muted); }

/* ---------- Tables ---------- */
.table { color: var(--cc-text); }
.table > :not(caption) > * > * { background: transparent; border-bottom-color: var(--cc-border); }
.cc-table-card { background: var(--cc-bg-card); border: 1px solid var(--cc-border); border-radius: 14px; overflow: hidden; }

/* ---------- Badges ---------- */
.cc-tier-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}

/* ---------- Category chips (library page filter) ---------- */
.cc-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .9rem;
  border-radius: 999px;
  background: var(--cc-bg-card);
  border: 1px solid var(--cc-border);
  color: var(--cc-text-muted);
  font-weight: 500;
  font-size: .875rem;
}
.cc-chip:hover { color: var(--cc-text); border-color: rgba(220,38,38,.4); }
.cc-chip.active { background: var(--cc-primary-soft); color: #fca5a5; border-color: rgba(220,38,38,.5); }

/* ---------- Forms ---------- */
.form-control, .form-select {
  background: var(--cc-bg-elevated);
  border: 1px solid var(--cc-border);
  color: var(--cc-text);
}
.form-control:focus, .form-select:focus {
  background: var(--cc-bg-elevated);
  color: var(--cc-text);
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 .2rem var(--cc-primary-soft);
}
.form-control::placeholder { color: var(--cc-text-muted); }
label.form-label { color: var(--cc-text-muted); font-size: .875rem; font-weight: 500; }

/* ---------- Global right sidebar: socials dock + Discord widget ---------- */
.cc-rightbar {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 1040;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
}

.cc-rightbar-dock {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: var(--cc-bg-card);
  border: 1px solid var(--cc-border);
  border-right: none;
  border-radius: 10px 0 0 10px;
  overflow: hidden;
  box-shadow: -4px 0 16px rgba(0, 0, 0, .25);
}

.cc-rightbar-tab {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: none;
  border-bottom: 1px solid var(--cc-border);
  background: transparent;
  color: var(--cc-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}
.cc-rightbar-dock > :last-child { border-bottom: none; }
.cc-rightbar-tab:hover { background: var(--cc-bg-elevated); color: var(--cc-text); }
.cc-rightbar-tab img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.cc-rightbar.open #ccRightbarTab { background: var(--cc-primary-soft); color: var(--cc-primary); }

.cc-rightbar-panel {
  width: 300px;
  max-width: calc(100vw - 48px);
  max-height: 70vh;
  background: var(--cc-bg-card);
  border: 1px solid var(--cc-border);
  border-radius: 10px 0 0 10px;
  box-shadow: -8px 0 28px rgba(0, 0, 0, .45);
  display: none;
  flex-direction: column;
  overflow: hidden;
  margin-right: -1px;
}
.cc-rightbar.open .cc-rightbar-panel { display: flex; }

.cc-rightbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--cc-border);
  background: var(--cc-bg-elevated);
  flex-shrink: 0;
}

.cc-rightbar-collapse {
  background: transparent;
  border: none;
  color: var(--cc-text-muted);
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.cc-rightbar-collapse:hover { color: var(--cc-text); }

.cc-rightbar-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

.cc-rightbar-channels {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--cc-border);
}
.cc-rightbar-channels:empty { display: none; }

.cc-channel-category {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--cc-text-muted);
  margin: .75rem 0 .25rem;
}
.cc-channel-category:first-child { margin-top: 0; }

.cc-channel-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .4rem;
  border-radius: 6px;
  color: var(--cc-text-muted);
  font-size: .85rem;
  text-decoration: none;
}
.cc-channel-row:hover { background: var(--cc-bg-elevated); color: var(--cc-text); }
.cc-channel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cc-voice-members {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: 0 .4rem .4rem 1.6rem;
}
.cc-voice-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

