/**
 * SURA Design System
 * Version: 1.0.0
 *
 * A comprehensive CSS component library for building applications
 * with the SURA look and feel.
 *
 * Table of Contents:
 * 1. CSS Variables (Design Tokens)
 * 2. Reset & Base
 * 3. Typography
 * 4. Layout (Application Shell, Sidebar, Grid)
 * 5. Components (Cards, Buttons, Forms, Tables, etc.)
 * 6. Status & State Colors
 * 7. Utilities
 * 8. Animations
 * 9. Responsive
 * 10. Accessibility
 */

/* =============================================================================
   1. CSS VARIABLES (DESIGN TOKENS)
   ============================================================================= */

:root {
  /* ---------- Brand Colors ---------- */
  --sura-primary: #00AEC7;      /* Teal - Main accent, headers, primary buttons */
  --sura-secondary: #0033A0;    /* Navy Blue - Secondary emphasis, links */
  --sura-dark: #002060;         /* Dark Navy - Titles, strong emphasis */
  --sura-highlight: #E3E829;    /* Lime Yellow - Warnings, attention indicators */
  --sura-foreground: #44546A;   /* Body text color */

  /* ---------- Neutral Palette ---------- */
  --sura-neutral-1: #A4BCC2;    /* Disabled states, subtle backgrounds */
  --sura-neutral-2: #768692;    /* Secondary text, borders */
  --sura-accent-1: #65ACA3;     /* Alternative accent, success-related */
  --sura-accent-2: #B9D3DC;     /* Soft backgrounds, light emphasis */

  /* ---------- Teal Color Scale ---------- */
  --sura-teal-50: #e6f8fa;
  --sura-teal-100: #ccf1f5;
  --sura-teal-200: #99e3eb;
  --sura-teal-300: #66d5e1;
  --sura-teal-400: #33c7d7;
  --sura-teal-500: #00AEC7;     /* Primary */
  --sura-teal-600: #008b9f;     /* Hover on primary */
  --sura-teal-700: #006877;     /* Pressed state */
  --sura-teal-800: #004650;
  --sura-teal-900: #002328;

  /* ---------- Navy Color Scale ---------- */
  --sura-navy-50: #e6ebf4;
  --sura-navy-100: #ccd7e9;
  --sura-navy-200: #99afd3;
  --sura-navy-300: #6687bd;
  --sura-navy-400: #335fa7;
  --sura-navy-500: #0033A0;     /* Secondary */
  --sura-navy-600: #002980;
  --sura-navy-700: #001f60;
  --sura-navy-800: #001440;
  --sura-navy-900: #000a20;

  /* ---------- Semantic Colors ---------- */
  --sura-success: #10B981;
  --sura-success-light: #D1FAE5;
  --sura-success-dark: #065F46;
  --sura-warning: #F59E0B;
  --sura-warning-light: #FEF3C7;
  --sura-warning-dark: #92400E;
  --sura-error: #EF4444;
  --sura-error-light: #FEE2E2;
  --sura-error-dark: #991B1B;
  --sura-info: #3B82F6;
  --sura-info-light: #DBEAFE;
  --sura-info-dark: #1E40AF;

  /* ---------- Background Colors ---------- */
  --sura-background: #FFFFFF;
  --sura-surface: #F9FAFB;      /* Light gray background */
  --sura-surface-hover: #F3F4F6;
  --sura-muted: #9CA3AF;
  --sura-border: #E5E7EB;
  --sura-border-dark: #D1D5DB;

  /* ---------- Spacing System (4px base) ---------- */
  --space-0: 0;
  --space-0-5: 2px;
  --space-1: 4px;
  --space-1-5: 6px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---------- Typography ---------- */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', monospace;

  /* Font Sizes */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 36px;

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* ---------- Border Radius ---------- */
  --radius-none: 0;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 9999px;

  /* ---------- Shadows ---------- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* ---------- Transitions ---------- */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* ---------- Layout ---------- */
  --header-height: 64px;
  --sidebar-width: 256px;
  --sidebar-collapsed-width: 64px;
  --container-max-width: 1280px;

  /* ---------- Z-Index Scale ---------- */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* =============================================================================
   2. RESET & BASE
   ============================================================================= */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--sura-foreground);
  background-color: var(--sura-surface);
}

/* =============================================================================
   3. TYPOGRAPHY
   ============================================================================= */

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--sura-dark);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

h1, .h1 { font-size: var(--text-2xl); }
h2, .h2 { font-size: var(--text-lg); font-weight: var(--font-semibold); }
h3, .h3 { font-size: var(--text-base); font-weight: var(--font-semibold); }
h4, .h4 { font-size: var(--text-sm); font-weight: var(--font-semibold); }

/* Page Title */
.page-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--sura-dark);
  line-height: var(--leading-tight);
}

/* Section Heading */
.section-heading {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--sura-dark);
  line-height: 1.4;
}

/* Card Title */
.card-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--sura-dark);
  line-height: var(--leading-normal);
}

/* Body Text */
p {
  margin-bottom: var(--space-4);
}

/* Links */
a {
  color: var(--sura-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--sura-secondary);
  text-decoration: underline;
}

/* Small/Caption */
small, .text-small {
  font-size: var(--text-xs);
  line-height: 1.4;
}

/* Label */
.label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: var(--leading-normal);
}

/* =============================================================================
   4. LAYOUT
   ============================================================================= */

/* ---------- Application Shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Header ---------- */
.header {
  height: var(--header-height);
  background: linear-gradient(135deg, var(--sura-secondary) 0%, var(--sura-dark) 100%);
  border-bottom: 1px solid var(--sura-border);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: white;
}

.header-logo:hover {
  color: white;
  text-decoration: none;
}

.header-logo img {
  height: 40px;
  background: white;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.header-logo .portal-name {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  opacity: 0.9;
  padding-left: var(--space-3);
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  transition: opacity var(--transition-fast);
}

.header-logo:hover .portal-name {
  opacity: 0.7;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.header-nav a {
  color: white;
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  opacity: 0.9;
  transition: opacity var(--transition-fast);
}

.header-nav a:hover {
  opacity: 1;
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sura-background);
  border-right: 1px solid var(--sura-border);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: var(--z-fixed);
  transition: width var(--transition-slow);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--sura-border);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--sura-border);
}

/* Navigation Items */
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-lg);
  color: #374151;
  text-decoration: none;
  transition: background-color var(--transition-fast);
  margin-bottom: var(--space-1);
}

.nav-item:hover {
  background: var(--sura-surface);
  text-decoration: none;
}

.nav-item.active {
  background: var(--sura-teal-50);
  color: var(--sura-primary);
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-item-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  white-space: nowrap;
}

/* Collapsed sidebar hides labels */
.sidebar.collapsed .nav-item-label {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: var(--space-3);
}

/* Navigation Group */
.nav-group {
  margin-bottom: var(--space-4);
}

.nav-group-label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  color: var(--sura-muted);
  padding: var(--space-2) var(--space-3);
  letter-spacing: 0.05em;
}

.sidebar.collapsed .nav-group-label {
  display: none;
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  padding: var(--space-6);
  background: var(--sura-surface);
  min-height: 100vh;
}

/* With sidebar layout */
.main-content.with-sidebar {
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-slow);
}

.main-content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed-width);
}

/* Without sidebar (current layout) */
.main-content.centered {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

/* ---------- Grid System ---------- */
.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Auto-fit responsive grid */
.grid-auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-auto-fit-sm {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.grid-auto-fit-lg {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* =============================================================================
   5. COMPONENTS
   ============================================================================= */

/* ---------- Cards ---------- */
.card {
  background: var(--sura-background);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--sura-border);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--sura-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--sura-border);
  background: var(--sura-surface);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Stat Card */
.stat-card {
  background: var(--sura-background);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  border: 1px solid var(--sura-border);
  box-shadow: var(--shadow);
}

.stat-card .icon-wrapper {
  padding: var(--space-3);
  border-radius: var(--radius-xl);
  display: inline-flex;
  margin-bottom: var(--space-3);
}

.stat-card .stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--sura-dark);
  line-height: var(--leading-none);
}

.stat-card .stat-label {
  font-size: var(--text-sm);
  color: var(--sura-muted);
  margin-top: var(--space-1);
  min-height: 40px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  line-height: var(--leading-none);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Primary Button */
.btn-primary {
  background: var(--sura-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--sura-teal-600);
  color: white;
}

/* Secondary Button */
.btn-secondary {
  background: var(--sura-secondary);
  color: white;
}

.btn-secondary:hover {
  background: var(--sura-navy-600);
  color: white;
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--sura-foreground);
  border: 1px solid var(--sura-border);
}

.btn-outline:hover {
  background: var(--sura-surface);
  color: var(--sura-foreground);
}

/* Danger Button */
.btn-danger {
  background: var(--sura-error);
  color: white;
}

.btn-danger:hover {
  background: #DC2626;
  color: white;
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--sura-foreground);
}

.btn-ghost:hover {
  background: var(--sura-surface);
}

/* Icon Button */
.btn-icon {
  padding: var(--space-2);
  border-radius: var(--radius-lg);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-1-5) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: #374151;
  margin-bottom: var(--space-1);
}

.form-label .required {
  color: var(--sura-error);
}

.form-input,
.input {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--sura-border-dark);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--sura-foreground);
  background: var(--sura-background);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--sura-primary);
}

.form-input::placeholder,
.input::placeholder {
  color: var(--sura-muted);
}

.form-input.error,
.input.error {
  border-color: var(--sura-error);
}

.form-error {
  color: var(--sura-error);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}

.form-help {
  color: var(--sura-muted);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}

/* Select */
.select {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--sura-border-dark);
  background: var(--sura-background);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  cursor: pointer;
}

.select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--sura-primary);
}

/* Checkbox & Radio */
.checkbox,
.radio {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.checkbox input,
.radio input {
  width: 16px;
  height: 16px;
  accent-color: var(--sura-primary);
}

/* ---------- Tables ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background: var(--sura-surface);
}

.table th {
  padding: var(--space-3) var(--space-6);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  color: var(--sura-muted);
  border-bottom: 1px solid var(--sura-border);
}

.table td {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--sura-border);
  font-size: var(--text-sm);
}

.table tbody tr:hover {
  background: var(--sura-surface);
}

/* Table with dark header (SURA style) */
.table-sura thead {
  background: var(--sura-secondary);
}

.table-sura th {
  color: white;
  font-weight: var(--font-semibold);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

/* Status Badges */
.badge-submitted,
.badge-pending {
  background: var(--sura-surface);
  color: #374151;
}

.badge-in-review,
.badge-running {
  background: var(--sura-teal-50);
  color: var(--sura-primary);
}

.badge-changes-required,
.badge-skipped {
  background: var(--sura-warning-light);
  color: var(--sura-warning-dark);
}

.badge-approved,
.badge-completed,
.badge-success {
  background: var(--sura-success-light);
  color: var(--sura-success-dark);
}

.badge-rejected,
.badge-failed,
.badge-error {
  background: var(--sura-error-light);
  color: var(--sura-error-dark);
}

/* Priority Badges */
.badge-low {
  background: var(--sura-surface);
  color: #374151;
}

.badge-medium {
  background: var(--sura-info-light);
  color: var(--sura-info-dark);
}

.badge-high {
  background: #FFEDD5;
  color: #C2410C;
}

.badge-critical {
  background: var(--sura-error-light);
  color: var(--sura-error-dark);
}

/* Role Badges */
.badge-admin {
  background: #F3E8FF;
  color: #7C3AED;
}

.badge-operator {
  background: var(--sura-info-light);
  color: var(--sura-info-dark);
}

.badge-viewer {
  background: var(--sura-surface);
  color: #374151;
}

/* ---------- Alerts / Banners ---------- */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: var(--font-medium);
  margin-bottom: var(--space-1);
}

.alert-error {
  background: var(--sura-error-light);
  border: 1px solid #FECACA;
  color: #7F1D1D;
}

.alert-warning {
  background: var(--sura-warning-light);
  border: 1px solid #FDE68A;
  color: var(--sura-warning-dark);
}

.alert-info {
  background: var(--sura-teal-50);
  border: 1px solid var(--sura-teal-200);
  color: var(--sura-teal-800);
}

.alert-success {
  background: var(--sura-success-light);
  border: 1px solid #86EFAC;
  color: var(--sura-success-dark);
}

/* ---------- Empty States ---------- */
.empty-state {
  padding: var(--space-8);
  text-align: center;
}

.empty-state .icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  color: var(--sura-border-dark);
}

.empty-state .title {
  margin-top: var(--space-4);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--sura-muted);
}

.empty-state .description {
  font-size: var(--text-sm);
  color: var(--sura-muted);
  margin-top: var(--space-2);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--sura-border);
  gap: var(--space-1);
}

.tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--sura-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--sura-foreground);
}

.tab.active {
  color: var(--sura-primary);
  border-bottom-color: var(--sura-primary);
}

.tab-content {
  padding: var(--space-4) 0;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ---------- Modal / Dialog ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal {
  background: var(--sura-background);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
}

.modal-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--sura-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--sura-dark);
}

.modal-close {
  background: transparent;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  color: var(--sura-muted);
  border-radius: var(--radius-lg);
}

.modal-close:hover {
  background: var(--sura-surface);
  color: var(--sura-foreground);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--sura-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ---------- Dropdown ---------- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-2);
  background: var(--sura-background);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--sura-border);
  min-width: 200px;
  z-index: var(--z-dropdown);
  display: none;
}

.dropdown-menu.open {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--sura-foreground);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--sura-surface);
  text-decoration: none;
}

.dropdown-divider {
  height: 1px;
  background: var(--sura-border);
  margin: var(--space-2) 0;
}

/* ---------- Tooltip ---------- */
.tooltip {
  position: relative;
}

.tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--sura-dark);
  color: white;
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
  white-space: nowrap;
  z-index: var(--z-tooltip);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.tooltip:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* ---------- Progress Bar ---------- */
.progress {
  height: 8px;
  background: var(--sura-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--sura-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-bar.success {
  background: var(--sura-success);
}

.progress-bar.warning {
  background: var(--sura-warning);
}

.progress-bar.error {
  background: var(--sura-error);
}

/* ---------- Avatar ---------- */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--sura-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
}

.avatar-sm { width: 24px; height: 24px; font-size: var(--text-xs); }
.avatar-lg { width: 40px; height: 40px; font-size: var(--text-base); }
.avatar-xl { width: 48px; height: 48px; font-size: var(--text-lg); }

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  background: var(--sura-border);
  margin: var(--space-4) 0;
}

/* ---------- Language Toggle ---------- */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: rgba(255, 255, 255, 0.1);
  padding: var(--space-1-5) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
}

.lang-toggle a {
  color: white;
  text-decoration: none;
  opacity: 0.5;
  padding: var(--space-0-5) var(--space-1-5);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.lang-toggle a:hover {
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.1);
}

.lang-toggle a.active {
  opacity: 1;
  font-weight: var(--font-semibold);
  background: var(--sura-primary);
}

/* ---------- User Menu ---------- */
.user-menu {
  position: relative;
  cursor: pointer;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1-5) var(--space-3);
  border-radius: var(--radius-md);
  color: white;
  transition: background var(--transition-fast);
}

.user-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-menu-trigger::after {
  content: "\25BC";
  font-size: 8px;
  opacity: 0.7;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-2);
  background: var(--sura-background);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  display: none;
  z-index: var(--z-dropdown);
  overflow: hidden;
}

.user-dropdown.open {
  display: block;
}

.user-dropdown-header {
  padding: var(--space-4);
  background: var(--sura-surface);
  border-bottom: 1px solid var(--sura-border);
}

.user-dropdown-header .name {
  font-weight: var(--font-semibold);
  color: var(--sura-dark);
}

.user-dropdown-header .email {
  font-size: var(--text-xs);
  color: var(--sura-muted);
}

.user-dropdown-header .role {
  font-size: 11px;
  color: var(--sura-primary);
  margin-top: var(--space-1);
}

/* =============================================================================
   6. STATUS & STATE COLORS
   ============================================================================= */

/* Service Health States */
.status-healthy {
  color: var(--sura-success);
}

.status-degraded {
  color: var(--sura-warning);
}

.status-unhealthy {
  color: var(--sura-error);
}

.status-unknown {
  color: var(--sura-muted);
}

/* Dot indicators */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.status-dot.healthy { background: var(--sura-success); }
.status-dot.degraded { background: var(--sura-warning); }
.status-dot.unhealthy { background: var(--sura-error); }
.status-dot.unknown { background: var(--sura-muted); }

/* =============================================================================
   7. UTILITIES
   ============================================================================= */

/* ---------- Text ---------- */
.text-primary { color: var(--sura-primary); }
.text-secondary { color: var(--sura-secondary); }
.text-muted { color: var(--sura-muted); }
.text-success { color: var(--sura-success); }
.text-warning { color: var(--sura-warning); }
.text-error { color: var(--sura-error); }
.text-dark { color: var(--sura-dark); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Spacing ---------- */
.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); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.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-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-3 { margin-left: var(--space-3); }
.ml-4 { margin-left: var(--space-4); }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.mr-4 { margin-right: var(--space-4); }

.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-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-0 { padding-left: 0; padding-right: 0; }
.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

/* ---------- Gap ---------- */
.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-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ---------- Width & Height ---------- */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.h-auto { height: auto; }
.min-h-screen { min-height: 100vh; }

/* ---------- Display ---------- */
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.hidden { display: none; }

/* ---------- Position ---------- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* ---------- Overflow ---------- */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ---------- Border ---------- */
.border { border: 1px solid var(--sura-border); }
.border-0 { border: none; }
.border-t { border-top: 1px solid var(--sura-border); }
.border-b { border-bottom: 1px solid var(--sura-border); }
.border-l { border-left: 1px solid var(--sura-border); }
.border-r { border-right: 1px solid var(--sura-border); }

.rounded { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ---------- Shadow ---------- */
.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-none { box-shadow: none; }

/* ---------- Background ---------- */
.bg-white { background: white; }
.bg-surface { background: var(--sura-surface); }
.bg-primary { background: var(--sura-primary); }
.bg-secondary { background: var(--sura-secondary); }
.bg-success { background: var(--sura-success-light); }
.bg-warning { background: var(--sura-warning-light); }
.bg-error { background: var(--sura-error-light); }

/* ---------- Cursor ---------- */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* =============================================================================
   8. ANIMATIONS
   ============================================================================= */

/* Slide in from right (for toasts) */
@keyframes slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.animate-slide-in {
  animation: slide-in 0.3s ease-out;
}

/* Fade in */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  animation: fade-in 0.2s ease-out;
}

/* Pulse dot (for connection status) */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-pulse-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Spin (for loading) */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Scale up */
@keyframes scale-up {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.animate-scale-up {
  animation: scale-up 0.2s ease-out;
}

/* =============================================================================
   9. RESPONSIVE
   ============================================================================= */

/* Small (640px) */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .sm\:flex { display: flex; }
  .sm\:hidden { display: none; }
  .sm\:block { display: block; }
}

/* Medium (768px) */
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
  .md\:block { display: block; }
}

/* Large (1024px) - Desktop, sidebar visible */
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .lg\:flex { display: flex; }
  .lg\:hidden { display: none; }
  .lg\:block { display: block; }

  .sidebar {
    transform: translateX(0);
  }
}

/* Extra Large (1280px) */
@media (min-width: 1280px) {
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .xl\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
}

/* Mobile adjustments */
@media (max-width: 767px) {
  :root {
    --header-height: 56px;
  }

  .header {
    padding: 0 var(--space-4);
  }

  .header-nav {
    display: none;
  }

  .main-content {
    padding: var(--space-4);
  }

  .card-body,
  .card-header,
  .card-footer {
    padding: var(--space-4);
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content.with-sidebar {
    margin-left: 0;
  }

  /* Mobile navigation overlay */
  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-fixed) - 1);
    display: none;
  }

  .mobile-nav-backdrop.open {
    display: block;
  }
}

/* =============================================================================
   10. ACCESSIBILITY
   ============================================================================= */

/* Screen reader only - visually hidden but accessible */
.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;
}

/* Screen reader only - but focusable (for skip links) */
.sr-only-focusable:not(:focus):not(:focus-within) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip navigation link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sura-dark);
  color: white;
  padding: var(--space-3) var(--space-6);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  font-weight: var(--font-semibold);
  z-index: var(--z-tooltip);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--sura-highlight);
  outline-offset: 2px;
}

/* Enhanced focus styles for accessibility */
:focus-visible {
  outline: 3px solid var(--sura-primary);
  outline-offset: 2px;
}

/* Buttons and links should have visible focus */
.btn:focus-visible,
a:focus-visible {
  outline: 3px solid var(--sura-highlight);
  outline-offset: 2px;
}

/* Live region for announcements */
.a11y-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --sura-border: #000000;
  }

  .badge,
  .btn {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@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;
  }
}

/* =============================================================================
   FOOTER
   ============================================================================= */

.footer {
  background: var(--sura-dark);
  color: white;
  padding: var(--space-6);
  text-align: center;
  font-size: var(--text-sm);
}

.footer a {
  color: var(--sura-primary);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* =============================================================================
   DEV TOOLBAR (Development Only)
   ============================================================================= */

.dev-toolbar {
  background: linear-gradient(90deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: var(--space-2) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  position: sticky;
  top: 0;
  z-index: 10000;
  border-bottom: 2px solid #e94560;
}

.dev-toolbar-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: #e94560;
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dev-toolbar-label::before {
  content: "\2699\FE0F";
}

.dev-toolbar-users {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.dev-toolbar-users label {
  color: #a0a0a0;
  margin-right: var(--space-2);
}

.dev-user-btn {
  padding: var(--space-1) var(--space-3);
  border: 1px solid #444;
  background: #2a2a4a;
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  transition: all var(--transition-fast);
}

.dev-user-btn:hover {
  background: #3a3a6a;
  border-color: #e94560;
}

.dev-user-btn.active {
  background: #e94560;
  border-color: #e94560;
  color: #fff;
}

.dev-user-btn .role {
  font-size: 9px;
  opacity: 0.7;
  display: block;
  margin-top: 2px;
}
