/* ============================================================
   OrgForge — Master Stylesheet
   Design tokens: bg #0a0a0f | card #13131a | border #1e1e2e
   Accent blue #4f8ef7 | Gold #f5c518
   Text #e8e8f0 | Muted #6b6b80
   Font: Inter | Radius: 8px
   ============================================================ */

/* ── Google Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  --bg:           #0a0a0f;
  --card:         #13131a;
  --border:       #1e1e2e;
  --blue:         #4f8ef7;
  --gold:         #f5c518;
  --text:         #e8e8f0;
  --muted:        #6b6b80;
  --sidebar:      #0d0d14;
  --sidebar-w:    240px;
  --radius:       8px;
  --radius-lg:    12px;
  --transition:   all 0.2s ease;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: var(--transition);
}

a:hover { opacity: 0.85; }

img, svg { display: block; max-width: 100%; }

ul, ol { list-style: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button { cursor: pointer; }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
}

p { color: var(--muted); }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ── Utility Classes ───────────────────────────────────────── */
.hidden          { display: none !important; }
.flex            { display: flex; }
.flex-col        { display: flex; flex-direction: column; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.items-end       { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-wrap       { flex-wrap: wrap; }
.flex-1          { flex: 1; }
.w-full          { width: 100%; }
.h-full          { height: 100%; }
.relative        { position: relative; }
.absolute        { position: absolute; }
.fixed           { position: fixed; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.text-center     { text-align: center; }
.text-right      { text-align: right; }
.text-muted      { color: var(--muted) !important; }
.text-accent     { color: var(--blue) !important; }
.text-gold       { color: var(--gold) !important; }
.text-danger     { color: #e74c3c !important; }
.text-success    { color: #2ecc71 !important; }
.text-sm         { font-size: 0.875rem; }
.text-xs         { font-size: 0.75rem; }
.text-lg         { font-size: 1.125rem; }
.text-xl         { font-size: 1.25rem; }
.font-bold       { font-weight: 700; }
.font-semibold   { font-weight: 600; }
.font-medium     { font-weight: 500; }
.rounded         { border-radius: var(--radius); }
.rounded-full    { border-radius: 9999px; }
.rounded-lg      { border-radius: var(--radius-lg); }
.shadow          { box-shadow: 0 4px 24px rgba(0,0,0,0.4); }
.cursor-pointer  { cursor: pointer; }
.select-none     { user-select: none; }
.opacity-0       { opacity: 0; }
.opacity-50      { opacity: 0.5; }

/* Gap utilities */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Margin utilities */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

/* Padding utilities */
.p-1  { padding: 0.25rem; }
.p-2  { padding: 0.5rem; }
.p-3  { padding: 0.75rem; }
.p-4  { padding: 1rem; }
.p-6  { padding: 1.5rem; }
.p-8  { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Grid */
.grid        { display: grid; }
.grid-2      { grid-template-columns: repeat(2, 1fr); }
.grid-3      { grid-template-columns: repeat(3, 1fr); }
.grid-4      { grid-template-columns: repeat(4, 1fr); }

/* Fade-in animation class for IntersectionObserver */
.fade-in-target {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in-target.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
}
.btn-primary:hover {
  filter: brightness(1.12);
  color: #fff;
  opacity: 1;
}

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
}
.btn-outline:hover {
  background: var(--blue);
  color: #fff;
  opacity: 1;
}

.btn-gold {
  background: var(--gold);
  color: #0a0a0f;
  border: 1px solid var(--gold);
  font-weight: 700;
}
.btn-gold:hover {
  filter: brightness(1.1);
  opacity: 1;
  color: #0a0a0f;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--text);
  background: rgba(79,142,247,0.08);
  opacity: 1;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
  border: 1px solid #e74c3c;
}
.btn-danger:hover {
  filter: brightness(1.1);
  opacity: 1;
  color: #fff;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}
.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius);
}

/* ── Navigation ────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-logo:hover { opacity: 1; color: var(--text); }
.nav-logo .logo-bolt {
  font-size: 1.4rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--blue);
  transition: width 0.2s ease;
}
.nav-links a:hover {
  color: var(--text);
  opacity: 1;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a.active {
  color: var(--text);
}
.nav-links a.active::after { width: 100%; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1100;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav overlay */
.nav-mobile {
  display: none;
  position: fixed;
  top: 64px;
  left: 0; right: 0; bottom: 0;
  background: rgba(10,10,15,0.97);
  backdrop-filter: blur(16px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  animation: fadeIn 0.2s ease;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Hero Section ──────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 2rem 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Floating org chart nodes in hero bg */
@keyframes float-node {
  0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.06; }
  33%       { transform: translateY(-18px) rotate(1deg); opacity: 0.1; }
  66%       { transform: translateY(-8px) rotate(-1deg); opacity: 0.07; }
}

.hero-float-node {
  position: absolute;
  width: 160px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  opacity: 0.08;
  animation: float-node var(--duration, 6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  pointer-events: none;
}
.hero-float-node .fn-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
}
.hero-float-node .fn-sub {
  font-size: 10px;
  color: var(--muted);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(79,142,247,0.1);
  border: 1px solid rgba(79,142,247,0.3);
  border-radius: 9999px;
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--blue);
  margin-bottom: 1.5rem;
  animation: fadeIn 0.6s ease;
}

.hero h1 {
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  animation: fadeIn 0.7s ease 0.1s both;
}

.text-gradient {
  background: linear-gradient(135deg, var(--blue) 0%, #7b5ef8 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p.hero-sub {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  animation: fadeIn 0.7s ease 0.2s both;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  animation: fadeIn 0.7s ease 0.3s both;
}

.trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  animation: fadeIn 0.7s ease 0.4s both;
}
.trust-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
.trust-badge .icon { color: var(--blue); }

/* ── Sections ──────────────────────────────────────────────── */
.section {
  padding: 5rem 2rem;
}
.section-sm { padding: 3rem 2rem; }
.container {
  max-width: 1120px;
  margin: 0 auto;
}
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-header .eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin-bottom: 0.75rem;
}
.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.section-header p {
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ── Feature Cards ─────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  animation: fadeIn 0.5s ease both;
}
.feature-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(79,142,247,0.12);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
  background: rgba(79,142,247,0.12);
  border: 1px solid rgba(79,142,247,0.2);
}
.feature-icon.gold  { background: rgba(245,197,24,0.12); border-color: rgba(245,197,24,0.2); }
.feature-icon.green { background: rgba(46,204,113,0.12); border-color: rgba(46,204,113,0.2); }
.feature-icon.purple{ background: rgba(155,89,182,0.12); border-color: rgba(155,89,182,0.2); }
.feature-icon.red   { background: rgba(231,76,60,0.12);  border-color: rgba(231,76,60,0.2);  }
.feature-icon.orange{ background: rgba(243,156,18,0.12); border-color: rgba(243,156,18,0.2); }

.feature-card h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ── Pricing Section ───────────────────────────────────────── */
.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.pricing-toggle label {
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}
.pricing-toggle label.active { color: var(--text); font-weight: 600; }
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 9999px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 4px; top: 4px;
  background: #fff;
  border-radius: 9999px;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--blue); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.pricing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  position: relative;
}
.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.pricing-card.popular {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(79,142,247,0.3), 0 8px 40px rgba(79,142,247,0.15);
}

.popular-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.875rem;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pricing-plan-name {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.pricing-price {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.pricing-price .price-num {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
}
.pricing-price .price-currency {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}
.pricing-price .price-period {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.pricing-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  min-height: 40px;
}

.pricing-features {
  margin-bottom: 2rem;
}
.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--text);
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(30,30,46,0.5);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li .check {
  color: var(--blue);
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.pricing-features li .cross {
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 1px;
}
.pricing-features li.disabled { color: var(--muted); }

/* ── Auth Pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  animation: fadeIn 0.4s ease;
}

.auth-card .auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.auth-card h2 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.375rem;
}
.auth-card .auth-sub {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* Form elements */
.form-group {
  margin-bottom: 1.125rem;
}
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.375rem;
}
.form-label .required { color: #e74c3c; margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  appearance: none;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--muted); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.15);
  background: rgba(30,30,46,0.8);
}
.form-input.error,
.form-select.error {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231,76,60,0.12);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b80' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-help {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.form-error {
  font-size: 0.75rem;
  color: #e74c3c;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Password field wrapper */
.password-wrapper {
  position: relative;
}
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  transition: color 0.2s;
}
.password-toggle:hover { color: var(--text); }

/* Strength bar */
.strength-bar-wrapper {
  margin-top: 0.5rem;
}
.strength-bar {
  height: 4px;
  border-radius: 9999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 4px;
}
.strength-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease, background 0.3s ease;
  width: 0%;
}
.strength-bar-fill.weak   { background: #e74c3c; width: 25%; }
.strength-bar-fill.fair   { background: #f39c12; width: 50%; }
.strength-bar-fill.good   { background: var(--gold); width: 75%; }
.strength-bar-fill.strong { background: #2ecc71; width: 100%; }
.strength-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 0.8125rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.auth-footer a { color: var(--blue); }

/* ── Dashboard Layout ──────────────────────────────────────── */
.dashboard-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 200;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-logo {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.sidebar-logo a:hover { opacity: 1; }
.sidebar-logo .bolt { font-size: 1.2rem; }

.sidebar-user {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #7b5ef8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
}
.plan-badge.free     { background: rgba(107,107,128,0.2); color: var(--muted); }
.plan-badge.pro      { background: rgba(79,142,247,0.2);  color: var(--blue); }
.plan-badge.business { background: rgba(245,197,24,0.2);  color: var(--gold); }
.plan-badge.admin    { background: rgba(231,76,60,0.2);   color: #e74c3c; }

.sidebar-new-btn {
  margin: 1rem;
  width: calc(100% - 2rem);
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.sidebar-new-btn:hover {
  filter: brightness(1.12);
  color: #fff;
  opacity: 1;
}

.sidebar-nav { flex: 1; padding: 0.5rem 0; }

.sidebar-nav-section {
  padding: 0 1rem;
  margin-bottom: 0.25rem;
}
.sidebar-nav-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0.75rem 0 0.25rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  margin-bottom: 2px;
}
.sidebar-nav-item:hover {
  background: var(--card);
  color: var(--text);
  opacity: 1;
}
.sidebar-nav-item.active {
  background: var(--card);
  color: var(--text);
  border-left: 2px solid var(--blue);
  padding-left: calc(0.625rem - 2px);
}
.sidebar-nav-item .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.sidebar-nav-item .nav-badge {
  margin-left: auto;
  background: var(--blue);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9999px;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 0.4rem 0;
}
.sidebar-footer a:hover { color: var(--text); opacity: 1; }

/* Main dashboard content */
.dashboard-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  overflow-y: auto;
  height: 100vh;
  padding: 0;
  background: var(--bg);
}

.dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-content {
  padding: 1.5rem;
}

.page-header {
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}
.page-header p { font-size: 0.875rem; color: var(--muted); }

/* ── Stats Cards ───────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: var(--transition);
  animation: fadeIn 0.4s ease both;
}
.stat-card:hover {
  border-color: rgba(79,142,247,0.3);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.stat-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 0.375rem;
}
.stat-card-change {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.stat-card-change.up   { color: #2ecc71; }
.stat-card-change.down { color: #e74c3c; }
.stat-accent {
  width: 4px;
  height: 36px;
  border-radius: 2px;
  margin-bottom: 0.75rem;
}

/* ── Project Cards ─────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: block;
  animation: fadeIn 0.4s ease both;
}
.project-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 1;
}
.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.875rem;
}
.project-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: rgba(79,142,247,0.12);
  border: 1px solid rgba(79,142,247,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.project-card-menu {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}
.project-card-menu:hover { color: var(--text); background: var(--border); }
.project-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.project-card-desc {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.875rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
}
.project-card-nodes {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* New project card */
.project-card-new {
  border-style: dashed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 160px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}
.project-card-new:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(79,142,247,0.04);
}
.project-card-new .plus-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px dashed currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
}

/* ── Org Chart Canvas ──────────────────────────────────────── */
.chart-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.chart-toolbar {
  flex-shrink: 0;
  height: 52px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  gap: 0.75rem;
  z-index: 100;
}
.chart-toolbar-left,
.chart-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.chart-toolbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.chart-project-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}
.zoom-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 1rem;
  transition: var(--transition);
  font-weight: 600;
}
.zoom-btn:hover { background: var(--border); color: var(--text); }
.zoom-label {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 40px;
  text-align: center;
  font-weight: 500;
}

.toolbar-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 2px;
}

.chart-canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: var(--bg);
  background-image: radial-gradient(circle, #1e1e2e 1px, transparent 1px);
  background-size: 24px 24px;
  cursor: default;
}

#chart-canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  will-change: transform;
}

/* Connections SVG layer */
#connections-layer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.connection-line {
  stroke: #1e1e2e;
  stroke-width: 2;
  fill: none;
  transition: stroke 0.2s ease;
}
.connection-line.highlighted {
  stroke: var(--blue);
  stroke-width: 2.5;
}

/* Org Nodes */
.org-node {
  position: absolute;
  width: 200px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  z-index: 10;
  animation: fadeIn 0.25s ease;
}
.org-node:hover {
  border-color: var(--dept-color, var(--blue));
  box-shadow: 0 0 16px color-mix(in srgb, var(--dept-color, var(--blue)) 20%, transparent);
}
.org-node.selected {
  border-color: var(--blue);
  box-shadow: 0 0 20px rgba(79,142,247,0.25);
  z-index: 20;
}
.org-node.dragging {
  cursor: grabbing;
  opacity: 0.92;
  z-index: 1000;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

.node-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.node-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(79,142,247,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.status-filled {
  background: #2ecc71;
  animation: pulse 2s ease-in-out infinite;
}
.status-dot.status-in_progress,
.status-dot.status-in-progress {
  background: var(--gold);
}
.status-dot.status-vacant {
  background: var(--muted);
}

.node-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-person {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-dept {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.dept-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.node-actions {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  gap: 3px;
  z-index: 5;
}
.org-node:hover .node-actions { display: flex; }
.node-action-btn {
  width: 22px;
  height: 22px;
  background: var(--border);
  border: none;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  transition: var(--transition);
}
.node-action-btn:hover { background: var(--blue); color: #fff; }
.node-action-btn.delete:hover { background: #e74c3c; }

/* Node Panel */
.node-panel {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 320px;
  background: var(--sidebar);
  border-left: 1px solid var(--border);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.node-panel.open {
  transform: translateX(0);
  animation: slideInRight 0.25s ease;
}
.node-panel::-webkit-scrollbar { width: 4px; }
.node-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.node-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--sidebar);
  z-index: 1;
}
.node-panel-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}
.panel-close-btn {
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 1.1rem;
  transition: var(--transition);
}
.panel-close-btn:hover { background: var(--border); color: var(--text); }

.node-panel-body {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
}

.node-panel-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  gap: 0.5rem;
}
.node-panel-footer .btn { flex: 1; }

/* Skills tags */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
  min-height: 32px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
}
.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(79,142,247,0.15);
  border: 1px solid rgba(79,142,247,0.3);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 9999px;
}
.skill-tag .skill-remove {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.skill-tag .skill-remove:hover { opacity: 1; }
.skill-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.skill-input-row input { flex: 1; }
.skill-input-row button { flex-shrink: 0; }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.modal-lg { max-width: 640px; }
.modal-sm { max-width: 360px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.modal-header h3 {
  font-size: 1.0625rem;
  font-weight: 700;
}
.modal-close {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 1.25rem;
  transition: var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body {
  padding: 1.5rem;
}
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ── Activity Feed ──────────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(30,30,46,0.6);
  animation: fadeIn 0.3s ease;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-dot.gold   { background: var(--gold); }
.activity-dot.green  { background: #2ecc71; }
.activity-dot.red    { background: #e74c3c; }
.activity-dot.muted  { background: var(--muted); }
.activity-text {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--text);
  line-height: 1.5;
}
.activity-text strong { color: var(--text); }
.activity-meta {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.admin-table th {
  background: var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.75rem 1rem;
  text-align: left;
  white-space: nowrap;
}
.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(30,30,46,0.5);
  color: var(--text);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr {
  transition: background 0.15s ease;
}
.admin-table tbody tr:hover { background: rgba(30,30,46,0.4); }
.admin-table .td-muted { color: var(--muted); }
.admin-table .td-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
}
.badge-blue    { background: rgba(79,142,247,0.15);  color: var(--blue); }
.badge-green   { background: rgba(46,204,113,0.15);  color: #2ecc71; }
.badge-gold    { background: rgba(245,197,24,0.15);  color: var(--gold); }
.badge-red     { background: rgba(231,76,60,0.15);   color: #e74c3c; }
.badge-gray    { background: rgba(107,107,128,0.15); color: var(--muted); }
.badge-orange  { background: rgba(243,156,18,0.15);  color: #f39c12; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.25rem;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.page-link:hover {
  background: var(--border);
  color: var(--text);
  opacity: 1;
}
.page-link.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.page-link.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ── Search & Filter bar ─────────────────────────────────────── */
.search-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
}
.search-input-wrapper input {
  width: 100%;
  padding-left: 32px;
}

/* ── Admin sidebar specifics ─────────────────────────────────── */
.admin-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(231,76,60,0.2);
  color: #e74c3c;
  margin-left: 0.375rem;
}

/* CSS bar chart for plan distribution */
.plan-chart {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.plan-chart h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}
.plan-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}
.plan-bar-label {
  font-size: 0.8125rem;
  color: var(--muted);
  width: 70px;
  flex-shrink: 0;
  font-weight: 500;
}
.plan-bar-track {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
}
.plan-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.8s ease;
}
.plan-bar-fill.free     { background: var(--muted); }
.plan-bar-fill.pro      { background: var(--blue); }
.plan-bar-fill.business { background: var(--gold); }
.plan-bar-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Settings page ──────────────────────────────────────────── */
.settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.settings-section-header {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.settings-section-header h3 {
  font-size: 0.9375rem;
  font-weight: 700;
}
.settings-section-body {
  padding: 1.5rem;
}

/* Toggle switch for settings */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(30,30,46,0.5);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row-info h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.toggle-row-info p {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Toast Notifications ─────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  pointer-events: auto;
  animation: slideInRight 0.3s ease;
  min-width: 260px;
  max-width: 380px;
}
.toast.success { border-left: 3px solid #2ecc71; }
.toast.error   { border-left: 3px solid #e74c3c; }
.toast.warning { border-left: 3px solid var(--gold); }
.toast.info    { border-left: 3px solid var(--blue); }
.toast-icon    { font-size: 1rem; flex-shrink: 0; }
.toast-msg     { flex: 1; }
.toast-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  transition: color 0.2s;
}
.toast-close:hover { color: var(--text); }
.toast.removing {
  animation: fadeOut 0.25s ease forwards;
}

/* ── Templates Page ─────────────────────────────────────────── */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.template-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.template-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.template-preview {
  height: 140px;
  background: var(--bg);
  background-image: radial-gradient(circle, #1e1e2e 1px, transparent 1px);
  background-size: 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.template-info {
  padding: 1rem;
}
.template-info h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.template-info p {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}
.template-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Inline edit form (admin change plan) ─────────────────────── */
.inline-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.inline-form select {
  padding: 0.3rem 0.5rem;
  font-size: 0.8125rem;
}

/* ── Danger zone ─────────────────────────────────────────────── */
.danger-zone {
  border-color: rgba(231,76,60,0.3) !important;
}
.danger-zone .settings-section-header {
  border-bottom-color: rgba(231,76,60,0.2);
}
.danger-zone .settings-section-header h3 { color: #e74c3c; }

/* ── Code / pre ─────────────────────────────────────────────── */
code, pre {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  background: var(--border);
  border-radius: 4px;
  font-size: 0.8125rem;
}
code { padding: 2px 6px; }
pre  { padding: 1rem; overflow-x: auto; }

/* ── Misc ───────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
}
.empty-state .empty-icon {
  font-size: 3rem;
  opacity: 0.3;
}
.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.empty-state p {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 300px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.card-header {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-size: 0.9375rem;
  font-weight: 700;
}
.card-body {
  padding: 1.5rem;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Progress bar */
.progress-bar-wrapper {
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
  height: 6px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 9999px;
  transition: width 0.4s ease;
}
.progress-bar-fill.gold   { background: var(--gold); }
.progress-bar-fill.green  { background: #2ecc71; }
.progress-bar-fill.red    { background: #e74c3c; }

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--blue); opacity: 1; }
.breadcrumbs .sep { color: var(--border); }
.breadcrumbs .current { color: var(--text); }

/* Maintenance banner */
.maintenance-banner {
  background: rgba(245,197,24,0.1);
  border-bottom: 1px solid rgba(245,197,24,0.3);
  padding: 0.625rem 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gold);
  font-weight: 500;
}

/* Alert boxes */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid;
}
.alert-info    { background: rgba(79,142,247,0.08);  border-color: rgba(79,142,247,0.3);  color: var(--blue); }
.alert-success { background: rgba(46,204,113,0.08);  border-color: rgba(46,204,113,0.3);  color: #2ecc71; }
.alert-warning { background: rgba(245,197,24,0.08);  border-color: rgba(245,197,24,0.3);  color: var(--gold); }
.alert-error   { background: rgba(231,76,60,0.08);   border-color: rgba(231,76,60,0.3);   color: #e74c3c; }

/* ── Keyframe Animations ─────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(10px); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes slideOutRight {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.8; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* ── Responsive — Mobile (<768px) ────────────────────────────── */
@media (max-width: 768px) {
  /* Nav */
  .nav { padding: 0 1rem; }
  .nav-links, .nav-actions { display: none; }
  .hamburger { display: flex; }

  /* Hero */
  .hero { padding: 80px 1.25rem 60px; }
  .hero h1 { font-size: 2rem; }
  .hero p.hero-sub { font-size: 1rem; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .trust-badges { gap: 1rem; }

  /* Pricing */
  .pricing-grid { grid-template-columns: 1fr; }

  /* Section */
  .section { padding: 3rem 1.25rem; }

  /* Dashboard */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 500;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .dashboard-main { margin-left: 0; }

  /* Chart canvas — touch scroll */
  .chart-canvas-wrapper {
    touch-action: pan-x pan-y;
    overflow: auto;
  }
  .chart-toolbar { overflow-x: auto; }

  /* Node panel */
  .node-panel {
    width: 100%;
    top: auto;
    bottom: 0;
    height: 85vh;
    transform: translateY(100%);
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .node-panel.open {
    transform: translateY(0);
    animation: none;
  }

  /* Admin table */
  .admin-table th:nth-child(n+5),
  .admin-table td:nth-child(n+5) { display: none; }

  /* Stats */
  .stats-row { grid-template-columns: repeat(2, 1fr); }

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; }

  /* Features */
  .features-grid { grid-template-columns: 1fr; }

  /* Auth */
  .auth-card { padding: 1.75rem 1.25rem; }

  /* Settings */
  .search-filter-bar { flex-direction: column; align-items: stretch; }
  .search-input-wrapper { min-width: unset; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .pricing-price .price-num { font-size: 2.25rem; }
}

/* ── Scrollbar Styling (webkit) ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ════════════════════════════════════════════════════════════════
   PUBLIC PAGE ADDITIONS — BEM nav, page heroes, reveal, legal,
   pricing comparison, FAQ, about, features, templates, 404
   ════════════════════════════════════════════════════════════════ */

/* ── BEM Nav (header.php v2) ────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: 64px; z-index: 1000;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(30,30,46,0.6);
  transition: background 0.2s ease;
}
.site-header.scrolled {
  background: rgba(10,10,15,0.97);
  border-bottom-color: var(--border);
}
.nav-container {
  max-width: 1200px; margin: 0 auto;
  height: 64px; padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.nav-logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 1.15rem;
  color: var(--text); text-decoration: none;
  letter-spacing: -0.025em; flex-shrink: 0;
}
.nav-logo__bolt {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(79,142,247,0.1);
  border: 1px solid rgba(79,142,247,0.2);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.nav-logo:hover .nav-logo__bolt {
  background: rgba(79,142,247,0.2);
  border-color: rgba(79,142,247,0.4);
}
.nav-logo__name { color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 0.15rem; margin-left: 0.5rem; }
.nav-link {
  padding: 0.4rem 0.75rem; font-size: 0.875rem; font-weight: 500;
  color: var(--muted); border-radius: 6px; text-decoration: none;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-link--active { color: var(--text); }
.nav-actions {
  display: flex; align-items: center; gap: 0.5rem; margin-left: auto;
}
.nav-hamburger {
  display: none; flex-direction: column; justify-content: center;
  align-items: center; gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer;
  border-radius: 6px; transition: background 0.2s;
  margin-left: auto;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.05); }
.nav-hamburger__bar {
  display: block; width: 20px; height: 2px;
  background: var(--muted); border-radius: 2px;
  transition: all 0.25s ease;
}
.nav-hamburger[aria-expanded="true"] .nav-hamburger__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] .nav-hamburger__bar:nth-child(2) {
  opacity: 0; transform: scaleX(0);
}
.nav-hamburger[aria-expanded="true"] .nav-hamburger__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.mobile-menu {
  display: none; position: fixed; top: 64px; left: 0; right: 0;
  background: var(--sidebar-bg); border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem 1.5rem; z-index: 999;
  flex-direction: column; gap: 0;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu__links { display: flex; flex-direction: column; }
.mobile-menu__link {
  padding: 0.75rem 0; font-size: 0.95rem; font-weight: 500;
  color: var(--muted); border-bottom: 1px solid var(--border);
  text-decoration: none; transition: color 0.2s;
}
.mobile-menu__link:hover, .mobile-menu__link--active { color: var(--text); }
.mobile-menu__actions {
  display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem;
}
.mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 998;
}
.mobile-overlay.is-open { display: block; }
.btn--sm  { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn--block { display: flex; width: 100%; }

/* ── Scroll-reveal (.reveal) ─────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Page hero ───────────────────────────────────────────────── */
.page-hero {
  padding: 7rem 1.5rem 4rem; text-align: center;
  background: linear-gradient(180deg, rgba(79,142,247,0.05) 0%, transparent 100%);
  position: relative; overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute; top: -100px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 500px;
  background: radial-gradient(ellipse, rgba(79,142,247,0.08) 0%, transparent 65%);
  pointer-events: none;
}
.page-hero__label {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--blue); margin-bottom: 0.75rem;
}
.page-hero__title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900; letter-spacing: -0.035em; color: #fff;
  margin-bottom: 1rem; position: relative;
}
.page-hero__sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted); max-width: 560px; margin: 0 auto; line-height: 1.75;
}

/* ── Legal pages ─────────────────────────────────────────────── */
.legal-body {
  max-width: 740px; margin: 0 auto; padding: 3rem 1.5rem 6rem;
}
.legal-body h2 {
  font-size: 1.3rem; font-weight: 700; color: var(--text);
  margin: 2.5rem 0 0.75rem; border-top: 1px solid var(--border);
  padding-top: 2rem;
}
.legal-body h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.legal-body p, .legal-body li {
  font-size: 0.95rem; color: var(--muted); line-height: 1.8; margin-bottom: 0.75rem;
}
.legal-body ul { padding-left: 1.5rem; list-style: disc; margin-bottom: 1rem; }
.legal-body a { color: var(--blue); text-decoration: underline; }
.legal-meta {
  font-size: 0.8rem; color: var(--muted); margin-bottom: 2.5rem;
  padding-bottom: 2rem; border-bottom: 1px solid var(--border);
}

/* ── Pricing page extras ─────────────────────────────────────── */
.annual-saving {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 100px;
  font-size: 0.72rem; font-weight: 700;
  background: rgba(16,185,129,0.12); color: #10b981;
  border: 1px solid rgba(16,185,129,0.2);
}

/* Comparison table */
.compare-wrap { overflow-x: auto; margin-top: 3rem; }
.compare-table {
  width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 560px;
}
.compare-table th {
  padding: 0.75rem 1rem; text-align: center;
  font-size: 0.78rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.compare-table th:first-child { text-align: left; }
.compare-table td {
  padding: 0.7rem 1rem; border-bottom: 1px solid rgba(30,30,46,0.5);
  color: var(--muted); text-align: center; vertical-align: middle;
}
.compare-table td:first-child { text-align: left; color: var(--text); }
.compare-table tr:hover td { background: rgba(255,255,255,0.015); }
.compare-table .cat-row td {
  background: rgba(79,142,247,0.04); color: var(--text);
  font-weight: 700; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.06em; padding-top: 1rem;
}
.compare-check { color: var(--blue); font-size: 1rem; }
.compare-cross { color: var(--border); font-size: 1rem; }
.compare-val   { color: var(--text); font-weight: 600; font-size: 0.85rem; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; margin-top: 2.5rem; }
.faq-item { border-bottom: 1px solid var(--border); overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; display: flex;
  justify-content: space-between; align-items: center;
  padding: 1.25rem 0; background: none; border: none;
  color: var(--text); font-size: 0.975rem; font-weight: 600;
  cursor: pointer; font-family: var(--font); gap: 1rem;
  transition: color 0.2s;
}
.faq-q:hover { color: var(--blue); }
.faq-icon {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--border); display: flex; align-items: center; justify-content: center;
  transition: all 0.25s; font-size: 0.9rem; color: var(--muted);
}
.faq-item.open .faq-icon { background: var(--blue); color: #fff; transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.35s ease, padding 0.35s ease; }
.faq-item.open .faq-a { max-height: 300px; padding-bottom: 1.25rem; }
.faq-a p { font-size: 0.9rem; color: var(--muted); line-height: 1.8; }

/* ── About page ──────────────────────────────────────────────── */
.pub-stats-row {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 2rem; text-align: center;
}
.pub-stat-num { font-size: 2.75rem; font-weight: 900; color: #fff; letter-spacing: -0.04em; }
.pub-stat-lbl { font-size: 0.875rem; color: var(--muted); margin-top: 0.25rem; }
.team-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 1.5rem; margin-top: 2.5rem;
}
.team-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem 1.5rem; text-align: center;
  transition: all 0.2s;
}
.team-card:hover { border-color: rgba(79,142,247,0.3); transform: translateY(-3px); }
.team-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.2rem; color: #fff; margin: 0 auto 1rem;
}
.team-name  { font-size: 1rem; font-weight: 700; color: var(--text); }
.team-role  { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.team-bio   { font-size: 0.83rem; color: var(--muted); margin-top: 0.75rem; line-height: 1.65; }
.values-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 1.5rem;
}
.value-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  transition: all 0.2s;
}
.value-card:hover { border-color: rgba(79,142,247,0.25); transform: translateY(-2px); }
.value-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 1rem;
}
.value-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.value-desc  { font-size: 0.875rem; color: var(--muted); line-height: 1.7; }

/* ── Features page ───────────────────────────────────────────── */
.feat-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: center; padding: 5rem 1.5rem;
  max-width: 1200px; margin: 0 auto;
}
.feat-row + .feat-row { padding-top: 0; }
.feat-mockup {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  min-height: 300px; display: flex; align-items: center; justify-content: center;
  padding: 2rem; position: relative;
}
.feat-icon-grid {
  display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; margin-top: 1.5rem;
}
.feat-icon-item { display: flex; align-items: flex-start; gap: 10px; }
.feat-icon-dot {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.int-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  transition: all 0.2s;
}
.int-card:hover { border-color: rgba(79,142,247,0.3); transform: translateY(-2px); }
.int-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

/* ── Templates page ──────────────────────────────────────────── */
.filter-tabs {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 2rem 0;
}
.filter-tab {
  padding: 0.45rem 1rem; border-radius: 8px;
  font-size: 0.85rem; font-weight: 600;
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; transition: all 0.2s;
  font-family: var(--font);
}
.filter-tab:hover { border-color: rgba(79,142,247,0.3); color: var(--text); }
.filter-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.template-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all 0.2s; cursor: pointer;
}
.template-card:hover {
  border-color: rgba(79,142,247,0.35); transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.template-card[data-hidden="true"] { display: none; }
.template-preview {
  height: 160px; background: var(--sidebar-bg);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border); overflow: hidden; position: relative;
}
.template-body   { padding: 1.25rem; }
.template-name   { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 0.3rem; }
.template-desc-t { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.75rem; line-height: 1.6; }
.template-footer { display: flex; align-items: center; justify-content: space-between; }
.tpl-price { font-size: 0.85rem; font-weight: 700; }
.tpl-price--free { color: #10b981; }
.tpl-price--paid { color: var(--gold); }
.tpl-use-btn {
  padding: 5px 14px; border-radius: 6px;
  font-size: 0.78rem; font-weight: 700;
  background: rgba(79,142,247,0.1); border: 1px solid rgba(79,142,247,0.25);
  color: var(--blue); cursor: pointer; transition: all 0.2s; font-family: var(--font);
}
.tpl-use-btn:hover { background: var(--blue); color: #fff; }

/* Template modal */
.tpl-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 9999;
  align-items: center; justify-content: center; padding: 1rem;
}
.tpl-modal-overlay.open { display: flex; }
.tpl-modal-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; width: 100%; max-width: 640px; overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.tpl-modal-box { animation: modalIn 0.25s ease both; }
.tpl-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
}
.tpl-modal-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.tpl-modal-close {
  width: 30px; height: 30px; border-radius: 6px;
  background: rgba(255,255,255,0.05); border: none;
  color: var(--muted); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; font-family: var(--font);
}
.tpl-modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.tpl-modal-preview {
  height: 240px; background: var(--sidebar-bg);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
}
.tpl-modal-foot {
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.tpl-modal-meta { font-size: 0.85rem; color: var(--muted); }
.tpl-modal-meta strong { color: var(--text); }

/* ── 404 page ────────────────────────────────────────────────── */
.not-found-wrap {
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 3rem 1.5rem;
  position: relative; overflow: hidden;
}
.not-found-bg-code {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  font-size: clamp(8rem, 25vw, 18rem); font-weight: 900;
  color: var(--blue); opacity: 0.04; pointer-events: none;
  letter-spacing: -0.06em; line-height: 1; user-select: none;
}
.not-found-content { position: relative; z-index: 1; }
.not-found-icon { color: var(--blue); margin-bottom: 1.5rem; }
.not-found-title {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 800; color: var(--text); margin-bottom: 0.75rem;
}
.not-found-sub {
  font-size: 1rem; color: var(--muted); max-width: 400px;
  margin: 0 auto 2.5rem; line-height: 1.7;
}

/* ── Responsive additions ────────────────────────────────────── */
@media (max-width: 900px) {
  .feat-row { grid-template-columns: 1fr; gap: 2.5rem; }
  .feat-row--reverse .feat-mockup { order: -1; }
  .pub-stats-row { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 768px) {
  .nav-links, .nav-actions { display: none; }
  .nav-hamburger { display: flex; }
  .compare-table { font-size: 0.8rem; }
  .compare-table th, .compare-table td { padding: 0.6rem 0.4rem; }
}
@media (max-width: 560px) {
  .page-hero { padding: 5.5rem 1rem 3rem; }
  .feat-icon-grid { grid-template-columns: 1fr; }
}
