@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg: #0D0F14;
  --bg-2: #13161E;
  --bg-3: #1A1E28;
  --bg-4: #222836;
  --border: #252B3B;
  --border-2: #2E3547;
  --text: #E8E6DF;
  --text-2: #9A9690;
  --text-3: #5E5C58;
  --amber: #F5A623;
  --amber-dim: #C6841C;
  --amber-glow: rgba(245, 166, 35, 0.12);
  --green: #22C55E;
  --blue: #3B82F6;
  --red: #EF4444;
  --purple: #8B5CF6;
  --pink: #EC4899;
  --teal: #14B8A6;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.6), 0 1px 4px rgba(0,0,0,0.4);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── LAYOUT ─── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}
.main-content {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  max-width: 100%;
}
.content-area {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
}
.content-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ─── SIDEBAR ─── */
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: -0.5px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-dot { width: 8px; height: 8px; background: var(--amber); border-radius: 50%; }
.logo-sub { font-size: 11px; color: var(--text-3); font-family: var(--font-body); font-weight: 400; margin-top: 1px; text-transform: uppercase; letter-spacing: 1px; }

.sidebar-user {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-4);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--amber);
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border-2);
}
.user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.user-info-sm { min-width: 0; }
.user-name-sm { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-company-sm { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { padding: 8px 0; flex: 1; }
.nav-section { padding: 0 12px; margin-bottom: 4px; }
.nav-section-title { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-3); padding: 12px 8px 4px; font-weight: 500; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: all var(--transition);
  position: relative;
}
.nav-link:hover { background: var(--bg-3); color: var(--text); }
.nav-link.active { background: var(--amber-glow); color: var(--amber); font-weight: 500; }
.nav-link .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--amber);
  color: #000;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  text-decoration: none;
  font-size: 13px;
  transition: color var(--transition);
}
.sidebar-logout:hover { color: var(--red); }

/* ─── TOP BAR ─── */
.topbar {
  height: 52px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  color: var(--text);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ─── TYPOGRAPHY ─── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; color: var(--text); }
h1 { font-size: 32px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--amber); color: #000; }
.btn-primary:hover { background: #FFB83D; color: #000; text-decoration: none; }
.btn-secondary { background: var(--bg-4); color: var(--text); border: 1px solid var(--border-2); }
.btn-secondary:hover { background: var(--bg-3); border-color: var(--border-2); color: var(--text); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-3); color: var(--text); text-decoration: none; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #DC2626; color: #fff; text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 4px; }
.btn-icon { padding: 8px; border-radius: var(--radius); }

/* ─── CARDS ─── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-sm { padding: 14px 16px; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 12px;
  transition: border-color var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-select { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.form-error { font-size: 13px; color: var(--red); margin-top: 4px; }
.error-box {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  color: #FCA5A5;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}
.badge-amber { background: var(--amber-glow); color: var(--amber); border: 1px solid rgba(245,166,35,0.25); }
.badge-green { background: rgba(34,197,94,0.1); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.badge-blue { background: rgba(59,130,246,0.1); color: var(--blue); border: 1px solid rgba(59,130,246,0.2); }
.badge-purple { background: rgba(139,92,246,0.1); color: var(--purple); border: 1px solid rgba(139,92,246,0.2); }
.badge-red { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.badge-gray { background: var(--bg-4); color: var(--text-2); border: 1px solid var(--border); }

/* ─── FORUM ─── */
.post-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.post-row:last-child { border-bottom: none; }
.post-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 36px;
}
.vote-count { font-size: 13px; font-weight: 600; color: var(--text-2); font-family: var(--font-mono); }
.vote-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 14px;
  transition: all var(--transition);
}
.vote-btn:hover, .vote-btn.voted { color: var(--amber); }
.post-body { flex: 1; min-width: 0; }
.post-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
  line-height: 1.4;
}
.post-title:hover { color: var(--amber); text-decoration: none; }
.post-pinned .post-title::before { content: '📌 '; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text-3); }
.post-meta a { color: var(--text-2); }
.post-meta a:hover { color: var(--amber); }
.cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255,255,255,0.06);
  color: var(--text-2);
  text-decoration: none;
}
.cat-tag:hover { text-decoration: none; color: var(--text); }
.post-stats { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); }

/* Thread */
.thread-header {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 8px;
}
.thread-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.3;
}
.thread-body {
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
}
.thread-body p { margin-bottom: 12px; }
.thread-body p:last-child { margin-bottom: 0; }
.thread-body strong { color: var(--text); font-weight: 600; }
.thread-body ul, .thread-body ol { padding-left: 20px; margin-bottom: 12px; }
.thread-body li { margin-bottom: 4px; }
.thread-body code {
  font-family: var(--font-mono);
  background: var(--bg-4);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}
.thread-body pre { background: var(--bg-4); padding: 16px; border-radius: var(--radius); overflow-x: auto; margin-bottom: 12px; }
.thread-body pre code { background: none; padding: 0; }

.reply-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 8px;
}
.reply-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.reply-body { color: var(--text); line-height: 1.7; font-size: 14px; }
.reply-body p { margin-bottom: 8px; }
.reply-footer { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.accepted-badge { background: rgba(34,197,94,0.1); color: var(--green); border: 1px solid rgba(34,197,94,0.2); padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }

/* ─── DIRECTORY ─── */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.member-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-decoration: none;
  display: block;
  transition: all var(--transition);
}
.member-card:hover {
  border-color: var(--border-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.member-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-4);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-name { font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.member-company { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.member-tagline { font-size: 12px; color: var(--text-3); line-height: 1.4; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.member-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-pill { background: var(--bg-4); color: var(--text-3); font-size: 10px; padding: 2px 7px; border-radius: 10px; border: 1px solid var(--border); }

/* ─── RESOURCES ─── */
.resource-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.resource-icon { font-size: 22px; width: 40px; text-align: center; flex-shrink: 0; margin-top: 2px; }
.resource-title { font-size: 14px; font-weight: 500; color: var(--text); text-decoration: none; display: block; margin-bottom: 3px; }
.resource-title:hover { color: var(--amber); }
.resource-desc { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.resource-tag { background: var(--bg-4); color: var(--text-3); font-size: 10px; padding: 1px 6px; border-radius: 8px; border: 1px solid var(--border); }

/* ─── STATS BAR ─── */
.stats-row { display: flex; gap: 12px; margin-bottom: 24px; }
.stat-card {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  text-align: center;
}
.stat-number { font-family: var(--font-display); font-size: 32px; font-weight: 600; color: var(--amber); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ─── AUTH PAGES ─── */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-image: radial-gradient(ellipse at 50% 0%, rgba(245,166,35,0.06) 0%, transparent 60%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo-text {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: -0.5px;
}
.auth-title { font-size: 20px; font-weight: 500; margin-bottom: 4px; text-align: center; }
.auth-sub { font-size: 14px; color: var(--text-3); text-align: center; margin-bottom: 28px; }

/* ─── NOTIFICATIONS ─── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg-3);
  margin-bottom: 6px;
  font-size: 13px;
}
.notif-dot { width: 6px; height: 6px; background: var(--amber); border-radius: 50%; flex-shrink: 0; margin-top: 5px; }

/* ─── MISC ─── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-muted { color: var(--text-3); }
.text-amber { color: var(--amber); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.justify-between { justify-content: space-between; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.w-full { width: 100%; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-title { font-size: 16px; color: var(--text-2); margin-bottom: 6px; }

/* Admin table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-3); border-bottom: 1px solid var(--border); font-weight: 500; }
.data-table td { padding: 12px; font-size: 13px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-3); }

/* Category sidebar */
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 13px;
  color: var(--text-2);
  transition: all var(--transition);
}
.cat-item:hover, .cat-item.active { background: var(--bg-3); color: var(--text); text-decoration: none; }
.cat-count { margin-left: auto; font-size: 11px; color: var(--text-3); font-family: var(--font-mono); }

/* Two-col layout */
.two-col { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.two-col-reverse { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.filter-bar .form-input, .filter-bar .form-select { width: auto; flex: 1; min-width: 120px; padding: 8px 12px; }

/* Profile */
.profile-hero {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.profile-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--bg-4);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--amber);
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--border-2);
}
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

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

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.3s ease forwards; }

/* Mobile */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .two-col, .two-col-reverse { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { flex-wrap: wrap; }
  .content-area, .content-wide { padding: 16px; }
}
