@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Fira+Code:wght@400;500&display=swap');

/* ═══════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════ */
:root {
  /* Surfaces — warm dark */
  --bg:    #080705;
  --bg-2:  #0f0d09;
  --bg-3:  #17140e;
  --bg-4:  #1f1b12;
  --bg-5:  #271f15;

  /* Borders — warm charcoal */
  --bd:    #2c2518;
  --bd-2:  #3d3320;
  --bd-3:  #574530;

  /* Copper / Amber — the brand */
  --cu:       #d4821a;      /* copper primary   */
  --cu-hi:    #e89c38;      /* bright hover     */
  --cu-lo:    #a8630e;      /* pressed/dim      */
  --cu-glow:  rgba(212,130,26,0.22);
  --cu-sub:   rgba(212,130,26,0.08);
  --cu-line:  rgba(212,130,26,0.4);

  /* PCB greens */
  --green:      #34d399;
  --green-glow: rgba(52,211,153,0.18);
  --green-sub:  rgba(52,211,153,0.08);

  /* Semantic accents */
  --cyan:   #22d3ee;
  --violet: #a78bfa;
  --red:    #f87171;
  --amber:  #fbbf24;

  /* Text — warm white scale */
  --tx-1: #f0e8d5;
  --tx-2: #9e8a68;
  --tx-3: #5c503a;
  --tx-4: #30281c;

  /* Geometry */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t:    0.18s;

  /* Shadow */
  --sh:    0 4px 20px rgba(0,0,0,0.55);
  --sh-lg: 0 12px 48px rgba(0,0,0,0.75);
  --sh-cu: 0 0 24px var(--cu-glow), 0 4px 20px rgba(0,0,0,0.5);

  /* Fonts */
  --f-display: 'Syne', sans-serif;
  --f-body:    'DM Sans', sans-serif;
  --f-mono:    'Fira Code', monospace;
}

/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--f-body);
  font-weight: 400;
  background: var(--bg);
  color: var(--tx-1);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Dot-grid — technical drawing paper */
  background-image:
    radial-gradient(circle, var(--tx-4) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--bd-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cu); }

a { color: var(--cu); text-decoration: none; transition: color var(--t) var(--ease); }
a:hover { color: var(--cu-hi); }
img { max-width: 100%; height: auto; display: block; }

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
.container    { max-width: 1300px; margin: 0 auto; padding: 0 2rem; }
.container-sm { max-width: 860px;  margin: 0 auto; padding: 0 2rem; }

/* ═══════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(8,7,5,0.82);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--bd);
}
.navbar-inner {
  display: flex; align-items: center; gap: 2rem;
  max-width: 1300px; margin: 0 auto; padding: 0 2rem;
  height: 60px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-display);
  font-size: 1.05rem; font-weight: 700;
  color: var(--tx-1); text-decoration: none;
  letter-spacing: 0.02em; white-space: nowrap; flex-shrink: 0;
}
.navbar-brand:hover { color: var(--cu-hi); }
.brand-icon {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--cu);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
  box-shadow: 0 0 10px var(--cu-glow);
}
.navbar-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-link {
  padding: 5px 12px; border-radius: var(--r-sm);
  font-size: 0.83rem; font-weight: 500;
  color: var(--tx-2); transition: var(--t) var(--ease);
  position: relative;
}
.nav-link:hover { color: var(--tx-1); background: var(--bg-4); }
.nav-link.active {
  color: var(--cu-hi);
  background: var(--cu-sub);
}
.navbar-actions { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--f-display); font-weight: 600;
  font-size: 0.83rem; letter-spacing: 0.02em;
  padding: 8px 18px; border-radius: var(--r-sm);
  border: none; cursor: pointer;
  transition: var(--t) var(--ease);
  white-space: nowrap; text-decoration: none;
  position: relative; overflow: hidden;
}
/* Shimmer on hover */
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s var(--ease);
}
.btn:hover::after { transform: translateX(100%); }

.btn-primary {
  background: var(--cu);
  color: #0a0705;
  box-shadow: 0 2px 12px var(--cu-glow);
}
.btn-primary:hover {
  background: var(--cu-hi); color: #0a0705;
  box-shadow: var(--sh-cu);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--tx-1);
  border: 1px solid var(--bd-2);
}
.btn-outline:hover {
  border-color: var(--cu);
  color: var(--cu-hi);
  background: var(--cu-sub);
}
.btn-ghost {
  background: transparent; color: var(--tx-2);
}
.btn-ghost:hover { background: var(--bg-4); color: var(--tx-1); }
.btn-danger {
  background: rgba(248,113,113,0.1); color: var(--red);
  border: 1px solid rgba(248,113,113,0.25);
}
.btn-danger:hover { background: rgba(248,113,113,0.2); }
.btn-success {
  background: var(--green-sub); color: var(--green);
  border: 1px solid rgba(52,211,153,0.3);
}
.btn-success:hover { background: var(--green-glow); }
.btn-warning {
  background: rgba(251,191,36,0.1); color: var(--amber);
  border: 1px solid rgba(251,191,36,0.3);
}
.btn-sm  { padding: 6px 13px; font-size: 0.78rem; }
.btn-lg  { padding: 11px 28px; font-size: 0.92rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--r-sm); }

/* ═══════════════════════════════════════════
   HERO
═══════════════════════════════════════════ */
.hero {
  padding: 5.5rem 0 4.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--bd);
}
/* Radial ambient glow */
.hero::before {
  content: '';
  position: absolute; inset: -20%;
  background: radial-gradient(ellipse 70% 50% at 50% 40%,
    rgba(212,130,26,0.1) 0%,
    transparent 65%);
  pointer-events: none;
}
/* Animated scan line */
.hero::after {
  content: '';
  position: absolute; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--cu-line) 40%,
    var(--cu) 50%,
    var(--cu-line) 60%,
    transparent 100%);
  animation: scan 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes scan {
  0%   { top: 0%;   opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cu-sub);
  border: 1px solid var(--cu-line);
  border-radius: 100px;
  padding: 5px 16px;
  font-family: var(--f-mono); font-size: 0.72rem;
  font-weight: 500; color: var(--cu-hi);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 1.75rem;
  position: relative; z-index: 1;
}
.hero h1 {
  font-family: var(--f-display);
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  font-weight: 800; line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  position: relative; z-index: 1;
}
/* Copper gradient on hero h1 */
.hero h1 span.grad, .hero h1 {
  background: linear-gradient(
    135deg,
    var(--tx-1) 0%,
    var(--cu-hi) 50%,
    var(--tx-1) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}
.hero p {
  font-size: 1.1rem; font-weight: 400;
  color: var(--tx-2); max-width: 520px;
  margin: 0 auto 2.75rem; line-height: 1.7;
  position: relative; z-index: 1;
}
.hero-actions {
  display: flex; gap: 0.875rem;
  justify-content: center; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.hero-stats {
  display: flex; gap: 0; justify-content: center;
  margin-top: 4rem; padding-top: 3rem;
  border-top: 1px solid var(--bd);
  flex-wrap: wrap; position: relative; z-index: 1;
}
.hero-stats > div {
  padding: 0 3rem;
  border-right: 1px solid var(--bd);
}
.hero-stats > div:last-child { border-right: none; }
.hero-stat-value {
  font-family: var(--f-display);
  font-size: 2.2rem; font-weight: 800;
  color: var(--cu-hi); line-height: 1;
}
.hero-stat-label {
  font-size: 0.72rem; color: var(--tx-3);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 5px; font-family: var(--f-mono);
}

/* ═══════════════════════════════════════════
   SECTION
═══════════════════════════════════════════ */
.section { padding: 4rem 0; }
.section-header {
  display: flex; align-items: flex-end;
  justify-content: space-between; gap: 1rem;
  margin-bottom: 2.25rem;
}
.section-title {
  font-family: var(--f-display);
  font-size: 1.35rem; font-weight: 700;
  letter-spacing: -0.01em;
}
.section-subtitle { color: var(--tx-3); font-size: 0.83rem; margin-top: 4px; }

/* ═══════════════════════════════════════════
   CARDS
═══════════════════════════════════════════ */
.card {
  background: var(--bg-3);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--t) var(--ease),
              box-shadow var(--t) var(--ease),
              transform var(--t) var(--ease);
  position: relative;
}
/* PCB corner brackets — appear on hover */
.card::before, .card::after {
  content: ''; position: absolute; z-index: 2;
  width: 14px; height: 14px;
  opacity: 0;
  transition: opacity var(--t) var(--ease);
  pointer-events: none;
}
.card::before {
  top: 8px; left: 8px;
  border-top: 1.5px solid var(--cu);
  border-left: 1.5px solid var(--cu);
  border-top-left-radius: 3px;
}
.card::after {
  bottom: 8px; right: 8px;
  border-bottom: 1.5px solid var(--cu);
  border-right: 1.5px solid var(--cu);
  border-bottom-right-radius: 3px;
}
.card:hover {
  border-color: var(--bd-2);
  box-shadow: var(--sh-cu);
  transform: translateY(-3px);
}
.card:hover::before, .card:hover::after { opacity: 1; }
.card-body { padding: 1.4rem; }
.card-footer {
  padding: 0.875rem 1.4rem;
  border-top: 1px solid var(--bd);
}

/* Schematic card */
.schematic-card { cursor: pointer; display: block !important; text-decoration: none !important; }
.schematic-card .card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-2);
}
.schematic-card .card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s var(--ease);
  filter: brightness(0.9);
}
.schematic-card:hover .card-image img {
  transform: scale(1.05);
  filter: brightness(1);
}
.card-image-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--bd-2);
  background: linear-gradient(145deg, var(--bg-2), var(--bg-4));
}
.card-badges {
  position: absolute; top: 10px; left: 10px;
  display: flex; gap: 5px; flex-wrap: wrap;
}
.card-featured {
  position: absolute; top: 10px; right: 10px;
  background: var(--cu);
  color: #080705; font-family: var(--f-mono);
  font-size: 0.65rem; font-weight: 500;
  padding: 3px 9px; border-radius: 4px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.card-meta {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 0.75rem; margin-top: 0.875rem;
}
.card-stats { display: flex; gap: 0.875rem; }
.card-stat {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.76rem; color: var(--tx-3);
  font-family: var(--f-mono);
}
.card-author { display: flex; align-items: center; gap: 7px; }
.card-author-name { font-size: 0.76rem; color: var(--tx-3); }

/* ═══════════════════════════════════════════
   GRID
═══════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════
   BADGES & TAGS
═══════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 4px;
  font-family: var(--f-mono); font-size: 0.7rem;
  font-weight: 500; letter-spacing: 0.04em;
}
.badge-green  { background: var(--green-sub);  color: var(--green);  border: 1px solid rgba(52,211,153,0.25); }
.badge-blue   { background: rgba(34,211,238,.08); color: var(--cyan); border: 1px solid rgba(34,211,238,.2); }
.badge-amber  { background: rgba(251,191,36,.1); color: var(--amber); border: 1px solid rgba(251,191,36,.25); }
.badge-red    { background: rgba(248,113,113,.1); color: var(--red);  border: 1px solid rgba(248,113,113,.25); }
.badge-purple { background: rgba(167,139,250,.1); color: var(--violet); border: 1px solid rgba(167,139,250,.25); }
.badge-gray   { background: var(--bg-4); color: var(--tx-3); border: 1px solid var(--bd-2); }
.tag {
  display: inline-flex; align-items: center;
  background: var(--bg-4); border: 1px solid var(--bd);
  color: var(--tx-3); padding: 3px 9px;
  border-radius: 4px; font-family: var(--f-mono);
  font-size: 0.7rem;
}

/* ═══════════════════════════════════════════
   AVATAR
═══════════════════════════════════════════ */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-display); font-size: 0.78rem; font-weight: 700;
  flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, var(--cu-lo), var(--cu-hi));
  color: #0a0705;
  border: 1px solid var(--cu-line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm  { width: 28px; height: 28px; font-size: 0.68rem; }
.avatar-lg  { width: 54px; height: 54px; font-size: 1.1rem; }
.avatar-xl  { width: 96px; height: 96px; font-size: 1.8rem; }

/* ═══════════════════════════════════════════
   FORMS
═══════════════════════════════════════════ */
.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 0.8rem; font-weight: 600;
  color: var(--tx-2); letter-spacing: 0.02em;
}
.form-control {
  width: 100%; padding: 10px 13px;
  background: var(--bg-4); border: 1px solid var(--bd-2);
  border-radius: var(--r-sm); color: var(--tx-1);
  font-family: var(--f-body); font-size: 0.875rem;
  transition: var(--t) var(--ease); outline: none;
  line-height: 1.5;
}
.form-control:focus {
  border-color: var(--cu);
  box-shadow: 0 0 0 3px var(--cu-sub);
}
.form-control::placeholder { color: var(--tx-3); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235c503a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px; appearance: none;
}
.form-hint  { font-size: 0.76rem; color: var(--tx-3); margin-top: 5px; }
.form-error { font-size: 0.76rem; color: var(--red);   margin-top: 5px; }

/* Upload zone */
.upload-zone {
  border: 1.5px dashed var(--bd-2);
  border-radius: var(--r);
  padding: 2.5rem; text-align: center; cursor: pointer;
  transition: var(--t) var(--ease);
  background: var(--bg-2);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--cu);
  background: var(--cu-sub);
}
.upload-zone-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.upload-zone p { color: var(--tx-2); font-size: 0.83rem; }
.upload-zone strong { color: var(--cu-hi); }

/* ═══════════════════════════════════════════
   AUTH PAGES
═══════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(212,130,26,0.07) 0%, transparent 70%),
    var(--bg);
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(212,130,26,0.07) 0%, transparent 70%),
    radial-gradient(circle, var(--tx-4) 1px, transparent 1px);
  background-size: auto, 28px 28px;
}
.auth-card {
  background: var(--bg-3);
  border: 1px solid var(--bd-2);
  border-radius: var(--r-xl);
  padding: 2.5rem;
  width: 100%; max-width: 400px;
  box-shadow: var(--sh-lg);
  position: relative;
}
/* Corner accents on auth card */
.auth-card::before {
  content: '';
  position: absolute; top: 14px; left: 14px; right: 14px; bottom: 14px;
  border: 1px solid var(--cu-line);
  border-radius: calc(var(--r-xl) - 6px);
  pointer-events: none;
  opacity: 0.5;
}
.auth-title {
  font-family: var(--f-display);
  font-size: 1.7rem; font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 0.3rem;
}
.auth-subtitle { color: var(--tx-3); font-size: 0.83rem; margin-bottom: 2rem; }
.auth-divider {
  display: flex; align-items: center; gap: 1rem;
  color: var(--tx-3); font-size: 0.78rem; margin: 1.5rem 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--bd);
}

/* ═══════════════════════════════════════════
   SCHEMATIC DETAIL
═══════════════════════════════════════════ */
.schematic-detail { padding: 2.5rem 0 4rem; }
.schematic-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
}
@media (max-width: 900px) { .schematic-layout { grid-template-columns: 1fr; } }

.schematic-image-main {
  background: var(--bg-2);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
}
.schematic-image-main img {
  width: 100%; height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}
.schematic-sidebar { display: flex; flex-direction: column; gap: 1.2rem; }
.info-card {
  background: var(--bg-3);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 1.2rem;
}
.info-card h3 {
  font-family: var(--f-mono);
  font-size: 0.68rem; font-weight: 500;
  color: var(--cu); letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 1rem;
}

/* Parts table */
.parts-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.parts-table th {
  background: var(--bg-4);
  color: var(--tx-3);
  font-family: var(--f-mono); font-size: 0.65rem;
  font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 7px 11px; text-align: left;
}
.parts-table th:first-child { border-radius: var(--r-sm) 0 0 0; }
.parts-table th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
.parts-table td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--bd);
  color: var(--tx-2);
}
.parts-table tr:last-child td { border-bottom: none; }
.parts-table tbody tr:hover td { background: var(--bg-4); }
.part-value { font-family: var(--f-mono); color: var(--cu-hi); font-size: 0.8rem; }

/* Datasheet items */
.datasheet-item {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--bd);
  gap: 1rem;
}
.datasheet-item:last-child { border-bottom: none; }
.datasheet-name { font-size: 0.83rem; font-weight: 500; }
.datasheet-size { font-family: var(--f-mono); font-size: 0.7rem; color: var(--tx-3); margin-top: 2px; }
.datasheet-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ═══════════════════════════════════════════
   VOTE BUTTONS
═══════════════════════════════════════════ */
.vote-section { display: flex; align-items: center; gap: 0.625rem; }
.vote-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--r-sm);
  background: var(--bg-4); border: 1px solid var(--bd-2);
  color: var(--tx-2);
  font-family: var(--f-mono); font-size: 0.83rem;
  cursor: pointer; transition: var(--t) var(--ease);
}
.vote-btn:hover { border-color: var(--bd-3); color: var(--tx-1); }
.vote-btn.active-like    { background: var(--green-sub); border-color: rgba(52,211,153,.35); color: var(--green); }
.vote-btn.active-dislike { background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.3); color: var(--red); }

/* ═══════════════════════════════════════════
   COMMENTS
═══════════════════════════════════════════ */
.comment {
  display: flex; gap: 1rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--bd);
}
.comment:last-child { border-bottom: none; }
.comment-body { flex: 1; }
.comment-header {
  display: flex; align-items: center; gap: 9px; margin-bottom: 0.5rem;
}
.comment-username { font-family: var(--f-display); font-size: 0.83rem; font-weight: 700; }
.comment-time { font-family: var(--f-mono); font-size: 0.7rem; color: var(--tx-3); }
.comment-text { font-size: 0.875rem; color: var(--tx-2); line-height: 1.75; }
.comment-form { margin-top: 1.5rem; }

/* ═══════════════════════════════════════════
   CATEGORY PILLS
═══════════════════════════════════════════ */
.category-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.cat-pill {
  padding: 6px 14px; border-radius: 100px;
  background: var(--bg-3); border: 1px solid var(--bd);
  color: var(--tx-2); font-size: 0.78rem; font-weight: 500;
  cursor: pointer; transition: var(--t) var(--ease); text-decoration: none;
  font-family: var(--f-mono); letter-spacing: 0.02em;
}
.cat-pill:hover { background: var(--bg-5); border-color: var(--bd-3); color: var(--tx-1); }
.cat-pill.active {
  background: var(--cu-sub);
  border-color: var(--cu-line);
  color: var(--cu-hi);
}

/* ═══════════════════════════════════════════
   SEARCH & FILTER
═══════════════════════════════════════════ */
.search-bar {
  display: flex; align-items: center;
  background: var(--bg-4); border: 1px solid var(--bd-2);
  border-radius: var(--r-sm); padding: 9px 13px; gap: 9px;
  transition: var(--t) var(--ease);
}
.search-bar:focus-within {
  border-color: var(--cu);
  box-shadow: 0 0 0 3px var(--cu-sub);
}
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--tx-1); font-family: var(--f-body); font-size: 0.875rem;
}
.search-bar input::placeholder { color: var(--tx-3); }
.search-icon { color: var(--tx-3); font-size: 0.9rem; }
.filter-bar {
  background: var(--bg-3); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 1rem 1.2rem; margin-bottom: 2rem;
}
.filter-bar form {
  display: flex; gap: 0.875rem; flex-wrap: wrap; align-items: center; width: 100%;
}
.filter-bar .search-wrap { flex: 1; min-width: 200px; }
.filter-select {
  background: var(--bg-4); border: 1px solid var(--bd-2);
  border-radius: var(--r-sm); color: var(--tx-1);
  padding: 9px 36px 9px 13px;
  font-family: var(--f-body); font-size: 0.8rem;
  cursor: pointer; outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235c503a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: var(--t) var(--ease);
}
.filter-select:focus { border-color: var(--cu); outline: none; }

/* ═══════════════════════════════════════════
   PROFILE
═══════════════════════════════════════════ */
.profile-header {
  background: var(--bg-3); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: 2rem;
  display: flex; align-items: flex-start; gap: 1.5rem;
  margin-bottom: 2rem;
  position: relative; overflow: hidden;
}
.profile-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cu), transparent);
}
.profile-info h1 {
  font-family: var(--f-display);
  font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em;
}
.profile-bio { color: var(--tx-2); margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.65; }
.profile-meta { display: flex; gap: 2rem; margin-top: 1rem; flex-wrap: wrap; }
.profile-meta-item { font-size: 0.78rem; color: var(--tx-3); font-family: var(--f-mono); }
.profile-meta-item strong { color: var(--tx-1); font-weight: 600; }

/* ═══════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════ */
.alert {
  padding: 11px 15px; border-radius: var(--r-sm);
  font-size: 0.83rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 9px;
}
.alert-success { background: var(--green-sub); border: 1px solid rgba(52,211,153,.3); color: var(--green); }
.alert-error   { background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.3); color: var(--red); }
.alert-info    { background: var(--cu-sub); border: 1px solid var(--cu-line); color: var(--cu-hi); }
.alert-warning { background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.3); color: var(--amber); }

/* ═══════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════ */
.pagination { display: flex; gap: 0.35rem; justify-content: center; margin-top: 3rem; }
.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: var(--bg-3); border: 1px solid var(--bd);
  color: var(--tx-2); font-family: var(--f-mono); font-size: 0.83rem;
  cursor: pointer; transition: var(--t) var(--ease);
  text-decoration: none;
}
.page-btn:hover { background: var(--bg-5); border-color: var(--bd-3); color: var(--tx-1); }
.page-btn.active {
  background: var(--cu); border-color: var(--cu);
  color: #0a0705; font-weight: 600;
  box-shadow: 0 2px 10px var(--cu-glow);
}

/* ═══════════════════════════════════════════
   MODAL
═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(4,3,2,0.9); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; opacity: 0; pointer-events: none;
  transition: opacity 0.22s var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-3); border: 1px solid var(--bd-2);
  border-radius: var(--r-xl); max-width: 900px; width: 100%;
  max-height: 90vh; overflow: auto;
  transform: translateY(10px) scale(0.97);
  transition: transform 0.22s var(--ease);
}
.modal-overlay.open .modal { transform: none; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--bd);
}
.modal-title { font-family: var(--f-display); font-size: 0.95rem; font-weight: 700; }
.modal-body { padding: 1.5rem; }
.pdf-embed { width: 100%; height: 75vh; border: none; border-radius: var(--r-sm); background: #fff; }

/* ═══════════════════════════════════════════
   ADMIN LAYOUT
═══════════════════════════════════════════ */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 248px; flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--bd);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar-brand {
  padding: 1.4rem 1.2rem 1rem;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--bd);
}
.admin-sidebar-brand > div:first-child {
  font-size: 0.95rem; font-family: var(--f-display); font-weight: 700;
}
.admin-nav { padding: 0.875rem 0.75rem; flex: 1; }
.admin-nav-section {
  font-family: var(--f-mono); font-size: 0.62rem; font-weight: 500;
  color: var(--tx-3); text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0.875rem 0.5rem 0.35rem; margin-top: 0.4rem;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; border-radius: var(--r-sm);
  color: var(--tx-2); font-size: 0.83rem; font-weight: 500;
  text-decoration: none; transition: var(--t) var(--ease);
  margin-bottom: 1px;
}
.admin-nav-item:hover { background: var(--bg-4); color: var(--tx-1); }
.admin-nav-item.active {
  background: var(--cu-sub);
  color: var(--cu-hi);
  border-left: 2px solid var(--cu);
  padding-left: 9px;
}
.admin-nav-item .badge { margin-left: auto; }
.admin-main { flex: 1; overflow: auto; min-width: 0; }
.admin-topbar {
  background: var(--bg-2); border-bottom: 1px solid var(--bd);
  padding: 0 2rem; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  font-family: var(--f-display); font-weight: 600; font-size: 0.9rem;
}
.admin-content { padding: 2rem; }
.admin-title {
  font-family: var(--f-display);
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 0.25rem;
}
.admin-subtitle { color: var(--tx-3); font-size: 0.83rem; margin-bottom: 2rem; }

/* Stat cards */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--bg-3); border: 1px solid var(--bd);
  border-radius: var(--r); padding: 1.35rem;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cu-line), transparent);
  opacity: 0; transition: opacity var(--t) var(--ease);
}
.stat-card:hover::after { opacity: 1; }
.stat-card-label {
  font-family: var(--f-mono); font-size: 0.65rem;
  font-weight: 500; color: var(--tx-3);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.stat-card-value {
  font-family: var(--f-display);
  font-size: 2rem; font-weight: 800;
  margin-top: 0.35rem; letter-spacing: -0.02em;
}
.stat-card-icon {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; margin-bottom: 0.875rem;
}

/* Admin table */
.admin-table-wrap {
  background: var(--bg-3); border: 1px solid var(--bd);
  border-radius: var(--r-lg); overflow: hidden;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  background: var(--bg-4); color: var(--tx-3);
  font-family: var(--f-mono); font-size: 0.65rem;
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.09em;
  padding: 11px 15px; text-align: left; white-space: nowrap;
}
.admin-table td { padding: 12px 15px; border-bottom: 1px solid var(--bd); font-size: 0.83rem; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--bg-4); }
.admin-table-actions { display: flex; gap: 5px; }

/* Status */
.status-pending  { background: rgba(251,191,36,.1); color: var(--amber); border: 1px solid rgba(251,191,36,.3); border-radius: 4px; padding: 3px 8px; font-family: var(--f-mono); font-size: 0.67rem; font-weight: 500; letter-spacing: 0.04em; }
.status-approved { background: var(--green-sub); color: var(--green); border: 1px solid rgba(52,211,153,.3); border-radius: 4px; padding: 3px 8px; font-family: var(--f-mono); font-size: 0.67rem; font-weight: 500; letter-spacing: 0.04em; }
.status-rejected { background: rgba(248,113,113,.08); color: var(--red); border: 1px solid rgba(248,113,113,.3); border-radius: 4px; padding: 3px 8px; font-family: var(--f-mono); font-size: 0.67rem; font-weight: 500; letter-spacing: 0.04em; }

/* Component row */
.component-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1.5fr 1fr;
  gap: 0.625rem; align-items: start; margin-bottom: 0.625rem;
  background: var(--bg-4); padding: 0.75rem; border-radius: var(--r-sm);
  border: 1px solid var(--bd);
}
@media (max-width: 700px) { .component-row { grid-template-columns: 1fr 1fr; } }

/* ═══════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 5rem 2rem; color: var(--tx-3);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { font-family: var(--f-display); font-size: 1.1rem; color: var(--tx-2); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.83rem; }

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--bd); margin-top: 5rem;
  padding: 2.5rem 0 2rem; color: var(--tx-3); font-size: 0.78rem;
}
.footer-inner {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-brand {
  font-family: var(--f-display);
  font-size: 0.95rem; font-weight: 700; color: var(--tx-2);
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--tx-3); transition: color var(--t); }
.footer-links a:hover { color: var(--cu-hi); }

/* ═══════════════════════════════════════════
   MISC
═══════════════════════════════════════════ */
.divider { height: 1px; background: var(--bd); margin: 1.5rem 0; }
.breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: 0.72rem;
  color: var(--tx-3); margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--tx-3); }
.breadcrumb a:hover { color: var(--cu-hi); }
.breadcrumb-sep { color: var(--bd-2); }

/* Toggle */
.toggle-wrap { display: flex; align-items: center; gap: 9px; }
.toggle-input { display: none; }
.toggle-label {
  width: 42px; height: 22px; background: var(--bd-2);
  border-radius: 100px; cursor: pointer; position: relative;
  transition: background var(--t) var(--ease);
}
.toggle-label::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; background: var(--tx-2);
  border-radius: 50%; transition: var(--t) var(--ease);
}
.toggle-input:checked + .toggle-label { background: var(--cu); }
.toggle-input:checked + .toggle-label::after {
  transform: translateX(20px);
  background: #0a0705;
}

/* Spinner */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--bd-2);
  border-top-color: var(--cu);
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Utilities */
.text-muted         { color: var(--tx-3); }
.text-primary-color { color: var(--cu-hi); }
.text-cyan          { color: var(--cyan); }
.text-green         { color: var(--green); }
.text-red           { color: var(--red); }
.text-amber         { color: var(--amber); }
.font-mono          { font-family: var(--f-mono); }
.w-full             { width: 100%; }
.hidden             { display: none !important; }
.flex               { display: flex; }
.items-center       { align-items: center; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.fade-up { animation: fadeUp 0.45s var(--ease) both; }

/* Staggered card entrance */
.grid-3 .card, .grid-4 .card, .grid-2 .card {
  animation: fadeUp 0.4s var(--ease) both;
}
.grid-3 .card:nth-child(2), .grid-4 .card:nth-child(2), .grid-2 .card:nth-child(2) { animation-delay: 0.07s; }
.grid-3 .card:nth-child(3), .grid-4 .card:nth-child(3) { animation-delay: 0.14s; }
.grid-4 .card:nth-child(4) { animation-delay: 0.21s; }

/* ═══════════════════════════════════════════
   GLOW UTILITIES
═══════════════════════════════════════════ */
.glow-cu    { box-shadow: 0 0 20px var(--cu-glow); }
.glow-green { box-shadow: 0 0 20px var(--green-glow); }
