/* ===========================================================================
   APAS UI - Refined Core CSS Framework v1.0
   Optimized for Component-Based Architecture
   
   Structure:
   1. Design Tokens & Variables
   2. Reset & Base Styles
   3. Typography System
   4. Spacing & Layout Utilities
   5. Color System
   6. Component Foundations
   7. State & Interaction
   8. Responsive System
   9. Accessibility
   10. Print Styles
   =========================================================================== */

/* ===========================================================================
   1. DESIGN TOKENS & VARIABLES
   =========================================================================== */
:root {
  /* Typography */
  --font-main: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Monaco", "Courier New", monospace;
  --font-math: "Latin Modern Math", "STIX Two Math", serif;
  
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  
  --lh-tight: 1.25;
  --lh-normal: 1.5;
  --lh-relaxed: 1.75;
  
  /* Brand Colors */
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  
  --secondary-500: #8b5cf6;
  --secondary-600: #7c3aed;
  
  --accent-500: #ec4899;
  --accent-600: #db2777;
  
  /* Semantic Colors */
  --success-400: #4ade80;
  --success-500: #22c55e;
  --success-600: #16a34a;
  
  --warning-400: #facc15;
  --warning-500: #eab308;
  --warning-600: #ca8a04;
  
  --danger-400: #f87171;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  
  --info-400: #38bdf8;
  --info-500: #0ea5e9;
  --info-600: #0284c7;
  
  /* Neutrals - Light Mode */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Semantic Aliases */
  --bg: #f8fafc;
  --bg-secondary: #ffffff;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --divider: rgba(0, 0, 0, 0.06);
  
  --text: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-inverse: #ffffff;
  
  /* Spacing Scale */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  
  /* Border Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.14);
  --shadow-2xl: 0 32px 80px rgba(0, 0, 0, 0.16);
  
  /* Focus Ring */
  --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.15);
  --focus-ring-offset: 2px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-index Scale */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;
  
  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  
  --sidebar-width: 280px;
  --sidebar-collapsed: 64px;
  --header-height: 64px;
}

/* Dark Mode */
html.dark {
  --bg: #0a0e1a;
  --bg-secondary: #0f1724;
  --surface: #0f1724;
  --surface-raised: #1a2332;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --divider: rgba(255, 255, 255, 0.06);
  
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-inverse: #0f172a;
  
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.75);
}

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

/* ===========================================================================
   2. RESET & BASE STYLES
   =========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* Selection */
::selection {
  background: rgba(59, 130, 246, 0.2);
  color: var(--text);
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-500);
}

/* Images */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form Elements */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Lists */
ul,
ol {
  list-style: none;
}

/* Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  color: inherit;
}

/* Code */
code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
}

/* ===========================================================================
   3. TYPOGRAPHY SYSTEM
   =========================================================================== */

/* Font Sizes */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.text-7xl { font-size: 4.5rem; line-height: 1; }
.text-8xl { font-size: 6rem; line-height: 1; }
.text-9xl { font-size: 8rem; line-height: 1; }

/* Font Weights */
.font-light { font-weight: var(--fw-light); }
.font-regular { font-weight: var(--fw-regular); }
.font-medium { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold { font-weight: var(--fw-bold); }
.font-extrabold { font-weight: var(--fw-extrabold); }

/* Line Heights */
.leading-none { line-height: 1; }
.leading-tight { line-height: var(--lh-tight); }
.leading-normal { line-height: var(--lh-normal); }
.leading-relaxed { line-height: var(--lh-relaxed); }

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

/* Text Transform */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.normal-case { text-transform: none; }

/* Text Decoration */
.underline { text-decoration: underline; }
.line-through { text-decoration: line-through; }
.no-underline { text-decoration: none; }

/* Text Overflow */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-1 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* Letter Spacing */
.tracking-tight { letter-spacing: -0.025em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }

/* Whitespace */
.whitespace-normal { white-space: normal; }
.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre { white-space: pre; }
.whitespace-pre-wrap { white-space: pre-wrap; }

/* Word Break */
.break-normal { word-break: normal; overflow-wrap: normal; }
.break-words { overflow-wrap: break-word; }
.break-all { word-break: break-all; }

/* ===========================================================================
   4. SPACING & LAYOUT UTILITIES
   =========================================================================== */

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.p-10 { padding: var(--space-10); }
.p-12 { padding: var(--space-12); }

/* Padding X (horizontal) */
.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: var(--space-1); padding-right: var(--space-1); }
.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-5 { padding-left: var(--space-5); padding-right: var(--space-5); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.px-8 { padding-left: var(--space-8); padding-right: var(--space-8); }

/* Padding Y (vertical) */
.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }

/* Individual Padding */
.pt-0 { padding-top: 0; }
.pt-1 { padding-top: var(--space-1); }
.pt-2 { padding-top: var(--space-2); }
.pt-4 { padding-top: var(--space-4); }
.pt-6 { padding-top: var(--space-6); }
.pt-8 { padding-top: var(--space-8); }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: var(--space-1); }
.pb-2 { padding-bottom: var(--space-2); }
.pb-4 { padding-bottom: var(--space-4); }
.pb-6 { padding-bottom: var(--space-6); }
.pb-8 { padding-bottom: var(--space-8); }

.pl-0 { padding-left: 0; }
.pl-2 { padding-left: var(--space-2); }
.pl-4 { padding-left: var(--space-4); }
.pl-6 { padding-left: var(--space-6); }

.pr-0 { padding-right: 0; }
.pr-2 { padding-right: var(--space-2); }
.pr-4 { padding-right: var(--space-4); }
.pr-6 { padding-right: var(--space-6); }

/* Margin */
.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-6 { margin: var(--space-6); }
.m-8 { margin: var(--space-8); }
.m-auto { margin: auto; }

/* Margin X */
.mx-0 { margin-left: 0; margin-right: 0; }
.mx-1 { margin-left: var(--space-1); margin-right: var(--space-1); }
.mx-2 { margin-left: var(--space-2); margin-right: var(--space-2); }
.mx-4 { margin-left: var(--space-4); margin-right: var(--space-4); }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Margin Y */
.my-0 { margin-top: 0; margin-bottom: 0; }
.my-1 { margin-top: var(--space-1); margin-bottom: var(--space-1); }
.my-2 { margin-top: var(--space-2); margin-bottom: var(--space-2); }
.my-4 { margin-top: var(--space-4); margin-bottom: var(--space-4); }
.my-6 { margin-top: var(--space-6); margin-bottom: var(--space-6); }
.my-8 { margin-top: var(--space-8); margin-bottom: var(--space-8); }

/* Individual Margin */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }

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

.ml-0 { margin-left: 0; }
.ml-2 { margin-left: var(--space-2); }
.ml-4 { margin-left: var(--space-4); }
.ml-auto { margin-left: auto; }

.mr-0 { margin-right: 0; }
.mr-2 { margin-right: var(--space-2); }
.mr-4 { margin-right: var(--space-4); }
.mr-auto { margin-right: auto; }

/* Gap (for Flex/Grid) */
.gap-0 { gap: 0; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.inline-grid { display: inline-grid; }
.hidden { display: none; }

/* Flex Direction */
.flex-row { flex-direction: row; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-col { flex-direction: column; }
.flex-col-reverse { flex-direction: column-reverse; }

/* Flex Wrap */
.flex-wrap { flex-wrap: wrap; }
.flex-wrap-reverse { flex-wrap: wrap-reverse; }
.flex-nowrap { flex-wrap: nowrap; }

/* Flex */
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-initial { flex: 0 1 auto; }
.flex-none { flex: none; }

/* Justify Content */
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

/* Align Items */
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.items-stretch { align-items: stretch; }

/* Align Self */
.self-auto { align-self: auto; }
.self-start { align-self: flex-start; }
.self-end { align-self: flex-end; }
.self-center { align-self: center; }
.self-stretch { align-self: stretch; }

/* Grid Template Columns */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Width */
.w-auto { width: auto; }
.w-full { width: 100%; }
.w-screen { width: 100vw; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333333%; }
.w-2\/3 { width: 66.666667%; }
.w-1\/4 { width: 25%; }
.w-3\/4 { width: 75%; }

/* Height */
.h-auto { height: auto; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }

/* Min/Max Width */
.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }
.max-w-xs { max-width: 320px; }
.max-w-sm { max-width: 384px; }
.max-w-md { max-width: 448px; }
.max-w-lg { max-width: 512px; }
.max-w-xl { max-width: 576px; }
.max-w-2xl { max-width: 672px; }
.max-w-3xl { max-width: 768px; }
.max-w-4xl { max-width: 896px; }
.max-w-5xl { max-width: 1024px; }
.max-w-6xl { max-width: 1152px; }
.max-w-7xl { max-width: 1280px; }
.max-w-full { max-width: 100%; }

/* Min/Max Height */
.min-h-0 { min-height: 0; }
.min-h-full { min-height: 100%; }
.min-h-screen { min-height: 100vh; }
.max-h-full { max-height: 100%; }
.max-h-screen { max-height: 100vh; }

/* Position */
.static { position: static; }
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.sticky { position: sticky; }

/* Inset */
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-x-0 { left: 0; right: 0; }
.inset-y-0 { top: 0; bottom: 0; }

.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* Z-index */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-auto { z-index: auto; }

/* ===========================================================================
   5. COLOR SYSTEM
   =========================================================================== */

/* Text Colors */
.text-primary { color: var(--primary-500); }
.text-secondary { color: var(--secondary-500); }
.text-success { color: var(--success-500); }
.text-warning { color: var(--warning-500); }
.text-danger { color: var(--danger-500); }
.text-info { color: var(--info-500); }
.text-muted { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-white { color: var(--text-inverse); }
.text-black { color: #000; }

/* Background Colors */
.bg-primary { background-color: var(--primary-500); color: var(--text-inverse); }
.bg-secondary { background-color: var(--secondary-500); color: var(--text-inverse); }
.bg-success { background-color: var(--success-500); color: var(--text-inverse); }
.bg-warning { background-color: var(--warning-500); color: var(--text-inverse); }
.bg-danger { background-color: var(--danger-500); color: var(--text-inverse); }
.bg-info { background-color: var(--info-500); color: var(--text-inverse); }

.bg-surface { background-color: var(--surface); }
.bg-surface-raised { background-color: var(--surface-raised); }
.bg-transparent { background-color: transparent; }

/* Subtle Backgrounds */
.bg-primary-subtle { background-color: rgba(59, 130, 246, 0.1); }
.bg-success-subtle { background-color: rgba(34, 197, 94, 0.1); }
.bg-warning-subtle { background-color: rgba(234, 179, 8, 0.1); }
.bg-danger-subtle { background-color: rgba(239, 68, 68, 0.1); }
.bg-info-subtle { background-color: rgba(14, 165, 233, 0.1); }

/* Border Colors */
.border-primary { border-color: var(--primary-500); }
.border-success { border-color: var(--success-500); }
.border-warning { border-color: var(--warning-500); }
.border-danger { border-color: var(--danger-500); }
.border-default { border-color: var(--border); }
.border-strong { border-color: var(--border-strong); }

/* ===========================================================================
   6. COMPONENT FOUNDATIONS
   =========================================================================== */

/* Border Radius */
.rounded-none { border-radius: 0; }
.rounded-xs { border-radius: var(--radius-xs); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Border Width */
.border-0 { border-width: 0; }
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-4 { border-width: 4px; }

.border-t { border-top-width: 1px; }
.border-r { border-right-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-l { border-left-width: 1px; }

/* Border Style */
.border-solid { border-style: solid; }
.border-dashed { border-style: dashed; }
.border-dotted { border-style: dotted; }
.border-none { border-style: none; }

/* Shadows */
.shadow-none { box-shadow: none; }
.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* Overflow */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-visible { overflow: visible; }
.overflow-scroll { overflow: scroll; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-hidden { overflow-y: hidden; }

/* Cursor */
.cursor-auto { cursor: auto; }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-wait { cursor: wait; }
.cursor-text { cursor: text; }
.cursor-move { cursor: move; }

/* User Select */
.select-none { user-select: none; }
.select-text { user-select: text; }
.select-all { user-select: all; }
.select-auto { user-select: auto; }

/* Pointer Events */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* Container */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 640px) {
  .container { max-width: var(--container-sm); }
}

@media (min-width: 768px) {
  .container { max-width: var(--container-md); }
}

@media (min-width: 1024px) {
  .container { max-width: var(--container-lg); }
}

@media (min-width: 1280px) {
  .container { max-width: var(--container-xl); }
}

@media (min-width: 1536px) {
  .container { max-width: var(--container-2xl); }
}

/* Divider */
.divider {
  height: 1px;
  background: var(--divider);
  border: none;
}

.divider-vertical {
  width: 1px;
  height: 100%;
  background: var(--divider);
}

/* Aspect Ratio */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-portrait { aspect-ratio: 3 / 4; }
.aspect-auto { aspect-ratio: auto; }

/* Object Fit */
.object-contain { object-fit: contain; }
.object-cover { object-fit: cover; }
.object-fill { object-fit: fill; }
.object-none { object-fit: none; }

/* Object Position */
.object-center { object-position: center; }
.object-top { object-position: top; }
.object-bottom { object-position: bottom; }
.object-left { object-position: left; }
.object-right { object-position: right; }

/* ===========================================================================
   7. BUTTON COMPONENT
   =========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  font-weight: var(--fw-medium);
  line-height: 1;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Button Variants */
.btn-primary {
  background: var(--primary-500);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-600);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--secondary-500);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--secondary-600);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--success-500);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-success:hover:not(:disabled) {
  background: var(--success-600);
  box-shadow: var(--shadow-md);
}

.btn-warning {
  background: var(--warning-500);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-warning:hover:not(:disabled) {
  background: var(--warning-600);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: var(--danger-500);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-600);
  box-shadow: var(--shadow-md);
}

/* Button Styles */
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface-raised);
  border-color: var(--border-strong);
}

.btn-outline.btn-primary {
  border-color: var(--primary-500);
  color: var(--primary-500);
}

.btn-outline.btn-primary:hover:not(:disabled) {
  background: var(--primary-500);
  color: var(--text-inverse);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-raised);
  color: var(--text);
}

.btn-link {
  background: transparent;
  color: var(--primary-500);
  padding: 0;
  height: auto;
}

.btn-link:hover:not(:disabled) {
  text-decoration: underline;
}

/* Button Sizes */
.btn-xs {
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
  gap: var(--space-1);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: 0.8125rem;
  gap: var(--space-1);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: 1rem;
  gap: var(--space-2);
}

.btn-xl {
  padding: var(--space-5) var(--space-8);
  font-size: 1.125rem;
  gap: var(--space-3);
}

/* Button Full Width */
.btn-block {
  width: 100%;
  display: flex;
}

/* Button Group */
.btn-group {
  display: inline-flex;
}

.btn-group .btn {
  border-radius: 0;
  border-right-width: 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}

.btn-group .btn:last-child {
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  border-right-width: 1px;
}

/* ===========================================================================
   8. FORM COMPONENTS
   =========================================================================== */

/* Input Base */
.input,
.textarea,
.select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
  outline: none;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-tertiary);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--primary-500);
  box-shadow: var(--focus-ring);
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--gray-100);
}

html.dark .input:disabled,
html.dark .textarea:disabled,
html.dark .select:disabled {
  background: rgba(255, 255, 255, 0.05);
}

/* Input Sizes */
.input-xs { padding: var(--space-1) var(--space-2); font-size: 0.75rem; }
.input-sm { padding: var(--space-2) var(--space-3); font-size: 0.8125rem; }
.input-lg { padding: var(--space-4) var(--space-5); font-size: 1rem; }

/* Input States */
.input-error,
.textarea-error,
.select-error {
  border-color: var(--danger-500);
}

.input-error:focus,
.textarea-error:focus,
.select-error:focus {
  border-color: var(--danger-500);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.input-success,
.textarea-success,
.select-success {
  border-color: var(--success-500);
}

.input-success:focus,
.textarea-success:focus,
.select-success:focus {
  border-color: var(--success-500);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* Textarea */
.textarea {
  resize: vertical;
  min-height: 80px;
}

.textarea.no-resize {
  resize: none;
}

/* Select */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
}

/* Checkbox & Radio */
.checkbox,
.radio {
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.checkbox {
  border-radius: var(--radius-xs);
}

.radio {
  border-radius: var(--radius-full);
}

.checkbox:checked,
.radio:checked {
  background-color: var(--primary-500);
  border-color: var(--primary-500);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='10' viewBox='0 0 12 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 5L4.5 8.5L11 1.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.radio:checked {
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='8' viewBox='0 0 8 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='4' cy='4' r='3' fill='white'/%3E%3C/svg%3E");
}

.checkbox:focus,
.radio:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
  background: var(--primary-500);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle input:focus + .toggle-slider {
  box-shadow: var(--focus-ring);
}

/* Form Group */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 0.875rem;
  font-weight: var(--fw-medium);
  color: var(--text);
}

.form-help {
  display: block;
  margin-top: var(--space-1);
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.form-error {
  display: block;
  margin-top: var(--space-1);
  font-size: 0.8125rem;
  color: var(--danger-500);
}

.form-success {
  display: block;
  margin-top: var(--space-1);
  font-size: 0.8125rem;
  color: var(--success-500);
}

/* Input Group */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .input {
  border-radius: 0;
}

.input-group .input:first-child {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}

.input-group .input:last-child {
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  background: var(--gray-100);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

html.dark .input-group-text {
  background: rgba(255, 255, 255, 0.05);
}

.input-group-text:first-child {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
  border-right: 0;
}

.input-group-text:last-child {
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  border-left: 0;
}

/* ===========================================================================
   9. CARD COMPONENT
   =========================================================================== */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.card-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--divider);
}

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

.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--divider);
  background: var(--bg);
}

.card-title {
  font-size: 1.125rem;
  font-weight: var(--fw-semibold);
  color: var(--text);
  margin: 0;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* Card Variants */
.card-flat {
  box-shadow: none;
  border: 1px solid var(--border);
}

.card-outline {
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
}

/* ===========================================================================
   10. BADGE COMPONENT
   =========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  line-height: 1;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Badge Variants */
.badge-primary {
  background: var(--primary-500);
  color: var(--text-inverse);
}

.badge-secondary {
  background: var(--secondary-500);
  color: var(--text-inverse);
}

.badge-success {
  background: var(--success-500);
  color: var(--text-inverse);
}

.badge-warning {
  background: var(--warning-500);
  color: var(--text-inverse);
}

.badge-danger {
  background: var(--danger-500);
  color: var(--text-inverse);
}

.badge-info {
  background: var(--info-500);
  color: var(--text-inverse);
}

.badge-gray {
  background: var(--gray-200);
  color: var(--gray-700);
}

html.dark .badge-gray {
  background: var(--gray-700);
  color: var(--gray-200);
}

/* Badge Outline */
.badge-outline {
  background: transparent;
  border: 1px solid currentColor;
}

.badge-outline.badge-primary {
  color: var(--primary-500);
}

.badge-outline.badge-success {
  color: var(--success-500);
}

.badge-outline.badge-warning {
  color: var(--warning-500);
}

.badge-outline.badge-danger {
  color: var(--danger-500);
}

/* Badge Dot */
.badge-dot {
  padding-left: var(--space-3);
  position: relative;
}

.badge-dot::before {
  content: "";
  position: absolute;
  left: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

/* ===========================================================================
   11. ALERT COMPONENT
   =========================================================================== */

.alert {
  padding: var(--space-4);
  border-radius: var(--radius);
  border-left: 4px solid;
  display: flex;
  gap: var(--space-3);
}

.alert-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-1);
}

.alert-message {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Alert Variants */
.alert-primary {
  background: var(--bg-primary-subtle);
  border-color: var(--primary-500);
  color: var(--primary-700);
}

.alert-success {
  background: var(--bg-success-subtle);
  border-color: var(--success-500);
  color: var(--success-600);
}

.alert-warning {
  background: var(--bg-warning-subtle);
  border-color: var(--warning-500);
  color: var(--warning-600);
}

.alert-danger {
  background: var(--bg-danger-subtle);
  border-color: var(--danger-500);
  color: var(--danger-600);
}

.alert-info {
  background: var(--bg-info-subtle);
  border-color: var(--info-500);
  color: var(--info-600);
}

/* Alert Dismissible */
.alert-dismissible {
  padding-right: var(--space-10);
  position: relative;
}

.alert-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  padding: var(--space-1);
  background: none;
  border: none;
  color: currentColor;
  opacity: 0.6;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.alert-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

/* ===========================================================================
   12. MODAL COMPONENT
   =========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  overflow-y: auto;
}

.modal.is-active {
  display: flex;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-backdrop);
  animation: fadeIn 0.2s ease;
}

.modal-container {
  position: relative;
  z-index: var(--z-modal);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: 1px solid var(--divider);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: var(--fw-semibold);
  margin: 0;
}

.modal-close {
  padding: var(--space-2);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition-fast);
  font-size: 1.5rem;
  line-height: 1;
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--text);
}

html.dark .modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: var(--space-5);
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-footer {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--divider);
}

/* Modal Sizes */
.modal-sm .modal-container { max-width: 400px; }
.modal-lg .modal-container { max-width: 800px; }
.modal-xl .modal-container { max-width: 1200px; }
.modal-full .modal-container { max-width: none; margin: var(--space-4); }

/* ===========================================================================
   13. LOADING & SPINNER
   =========================================================================== */

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary-500);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

html.dark .spinner {
  border-color: var(--gray-700);
  border-top-color: var(--primary-500);
}

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

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 32px; height: 32px; border-width: 4px; }
.spinner-xl { width: 48px; height: 48px; border-width: 5px; }

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  backdrop-filter: blur(4px);
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.loading-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 25%,
    rgba(0, 0, 0, 0.12) 50%,
    rgba(0, 0, 0, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

html.dark .skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 1rem; margin-bottom: var(--space-2); }
.skeleton-title { height: 1.5rem; width: 60%; margin-bottom: var(--space-3); }
.skeleton-avatar { width: 48px; height: 48px; border-radius: var(--radius-full); }
.skeleton-card { height: 200px; }

/* ===========================================================================
   14. TOAST NOTIFICATION
   =========================================================================== */

.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 420px;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: slideInRight 0.3s ease;
}

.toast-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: var(--fw-semibold);
  font-size: 0.875rem;
  margin-bottom: var(--space-1);
}

.toast-message {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.toast-close {
  flex-shrink: 0;
  padding: var(--space-1);
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

/* Toast Variants */
.toast-success {
  border-left: 4px solid var(--success-500);
}

.toast-success .toast-icon {
  color: var(--success-500);
}

.toast-warning {
  border-left: 4px solid var(--warning-500);
}

.toast-warning .toast-icon {
  color: var(--warning-500);
}

.toast-danger {
  border-left: 4px solid var(--danger-500);
}

.toast-danger .toast-icon {
  color: var(--danger-500);
}

.toast-info {
  border-left: 4px solid var(--info-500);
}

.toast-info .toast-icon {
  color: var(--info-500);
}

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

/* ===========================================================================
   15. ACCORDION COMPONENT
   =========================================================================== */

.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid var(--border);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: none;
  cursor: pointer;
  font-weight: var(--fw-medium);
  text-align: left;
  transition: all var(--transition-fast);
}

.accordion-header:hover {
  background: var(--surface-raised);
}

.accordion-item.is-active .accordion-header {
  background: var(--bg-primary-subtle);
  border-left: 3px solid var(--primary-500);
}

.accordion-icon {
  flex-shrink: 0;
  transition: transform var(--transition-fast);
  font-size: 1.25rem;
  color: var(--text-tertiary);
}

.accordion-item.is-active .accordion-icon {
  transform: rotate(180deg);
  color: var(--primary-500);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-item.is-active .accordion-content {
  max-height: 1000px;
}

.accordion-body {
  padding: var(--space-4) var(--space-5);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===========================================================================
   16. TABS COMPONENT
   =========================================================================== */

.tabs {
  display: flex;
  flex-direction: column;
}

.tabs-header {
  display: flex;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-header::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.tab.is-active {
  color: var(--primary-500);
  border-bottom-color: var(--primary-500);
}

.tabs-content {
  padding: var(--space-5) 0;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.is-active {
  display: block;
}

/* Tabs Variants */
.tabs-pills .tabs-header {
  border-bottom: none;
  gap: var(--space-2);
}

.tabs-pills .tab {
  border-radius: var(--radius);
  margin-bottom: 0;
}

.tabs-pills .tab.is-active {
  background: var(--primary-500);
  color: var(--text-inverse);
}

/* ===========================================================================
   17. DROPDOWN COMPONENT
   =========================================================================== */

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: var(--z-dropdown);
  min-width: 200px;
  margin-top: var(--space-2);
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

.dropdown.is-active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--surface-raised);
}

.dropdown-item:active {
  background: var(--bg-primary-subtle);
}

.dropdown-divider {
  height: 1px;
  margin: var(--space-2) 0;
  background: var(--divider);
}

.dropdown-header {
  padding: var(--space-2) var(--space-3);
  font-size: 0.75rem;
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Dropdown Positions */
.dropdown-menu.dropdown-right {
  left: auto;
  right: 0;
}

.dropdown-menu.dropdown-top {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: var(--space-2);
}

/* ===========================================================================
   18. TOOLTIP COMPONENT
   =========================================================================== */

.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-content {
  position: absolute;
  z-index: var(--z-tooltip);
  padding: var(--space-2) var(--space-3);
  background: var(--gray-900);
  color: white;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  pointer-events: none;
}

.tooltip:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* Tooltip Positions */
.tooltip-top .tooltip-content {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  margin-bottom: var(--space-2);
}

.tooltip:hover .tooltip-top .tooltip-content {
  transform: translateX(-50%) translateY(0);
}

.tooltip-bottom .tooltip-content {
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  margin-top: var(--space-2);
}

.tooltip:hover .tooltip-bottom .tooltip-content {
  transform: translateX(-50%) translateY(0);
}

.tooltip-left .tooltip-content {
  right: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  margin-right: var(--space-2);
}

.tooltip:hover .tooltip-left .tooltip-content {
  transform: translateY(-50%) translateX(0);
}

.tooltip-right .tooltip-content {
  left: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  margin-left: var(--space-2);
}

.tooltip:hover .tooltip-right .tooltip-content {
  transform: translateY(-50%) translateY(0);
}

/* ===========================================================================
   19. BREADCRUMB COMPONENT
   =========================================================================== */

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.875rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
}

.breadcrumb-item a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
  color: var(--primary-500);
}

.breadcrumb-item.is-active {
  color: var(--text);
  font-weight: var(--fw-medium);
}

.breadcrumb-separator {
  color: var(--text-tertiary);
}

/* ===========================================================================
   20. PAGINATION COMPONENT
   =========================================================================== */

.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.pagination-item:hover:not(.is-active):not(:disabled) {
  background: var(--surface-raised);
  border-color: var(--primary-500);
  color: var(--primary-500);
}

.pagination-item.is-active {
  background: var(--primary-500);
  border-color: var(--primary-500);
  color: var(--text-inverse);
}

.pagination-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  color: var(--text-tertiary);
}

/* ===========================================================================
   21. PROGRESS BAR COMPONENT
   =========================================================================== */

.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

html.dark .progress {
  background: var(--gray-700);
}

.progress-bar {
  height: 100%;
  background: var(--primary-500);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Progress Variants */
.progress-bar-success { background: var(--success-500); }
.progress-bar-warning { background: var(--warning-500); }
.progress-bar-danger { background: var(--danger-500); }
.progress-bar-info { background: var(--info-500); }

/* Progress Sizes */
.progress-sm { height: 4px; }
.progress-lg { height: 12px; }
.progress-xl { height: 16px; }

/* Progress Striped */
.progress-striped .progress-bar {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
}

.progress-animated .progress-bar {
  animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
  0% { background-position: 1rem 0; }
  100% { background-position: 0 0; }
}

/* ===========================================================================
   22. TABLE COMPONENT
   =========================================================================== */

.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table thead {
  background: var(--surface-raised);
  border-bottom: 2px solid var(--border);
}

.table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: var(--fw-semibold);
  color: var(--text);
  white-space: nowrap;
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.table tbody tr:hover {
  background: var(--surface-raised);
}

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

/* Table Variants */
.table-bordered {
  border: 1px solid var(--border);
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--border);
}

.table-striped tbody tr:nth-child(odd) {
  background: var(--surface-raised);
}

.table-compact th,
.table-compact td {
  padding: var(--space-2) var(--space-3);
}

/* ===========================================================================
   23. DIVIDER COMPONENT
   =========================================================================== */

.divider-horizontal {
  height: 1px;
  background: var(--divider);
  margin: var(--space-4) 0;
}

.divider-vertical {
  width: 1px;
  background: var(--divider);
  margin: 0 var(--space-4);
  align-self: stretch;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-4) 0;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--divider);
}

/* ===========================================================================
   24. AVATAR COMPONENT
   =========================================================================== */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--gray-200);
  color: var(--gray-700);
  font-weight: var(--fw-semibold);
}

html.dark .avatar {
  background: var(--gray-700);
  color: var(--gray-200);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Avatar Sizes */
.avatar-xs { width: 24px; height: 24px; font-size: 0.75rem; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.875rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1.125rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar-2xl { width: 96px; height: 96px; font-size: 2rem; }

/* Avatar Group */
.avatar-group {
  display: flex;
  align-items: center;
}

.avatar-group .avatar {
  margin-left: calc(var(--space-2) * -1);
  border: 2px solid var(--surface);
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

/* ===========================================================================
   25. UTILITY CLASSES
   =========================================================================== */

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

/* Focus Visible */
.focus-ring:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Interactive */
.interactive {
  cursor: pointer;
  transition: all var(--transition-fast);
}

.interactive:hover {
  opacity: 0.8;
}

.interactive:active {
  transform: scale(0.98);
}

/* No Scrollbar */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Smooth Scroll */
.smooth-scroll {
  scroll-behavior: smooth;
}

/* ===========================================================================
   26. ANIMATIONS
   =========================================================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animation Classes */
.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-fade-out { animation: fadeOut 0.3s ease; }
.animate-slide-up { animation: slideUp 0.3s ease; }
.animate-slide-down { animation: slideDown 0.3s ease; }
.animate-slide-left { animation: slideInLeft 0.3s ease; }
.animate-scale-in { animation: scaleIn 0.3s ease; }

/* ===========================================================================
   27. RESPONSIVE UTILITIES
   =========================================================================== */

/* Hide/Show at breakpoints */
@media (max-width: 639px) {
  .hide-xs { display: none !important; }
}

@media (min-width: 640px) {
  .show-xs { display: none !important; }
  
  /* SM Breakpoint */
  .sm\:block { display: block; }
  .sm\:flex { display: flex; }
  .sm\:grid { display: grid; }
  .sm\:hidden { display: none; }
  .sm\:text-center { text-align: center; }
  .sm\:text-left { text-align: left; }
}

@media (min-width: 768px) {
  /* MD Breakpoint */
  .md\:block { display: block; }
  .md\:flex { display: flex; }
  .md\:grid { display: grid; }
  .md\:hidden { display: none; }
  .md\:text-2xl { font-size: 1.5rem; }
  .md\:text-3xl { font-size: 1.875rem; }
  .md\:w-1\/2 { width: 50%; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  /* LG Breakpoint */
  .lg\:block { display: block; }
  .lg\:flex { display: flex; }
  .lg\:grid { display: grid; }
  .lg\:hidden { display: none; }
  .lg\:text-4xl { font-size: 2.25rem; }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:px-8 { padding-left: var(--space-8); padding-right: var(--space-8); }
}

@media (min-width: 1280px) {
  /* XL Breakpoint */
  .xl\:block { display: block; }
  .xl\:flex { display: flex; }
  .xl\:grid { display: grid; }
  .xl\:hidden { display: none; }
  .xl\:text-5xl { font-size: 3rem; }
  .xl\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ===========================================================================
   28. PRINT STYLES
   =========================================================================== */

@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .card,
  .modal,
  .alert {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
  
  a {
    text-decoration: underline !important;
  }
  
  .btn {
    border: 1px solid #000 !important;
  }
}

/* ===========================================================================
   29. ACCESSIBILITY ENHANCEMENTS
   =========================================================================== */

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

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

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

/* ===========================================================================
   30. DARK MODE SPECIFIC ADJUSTMENTS
   =========================================================================== */

html.dark {
  color-scheme: dark;
}

html.dark .card {
  background: var(--surface);
}

html.dark .btn-outline {
  border-color: var(--border);
}

html.dark .btn-outline:hover {
  background: var(--surface-raised);
}

html.dark .input,
html.dark .textarea,
html.dark .select {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html.dark .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

html.dark .toast {
  background: var(--surface);
  border-color: var(--border);
}

html.dark .dropdown-menu {
  background: var(--surface);
  border-color: var(--border);
}

html.dark .table thead {
  background: var(--surface-raised);
}

html.dark .table tbody tr:hover {
  background: var(--surface-raised);
}

/* ===========================================================================
   31. Number Grid Styles
   =========================================================================== */
 
.number-grid-container {
  margin: 1.5rem 0;
}

.grid-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.grid-description {
  color: var(--muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns, 5), 1fr);
  gap: var(--grid-gap, 12px);
  margin: 1rem 0;
}

.grid-number {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

/* Box Style (Default) */
.grid-number-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 0.5rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.grid-number-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: var(--primary-300);
  background: var(--primary-50);
}

/* Circle Style */
.grid-number-circle {
  background: var(--surface);
  border: 2px solid var(--primary-200);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-weight: 600;
  color: var(--primary-600);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.grid-number-circle:hover {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
  transform: scale(1.05);
}

/* Minimal Style */
.grid-number-minimal {
  color: var(--text);
  padding: 0.75rem 0.5rem;
  border-bottom: 2px solid transparent;
}

.grid-number-minimal:hover {
  color: var(--primary-600);
  border-bottom-color: var(--primary-500);
}

/* Number value */
.grid-number-value {
  font-size: 1.1rem;
  font-weight: 500;
}

/* Index (small number in corner) */
.grid-number-index {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.7rem;
  color: var(--muted);
  background: rgba(0,0,0,0.05);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Click animation */
.grid-number-clicked {
  animation: pulse 0.3s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* Count at bottom */
.grid-count {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Empty state */
.grid-empty {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
  font-style: italic;
}

.number-selected {
  border-color: var(--primary-500);
  background: var(--bg-primary-subtle);
}

.number-correct {
  background: var(--success-500);
  color: white;
  border-color: var(--success-500);
}

.number-wrong {
  background: var(--danger-500);
  color: white;
  border-color: var(--danger-500);
}

/* ===========================================================================
   32. VISUAL PRESETS & EFFECTS
   =========================================================================== */

/* Gradient Backgrounds */
.bg-gradient {
  background: linear-gradient(
    135deg,
    var(--primary-600),
    var(--secondary-600),
    var(--accent-500)
  );
}

/* Gradient Text */
.text-gradient {
  background: linear-gradient(
    90deg,
    var(--primary-500),
    var(--secondary-500),
    var(--accent-500)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
}

html.dark .glass {
  background: rgba(15, 23, 42, 0.75);
}

/* Ambient Glow */
.glow-sm {
  box-shadow:
    0 0 0 0 rgba(59, 130, 246, 0.2),
    0 8px 32px rgba(59, 130, 246, 0.35);
}

.glow-md {
  box-shadow:
    0 0 0 0 rgba(139, 92, 246, 0.25),
    0 12px 48px rgba(139, 92, 246, 0.4);
}

.glow-lg {
  box-shadow:
    0 0 0 0 rgba(236, 72, 153, 0.25),
    0 16px 64px rgba(236, 72, 153, 0.45);
}

/* Decorative Blur */
.blur-sm { filter: blur(8px); }
.blur-md { filter: blur(16px); }
.blur-lg { filter: blur(32px); }

/* ===========================================================================
   33. LEARNING / EDUCATION COMPONENTS
   =========================================================================== */

.learn-container {
  max-width: 840px;
  margin: auto;
  padding: var(--space-6);
}

/* Section heading */
.learn-title {
  font-size: 1.4rem;
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-4);
}

/* Definition */
.learn-definition {
  background: var(--bg-primary-subtle);
  border-left: 4px solid var(--primary-500);
  padding: var(--space-4);
  border-radius: var(--radius);
}

/* Theory */
.learn-theory {
  background: var(--surface);
  padding: var(--space-5);
  border-radius: var(--radius);
  line-height: 1.7;
}

/* Lists inside theory / derivation */
.learn-list {
  margin-top: var(--space-3);
  padding-left: var(--space-6);
}

.learn-list li {
  margin-bottom: var(--space-2);
}

.learn-list-bullets { list-style: disc; }
.learn-list-numbers { list-style: decimal; }
.learn-list-alpha { list-style: lower-alpha; }

/* Formula */
.learn-formula {
  background: var(--surface-raised);
  border: 1px dashed var(--border);
  padding: var(--space-4);
  border-radius: var(--radius);
  font-family: var(--font-math);
  font-size: 1.1rem;
  text-align: center;
}

/* Derivation / Proof */
.learn-derivation {
  background: var(--bg);
  border-left: 3px solid var(--secondary-500);
  padding: var(--space-4);
  line-height: 1.7;
}

/* Example */
.learn-example {
  background: var(--bg-success-subtle);
  border-left: 4px solid var(--success-500);
  padding: var(--space-4);
  border-radius: var(--radius);
}

/* Note / Warning */
.learn-note {
  background: rgba(14, 165, 233, 0.1);
  border-left: 4px solid var(--info-500);
  padding: var(--space-4);
  border-radius: var(--radius);
}

/* ===========================================================================
   34. QUIZ / PRACTICE COMPONENTS
   =========================================================================== */

.quiz-container {
  max-width: 900px;
  margin: auto;
  padding: var(--space-6);
}

.quiz-question {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-5);
  border-radius: var(--radius);
  margin-bottom: var(--space-5);
}

.quiz-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.quiz-options {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.quiz-option {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.quiz-option.correct {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--success-500);
}

.quiz-option.wrong {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger-500);
}

/* Answer input */
.quiz-answer {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
}

/* Solution */
.quiz-solution {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-success-subtle);
  border-left: 4px solid var(--success-500);
  border-radius: var(--radius);
}

/* ===========================================================================
   35. EXAM / ASSESSMENT COMPONENTS
   =========================================================================== */

.exam-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-raised);
  padding: var(--space-4);
  border-radius: var(--radius);
  margin-bottom: var(--space-6);
}

.exam-timer {
  font-weight: var(--fw-semibold);
  color: var(--danger-500);
}

.exam-marks {
  background: var(--bg-primary-subtle);
  color: var(--primary-600);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

/* Exam lock */
.exam-mode .quiz-option {
  pointer-events: none;
}

/* ===========================================================================
   END OF APAS UI CORE CSS v1.0
   =========================================================================== */