/* ============================================================
   GLACIER DESIGN SYSTEM — LIQUID GLASS v1.0
   Urgentflex Medical Platform
   ============================================================ */

/* ---- Google Fonts Import ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS Custom Properties (Design Tokens) ---- */
:root {
  /* Primary Blues */
  --glacier-50: #F0F6FF;
  --glacier-100: #E0EDFF;
  --glacier-200: #B3D1FD;
  --glacier-300: #7BABFA;
  --glacier-400: #4B8BF5;
  --glacier-500: #2563EB;
  --glacier-600: #1E4D8C;
  --glacier-700: #163566;
  --glacier-800: #0F2440;
  --glacier-900: #0A1628;

  /* Silver Neutrals */
  --silver-50: #F8FAFC;
  --silver-100: #F1F5F9;
  --silver-200: #E2E8F0;
  --silver-300: #CBD5E1;
  --silver-400: #94A3B8;
  --silver-500: #64748B;
  --silver-600: #475569;
  --silver-700: #2D3C50;
  --silver-800: #1E2A3A;
  --silver-900: #111827;
  --silver-950: #0B0F14;

  /* Semantic Status Colors */
  --status-success: #10B981;
  --status-success-glass: rgba(16, 185, 129, 0.12);
  --status-warning: #F59E0B;
  --status-warning-glass: rgba(245, 158, 11, 0.12);
  --status-critical: #EF4444;
  --status-critical-glass: rgba(239, 68, 68, 0.12);
  --status-info: #3B82F6;
  --status-info-glass: rgba(59, 130, 246, 0.12);

  /* Liquid Glass Tokens */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-hover: rgba(255, 255, 255, 0.12);
  --glass-bg-active: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-border-strong: rgba(255, 255, 255, 0.25);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.12);
  --glass-blur: 20px;
  --glass-blur-heavy: 40px;
  --glass-highlight: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 50%);
  --glass-dark-bg: rgba(15, 23, 42, 0.6);
  --glass-dark-border: rgba(255, 255, 255, 0.08);

  /* Spacing */
  --space-1: 4px;
  --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;
  --space-20: 80px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Animation */
  --ease-default: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --ease-glass: cubic-bezier(0.22, 0.68, 0, 1.04);
  --duration-instant: 100ms;
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-cinematic: 800ms;

  /* Layout */
  --sidebar-width: 280px;
  --sidebar-collapsed: 64px;
  --topbar-height: 56px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--glacier-900);
  color: #ffffff;
  line-height: 1.5;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { border: none; cursor: pointer; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   LIQUID GLASS UTILITIES
   ============================================================ */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,0.1);
}

.glass-elevated {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.12);
}

.glass-floating {
  background: var(--glass-bg);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.15);
}

.glass-overlay {
  background: rgba(10, 22, 40, 0.75);
  backdrop-filter: blur(var(--glass-blur-heavy)) saturate(200%);
  -webkit-backdrop-filter: blur(var(--glass-blur-heavy)) saturate(200%);
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 16px 48px rgba(0,0,0,0.20), 0 8px 16px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Hoverable glass card */
.glass-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  transition: transform var(--duration-fast) var(--ease-glass),
              box-shadow var(--duration-fast) var(--ease-glass),
              background var(--duration-fast) ease;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--glass-highlight);
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
  transition: opacity var(--duration-fast) ease;
}

.glass-card::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.07) 0%, transparent 50%);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--duration-normal) ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  background: var(--glass-bg-hover) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.15) !important;
}

.glass-card:hover::before { opacity: 0.9; }
.glass-card:hover::after { opacity: 1; }

/* ============================================================
   GLASS SHIMMER / SKELETON
   ============================================================ */
@keyframes glass-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.glass-skeleton {
  background: linear-gradient(90deg, var(--glass-bg) 25%, rgba(255,255,255,0.1) 50%, var(--glass-bg) 75%);
  background-size: 200% 100%;
  animation: glass-shimmer 1.5s ease infinite;
  border-radius: var(--radius-md);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.type-display-xl { font-size: 72px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.type-display-lg { font-size: 56px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.type-display-md { font-size: 40px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.type-heading-xl { font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.type-heading-lg { font-size: 24px; font-weight: 600; line-height: 1.3; }
.type-heading-md { font-size: 20px; font-weight: 600; line-height: 1.4; }
.type-heading-sm { font-size: 16px; font-weight: 600; line-height: 1.4; letter-spacing: 0.01em; }
.type-body-lg { font-size: 18px; font-weight: 400; line-height: 1.6; }
.type-body-md { font-size: 16px; font-weight: 400; line-height: 1.5; }
.type-body-sm { font-size: 14px; font-weight: 400; line-height: 1.5; letter-spacing: 0.01em; }
.type-caption { font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: 0.02em; }
.type-overline { font-size: 11px; font-weight: 600; line-height: 1.2; letter-spacing: 0.08em; text-transform: uppercase; }

/* ============================================================
   GLASS BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-6);
  height: 44px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-glass);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  border: none;
  font-family: inherit;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--glacier-500), var(--glacier-600));
  color: white;
  box-shadow: 0 4px 16px rgba(37,99,235,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--glacier-400), var(--glacier-500));
  box-shadow: 0 6px 24px rgba(37,99,235,0.5), inset 0 1px 0 rgba(255,255,255,0.25);
  transform: translateY(-1px);
}

.btn-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  color: white;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-glass:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-strong);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-sm { height: 36px; padding: 0 var(--space-4); font-size: 14px; }
.btn-lg { height: 52px; padding: 0 var(--space-8); font-size: 18px; border-radius: var(--radius-md); }
.btn-xl { height: 60px; padding: 0 var(--space-10); font-size: 18px; border-radius: var(--radius-md); }
.btn-full { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon-sm { width: 36px; height: 36px; padding: 0; }

.btn-danger {
  background: var(--status-critical-glass);
  border: 1px solid rgba(239,68,68,0.3);
  color: #FCA5A5;
}
.btn-danger:hover { background: rgba(239,68,68,0.2); color: white; }

/* ============================================================
   GLASS INPUTS
   ============================================================ */
.input-glass {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: white;
  font-size: 16px;
  font-family: inherit;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  outline: none;
}

.input-glass::placeholder { color: var(--silver-500); }
.input-glass:focus {
  border-color: var(--glacier-400);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15), inset 0 1px 0 rgba(255,255,255,0.1);
}
.input-glass.error { border-color: var(--status-critical); box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
.input-glass.success { border-color: var(--status-success); }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-left { position: absolute; left: 14px; color: var(--silver-500); pointer-events: none; z-index: 2; }
.input-icon-right { position: absolute; right: 14px; color: var(--silver-500); z-index: 2; }
.input-glass.has-icon-left { padding-left: 44px; }
.input-glass.has-icon-right { padding-right: 44px; }

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--silver-300);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.input-error-text { font-size: 12px; color: #FCA5A5; margin-top: 4px; }
.input-helper-text { font-size: 12px; color: var(--silver-500); margin-top: 4px; }

/* ============================================================
   STATUS BADGES / PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-blue { background: var(--status-info-glass); color: var(--glacier-300); border: 1px solid rgba(59,130,246,0.25); }
.badge-green { background: var(--status-success-glass); color: #6EE7B7; border: 1px solid rgba(16,185,129,0.25); }
.badge-amber { background: var(--status-warning-glass); color: #FCD34D; border: 1px solid rgba(245,158,11,0.25); }
.badge-red { background: var(--status-critical-glass); color: #FCA5A5; border: 1px solid rgba(239,68,68,0.25); }
.badge-gray { background: rgba(100,116,139,0.15); color: var(--silver-300); border: 1px solid rgba(100,116,139,0.25); }
.badge-purple { background: rgba(139,92,246,0.12); color: #C4B5FD; border: 1px solid rgba(139,92,246,0.25); }

.badge .badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-dot-pulse { animation: pulse-dot 2s infinite; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

/* ============================================================
   TOOLTIPS
   ============================================================ */
.tooltip-wrap { position: relative; display: inline-flex; }
.tooltip-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--silver-900);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: white;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 150ms ease;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.tooltip-wrap:hover .tooltip-content {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(37,99,235,0.3); }
  50% { box-shadow: 0 0 40px rgba(37,99,235,0.6); }
}
@keyframes count-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes orb-float {
  0% { transform: translate(0px, 0px) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
  100% { transform: translate(0px, 0px) scale(1); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
@keyframes toast-in {
  from { transform: translateY(-100%) translateX(-50%); opacity: 0; }
  to { transform: translateY(0) translateX(-50%); opacity: 1; }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes check-draw {
  from { stroke-dashoffset: 30; }
  to { stroke-dashoffset: 0; }
}

.animate-fadeInUp { animation: fadeInUp var(--duration-slow) var(--ease-spring) forwards; }
.animate-fadeIn { animation: fadeIn var(--duration-normal) ease forwards; }
.animate-float { animation: float 2.5s ease-in-out infinite; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
.animate-gradient { animation: gradient-shift 6s ease infinite; background-size: 200% 200%; }
.animate-spin { animation: spin 1s linear infinite; }

/* Staggered entrance delays */
.delay-0 { animation-delay: 0ms; }
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }
.delay-5 { animation-delay: 500ms; }
.delay-6 { animation-delay: 600ms; }

/* Initially hidden for JS-triggered animations */
.anim-init { opacity: 0; transform: translateY(24px); }
.anim-ready { transition: opacity 0.6s var(--ease-spring), transform 0.6s var(--ease-spring); }
.anim-visible { opacity: 1 !important; transform: translateY(0) !important; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  pointer-events: all;
  animation: toast-in 0.4s var(--ease-spring) forwards;
  min-width: 280px;
  max-width: 420px;
}
.toast-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); backdrop-filter: blur(20px); color: #6EE7B7; }
.toast-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); backdrop-filter: blur(20px); color: #FCA5A5; }
.toast-info { background: rgba(37,99,235,0.15); border: 1px solid rgba(37,99,235,0.3); backdrop-filter: blur(20px); color: var(--glacier-300); }
.toast-warning { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); backdrop-filter: blur(20px); color: #FCD34D; }

/* ============================================================
   MODAL OVERLAY
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.2s ease;
}

.modal-container {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-2xl);
  animation: fadeInUp 0.3s var(--ease-spring);
}

/* ============================================================
   SLIDE-OVER PANEL
   ============================================================ */
.slideover-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 599;
  animation: fadeIn 0.2s ease;
}

.slideover-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 95vw;
  overflow-y: auto;
  z-index: 901;
  border-left: 1px solid var(--glass-border);
  animation: slideInRight 0.4s var(--ease-spring);
}

/* ============================================================
   DROPDOWN MENUS
   ============================================================ */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  min-width: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  z-index: 500;
  animation: slideDown 0.2s var(--ease-spring);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--silver-200);
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}
.dropdown-item:hover { background: var(--glass-bg-hover); color: white; }
.dropdown-item.danger { color: #FCA5A5; }
.dropdown-item.danger:hover { background: var(--status-critical-glass); }

.dropdown-divider { height: 1px; background: var(--glass-border); margin: 4px 0; }

/* ============================================================
   TABS
   ============================================================ */
.tab-bar {
  display: flex;
  gap: var(--space-1);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--glass-border);
}

.tab-item {
  flex: 1;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--silver-400);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  text-align: center;
  white-space: nowrap;
}
.tab-item:hover { color: var(--silver-200); }
.tab-item.active {
  background: var(--glass-bg-hover);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  border: 1px solid var(--glass-border);
}

/* ============================================================
   TABLE STYLES
   ============================================================ */
.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-xl);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--silver-400);
  text-align: left;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--silver-200); }

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--silver-200);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--duration-fast) ease;
}

.data-table tr:hover td {
  background: rgba(255,255,255,0.04);
}

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

/* ============================================================
   CHARTS CONTAINER
   ============================================================ */
.chart-container { position: relative; width: 100%; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease-spring);
}
.progress-blue { background: linear-gradient(90deg, var(--glacier-500), var(--glacier-400)); }
.progress-green { background: linear-gradient(90deg, var(--status-success), #34D399); }
.progress-amber { background: linear-gradient(90deg, var(--status-warning), #FCD34D); }
.progress-red { background: linear-gradient(90deg, var(--status-critical), #F87171); }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  background: linear-gradient(135deg, var(--glacier-600), var(--glacier-400));
  color: white;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.12);
}
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-md { width: 40px; height: 40px; font-size: 15px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   RESPONSIVE UTILITIES
   ============================================================ */
@media (max-width: 768px) {
  .type-display-xl { font-size: 40px; }
  .type-display-lg { font-size: 32px; }
  .type-display-md { font-size: 28px; }
  .type-heading-xl { font-size: 24px; }
  .hide-mobile { display: none !important; }
  .slideover-panel { width: 100vw; }
}

@media (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}

/* ============================================================
   MOBILE SIDEBAR OVERLAY (Opus 4.7 fix)
   Transform-based slide-in with backdrop overlay + swipe-to-close
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    transform: translateX(-100%) !important;
    transition: transform 300ms var(--ease-spring) !important;
    z-index: 1000 !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
    z-index: 999;
  }
  .sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }
  body.sidebar-open {
    overflow: hidden;
  }
  /* Reset any inline left positioning from desktop collapse mode */
  .topbar,
  .main-content {
    left: 0 !important;
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .glass-skeleton { animation: none; background: var(--glass-bg); }
}

/* ============================================================
   FOCUS STYLES
   ============================================================ */
:focus-visible {
  outline: 3px solid var(--glacier-400);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.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); }
.w-full { width: 100%; }
.h-full { height: 100%; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.pointer-events-none { pointer-events: none; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.rounded-full { border-radius: var(--radius-full); }
.border-t { border-top: 1px solid var(--glass-border); }
.border-b { border-bottom: 1px solid var(--glass-border); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.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-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-auto { margin-top: auto; }
.ml-auto { margin-left: auto; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }

/* Color utilities */
.text-white { color: white; }
.text-silver-300 { color: var(--silver-300); }
.text-silver-400 { color: var(--silver-400); }
.text-silver-500 { color: var(--silver-500); }
.text-glacier-300 { color: var(--glacier-300); }
.text-glacier-400 { color: var(--glacier-400); }
.text-glacier-500 { color: var(--glacier-500); }
.text-success { color: var(--status-success); }
.text-warning { color: var(--status-warning); }
.text-critical { color: var(--status-critical); }
.text-info { color: var(--status-info); }

/* Grid */
.grid { display: grid; }
.grid-2 { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
