/**
 * reachDr Design System v2.0
 * Modern Healthcare Admin Dashboard
 * Light theme default with dark mode support
 */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

/* ============================================
   THEME VARIABLES - LIGHT THEME DEFAULT
   ============================================ */
:root {
  /* Light Theme (Default) */
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;
  --bg-sidebar: #ffffff;
  
  --text: #334155;
  --text-heading: #1e293b;
  --text-muted: #64748b;
  --text-secondary: #475569;
  
  /* Primary Blue */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-glow: rgba(37, 99, 235, 0.15);
  
  /* Legacy accent (keep for backward compat) */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --accent-secondary: #3b82f6;
  
  /* Medical Blue (legacy) */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #3b82f6;
  --color-primary-glow: rgba(37, 99, 235, 0.15);
  
  --border: #e2e8f0;
  --border-subtle: #cbd5e1;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  /* Gradients */
  --gradient-hero: radial-gradient(1400px 900px at 30% 0%, #dbeafe 0%, #f1f5f9 50%, var(--bg) 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #ffffff 100%);
  --gradient-accent: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 50px;
  
  /* Shadows - Light theme shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --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-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px var(--primary-glow);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
  
  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  
  /* Layout */
  --sidebar-width: 240px;
  --header-height: 64px;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-input: #1e293b;
  --bg-sidebar: #1e293b;
  
  --text: #e2e8f0;
  --text-heading: #f8fafc;
  --text-muted: #94a3b8;
  --text-secondary: #cbd5e1;
  
  --border: #334155;
  --border-subtle: #475569;
  
  --gradient-hero: radial-gradient(1400px 900px at 30% 0%, #1e3a5f 0%, #1e293b 50%, var(--bg) 100%);
  --gradient-card: linear-gradient(145deg, #1e293b 0%, #1e293b 100%);
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p { color: var(--text); }
.text-muted { color: var(--text-muted); }
.text-heading { color: var(--text-heading); }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-family);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

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

.btn-accent {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-subtle);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--primary);
}

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

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

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: 0.8125rem;
}

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

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-icon.btn-lg {
  width: 48px;
  height: 48px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}

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

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

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

.card-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

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

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  font-family: var(--font-family);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.form-helper {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

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

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.badge-neutral {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

[data-theme="dark"] .badge-success { color: #34d399; }
[data-theme="dark"] .badge-warning { color: #fbbf24; }
[data-theme="dark"] .badge-danger { color: #f87171; }
[data-theme="dark"] .badge-info { color: #60a5fa; }

/* ============================================
   TABLES
   ============================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  font-size: 0.875rem;
  color: var(--text);
}

tr:hover td {
  background: var(--bg-card-hover);
}

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

/* ============================================
   ALERTS
   ============================================ */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.alert-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.alert-content {
  flex: 1;
}

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

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #059669;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #d97706;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #2563eb;
}

[data-theme="dark"] .alert-success { color: #34d399; }
[data-theme="dark"] .alert-warning { color: #fbbf24; }
[data-theme="dark"] .alert-danger { color: #f87171; }
[data-theme="dark"] .alert-info { color: #60a5fa; }

/* ============================================
   MODERN ADMIN LAYOUT
   ============================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ============================================
   SIDEBAR - Modern Healthcare Admin
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

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

.sidebar-logo {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-decoration: none;
}

.sidebar-logo-main {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: white;
}

.sidebar-logo-text {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-heading);
}

.sidebar-logo-subtitle {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: calc(36px + var(--space-3));
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
  overflow-y: auto;
}

.nav-section {
  padding: var(--space-3) var(--space-5);
  font-size: 0.6875rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-top: var(--space-2);
}

.nav-section:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--bg-secondary);
  color: var(--text-heading);
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

[data-theme="dark"] .nav-item.active {
  background: rgba(59, 130, 246, 0.15);
}

.nav-item-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--danger);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
}

.sidebar-new-report {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  margin-bottom: var(--space-4);
}

.sidebar-new-report:hover {
  background: var(--primary-hover);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--gradient-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   TOP HEADER BAR
   ============================================ */
.top-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: 90;
}

.header-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
}

.header-search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  padding-left: var(--space-10);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--text);
  transition: all var(--transition);
}

.header-search-input::placeholder {
  color: var(--text-muted);
}

.header-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-card);
}

.header-search-wrapper {
  position: relative;
}

.header-search-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

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

.header-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.125rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}

.header-icon-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-heading);
}

.header-icon-btn .notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.header-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  margin-left: var(--space-2);
}

.header-user:hover {
  background: var(--bg-secondary);
}

.header-user-avatar {
  width: 36px;
  height: 36px;
  background: var(--gradient-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.8125rem;
}

.header-user-info {
  text-align: right;
}

.header-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-heading);
}

.header-user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--header-height);
  flex: 1;
  min-height: 100vh;
}

.main-content-inner {
  padding: var(--space-6);
  max-width: 1400px;
  margin: 0 auto;
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

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

.breadcrumbs .sep {
  color: var(--border-subtle);
  font-size: 0.75rem;
}

.breadcrumbs .current {
  color: var(--text-heading);
  font-weight: 600;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.page-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* ============================================
   MODERN STATS CARDS
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  position: relative;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}

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

.stat-card-icon {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-card-icon.blue {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

.stat-card-icon.green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.stat-card-icon.yellow {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.stat-card-icon.red {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-card-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.stat-card-trend {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.8125rem;
  font-weight: 500;
}

.stat-card-trend.up {
  color: var(--success);
}

.stat-card-trend.down {
  color: var(--danger);
}

.stat-card-trend.neutral {
  color: var(--text-muted);
}

.stat-card-progress {
  margin-top: var(--space-3);
}

.stat-progress-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.stat-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.stat-progress-fill.blue { background: var(--primary); }
.stat-progress-fill.green { background: var(--success); }
.stat-progress-fill.yellow { background: var(--warning); }
.stat-progress-fill.red { background: var(--danger); }

/* ============================================
   CONTENT CARDS
   ============================================ */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-5);
}

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

.content-card-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

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

.content-card-body.no-padding {
  padding: 0;
}

/* ============================================
   AVATAR CIRCLES
   ============================================ */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.avatar-primary {
  background: var(--gradient-accent);
  color: white;
}

.avatar-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.avatar-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

/* ============================================
   ACTIVITY FEED
   ============================================ */
.activity-feed {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  position: relative;
}

.activity-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 52px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.activity-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.activity-dot.success { background: rgba(16, 185, 129, 0.15); }
.activity-dot.warning { background: rgba(245, 158, 11, 0.15); }
.activity-dot.info { background: rgba(59, 130, 246, 0.15); }
.activity-dot.danger { background: rgba(239, 68, 68, 0.15); }

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-weight: 600;
  color: var(--text-heading);
  font-size: 0.9375rem;
  margin-bottom: var(--space-1);
}

.activity-description {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ============================================
   TABLES IN CARDS
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: transparent;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  font-size: 0.875rem;
  color: var(--text);
}

.data-table tbody tr:hover {
  background: var(--bg-secondary);
}

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

.table-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.table-user-name {
  font-weight: 600;
  color: var(--text-heading);
}

.table-user-email {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress-container {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }
.progress-fill.info { background: var(--info); }
.progress-fill.primary { background: var(--primary); }

.progress-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 50px;
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.875rem;
  color: var(--text);
}

.theme-toggle:hover {
  border-color: var(--primary);
}

.theme-toggle .sun-icon {
  display: block;
}

.theme-toggle .moon-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: block;
}

/* ============================================
   MOBILE MENU TOGGLE
   ============================================ */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 200;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ============================================
   CIRCULAR PROGRESS
   ============================================ */
.circular-progress {
  position: relative;
  width: 80px;
  height: 80px;
}

.circular-progress svg {
  transform: rotate(-90deg);
  width: 80px;
  height: 80px;
}

.circular-progress .track {
  fill: none;
  stroke: var(--bg-secondary);
  stroke-width: 8;
}

.circular-progress .fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.circular-progress .fill.blue { stroke: var(--primary); }
.circular-progress .fill.green { stroke: var(--success); }
.circular-progress .fill.yellow { stroke: var(--warning); }
.circular-progress .fill.red { stroke: var(--danger); }

.circular-progress-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
}

.circular-progress-sm {
  width: 48px;
  height: 48px;
}

.circular-progress-sm svg {
  width: 48px;
  height: 48px;
}

.circular-progress-sm .track,
.circular-progress-sm .fill {
  stroke-width: 5;
}

.circular-progress-sm .circular-progress-value {
  font-size: 0.875rem;
}

/* ============================================
   ENGAGEMENT / PROGRESS BARS
   ============================================ */
.engagement-item {
  margin-bottom: var(--space-4);
}

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

.engagement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.engagement-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.engagement-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-heading);
}

.engagement-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.engagement-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.engagement-fill.excellent { background: var(--success); }
.engagement-fill.good { background: var(--primary); }
.engagement-fill.warning { background: var(--warning); }
.engagement-fill.poor { background: var(--danger); }

/* ============================================
   LIVE FEED
   ============================================ */
.live-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.live-feed-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.live-feed-item:hover {
  background: var(--bg-card-hover);
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.live-dot.online { background: var(--success); box-shadow: 0 0 8px var(--success); }
.live-dot.warning { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.live-dot.critical { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: pulse-dot 1.5s infinite; }
.live-dot.offline { background: var(--text-muted); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.live-content {
  flex: 1;
  min-width: 0;
}

.live-title {
  font-weight: 600;
  color: var(--text-heading);
  font-size: 0.875rem;
}

.live-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================
   STATUS BADGES (Clinical)
   ============================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.critical {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.lapsed {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.stable {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.pending {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ============================================
   TASK CENTER CARD
   ============================================ */
.task-card {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  color: white;
}

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.task-card-title {
  font-size: 1rem;
  font-weight: 600;
}

.task-card-count {
  background: rgba(255, 255, 255, 0.2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.task-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.task-item:hover {
  background: rgba(255, 255, 255, 0.2);
}

.task-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-checkbox.checked {
  background: white;
  border-color: white;
  color: var(--primary);
}

.task-text {
  flex: 1;
  font-size: 0.875rem;
}

.task-priority {
  font-size: 0.6875rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
}

.task-priority.high { background: rgba(239, 68, 68, 0.8); }
.task-priority.medium { background: rgba(245, 158, 11, 0.8); }

/* ============================================
   WARNING / ALERT CARDS
   ============================================ */
.warning-card {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  color: #78350f;
}

.warning-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.warning-card-icon {
  font-size: 1.5rem;
}

.warning-card-title {
  font-size: 1rem;
  font-weight: 600;
}

.warning-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.warning-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.warning-item-icon {
  font-size: 1rem;
}

/* ============================================
   PRO TIP CARD
   ============================================ */
.tip-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.tip-icon {
  width: 36px;
  height: 36px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.tip-content {
  flex: 1;
}

.tip-label {
  font-size: 0.6875rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.tip-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================
   CHART PLACEHOLDER
   ============================================ */
.chart-placeholder {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: var(--space-6);
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  min-height: 200px;
  gap: var(--space-2);
}

.chart-bar {
  width: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 0.5s ease;
  opacity: 0.8;
}

.chart-bar:hover {
  opacity: 1;
}

.chart-bar.alt { background: rgba(37, 99, 235, 0.4); }

/* ============================================
   GRID LAYOUTS
   ============================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.dashboard-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.col-span-2 {
  grid-column: span 2;
}

/* ============================================
   MINI PROGRESS BARS (in stat cards)
   ============================================ */
.stat-mini-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

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

.stat-mini-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  width: 60px;
  flex-shrink: 0;
}

.stat-mini-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.stat-mini-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

.stat-mini-fill.blue { background: var(--primary); }
.stat-mini-fill.green { background: var(--success); }
.stat-mini-fill.yellow { background: var(--warning); }

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet - Icons Only Sidebar */
@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --sidebar-width: 72px;
  }
  
  .sidebar {
    width: 72px;
  }
  
  .sidebar-logo-text,
  .sidebar-logo-subtitle,
  .nav-section,
  .user-details,
  .sidebar-new-report span:not(:first-child) {
    display: none;
  }
  
  .sidebar-logo-main {
    justify-content: center;
  }
  
  .nav-item {
    justify-content: center;
    padding: var(--space-3);
  }
  
  .nav-item-icon {
    width: auto;
    font-size: 1.25rem;
  }
  
  .sidebar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    margin-left: 0;
    min-width: 16px;
    height: 16px;
    font-size: 0.5625rem;
  }
  
  .nav-item {
    position: relative;
  }
  
  .sidebar-new-report {
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0 auto var(--space-4);
    border-radius: 50%;
  }
  
  .sidebar-footer {
    padding: var(--space-3);
  }
  
  .user-info {
    justify-content: center;
  }
  
  .theme-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
  }
  
  .theme-toggle span {
    display: none;
  }
  
  .theme-toggle::after {
    content: '🌓';
    font-size: 1rem;
  }
  
  .top-header {
    left: 72px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  
  .col-span-2 {
    grid-column: span 1;
  }
}

/* Mobile - Hamburger Menu */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-lg);
    z-index: 100;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .top-header {
    left: 0;
    padding-left: calc(var(--space-4) + 52px);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .main-content-inner {
    padding: var(--space-4);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  
  .stat-card {
    padding: var(--space-4);
  }
  
  .stat-card-value {
    font-size: 1.5rem;
  }
  
  .stat-card-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .page-actions {
    width: 100%;
  }
  
  .page-actions .btn {
    flex: 1;
    justify-content: center;
  }
  
  .header-search {
    display: none;
  }
  
  .header-user-info {
    display: none;
  }
  
  .dashboard-grid,
  .dashboard-grid-3 {
    grid-template-columns: 1fr;
  }
  
  .col-span-2 {
    grid-column: span 1;
  }
  
  .circular-progress {
    width: 64px;
    height: 64px;
  }
  
  .circular-progress svg {
    width: 64px;
    height: 64px;
  }
  
  .circular-progress-value {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-card-trend {
    font-size: 0.75rem;
  }
  
  .chart-placeholder {
    min-height: 150px;
  }
  
  .chart-bar {
    width: 20px;
  }
}

/* ============================================
   LEGACY COMPATIBILITY
   ============================================ */

/* Portal layout aliases */
.portal-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.portal-main { flex: 1; padding: var(--space-6); max-width: 1400px; margin: 0 auto; width: 100%; }
.portal-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-6); flex-wrap: wrap; gap: var(--space-4); }
.portal-page-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-heading); margin: 0; }
.portal-page-actions { display: flex; gap: var(--space-3); }

.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
}

.portal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.portal-card-header h2 {
  font-size: 1rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-heading);
}

/* Portal Stats */
.portal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (max-width: 900px) {
  .portal-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .portal-stats { grid-template-columns: 1fr; }
}

.portal-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}

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

.portal-stat.highlight-success { border-color: var(--success); }
.portal-stat.highlight-warning { border-color: var(--warning); }
.portal-stat.highlight-danger { border-color: var(--danger); }

.portal-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.portal-stat.highlight-success .portal-stat-value { color: var(--success); }
.portal-stat.highlight-warning .portal-stat-value { color: var(--warning); }
.portal-stat.highlight-danger .portal-stat-value { color: var(--danger); }

.portal-stat-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Portal Tables */
.portal-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-table th,
.portal-table td {
  padding: var(--space-4) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.portal-table th {
  font-weight: 600;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-secondary);
}

.portal-table td {
  font-size: 0.9375rem;
  color: var(--text);
}

.portal-table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* Portal Progress */
.portal-progress {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.portal-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
  min-width: 50px;
}

.portal-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.portal-progress-fill.green { background: var(--success); }
.portal-progress-fill.yellow { background: var(--warning); }
.portal-progress-fill.blue { background: var(--primary); }
.portal-progress-fill.red { background: var(--danger); }

.portal-progress-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 45px;
}

/* CPT Hints */
.portal-cpt-hint {
  font-size: 0.6875rem;
  margin-top: var(--space-1);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.portal-cpt-hint.info { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.portal-cpt-hint.urgent { background: rgba(245, 158, 11, 0.15); color: var(--warning); font-weight: 600; }
.portal-cpt-hint.warning { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.portal-cpt-hint.success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.portal-cpt-hint.ready { background: rgba(16, 185, 129, 0.15); color: var(--success); }

/* Portal Card List (Mobile) */
.portal-card-list {
  display: none;
  flex-direction: column;
  gap: var(--space-3);
}

.portal-list-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.portal-list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.portal-list-item-title {
  font-weight: 600;
  color: var(--primary);
}

.portal-list-item-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  font-size: 0.875rem;
}

.portal-list-item-body label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.portal-list-item-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .portal-table-wrapper { display: none; }
  .portal-card-list { display: flex; }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.6;
}

.empty-state h3 {
  color: var(--text-heading);
  margin-bottom: var(--space-2);
}

.empty-state p {
  max-width: 400px;
  margin: 0 auto var(--space-4);
}

/* Table Search & Sorting */
.table-search {
  flex: 1;
  min-width: 200px;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
}

.table-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.sortable-table th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.sortable-table th[data-sort]:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
}

/* App Layout (legacy) */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Utility Classes */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* ============================================
   LANDING PAGE
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .nav {
  background: rgba(15, 23, 42, 0.9);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text-heading);
  text-decoration: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  gap: var(--space-8);
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.hero {
  min-height: 100vh;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px var(--space-6) 80px;
  position: relative;
}

.hero-content {
  max-width: 900px;
  text-align: center;
}

.hero h1 span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: var(--text-muted);
  margin: var(--space-4) 0;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-8);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--text);
}

@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .mobile-menu-btn { display: block; }
}
