/* ========================================
   Currency Denomination Distributor - Design System
   v3.0.0 - Premium Professional Documentation UI
   Modern, Accessible, Responsive
   ======================================== */

/* 1. CSS Variables & Design Tokens
   ======================================== */
:root {
  /* Color Palette - Brand */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  --primary-950: #172554;

  /* Color Palette - Neutral (Slate) */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  /* Color Palette - Semantic */
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;
  --success-800: #166534;
  
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;
  --warning-800: #92400e;
  
  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;
  --danger-800: #991b1b;
  
  --info-50: #f0f9ff;
  --info-100: #e0f2fe;
  --info-500: #06b6d4;
  --info-600: #0891b2;
  --info-700: #0e7490;
  --info-800: #155e75;

  /* Layout Dimensions */
  --sidebar-width: 300px;
  --sidebar-width-collapsed: 70px;
  --header-height: 70px;
  --content-max-width: 1100px;
  --content-width-wide: 1400px;

  /* Spacing Scale */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-7: 1.75rem;   /* 28px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  
  /* 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-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Font Weights */
  --weight-light: 300;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index Scale */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-fixed: 1200;
  --z-modal-backdrop: 1300;
  --z-modal: 1400;
  --z-popover: 1500;
  --z-tooltip: 1600;
}

/* 2. Global Reset & Base Styles
   ======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(to bottom right, var(--slate-50), var(--slate-100));
  color: var(--slate-800);
  line-height: var(--leading-relaxed);
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  height: 100%;
  overflow-x: hidden;
}

/* Selection */
::selection {
  background-color: var(--primary-100);
  color: var(--primary-900);
}

::-moz-selection {
  background-color: var(--primary-100);
  color: var(--primary-900);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--slate-100);
}

::-webkit-scrollbar-thumb {
  background: var(--slate-400);
  border-radius: var(--radius-lg);
  border: 2px solid var(--slate-100);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--slate-500);
}

/* Sidebar Scrollbar - Dark Theme */
.sidebar::-webkit-scrollbar-track {
  background: var(--slate-800);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--slate-600);
  border-color: var(--slate-800);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--slate-500);
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-600);
  color: white;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* 3. Typography System
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--slate-900);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-6) 0;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-extrabold);
  background: linear-gradient(135deg, var(--slate-900) 0%, var(--primary-700) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-bottom: var(--space-4);
  border-bottom: 3px solid var(--primary-500);
  margin-bottom: var(--space-8);
}

h2 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--slate-800);
  margin-top: var(--space-12);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--slate-200);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 28px;
  background: linear-gradient(to bottom, var(--primary-500), var(--primary-700));
  border-radius: var(--radius-full);
}

h3 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--slate-700);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

h4 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--slate-700);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--slate-600);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--slate-600);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin-bottom: var(--space-5);
  color: var(--slate-600);
  line-height: var(--leading-relaxed);
  font-size: var(--text-base);
}

strong, b {
  font-weight: var(--weight-semibold);
  color: var(--slate-800);
}

em, i {
  font-style: italic;
  color: var(--slate-700);
}

a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition-fast), text-decoration var(--transition-fast);
  font-weight: var(--weight-medium);
}

a:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

a:active {
  color: var(--primary-800);
}

/* Code Elements */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--slate-100);
  color: var(--primary-700);
  padding: 0.2em 0.5em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-200);
  font-weight: var(--weight-medium);
}

pre {
  background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-800) 100%);
  color: var(--slate-100);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: var(--space-6) 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--slate-700);
  position: relative;
}

pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-500), var(--info-500), var(--success-500));
}

pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
}

blockquote {
  border-left: 4px solid var(--primary-500);
  padding-left: var(--space-6);
  margin: var(--space-6) 0;
  font-style: italic;
  color: var(--slate-600);
  background-color: var(--primary-50);
  padding: var(--space-4) var(--space-6);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Lists */
ul, ol {
  margin: var(--space-4) 0 var(--space-6) var(--space-8);
  padding-left: 0;
}

ul {
  list-style-type: none;
}

ul li {
  position: relative;
  padding-left: var(--space-6);
  margin-bottom: var(--space-3);
  color: var(--slate-600);
  line-height: var(--leading-relaxed);
}

ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background-color: var(--primary-500);
  border-radius: var(--radius-full);
}

ol {
  list-style-type: decimal;
  list-style-position: outside;
  padding-left: var(--space-8);
}

ol li {
  margin-bottom: var(--space-3);
  color: var(--slate-600);
  line-height: var(--leading-relaxed);
  padding-left: var(--space-2);
}

ol li::marker {
  color: var(--primary-600);
  font-weight: var(--weight-semibold);
}

/* Horizontal Rule */
hr {
  border: none;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--slate-300), transparent);
  margin: var(--space-12) 0;
}

/* 4. Layout Structure
   ======================================== */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Navigation
   ======================================== */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--slate-900) 0%, var(--slate-950) 100%);
  color: var(--slate-300);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: var(--z-fixed);
  transition: transform var(--transition-base), width var(--transition-base);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-2xl);
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

/* Hotspot for edge detection */
.sidebar-hotspot {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 24px;
  z-index: var(--z-fixed);
  background: transparent;
  display: none; /* Hidden by default */
}

/* Show hotspot when sidebar is collapsed on desktop */
@media (min-width: 769px) {
  body.sidebar-collapsed .sidebar-hotspot {
    display: block;
  }
}

/* Peeking state - slides in but overlays content (doesn't push it) */
.sidebar.peeking {
  transform: translateX(0);
  box-shadow: var(--shadow-2xl);
}

.sidebar-toggle {
  position: fixed;
  top: 85px;
  left: 24px;
  z-index: var(--z-modal);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-600);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

.sidebar-toggle:hover {
  background: var(--primary-700);
  transform: scale(1.05);
}

.sidebar-toggle.collapsed {
  left: 24px; /* Keep it visible when sidebar is collapsed */
  background: var(--slate-800);
  opacity: 0.8;
}

.sidebar-toggle.collapsed:hover {
  opacity: 1;
}

/* Adjust toggle position when sidebar is open on desktop */
@media (min-width: 769px) {
  .sidebar-toggle {
    left: calc(var(--sidebar-width) - 24px); /* Overlap edge */
    top: 85px;
    width: 32px;
    height: 32px;
    font-size: 14px;
    background: var(--slate-800);
    border: 1px solid var(--slate-700);
  }
  
  .sidebar.collapsed + .sidebar-toggle,
  body.sidebar-collapsed .sidebar-toggle {
    left: 24px;
  }
}

.sidebar-header {
  padding: var(--space-8) var(--space-6);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

/* Logo hover animation */
.sidebar-header img {
  transition: transform var(--transition-base);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.sidebar-header:hover img {
  transform: scale(1.05) rotate(3deg);
}

.sidebar-header h2 {
  color: white;
  font-size: var(--text-2xl);
  margin: 0 0 var(--space-2) 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  border: none;
  padding: 0;
}

.sidebar-header h2::before {
  content: none;
}

.sidebar-header p {
  font-size: var(--text-sm);
  color: var(--slate-400);
  margin: 0;
}

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

.text-gray-400 {
  color: var(--slate-400);
}

/* Navigation Sections */
.sidebar-nav,
.sidebar-section {
  padding: var(--space-2) var(--space-4);
}

.sidebar-section {
  margin-bottom: var(--space-6);
}

.sidebar-section h3,
.nav-section-title {
  text-transform: uppercase;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  color: var(--slate-500);
  margin: var(--space-6) 0 var(--space-3) 0;
  padding: 0 var(--space-3);
  border: none;
}

.sidebar-section h3::before,
.nav-section-title::before {
  content: none;
}

.nav-section {
  margin-bottom: var(--space-8);
}

.nav-links,
.sidebar-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li,
.sidebar-links li {
  margin-bottom: var(--space-1);
}

.nav-links li::before,
.sidebar-links li::before {
  content: none;
}

.nav-links a,
.sidebar-links a {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  color: var(--slate-400);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.nav-links a::before,
.sidebar-links a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-500);
  transform: scaleY(0);
  transition: transform var(--transition-base);
}

.nav-links a:hover,
.sidebar-links a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  transform: translateX(4px);
}

.nav-links a.active,
.sidebar-links a.active {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  color: white;
  font-weight: var(--weight-semibold);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.nav-links a.active::before,
.sidebar-links a.active::before {
  transform: scaleY(1);
}

/* Main Content Area
   ======================================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: white;
  position: relative;
  transition: margin-left var(--transition-base);
}

.main-content.expanded {
  margin-left: 0;
}

/* Page Header
   ======================================== */
.page-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-10);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-sm);
  gap: var(--space-4);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0; /* Allow flex item to shrink */
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--slate-600);
  font-weight: var(--weight-medium);
}

.breadcrumbs a {
  color: var(--slate-600);
  font-weight: var(--weight-semibold);
  transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
  color: var(--primary-600);
  text-decoration: none;
}

.breadcrumbs .separator,
.breadcrumbs span:not(.separator):not(:first-child):not(:last-child)::before {
  color: var(--slate-400);
  margin: 0 var(--space-1);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.action-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--slate-600);
  background-color: transparent;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.action-link:hover {
  background-color: var(--slate-50);
  border-color: var(--slate-300);
  color: var(--slate-900);
  text-decoration: none;
}

/* Article Container
   ======================================== */
.article-container {
  flex: 1;
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-12) var(--space-10);
}

.article-header {
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-8);
  border-bottom: 2px solid var(--slate-200);
}

.article-header h1 {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-4);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-top: var(--space-6);
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(135deg, var(--slate-50) 0%, var(--primary-50) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
}

.article-meta span {
  font-size: var(--text-sm);
  color: var(--slate-600);
  font-weight: var(--weight-medium);
}

.article-content {
  font-size: var(--text-base);
  color: var(--slate-700);
}

/* 5. Component Styles
   ======================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1px solid transparent;
  gap: var(--space-2);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background-color: white;
  border-color: var(--slate-300);
  color: var(--slate-700);
}

.btn-secondary:hover {
  background-color: var(--slate-50);
  border-color: var(--slate-400);
  text-decoration: none;
  color: var(--slate-900);
  box-shadow: var(--shadow-sm);
}

.btn-logout {
  background-color: transparent;
  border-color: var(--danger-500);
  color: var(--danger-600);
}

.btn-logout:hover {
  background-color: var(--danger-50);
  border-color: var(--danger-600);
  color: var(--danger-700);
  text-decoration: none;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-500) 0%, var(--danger-600) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--danger-600) 0%, var(--danger-700) 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: var(--space-8) 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-md);
  background: white;
}

table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  font-size: var(--text-sm);
}

thead {
  background: linear-gradient(135deg, var(--slate-50) 0%, var(--slate-100) 100%);
  border-bottom: 2px solid var(--slate-300);
}

th {
  background-color: transparent;
  color: var(--slate-800);
  font-weight: var(--weight-bold);
  text-align: left;
  padding: var(--space-4) var(--space-5);
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  border-bottom: none;
}

td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-700);
  line-height: var(--leading-relaxed);
}

tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background-color: var(--slate-50);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Alerts & Callouts */
.alert {
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-lg);
  margin: var(--space-6) 0;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  box-shadow: var(--shadow-sm);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.alert::before {
  content: 'ℹ';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}

.alert strong {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--weight-semibold);
}

.alert p {
  margin: 0;
}

.alert-info {
  background: linear-gradient(135deg, var(--info-50) 0%, var(--primary-50) 100%);
  border-color: var(--info-200);
  color: var(--info-900);
}

.alert-info::before {
  content: 'ℹ';
  background-color: var(--info-500);
  color: white;
}

.alert-success {
  background: linear-gradient(135deg, var(--success-50) 0%, var(--success-100) 100%);
  border-color: var(--success-200);
  color: var(--success-900);
}

.alert-success::before {
  content: '✓';
  background-color: var(--success-600);
  color: white;
}

.alert-warning {
  background: linear-gradient(135deg, var(--warning-50) 0%, var(--warning-100) 100%);
  border-color: var(--warning-200);
  color: var(--warning-900);
}

.alert-warning::before {
  content: '⚠';
  background-color: var(--warning-500);
  color: white;
}

.alert-danger {
  background: linear-gradient(135deg, var(--danger-50) 0%, var(--danger-100) 100%);
  border-color: var(--danger-200);
  color: var(--danger-900);
}

.alert-danger::before {
  content: '✕';
  background-color: var(--danger-600);
  color: white;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

.badge-success {
  background-color: var(--success-100);
  color: var(--success-800);
  border: 1px solid var(--success-200);
}

.badge-warning {
  background-color: var(--warning-100);
  color: var(--warning-800);
  border: 1px solid var(--warning-200);
}

.badge-danger {
  background-color: var(--danger-100);
  color: var(--danger-800);
  border: 1px solid var(--danger-200);
}

.badge-info {
  background-color: var(--info-100);
  color: var(--info-800);
  border: 1px solid var(--info-200);
}

/* Feature Cards */
.feature-card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin: var(--space-6) 0;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary-300);
}

.feature-card h3 {
  margin-top: 0;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

.card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-300);
}

.card h3 {
  color: var(--primary-700);
  margin-top: 0;
/* 6. Login Page Styles
   ======================================== */
.login-page {
  background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-950) 50%, var(--primary-950) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(20px);
  width: 100%;
  max-width: 440px;
  padding: var(--space-10) var(--space-8);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl), 0 0 80px rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.login-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
  color: white;
  font-size: var(--text-3xl);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.login-title {
  color: white;
  font-size: var(--text-3xl);
  margin: 0 0 var(--space-3) 0;
  font-weight: var(--weight-bold);
  border: none;
  padding: 0;
}

.login-subtitle {
  color: var(--slate-400);
  font-size: var(--text-base);
  margin: 0;
}

.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  color: var(--slate-300);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--slate-600);
  border-radius: var(--radius-lg);
  color: white;
  font-size: var(--text-base);
  transition: all var(--transition-base);
  font-family: var(--font-sans);
}

.form-input::placeholder {
  color: var(--slate-500);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), var(--shadow-lg);
  background-color: rgba(15, 23, 42, 0.8);
}

.btn-login {
  width: 100%;
  padding: var(--space-4);
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  margin-top: var(--space-2);
}

.btn-login:hover {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  transform: translateY(-2px);
}

.btn-login:active {
  transform: translateY(0);
}

.login-footer {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: var(--slate-500);
  font-size: var(--text-xs);
}

/* 7. Page Navigation Component
   ======================================== */

/* Navigation Bar Container */
.page-navigation-bar {
  margin-top: var(--space-16);
  padding: var(--space-10) 0;
  border-top: 2px solid var(--slate-200);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-6);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Navigation Buttons - Green Theme */
.page-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  background: #10b981;
  color: white;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  min-height: 40px;
  white-space: nowrap;
}

.page-nav-btn--prev {
  justify-self: start;
}

.page-nav-btn--next {
  justify-self: end;
}

.page-nav-btn:hover {
  background: #059669;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-nav-btn:active {
  background: #047857;
}

.page-nav-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

.page-nav-btn:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* Disabled button state - maintain space but invisible */
.page-nav-btn--disabled {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Button Icon - Arrow symbols */
.page-nav-btn__icon {
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: 1;
}

/* Button Text */
.page-nav-btn__text {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: white;
}

/* Center Page Indicator */
.page-nav-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  min-height: 40px;
  justify-self: center;
}

.page-nav-indicator__text {
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  color: var(--slate-700);
  letter-spacing: 0;
  white-space: nowrap;
  text-align: center;
}

/* Hide progress bar */
.page-nav-indicator__progress {
  display: none;
}

.page-nav-indicator__progress-fill {
  display: none;
}

/* 8. Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* 9. Responsive Design System
   ======================================== */

/* Mobile Navigation Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: var(--z-fixed);
  width: 44px;
  height: 44px;
  background: var(--primary-600);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
}

.mobile-menu-toggle:hover {
  background: var(--primary-700);
  transform: scale(1.05);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all var(--transition-base);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hamburger Menu Button (in page-header) */
/* Always visible on ALL devices for manual sidebar toggle */
.hamburger-menu {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: var(--primary-600);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0;
  gap: 4px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  z-index: calc(var(--z-sticky) + 1);
  flex-shrink: 0; /* Prevent button from shrinking */
  order: -1; /* Position hamburger as first item in header */
}

.hamburger-menu:hover {
  background: var(--primary-700);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.hamburger-menu:active {
  transform: scale(0.95);
}

.hamburger-menu:focus {
  outline: 2px solid var(--primary-400);
  outline-offset: 2px;
}

.hamburger-bar {
  width: 22px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all var(--transition-base);
}

.hamburger-menu.active .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-menu.active .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.hamburger-menu.active .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Touch device optimization */
.touch .action-link,
.touch .nav-links a,
.touch button,
.touch .btn {
  min-height: 44px;
  min-width: 44px;
}

/* Responsive table wrapper */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-6) 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
}

/* Desktop & Large Screens (> 1280px) */
@media (min-width: 1281px) {
  :root {
    --content-max-width: 1200px;
    --sidebar-width: 320px;
  }

  .article-container {
    max-width: var(--content-width-wide);
  }

  /* Larger typography for readability */
  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-4xl); }
  h3 { font-size: var(--text-3xl); }
}

/* Laptop (1025px - 1280px) */
@media (min-width: 1025px) and (max-width: 1280px) {
  :root {
    --sidebar-width: 280px;
    --content-max-width: 1000px;
  }

  .article-container {
    padding: var(--space-10) var(--space-8);
  }

  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }

  /* Slightly reduce spacing */
  .article-header {
    margin-bottom: var(--space-10);
  }
}

/* Tablet (481px - 1024px) */
@media (min-width: 481px) and (max-width: 1024px) {
  :root {
    --header-height: auto;
    --sidebar-width: 280px;
  }

  /* Ensure hamburger button is always visible on tablet - use fixed positioning */
  .hamburger-menu {
    display: flex !important;
    position: fixed !important;
    top: 16px !important;
    left: 16px !important;
    z-index: 9999 !important;
    width: 44px;
    height: 44px;
    background: var(--primary-600);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  }

  /* Show mobile menu toggle on tablet */
  .mobile-menu-toggle {
    display: flex;
  }

  /* Sidebar becomes overlay */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    box-shadow: none;
    z-index: calc(var(--z-fixed) - 1);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }

  /* Main content takes full width */
  .main-content {
    margin-left: 0;
    width: 100%;
  }

  /* Header adjustments - add left padding for fixed hamburger on tablet */
  .page-header {
    padding: var(--space-4) var(--space-6) var(--space-4) 72px; /* Left padding for hamburger */
    gap: var(--space-3);
  }

  .breadcrumbs {
    font-size: var(--text-xs);
    gap: var(--space-1);
  }

  .header-actions {
    gap: var(--space-4);
  }

  .action-link {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
  }

  /* Typography scaling */
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); margin-top: var(--space-10); }
  h3 { font-size: var(--text-xl); margin-top: var(--space-8); }
  h4 { font-size: var(--text-lg); }

  /* Article adjustments */
  .article-container {
    padding: var(--space-8) var(--space-6);
  }

  .article-header {
    margin-bottom: var(--space-8);
  }

  /* Navigation bar - compact layout */
  .page-navigation-bar {
    gap: var(--space-3);
  }

  .page-nav-btn {
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-sm);
    min-height: 48px;
  }

  /* Tables - scroll horizontally */
  .table-wrapper {
    margin-left: calc(-1 * var(--space-6));
    margin-right: calc(-1 * var(--space-6));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

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

  th, td {
    padding: var(--space-3) var(--space-4);
  }

  /* Code blocks */
  pre {
    font-size: var(--text-sm);
    margin-left: calc(-1 * var(--space-6));
    margin-right: calc(-1 * var(--space-6));
    border-radius: 0;
  }

  /* Cards and alerts */
  .feature-card,
  .alert {
    padding: var(--space-5);
  }
}

/* Mobile (≤ 480px) */
@media (max-width: 480px) {
  :root {
    --header-height: auto;
    --sidebar-width: 85vw;
    --text-base: 0.9375rem; /* 15px for better mobile readability */
  }

  /* CRITICAL: Hamburger button MUST be visible - use fixed positioning on mobile */
  .hamburger-menu {
    display: flex !important; /* Force visibility */
    position: fixed !important; /* Fixed positioning to guarantee visibility */
    top: 12px !important;
    left: 12px !important;
    z-index: 9999 !important; /* Maximum z-index */
    width: 44px;
    height: 44px;
    background: var(--primary-600);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
  }

  .hamburger-menu:active {
    transform: scale(0.95);
    background: var(--primary-700);
  }

  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex;
    top: var(--space-3);
    left: var(--space-3);
    width: 40px;
    height: 40px;
  }

  /* Full-width sidebar overlay */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    max-width: 320px;
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    z-index: calc(var(--z-fixed) - 1);
    overflow-y: auto;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.4);
  }

  /* Sidebar navigation touch-friendly */
  .nav-links a {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
  }

  .nav-section-title {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-sm);
  }

  /* Main content */
  .main-content {
    margin-left: 0;
    width: 100%;
  }

  /* Header - compact mobile layout - add left padding for fixed hamburger */
  .page-header {
    padding: var(--space-3) var(--space-3) var(--space-3) 68px; /* Left padding for hamburger */
    gap: var(--space-2);
    position: sticky;
    top: 0;
    background: linear-gradient(to bottom right, var(--slate-50), var(--slate-100));
    z-index: var(--z-sticky); /* Restored proper z-index */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap; /* Allow wrapping on very small screens */
    align-items: center; /* Center items vertically */
  }

  .header-content {
    flex-direction: row; /* Keep horizontal on mobile for compact layout */
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap; /* Allow content to wrap if needed */
  }

  .breadcrumbs {
    font-size: var(--text-xs);
    flex-wrap: wrap;
    gap: var(--space-1);
    flex: 0 1 auto; /* Allow shrinking */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .separator {
    margin: 0 var(--space-1);
  }

  .header-actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0; /* Prevent shrinking */
  }

  .action-link,
  .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    min-height: 40px;
    white-space: nowrap;
  }

  /* Typography - mobile optimized */
  h1 {
    font-size: var(--text-2xl);
    line-height: 1.3;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
  }

  h2 {
    font-size: var(--text-xl);
    margin-top: var(--space-8);
    margin-bottom: var(--space-5);
  }

  h3 {
    font-size: var(--text-lg);
    margin-top: var(--space-6);
    margin-bottom: var(--space-4);
  }

  h4 {
    font-size: var(--text-base);
    margin-top: var(--space-5);
  }

  /* Article layout */
  .article-container {
    padding: var(--space-6) var(--space-4);
    max-width: 100%;
  }

  .article-header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-5);
  }

  .article-meta {
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
    font-size: var(--text-xs);
  }

  /* Paragraphs and lists */
  p {
    font-size: var(--text-base);
    line-height: 1.7;
    margin-bottom: var(--space-5);
  }

  ul, ol {
    padding-left: var(--space-6);
    margin-bottom: var(--space-5);
  }

  li {
    margin-bottom: var(--space-3);
    line-height: 1.6;
  }

  /* Navigation bar - stack vertically */
  .page-navigation-bar {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: var(--space-4);
    padding: var(--space-6) 0;
    margin-top: var(--space-8);
  }

  .page-nav-indicator {
    order: -1;
    width: 100%;
    text-align: center;
  }

  .page-nav-btn {
    width: 100%;
    justify-content: center;
    padding: var(--space-4);
    min-height: 48px;
    font-size: var(--text-sm);
  }

  /* Tables - full bleed scroll */
  .table-wrapper {
    margin: var(--space-6) calc(-1 * var(--space-4));
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: inset 0 0 0 1px var(--slate-200);
  }

  table {
    font-size: var(--text-xs);
    min-width: 600px; /* Force horizontal scroll */
  }

  th, td {
    padding: var(--space-3);
    white-space: nowrap;
  }

  th {
    font-size: var(--text-xs);
    position: sticky;
    top: 0;
    background: var(--slate-100);
    z-index: 1;
  }

  /* Code blocks - full bleed */
  pre {
    margin: var(--space-6) calc(-1 * var(--space-4));
    border-radius: 0;
    border-left: none;
    border-right: none;
    font-size: var(--text-xs);
    line-height: 1.6;
    padding: var(--space-4);
  }

  code {
    font-size: var(--text-xs);
  }

  /* Cards and alerts - optimized spacing */
  .feature-card,
  .alert {
    padding: var(--space-4);
    margin-bottom: var(--space-5);
  }

  .feature-card h5,
  .alert h5 {
    font-size: var(--text-base);
    margin-bottom: var(--space-3);
  }

  /* Badges and tags */
  .badge,
  .tag {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
  }

  /* Buttons */
  button,
  .btn {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    min-height: 44px;
  }

  /* Home page - icon grid responsive */
  .icon-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .icon-card {
    padding: var(--space-5);
  }
}

/* Landscape orientation adjustments for phones */
@media (max-width: 768px) and (orientation: landscape) {
  .sidebar {
    width: 50vw;
    max-width: 280px;
  }

  .page-header {
    padding: var(--space-3) var(--space-4);
  }

  .article-container {
    padding: var(--space-5) var(--space-4);
  }

  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
}

/* Small Mobile (480px) */
@media (max-width: 480px) {
  .article-header h1 {
    font-size: var(--text-2xl);
  }

  .header-actions {
    flex-wrap: wrap;
  }
  
  .action-link {
    min-width: 45%; /* 2 per row */
    font-size: var(--text-xs);
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Toggle Button - Floating Action Button style */
.mobile-menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 85px;
    right: 24px;
    z-index: var(--z-modal);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-600);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-toggle:active {
    transform: scale(0.95);
    background: var(--primary-700);
  }
  
  /* Ensure it doesn't cover content at the very bottom */
  .app-container {
    padding-bottom: 80px; 
  }
}

/* Mobile Overlay */
.mobile-overlay {
  display: none;
}

@media (max-width: 1024px) {
  .mobile-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
  }

  .mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Print Styles - Only Print Article Content */
@media print {
  /* Hide navigation, header, and UI elements */
  .sidebar,
  .sidebar-hotspot,
  .page-header,
  .mobile-menu-toggle,
  .sidebar-toggle,
  .page-navigation-bar,
  .breadcrumbs,
  .header-actions,
  .article-meta,
  button,
  .btn {
    display: none !important;
  }

  /* Reset layout for print */
  body {
    background: white;
    margin: 0;
    padding: 0;
  }

  .app-container {
    display: block;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .article-container {
    max-width: 100%;
    padding: 20mm;
    margin: 0;
  }

  /* Style article title */
  .article-header h1 {
    margin-top: 0;
    font-size: 24pt;
    color: #000;
    border-bottom: 2px solid #333;
    padding-bottom: 10pt;
    margin-bottom: 15pt;
  }

  .article-header h2 {
    display: none;
  }

  /* Content typography for print */
  .article-content {
    font-size: 11pt;
    line-height: 1.6;
    color: #000;
  }

  h1 {
    font-size: 20pt;
    margin-top: 15pt;
    page-break-after: avoid;
  }

  h2 {
    font-size: 16pt;
    margin-top: 12pt;
    page-break-after: avoid;
  }

  h3 {
    font-size: 14pt;
    margin-top: 10pt;
    page-break-after: avoid;
  }

  h4, h5, h6 {
    font-size: 12pt;
    margin-top: 8pt;
    page-break-after: avoid;
  }

  p {
    margin: 8pt 0;
    orphans: 3;
    widows: 3;
  }

  /* Lists */
  ul, ol {
    margin: 8pt 0;
    padding-left: 20pt;
  }

  li {
    margin: 4pt 0;
  }

  /* Tables */
  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
    page-break-inside: avoid;
  }

  th, td {
    border: 1px solid #333;
    padding: 6pt;
    text-align: left;
  }

  th {
    background-color: #f0f0f0 !important;
    font-weight: bold;
  }

  /* Code blocks */
  pre {
    border: 1px solid #333;
    padding: 10pt;
    background-color: #f5f5f5 !important;
    font-size: 9pt;
    page-break-inside: avoid;
    overflow: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  code {
    font-size: 9pt;
    background-color: #f0f0f0 !important;
    padding: 2pt 4pt;
    border-radius: 2pt;
  }

  /* Links - show URL in print */
  a {
    color: #000;
    text-decoration: underline;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  /* Alerts and callouts */
  .alert {
    border: 1px solid #333;
    padding: 10pt;
    margin: 10pt 0;
    page-break-inside: avoid;
  }

  /* Images */
  img {
    max-width: 100%;
    page-break-inside: avoid;
  }

  /* Cards */
  .card,
  .feature-card {
    border: 1px solid #ddd;
    padding: 10pt;
    margin: 8pt 0;
    page-break-inside: avoid;
  }

  /* Remove shadows and backgrounds */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }
}

/* 10. Animations & Effects
   ======================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.slide-in {
  animation: slideInFromLeft 0.5s ease-out;
}

/* Smooth Transitions */
a, button, .btn, .nav-links a, .sidebar-links a, .card, .feature-card {
  will-change: transform;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 11. Dark Mode Support (Optional Future Enhancement)
   ======================================== */
@media (prefers-color-scheme: dark) {
  /* Uncomment to enable dark mode */
  /*
  :root {
    --slate-50: #0f172a;
    --slate-900: #f8fafc;
  }
  */
}

/* 12. Password Input Component
   ======================================== */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field {
  padding-right: 48px; /* Space for toggle button */
}

.password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 48px;
  background: transparent;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.password-toggle:hover {
  color: var(--slate-200);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: -2px;
}

.hidden {
  display: none !important;
}

/* Strength Meter */
.strength-meter-container {
  margin-top: var(--space-3);
}

.strength-bar-bg {
  height: 4px;
  background-color: var(--slate-700);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.strength-bar {
  height: 100%;
  width: 0;
  background-color: transparent;
  border-radius: var(--radius-full);
  transition: width var(--transition-base), background-color var(--transition-base);
}

.strength-text {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--slate-500);
  display: block;
  text-align: right;
  transition: color var(--transition-base);
}

/* Requirements List */
.password-requirements {
  margin: var(--space-6) 0;
  padding: var(--space-4);
  background-color: rgba(15, 23, 42, 0.4);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.requirements-title {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-400);
  margin-bottom: var(--space-3);
  font-weight: var(--weight-semibold);
}

.requirements-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.requirement-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--slate-400);
  margin-bottom: var(--space-2);
  transition: color var(--transition-fast);
}

.requirement-item:last-child {
  margin-bottom: 0;
}

.requirement-item::before {
  content: none; /* Override default list style */
}

.req-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 12px;
  font-weight: bold;
}

/* Validation States */
.requirement-item.valid {
  color: var(--success-500);
}

.requirement-item.valid .req-icon {
  color: var(--success-500);
}

.requirement-item.invalid {
  color: var(--slate-500);
}

/* 10. Responsive Utility Classes
   ======================================== */

/* Visibility utilities */
.hide-mobile { display: block; }
.hide-tablet { display: block; }
.hide-laptop { display: block; }
.hide-desktop { display: block; }

.show-mobile { display: none; }
.show-tablet { display: none; }
.show-laptop { display: none; }
.show-desktop { display: none; }

@media (max-width: 480px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
}

@media (min-width: 481px) and (max-width: 768px) {
  .hide-tablet { display: none !important; }
  .show-tablet { display: block !important; }
}

@media (min-width: 769px) and (max-width: 1280px) {
  .hide-laptop { display: none !important; }
  .show-laptop { display: block !important; }
}

@media (min-width: 1281px) {
  .hide-desktop { display: none !important; }
  .show-desktop { display: block !important; }
}

/* Flexbox utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Spacing utilities */
.m-0 { margin: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Touch-friendly sizing */
.touch-target {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* Smooth scroll behavior */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
