/* ============================================================
   FreshImpact Support — Stylesheet
   Aesthetic: Organic modern, editorial green
   Font: Inter (professional grade)
   ============================================================ */

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

:root {
  --ink:         #0d1f14;
  --ink-light:   #3d5246;
  --primary:     #1e6641;
  --primary-mid: #2d8a58;
  --primary-lt:  #e6f4ec;
  --accent:      #4ade80;
  --accent-warm: #a3e635;
  --sand:        #f5f2eb;
  --white:       #ffffff;
  --border:      #e2ebe5;
  --muted:       #7a9082;
  --danger:      #dc2626;
  --warning-bg:  #fef9c3;
  --warning-fg:  #854d0e;

  /* Layout */
  --sidebar-w:   268px;
  --topbar-h:    60px;
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   18px;
  --radius-xl:   24px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
  --shadow:      0 2px 8px rgba(0,0,0,.06), 0 8px 32px rgba(0,0,0,.06);
  --shadow-lg:   0 8px 40px rgba(0,0,0,.12);

  /* Typography System */
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display:'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:   ui-monospace, 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
  
  /* Font Weights */
  --fw-light:    300;
  --fw-normal:   400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-extrabold:800;
  --fw-black:    900;
  
  /* Font Sizes */
  --text-xs:     0.75rem;    /* 12px */
  --text-sm:     0.875rem;   /* 14px */
  --text-base:   1rem;       /* 16px */
  --text-lg:     1.125rem;   /* 18px */
  --text-xl:     1.25rem;    /* 20px */
  --text-2xl:    1.5rem;     /* 24px */
  --text-3xl:    1.875rem;   /* 30px */
  --text-4xl:    2.25rem;    /* 36px */
  --text-5xl:    3rem;       /* 48px */
  
  /* Line Heights */
  --leading-tight:   1.25;
  --leading-snug:    1.375;
  --leading-normal:  1.5;
  --leading-relaxed: 1.625;
  --leading-loose:   1.75;
  
  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight:   -0.025em;
  --tracking-normal:  0;
  --tracking-wide:    0.025em;
  --tracking-wider:   0.05em;
}

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

html { 
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--sand);
  color: var(--ink);
  font-size: var(--text-base);
  font-weight: var(--fw-normal);
  line-height: var(--leading-relaxed);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
}

h1 { font-size: var(--text-4xl); font-weight: var(--fw-extrabold); letter-spacing: var(--tracking-tighter); }
h2 { font-size: var(--text-3xl); font-weight: var(--fw-bold); }
h3 { font-size: var(--text-2xl); font-weight: var(--fw-semibold); }
h4 { font-size: var(--text-xl); font-weight: var(--fw-semibold); }
h5 { font-size: var(--text-lg); font-weight: var(--fw-medium); }
h6 { font-size: var(--text-base); font-weight: var(--fw-medium); }

p { line-height: var(--leading-relaxed); margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: var(--fw-semibold); }
em, i { font-style: italic; }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-weight: var(--fw-medium);
}

small { font-size: var(--text-sm); }

/* ══════════════════════════════════════════════
   PUBLIC LANDING PAGE
══════════════════════════════════════════════ */

.public-page { background: var(--white); }

/* Navbar */
.pub-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pub-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.pub-nav-logo .leaf { font-size: 26px; }
.pub-nav-logo .brand {
  font-family: var(--font-display);
  font-weight: var(--fw-extrabold);
  font-size: var(--text-lg);
  color: var(--ink);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
.pub-nav-logo .brand span { color: var(--primary); }
.pub-nav-logo .sub {
  font-size: var(--text-xs);
  color: var(--muted);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-weight: var(--fw-medium);
}

.pub-nav-links { display: flex; align-items: center; gap: 8px; }
.pub-nav-links a {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--ink-light);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.pub-nav-links a:hover { background: var(--primary-lt); color: var(--primary); }

.btn-nav-login {
  background: var(--white) !important;
  border: 1.5px solid var(--border) !important;
  color: var(--ink) !important;
  font-weight: var(--fw-semibold) !important;
}
.btn-nav-login:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background: var(--white) !important;
}

.btn-nav-register {
  background: var(--primary) !important;
  color: var(--white) !important;
  font-weight: var(--fw-semibold) !important;
  border: 1.5px solid var(--primary) !important;
}
.btn-nav-register:hover {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
}

/* Hero */
.hero {
  background: linear-gradient(160deg, #0d1f14 0%, #1a4a2e 50%, #0d3320 100%);
  padding: 100px 40px 120px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(45,138,88,.25) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(74,222,128,.1) 0%, transparent 50%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-inner {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(74,222,128,.12);
  border: 1px solid rgba(74,222,128,.25);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  animation: fadeUp .6s ease both;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: clamp(36px, 5vw, 58px);
  line-height: var(--leading-tight);
  color: var(--white);
  margin-bottom: 22px;
  letter-spacing: var(--tracking-tighter);
  animation: fadeUp .6s .1s ease both;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero p {
  font-size: var(--text-lg);
  font-weight: var(--fw-normal);
  color: rgba(255,255,255,.65);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: var(--leading-relaxed);
  animation: fadeUp .6s .2s ease both;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp .6s .3s ease both;
}

.btn-hero-primary {
  background: var(--accent);
  color: var(--ink);
  font-weight: var(--fw-bold);
  font-size: var(--text-base);
  padding: 13px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
}
.btn-hero-primary:hover {
  background: #22c55e;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(74,222,128,.3);
  color: var(--ink);
  text-decoration: none;
}

.btn-hero-secondary {
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: var(--fw-semibold);
  font-size: var(--text-base);
  padding: 13px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.15);
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-hero-secondary:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
  text-decoration: none;
}

/* Features strip */
.features-strip {
  background: var(--sand);
  padding: 64px 40px;
}
.features-strip .section-title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--text-3xl);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: var(--tracking-tight);
}
.features-strip .sub-heading {
  text-align: center;
  color: var(--muted);
  margin-bottom: 48px;
  font-size: var(--text-base);
  font-weight: var(--fw-normal);
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all .2s;
}
.feature-card:hover {
  border-color: var(--primary-mid);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-lt);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}
.feature-card h4 {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  margin-bottom: 8px;
  letter-spacing: var(--tracking-normal);
}
.feature-card p {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-relaxed);
}

/* KB Preview */
.kb-preview {
  background: var(--white);
  padding: 64px 40px;
}
.kb-preview .section-label {
  text-align: center;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--primary);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--fw-bold);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: var(--tracking-tight);
}
.section-sub {
  color: var(--muted);
  font-size: var(--text-base);
  font-weight: var(--fw-normal);
  text-align: center;
  margin-bottom: 36px;
  line-height: var(--leading-relaxed);
}

.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.kb-pub-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all .2s;
  background: var(--white);
  position: relative;
  overflow: hidden;
}
.kb-pub-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transition: transform .2s;
}
.kb-pub-card:hover::before { transform: scaleX(1); }
.kb-pub-card:hover {
  border-color: var(--primary-mid);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.kb-pub-cat {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--primary);
  margin-bottom: 8px;
}
.kb-pub-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  margin-bottom: 8px;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
}
.kb-pub-desc { 
  font-size: var(--text-sm); 
  color: var(--muted); 
  line-height: var(--leading-normal); 
}
.kb-pub-meta {
  margin-top: 14px;
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* KB Card (App/Internal KB Listing) */
.kb-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  position: relative;
  overflow: hidden;
  height: 100%;
}
.kb-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.kb-card:hover::before {
  transform: scaleX(1);
}
.kb-card:hover {
  border-color: var(--primary-mid);
  box-shadow: 0 8px 24px rgba(30, 102, 65, .12);
  transform: translateY(-4px);
  color: inherit;
}
.kb-card-category {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--primary);
  background: var(--primary-lt);
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 14px;
}
.kb-card-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  margin-bottom: 10px;
  color: var(--ink);
}
.kb-card-desc {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-relaxed);
  margin-bottom: 16px;
}
.kb-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.kb-card-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.kb-card-meta i {
  font-size: var(--text-sm);
}

.blurred-preview {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
  opacity: .7;
  position: relative;
}
.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,.8) 50%, rgba(255,255,255,.95) 100%);
  border-radius: var(--radius);
}
.lock-overlay-inner {
  text-align: center;
  padding: 20px;
}
.lock-overlay-inner i { 
  font-size: var(--text-3xl); 
  color: var(--primary); 
  margin-bottom: 10px; 
  display: block; 
}
.lock-overlay-inner p { 
  font-size: var(--text-sm); 
  color: var(--ink-light); 
  margin-bottom: 14px; 
  font-weight: var(--fw-medium);
}

/* CTA Section */
.cta-section {
  background: linear-gradient(160deg, var(--ink), var(--primary-mid));
  padding: 72px 40px;
  text-align: center;
  color: #fff;
}
.cta-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--fw-extrabold);
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: var(--tracking-tight);
}
.cta-section p { 
  color: rgba(255,255,255,.65); 
  font-size: var(--text-base); 
  font-weight: var(--fw-normal);
  margin-bottom: 32px; 
  line-height: var(--leading-relaxed);
}

/* Footer */
.pub-footer {
  background: var(--ink);
  color: rgba(255,255,255,.4);
  text-align: center;
  padding: 28px 40px;
  font-size: var(--text-sm);
  font-weight: var(--fw-normal);
}
.pub-footer a { 
  color: rgba(255,255,255,.5); 
  text-decoration: none; 
  font-weight: var(--fw-medium);
}

/* ══════════════════════════════════════════════
   AUTH PAGES (login / register / pending)
══════════════════════════════════════════════ */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-panel-left { display: none; }
}

.auth-panel-left {
  background: linear-gradient(160deg, #0d1f14, #1a4a2e);
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-panel-left::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(74,222,128,.08);
  top: -100px; right: -100px;
}
.auth-panel-left::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(45,138,88,.1);
  bottom: -80px; left: -60px;
}

.auth-left-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
  margin-bottom: 48px;
}
.auth-left-logo .leaf { font-size: 28px; }
.auth-left-logo .brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-extrabold);
  color: #fff;
  letter-spacing: var(--tracking-tight);
}
.auth-left-logo .brand span { color: var(--accent); }

.auth-left-content {
  position: relative;
  z-index: 1;
}
.auth-left-content h2 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--fw-extrabold);
  color: #fff;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tighter);
  margin-bottom: 18px;
}
.auth-left-content h2 em { font-style: normal; color: var(--accent); }
.auth-left-content p { 
  color: rgba(255,255,255,.55); 
  font-size: var(--text-base); 
  font-weight: var(--fw-normal);
  margin-bottom: 32px; 
  line-height: var(--leading-relaxed);
}

.auth-features {
  list-style: none;
}
.auth-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.7);
  font-size: var(--text-sm);
  font-weight: var(--fw-normal);
  margin-bottom: 12px;
  line-height: var(--leading-relaxed);
}
.auth-features li i { color: var(--accent); font-size: var(--text-base); flex-shrink: 0; }

.auth-left-footer { 
  color: rgba(255,255,255,.3); 
  font-size: var(--text-xs); 
  font-weight: var(--fw-normal);
  position: relative; 
  z-index: 1; 
}

.auth-panel-right {
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
}

.auth-form-wrap { width: 100%; max-width: 400px; }

.auth-form-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-extrabold);
  margin-bottom: 6px;
  letter-spacing: var(--tracking-tight);
}
.auth-form-sub { 
  color: var(--muted); 
  font-size: var(--text-sm); 
  font-weight: var(--fw-normal);
  margin-bottom: 32px; 
}

/* Pending page */
.pending-page {
  min-height: 100vh;
  background: var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pending-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 56px 48px;
  text-align: center;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.pending-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--warning-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  margin: 0 auto 24px;
  color: var(--warning-fg);
}
.pending-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-extrabold);
  margin-bottom: 12px;
  letter-spacing: var(--tracking-tight);
}
.pending-card p { 
  color: var(--muted); 
  font-size: var(--text-base); 
  font-weight: var(--fw-normal);
  line-height: var(--leading-relaxed); 
  margin-bottom: 24px; 
}

/* ══════════════════════════════════════════════
   APP LAYOUT (sidebar + content)
══════════════════════════════════════════════ */

.main-area { margin-left: var(--sidebar-w); min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  text-decoration: none;
}
.sidebar-brand .leaf { font-size: 22px; }
.sidebar-brand .brand-text { 
  font-family: var(--font-display); 
  font-size: var(--text-base); 
  font-weight: var(--fw-extrabold); 
  color: #fff; 
  line-height: var(--leading-tight); 
  letter-spacing: var(--tracking-tight);
}
.sidebar-brand .brand-text span { color: var(--accent); }
.sidebar-brand .brand-sub { 
  font-size: var(--text-xs); 
  color: rgba(255,255,255,.3); 
  letter-spacing: var(--tracking-wide); 
  text-transform: uppercase; 
}

.sidebar-nav { flex: 1; padding: 14px 10px; }
.nav-group-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: rgba(255,255,255,.2);
  padding: 18px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.55);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: all .15s;
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item i { font-size: var(--text-base); opacity: .8; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: var(--fw-bold); flex-shrink: 0;
}
.sidebar-user-name { 
  font-size: var(--text-sm); 
  font-weight: var(--fw-semibold); 
  color: #fff; 
  line-height: var(--leading-tight); 
}
.sidebar-user-role { 
  font-size: var(--text-xs); 
  color: rgba(255,255,255,.35); 
  text-transform: capitalize; 
  font-weight: var(--fw-normal);
}
.sidebar-logout {
  margin-left: auto;
  color: rgba(255,255,255,.3);
  font-size: 16px;
  text-decoration: none;
  padding: 4px;
  border-radius: 5px;
  transition: all .15s;
}
.sidebar-logout:hover { background: rgba(255,255,255,.06); color: #fff; }

/* Topbar mobile */
.topbar-mobile {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: none;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-mobile-title { 
  font-family: var(--font-display); 
  font-size: var(--text-base); 
  font-weight: var(--fw-bold); 
  letter-spacing: var(--tracking-tight);
}

.content { padding: 40px; max-width: 1400px; }

/* ══════════════════════════════════════════════
   COMPONENTS
══════════════════════════════════════════════ */

/* Page header */
.page-hdr { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.page-hdr-title { 
  font-family: var(--font-display); 
  font-size: var(--text-3xl); 
  font-weight: var(--fw-extrabold); 
  line-height: var(--leading-tight); 
  letter-spacing: var(--tracking-tight);
}
.page-hdr-sub { 
  font-size: var(--text-sm); 
  color: var(--muted); 
  font-weight: var(--fw-normal);
  margin-top: 3px; 
}

/* Alternative Page Header (used in KB) */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 20px;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--fw-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: 6px;
}
.page-subtitle {
  font-size: var(--text-base);
  color: var(--muted);
  font-weight: var(--fw-normal);
  line-height: var(--leading-relaxed);
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-hdr {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
}
.card-body { padding: 22px; }

/* Stat cards */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.si-green  { background: #dcfce7; color: #166534; }
.si-blue   { background: #dbeafe; color: #1d4ed8; }
.si-amber  { background: #fef3c7; color: #92400e; }
.si-red    { background: #fee2e2; color: #991b1b; }
.stat-val  { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: var(--fw-extrabold); line-height: var(--leading-tight); }
.stat-lbl  { font-size: var(--text-sm); color: var(--muted); font-weight: var(--fw-medium); margin-top: 3px; }

/* Buttons */
.btn-primary {
  background: var(--primary); border-color: var(--primary);
  color: #fff; 
  font-weight: var(--fw-semibold); 
  font-size: var(--text-sm);
  border-radius: var(--radius-sm); 
  padding: 8px 18px;
  transition: all .15s;
}
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-outline-primary { 
  color: var(--primary); 
  border-color: var(--primary); 
  font-weight: var(--fw-semibold); 
  font-size: var(--text-sm); 
  border-radius: var(--radius-sm); 
}
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-outline-secondary {
  color: var(--muted);
  border-color: var(--border);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}
.btn-outline-secondary:hover {
  background: var(--sand);
  border-color: var(--muted);
  color: var(--ink);
}
.btn-sm {
  font-size: var(--text-xs);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

/* Forms */
.form-label { 
  font-size: var(--text-sm); 
  font-weight: var(--fw-semibold); 
  color: var(--ink); 
  margin-bottom: 5px; 
  letter-spacing: var(--tracking-normal);
}
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm); 
  padding: 9px 13px;
  font-family: var(--font);
  font-weight: var(--fw-normal);
  transition: border-color .15s, box-shadow .15s;
  background: var(--white);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,102,65,.1);
}
.form-control-lg, .form-select-lg {
  font-size: var(--text-base);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}
.btn-lg {
  font-size: var(--text-base);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
}
textarea.form-control { resize: vertical; min-height: 110px; }

/* Alerts */
.alert { 
  border-radius: var(--radius-sm); 
  font-size: var(--text-sm); 
  font-weight: var(--fw-normal);
}
.alert-success { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.alert-danger   { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.alert-info     { background: #dbeafe; border-color: #bfdbfe; color: #1e40af; }
.alert-warning  { background: var(--warning-bg); border-color: #fef08a; color: var(--warning-fg); }

/* Status badges */
.badge-status {
  font-size: var(--text-xs); 
  font-weight: var(--fw-semibold);
  padding: 3px 10px; 
  border-radius: 100px;
}
.bs-open        { background: #fef3c7; color: #92400e; }
.bs-in_progress { background: #dbeafe; color: #1e40af; }
.bs-closed      { background: #dcfce7; color: #166534; }
.bs-pending     { background: #f3e8ff; color: #6b21a8; }
.bs-approved    { background: #dcfce7; color: #166534; }
.bs-rejected    { background: #fee2e2; color: #991b1b; }

/* Tables */
.table { font-size: var(--text-sm); }
.table thead th {
  background: #f9fafb; border-bottom: 2px solid var(--border);
  font-weight: var(--fw-semibold); 
  font-size: var(--text-xs); 
  color: var(--muted);
  text-transform: uppercase; 
  letter-spacing: var(--tracking-wide); 
  padding: 10px 14px;
}
.table tbody td { 
  padding: 13px 14px; 
  vertical-align: middle; 
  border-color: var(--border); 
}
.table-hover tbody tr:hover { background: rgba(30,102,65,.02); }

/* Ticket thread */
.thread { display: flex; flex-direction: column; gap: 16px; }
.t-msg { display: flex; gap: 12px; }
.t-msg.is-admin { flex-direction: row-reverse; }
.t-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); 
  font-weight: var(--fw-bold); 
  color: #fff; flex-shrink: 0;
}
.av-user  { background: var(--primary); }
.av-admin { background: #4f46e5; }
.t-bubble {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px;
  flex: 1; box-shadow: var(--shadow-sm);
}
.is-admin .t-bubble { background: #eef2ff; border-color: #c7d2fe; }
.t-meta { 
  font-size: var(--text-xs); 
  color: var(--muted); 
  margin-bottom: 8px; 
  display: flex; 
  align-items: center; 
  gap: 8px; 
}
.t-meta strong { color: var(--ink); font-weight: var(--fw-semibold); }
.t-text { 
  font-size: var(--text-sm); 
  line-height: var(--leading-relaxed); 
  white-space: pre-wrap; 
  word-break: break-word; 
}

/* Attachment item */
.att-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--sand);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--text-sm); 
  font-weight: var(--fw-normal);
  text-decoration: none; color: var(--ink);
  transition: all .15s;
}
.att-item:hover { background: var(--primary-lt); border-color: var(--primary-mid); color: var(--primary); }
.att-item i { color: var(--primary); font-size: var(--text-base); }

/* KB card (in app) */
.kb-card-app {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  text-decoration: none; color: inherit; display: block;
  transition: all .2s;
}
.kb-card-app:hover {
  border-color: var(--primary-mid);
  box-shadow: 0 4px 20px rgba(30,102,65,.1);
  transform: translateY(-2px); color: inherit;
}

/* Editor */
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 3px;
  padding: 8px; background: #f9fafb;
  border: 1.5px solid var(--border); border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.editor-toolbar button {
  background: none; border: 1px solid transparent;
  padding: 4px 8px; border-radius: 5px; 
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  cursor: pointer; color: var(--ink); transition: all .1s;
}
.editor-toolbar button:hover { background: #fff; border-color: var(--border); }
.editor-content {
  min-height: 200px; padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: var(--text-base); 
  line-height: var(--leading-relaxed); 
  font-weight: var(--fw-normal);
  outline: none;
}
.editor-content:focus {border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,102,65,.1); }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state i { font-size: 48px; opacity: .25; display: block; margin-bottom: 16px; }
.empty-state h5 { 
  font-weight: var(--fw-bold); 
  color: var(--ink); 
  font-family: var(--font-display); 
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-tight);
}

/* Ticket ID */
.tid {
  font-family: 'DM Mono', monospace; 
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--muted); background: var(--sand);
  padding: 2px 7px; border-radius: 5px; border: 1px solid var(--border);
}

.ticket-id {
  font-family: 'DM Mono', monospace;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  color: var(--primary);
  background: var(--primary-lt);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--primary-mid);
  letter-spacing: var(--tracking-wide);
}

/* Status badges */
.status-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: capitalize;
  letter-spacing: var(--tracking-normal);
}
.status-open {
  background: #fef3c7;
  color: #92400e;
}
.status-in_progress {
  background: #dbeafe;
  color: #1e40af;
}
.status-closed {
  background: #dcfce7;
  color: #166534;
}

/* Ticket Thread */
.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 24px 0;
}

.ticket-message {
  display: flex;
  gap: 14px;
  animation: fadeUp .3s ease;
}

.ticket-message.admin-reply {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.avatar-user {
  background: linear-gradient(135deg, var(--primary) 0%, #16a34a 100%);
}

.avatar-admin {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.message-bubble {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  flex: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
  transition: all .2s;
}

.admin-reply .message-bubble {
  background: #f0f9ff;
  border-color: #bfdbfe;
}

.message-bubble:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.message-meta {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.message-meta strong {
  color: var(--ink);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
}

.badge-support {
  background: #e0e7ff;
  color: #3730a3;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.message-content {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--sand);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  color: var(--ink);
  transition: all .2s;
}

.attachment-item:hover {
  background: var(--primary-lt);
  border-color: var(--primary-mid);
  color: var(--primary);
  transform: translateX(2px);
}

.attachment-item i {
  color: var(--primary);
  font-size: var(--text-lg);
}

.ticket-count {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: var(--fw-normal);
}

.ticket-subject-link {
  font-weight: var(--fw-medium);
  text-decoration: none;
  color: var(--ink);
  transition: color .15s;
}

.ticket-subject-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.ticket-info-header {
  padding: 20px 24px;
}

.ticket-info-meta {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: var(--fw-normal);
}

.ticket-info-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  margin: 0 0 10px;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

.ticket-info-details {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: var(--fw-normal);
}

.ticket-info-details strong {
  color: var(--ink);
  font-weight: var(--fw-semibold);
}

.ticket-details-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: var(--text-sm);
}

.ticket-details-row:last-child {
  margin-bottom: 0;
}

/* Breadcrumb */
.breadcrumb { 
  font-size: var(--text-sm); 
  font-weight: var(--fw-normal);
}
.breadcrumb-item+.breadcrumb-item::before { color: var(--muted); }

/* Filter bar */
.filter-bar { 
  display: flex; 
  gap: 10px; 
  flex-wrap: wrap; 
  align-items: center; 
  margin-bottom: 28px;
  padding: 16px 20px;
  background: var(--sand);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

/* Pagination */
.page-link { 
  color: var(--primary); 
  border-color: var(--border); 
  border-radius: 7px !important; 
  font-size: var(--text-sm); 
  font-weight: var(--fw-medium);
}
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* Search */
.search-wrap { position: relative; }
.search-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap input { padding-left: 36px; }

.search-bar { 
  position: relative; 
}
.search-bar i { 
  position: absolute; 
  left: 16px; 
  top: 50%; 
  transform: translateY(-50%); 
  color: var(--muted); 
  pointer-events: none;
  font-size: var(--text-lg);
  z-index: 5;
}
.search-bar input { 
  padding-left: 48px;
  font-size: var(--text-base);
  font-weight: var(--fw-normal);
}

/* Search results highlight */
mark {
  background: linear-gradient(120deg, #fef3c7 0%, #fde68a 100%);
  color: var(--ink);
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: var(--fw-semibold);
}

/* Search result count */
.search-result-count {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: var(--fw-normal);
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--sand);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}
.search-result-count strong {
  color: var(--ink);
  font-weight: var(--fw-semibold);
}

/* Responsive */
@media (max-width: 991px) {
  .main-area { margin-left: 0; }
  .sidebar { transform: translateX(-100%); box-shadow: 4px 0 24px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .topbar-mobile { display: flex; }
  .content { padding: 20px 16px; }
  .pub-nav { padding: 0 20px; }
  .hero { padding: 80px 24px 100px; }
  .features-strip, .kb-preview { padding: 56px 24px; }
  .cta-section { padding: 60px 24px; }
}

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.fade-in  { animation: fadeIn  .3s ease; }
.fade-up  { animation: fadeUp  .3s ease; }

/* Sidebar icon btn */
.btn-icon-sidebar {
  background: none; border: none;
  color: rgba(255,255,255,.4);
  cursor: pointer; 
  font-size: var(--text-lg); 
  padding: 4px 6px;
  border-radius: 6px; transition: all .15s;
}
.btn-icon-sidebar:hover { background: rgba(255,255,255,.07); color: #fff; }

/* Divider */
hr.divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* Dropdown */
.dropdown-menu { 
  border-radius: var(--radius-sm); 
  border-color: var(--border); 
  box-shadow: var(--shadow-lg); 
  font-size: var(--text-sm); 
  font-weight: var(--fw-normal);
}
