/*
 * ================================================================
 * Sahakari Tech — Global Design System  v2.0
 * Refined SaaS Typography — infodev.com.np / bandanasigdel.com.np inspired
 * Palette: bg #fafbfc · surface #e8ecf1 · muted #94a3b8 · primary #3b82f6
 * Fonts:   Plus Jakarta Sans (display/body) · Noto Sans Devanagari (Nepali)
 *          JetBrains Mono (mono)
 * ================================================================
 */

/* ── 1. CSS Custom Properties ─────────────────────────────── */
:root {
  /* Radius scale */
  --radius-sm:  0.375rem;
  --radius:     0.875rem;
  --radius-md:  0.875rem;
  --radius-lg:  1rem;
  --radius-xl:  1.25rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 1.75rem;

  /* Colour tokens — Cloud White light SaaS */
  --background:        #fafbfc;
  --foreground:        #0f172a;
  --card:              #ffffff;
  --card-foreground:   #0f172a;
  --muted:             #f1f5f9;
  --muted-foreground:  #64748b;
  --border:            #e2e8f0;
  --input:             #e8ecf1;
  --ring:              #3b82f6;

  /* Brand colours */
  --primary:           #2563eb;
  --primary-dark:      #1d4ed8;
  --primary-light:     #dbeafe;
  --primary-fg:        #ffffff;
  --secondary:         #10b981;
  --secondary-fg:      #ffffff;
  --accent:            #f59e0b;
  --destructive:       #ef4444;
  --destructive-fg:    #ffffff;
  --success:           #22c55e;
  --warning:           #eab308;
  --info:              #3b82f6;

  /* Elevation / shadow */
  --shadow-xs:       0 1px 2px rgba(15,23,42,0.04);
  --shadow-soft:     0 2px 8px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md:       0 4px 16px rgba(15,23,42,0.08), 0 2px 4px rgba(15,23,42,0.04);
  --shadow-elevated: 0 8px 32px rgba(15,23,42,0.10), 0 2px 8px rgba(15,23,42,0.06);
  --shadow-glow:     0 0 0 1px rgba(37,99,235,0.15), 0 4px 16px rgba(37,99,235,0.18);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  --gradient-hero:    radial-gradient(ellipse 70% 60% at 50% -10%, rgba(37,99,235,0.10) 0%, transparent 70%);
  --gradient-card:    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --gradient-surface: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);

  /* ── Typography ──────────────────────────────────────────── */
  /* Plus Jakarta Sans: clean, modern SaaS English (like infodev.com.np)
     Noto Sans Devanagari: clear, legible Nepali script (like bandanasigdel.com.np)
     Combined: PJS handles latin, Noto handles devanagari automatically via unicode ranges */
  --font-display:  'Plus Jakarta Sans', 'Noto Sans Devanagari', ui-sans-serif, system-ui, sans-serif;
  --font-body:     'Plus Jakarta Sans', 'Noto Sans Devanagari', ui-sans-serif, system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', ui-monospace, monospace;

  /* Type scale — uniform across all pages */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.8125rem;  /* 13px */
  --text-base: 0.9375rem;  /* 15px */
  --text-md:   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 */

  /* Transitions */
  --transition:    all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.12s ease;
}

/* Dark mode */
html.dark {
  --background:        #0f172a;
  --foreground:        #f1f5f9;
  --card:              #1e293b;
  --card-foreground:   #f1f5f9;
  --muted:             #1e293b;
  --muted-foreground:  #94a3b8;
  --border:            #334155;
  --input:             #1e293b;
  --shadow-soft:       0 2px 8px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-elevated:   0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
  --gradient-card:     linear-gradient(180deg, #1e293b 0%, #172033 100%);
  --gradient-surface:  linear-gradient(180deg, #0f172a 0%, #0d1526 100%);
  --gradient-hero:     radial-gradient(ellipse 70% 60% at 50% -10%, rgba(37,99,235,0.15) 0%, transparent 70%);
}

/* ── 2. Base Reset & Typography ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Enable subpixel rendering for Plus Jakarta Sans */
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--foreground);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11"; /* PJS optical features */
}

/* Devanagari script: use Noto Sans Devanagari automatically */
:lang(ne), [lang="ne"], .lang-np {
  font-family: 'Noto Sans Devanagari', 'Plus Jakarta Sans', sans-serif;
  line-height: 1.8; /* Devanagari needs more line-height */
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: var(--font-display);
  font-feature-settings: "cv02", "cv03", "cv04";
}

/* Uniform heading scale */
h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--foreground);
}
h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--foreground);
}
h3 {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--foreground);
}
h4 { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; color: var(--foreground); }
h5 { font-size: var(--text-base); font-weight: 600; color: var(--foreground); }
h6 { font-size: var(--text-sm); font-weight: 600; color: var(--muted-foreground); }

p {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--muted-foreground);
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
code, kbd, pre { font-family: var(--font-mono); }

/* Lead paragraph (intro text) */
.lead {
  font-size: var(--text-lg);
  line-height: 1.65;
  color: var(--muted-foreground);
  font-weight: 400;
}

/* Small/caption text */
.text-caption {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--muted-foreground);
}

/* ── 3. Layout Utilities ──────────────────────────────────── */
.container    { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 2rem; }
.container-sm { width: 100%; max-width: 720px;  margin-inline: auto; padding-inline: 2rem; }
.container-lg { width: 100%; max-width: 1400px; margin-inline: auto; padding-inline: 2rem; }

@media (max-width: 768px) {
  .container, .container-sm, .container-lg { padding-inline: 1.25rem; }
}

/* Section spacing — uniform */
.section { padding-block: 5rem; }
.section-sm { padding-block: 3.5rem; }
.section-lg { padding-block: 7rem; }

/* Section heading group */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-header h2 { margin-bottom: 0.875rem; }
.section-header p  {
  font-size: var(--text-lg);
  max-width: 40rem;
  margin-inline: auto;
  color: var(--muted-foreground);
}

/* ── 4. Decorative Patterns ───────────────────────────────── */
.bg-dot-grid {
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
}

.blur-orb {
  position: absolute;
  pointer-events: none;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.5;
}
.blur-orb-primary { background: rgba(37,99,235,0.22); }
.blur-orb-violet  { background: rgba(79,70,229,0.18); }
.blur-orb-teal    { background: rgba(16,185,129,0.15); }

.bg-gradient-hero {
  background: var(--background) var(--gradient-hero);
}

/* ── 5. Component Library ─────────────────────────────────── */

/* Navbar glass */
.glass {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(250,251,252,0.90);
  border-bottom: 1px solid var(--border);
}
html.dark .glass {
  background: rgba(15,23,42,0.90);
}

/* Section eyebrow chip */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 1.5px solid var(--primary-light);
  background: var(--primary-light);
  border-radius: 9999px;
  padding: 0.4rem 1.125rem;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  font-family: var(--font-display);
}

/* Section heading utilities */
.section-h2 {
  font-size: clamp(1.875rem, 3.5vw, 2.625rem);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-sub {
  font-size: clamp(1rem, 1.75vw, 1.125rem);
  line-height: 1.75;
  color: var(--muted-foreground);
}

/* Card base */
.st-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}
.st-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
  border-color: rgba(37,99,235,0.2);
}

/* Feature card */
.feature-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 1.875rem;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}
.feature-card h3 {
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--foreground);
  margin-bottom: 0.625rem;
}
.feature-card p {
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--muted-foreground);
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevated);
  border-color: rgba(37,99,235,0.25);
}

/* Product icon gradient box */
.icon-box {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glow);
}
.icon-box-blue    { background: linear-gradient(135deg, #2563eb, #4f46e5); }
.icon-box-green   { background: linear-gradient(135deg, #10b981, #059669); }
.icon-box-amber   { background: linear-gradient(135deg, #f59e0b, #d97706); }
.icon-box-purple  { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.icon-box-teal    { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.icon-box-rose    { background: linear-gradient(135deg, #f43f5e, #e11d48); }

/* Gradient text */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-primary { background: var(--gradient-primary); }
.bg-gradient-surface { background: var(--gradient-surface); }

/* ── 6. Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  letter-spacing: -0.01em;
}
.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn-sm  { padding: 0.5rem 1rem; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-md  { padding: 0.625rem 1.25rem; font-size: var(--text-sm); }
.btn-lg  { padding: 0.875rem 1.875rem; font-size: var(--text-md); border-radius: var(--radius-md); }

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(37,99,235,0.28);
}
.btn-primary:hover {
  box-shadow: 0 4px 18px rgba(37,99,235,0.38);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--muted);
  color: var(--foreground);
}

.btn-white {
  background: #fff;
  color: var(--primary);
  border-color: transparent;
}
.btn-white:hover { background: var(--primary-light); }

/* ── 7. Form Controls ─────────────────────────────────────── */
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.375rem;
  letter-spacing: -0.005em;
}
.form-label-sub {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted-foreground);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--foreground);
  transition: var(--transition);
  outline: none;
  box-shadow: var(--shadow-xs);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--muted-foreground); opacity: 0.65; }
.form-textarea { resize: vertical; min-height: 7rem; }

/* ── 8. Status Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.2rem 0.625rem;
  border-radius: 9999px;
  border: 1px solid;
  text-transform: capitalize;
  letter-spacing: 0.02em;
  font-family: var(--font-display);
}
.badge-open        { background:#fef2f2; color:#dc2626; border-color:#fecaca; }
.badge-in_progress { background:#fffbeb; color:#d97706; border-color:#fde68a; }
.badge-replied     { background:#eff6ff; color:#2563eb; border-color:#bfdbfe; }
.badge-resolved    { background:#f0fdf4; color:#16a34a; border-color:#bbf7d0; }
.badge-closed      { background:#f8fafc; color:#64748b; border-color:#e2e8f0; }
.badge-pending     { background:#fffbeb; color:#d97706; border-color:#fde68a; }
.badge-paid        { background:#f0fdf4; color:#16a34a; border-color:#bbf7d0; }
.badge-urgent      { background:#fef2f2; color:#dc2626; border-color:#fecaca; }
.badge-high        { background:#fff7ed; color:#ea580c; border-color:#fed7aa; }
.badge-normal      { background:#eff6ff; color:#2563eb; border-color:#bfdbfe; }
.badge-low         { background:#f8fafc; color:#64748b; border-color:#e2e8f0; }
.badge-new         { background:#f0fdf4; color:#16a34a; border-color:#bbf7d0; }
.badge-active      { background:#f0fdf4; color:#16a34a; border-color:#bbf7d0; }

/* ── 9. Table ─────────────────────────────────────────────── */
.st-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.st-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  background: var(--muted);
  font-family: var(--font-display);
}
.st-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
  vertical-align: middle;
  font-size: var(--text-sm);
}
.st-table tr:last-child td { border-bottom: none; }
.st-table tbody tr { transition: var(--transition-fast); }
.st-table tbody tr:hover { background: var(--muted); }

/* ── 10. Alert / Toast ────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: var(--text-sm);
  font-weight: 500;
}
.alert-success { background:#f0fdf4; color:#15803d; border-color:#bbf7d0; }
.alert-error   { background:#fef2f2; color:#b91c1c; border-color:#fecaca; }
.alert-warning { background:#fffbeb; color:#b45309; border-color:#fde68a; }
.alert-info    { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; }

/* ── 11. Sidebar ──────────────────────────────────────────── */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted-foreground);
  transition: var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}
.sidebar-link:hover { background: var(--muted); color: var(--foreground); }
.sidebar-link.active {
  background: rgba(37,99,235,0.08);
  color: var(--primary);
  font-weight: 600;
}
.sidebar-link .sidebar-icon {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-dark .sidebar-link { color: rgba(241,245,249,0.55); }
.sidebar-dark .sidebar-link:hover { background: rgba(241,245,249,0.07); color: rgba(241,245,249,0.9); }
.sidebar-dark .sidebar-link.active { background: rgba(37,99,235,0.2); color: #93c5fd; }

/* ── 12. Avatar ───────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--gradient-primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-sm  { width: 1.75rem; height: 1.75rem; font-size: var(--text-xs); }
.avatar-md  { width: 2.25rem; height: 2.25rem; font-size: var(--text-sm); }
.avatar-lg  { width: 3rem;    height: 3rem;    font-size: 1.125rem; }
.avatar-xl  { width: 4rem;    height: 4rem;    font-size: 1.5rem; }
.avatar-2xl { width: 5rem;    height: 5rem;    font-size: 1.875rem; }

/* ── 13. Divider ──────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.divider-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.divider-label::before, .divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── 14. Accordion ────────────────────────────────────────── */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.625rem;
  background: var(--card);
  transition: var(--transition-fast);
}
.accordion-item:hover { border-color: rgba(37,99,235,0.25); }
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 1.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--foreground);
  gap: 1rem;
}
.accordion-content {
  padding: 0 1.25rem 1.125rem;
  color: var(--muted-foreground);
  font-size: var(--text-base);
  line-height: 1.75;
}

/* ── 15. Pagination ───────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 2rem;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--foreground);
  background: var(--card);
  transition: var(--transition-fast);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── 16. WhatsApp Float Button ────────────────────────────── */
.whatsapp-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.40);
  color: #fff;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.whatsapp-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(37,211,102,0.50);
}

/* ── 17. Toast ────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  min-width: 280px;
  max-width: 400px;
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid;
  animation: toast-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes toast-in {
  from { opacity:0; transform: translateX(1rem); }
  to   { opacity:1; transform: translateX(0); }
}

/* ── 18. Responsive Grid helpers ──────────────────────────── */
.grid-auto-fill-sm { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.grid-auto-fill-md { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-auto-fill-lg { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1.5rem; }

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

/* ── 20. Utility overrides ────────────────────────────────── */
.transition-smooth { transition: var(--transition); }
.text-muted   { color: var(--muted-foreground); }
.text-primary { color: var(--primary); }
.bg-card      { background: var(--card); }
.border-card  { border: 1px solid var(--border); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-2xl  { border-radius: var(--radius-2xl); }
.rounded-3xl  { border-radius: var(--radius-3xl); }
.shadow-soft  { box-shadow: var(--shadow-soft); }
.shadow-elevated { box-shadow: var(--shadow-elevated); }
.shadow-glow  { box-shadow: var(--shadow-glow); }
.line-clamp-2 { overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.line-clamp-3 { overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; }

/* ── 21. Accessibility ────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ── 22. Button States ────────────────────────────────────── */
.btn[data-loading="1"],
.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}
@keyframes btn-spinner { to { transform: rotate(360deg); } }
.btn-spinner {
  display: inline-block;
  width: 0.875em;
  height: 0.875em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spinner 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 0.375rem;
}

/* ── 23. Print ────────────────────────────────────────────── */
@media print {
  header, nav, .sidebar, aside,
  #admin-sidebar, #portal-sidebar, #portal-sidebar-overlay, #admin-sidebar-overlay,
  .btn, .alert:not(.alert-print), footer,
  #float-chat-btn, #wa-float-btn,
  [data-no-print] { display: none !important; }

  body, html { background: #fff !important; color: #000 !important; font-size: 12pt !important; }
  main, .main-content, [style*="flex:1"] {
    width: 100% !important; max-width: 100% !important;
    padding: 0 !important; overflow: visible !important;
  }
  .st-card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  table { border-collapse: collapse !important; }
  th, td { border: 1px solid #ddd !important; padding: 6pt 8pt !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
  a[href^="#"]::after, a[href^="javascript"]::after { content: ""; }
  h1, h2, h3 { break-after: avoid; }
  img { max-width: 100% !important; }
}

/* ── 24. Priority Rows ────────────────────────────────────── */
.priority-urgent-row { border-left: 3px solid #dc2626 !important; background: #fff5f5; }
.priority-high-row   { border-left: 3px solid #d97706 !important; background: #fffbeb; }

/* ── 25. Breadcrumb ───────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted-foreground); text-decoration: none; transition: color 0.15s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep    { opacity: 0.4; }
.breadcrumb .current { color: var(--foreground); font-weight: 500; }

/* ── 26. Footer ───────────────────────────────────────────── */
:root { --footer-bg: #0f172a; }
.dark  { --footer-bg: #060c17; }

/* ── 27. Page Transition ──────────────────────────────────── */
@keyframes st-fade-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
body { animation: st-fade-in 0.2s ease-out; }
@media (prefers-reduced-motion: reduce) { body { animation: none; } }

/* ── 28. Nav Links ────────────────────────────────────────── */
.nav-link {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border-radius: 0.5rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--muted); }
.nav-link.active, .nav-link[aria-current="page"] {
  background: var(--primary-light, #eff6ff);
  color: var(--primary);
  font-weight: 600;
}
.nav-link-danger { color: var(--destructive); }
.nav-link-danger:hover { background: #fef2f2; color: var(--destructive); }

/* ── 29. Bulk Toolbar ─────────────────────────────────────── */
.bulk-toolbar {
  display: none; align-items: center; gap: 0.75rem;
  padding: 0.625rem 1rem; background: var(--primary-light,#eff6ff);
  border: 1px solid var(--primary); border-radius: 0.625rem;
  margin-bottom: 0.875rem; font-size: var(--text-sm);
}
.bulk-toolbar.active { display: flex; }

/* ── 30. Verify Banner ────────────────────────────────────── */
.verify-banner {
  display: flex; align-items: center; gap: 0.875rem; flex-wrap: wrap;
  padding: 0.875rem 1.25rem; background: #fefce8; border: 1px solid #fde047;
  border-radius: 0.75rem; margin-bottom: 1.25rem; font-size: var(--text-sm);
}

/* ── 31. Page-Level Utilities ─────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--foreground);
  margin: 0;
  letter-spacing: -0.02em;
}
.page-header p {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  margin: 0.25rem 0 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 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;
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-card .stat-label {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  margin-top: 0.375rem;
}

.portal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.portal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.portal-card-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.portal-card-body { padding: 1.5rem; }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
  color: var(--muted-foreground);
}
.sidebar-nav-item:hover { background: var(--muted); color: var(--foreground); }
.sidebar-nav-item.active { background: var(--primary-light, #eff6ff); color: var(--primary); font-weight: 600; }
.sidebar-nav-item:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
