/* Consistent Spacing System */
:root {
  /* Spacing Scale */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;        /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  
  /* Component Spacing - Ultra Compact */
  --card-padding: var(--space-3);
  --card-margin: var(--space-2);
  --section-gap: var(--space-3);
  --element-gap: var(--space-1);
  --button-padding: var(--space-1) var(--space-2);
  --input-padding: var(--space-1) var(--space-2);
  
  /* Border Radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-full: 9999px;
}

/* Color Palette Variables */
:root {
  /* Primary Colors */
  --primary-blue: #3b82f6;
  --primary-blue-hover: #2563eb;
  --primary-blue-light: #dbeafe;
  
  /* Status Colors */
  --status-clean: #10b981;
  --status-clean-bg: #d1fae5;
  --status-clean-text: #065f46;
  
  --status-messy: #ef4444;
  --status-messy-bg: #fee2e2;
  --status-messy-text: #991b1b;
  
  --status-missing: #f59e0b;
  --status-missing-bg: #fef3c7;
  --status-missing-text: #92400e;
  
  --status-other: #f97316;
  --status-other-bg: #fed7aa;
  --status-other-text: #9a3412;
  
  /* Critical Overdue Colors */
  --status-critical: #dc2626;
  --status-critical-bg: #fef2f2;
  --status-critical-text: #991b1b;
  
  --status-occupied: #f43f5e;
  --status-occupied-bg: #fce7f3;
  --status-occupied-text: #be185d;
  
  --status-free: #10b981;
  --status-free-bg: #d1fae5;
  --status-free-text: #065f46;
  
  /* Notification Priority Colors */
  --priority-0: #dc2626; /* Critical overdue */
  --priority-1: #dc2626; /* Messy bed */
  --priority-2: #ea580c; /* Missing equipment */
  --priority-3: #d97706; /* Other problem */
  --priority-4: #059669; /* Recently freed */
  --priority-5: #2563eb; /* Regular check */
  
  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  
  /* Hover Shadows */
  --shadow-hover-sm: 0 2px 4px 0 rgb(0 0 0 / 0.1);
  --shadow-hover-md: 0 6px 8px -1px rgb(0 0 0 / 0.15), 0 4px 6px -2px rgb(0 0 0 / 0.1);
  --shadow-hover-lg: 0 12px 20px -3px rgb(0 0 0 / 0.15), 0 6px 8px -4px rgb(0 0 0 / 0.1);
  
  /* Light mode text colors */
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-tertiary: #6b7280;
  --text-quaternary: #9ca3af;
}

/* Dark mode color overrides */
.dark {
  --gray-50: #1f2937;
  --gray-100: #374151;
  --gray-200: #4b5563;
  --gray-300: #6b7280;
  --gray-400: #9ca3af;
  --gray-500: #d1d5db;
  --gray-600: #e5e7eb;
  --gray-700: #f3f4f6;
  --gray-800: #f9fafb;
  --gray-900: #ffffff;
  
  /* Dark mode text colors */
  --text-primary: #f9fafb;
  --text-secondary: #e5e7eb;
  --text-tertiary: #d1d5db;
  --text-quaternary: #9ca3af;
  
  /* Dark mode status backgrounds - softer versions */
  --status-clean-bg: #1f2937;
  --status-messy-bg: #374151;
  --status-missing-bg: #4b5563;
  --status-other-bg: #6b7280;
  --status-occupied-bg: #7c2d12;
  --status-free-bg: #1f2937;
  --primary-blue-light: #374151;
}

/* Custom scrollbar styles */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

.status-pill { 
  border-radius: var(--radius-full); 
  padding: var(--space-1) var(--space-2); 
  font-weight: 700; 
  font-size: 0.75rem;
  display: inline-block; 
  max-width: 100%; 
  white-space: normal; 
  word-break: break-word; 
  text-align: center; 
}
.badge { 
  border-radius: var(--radius-md); 
  padding: var(--space-1) var(--space-2); 
  font-weight: 700; 
  font-size: 0.75rem;
  display: inline-block; 
  max-width: 100%; 
  white-space: normal; 
  word-break: break-word; 
  text-align: center; 
}
.card { 
  border-radius: var(--radius-xl); 
  box-shadow: var(--shadow-lg); 
  padding: var(--card-padding);
  margin-bottom: var(--card-margin);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

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

/* Button Styles */
.btn {
  padding: var(--button-padding);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  box-shadow: var(--shadow-hover-sm);
  transform: translateY(-1px);
}

.btn-primary {
  background-color: var(--primary-blue);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-blue-hover);
}

/* Bed Item Styles */
.bed-item {
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.bed-item:hover {
  box-shadow: var(--shadow-hover-md);
  transform: translateY(-1px);
}

/* Notification Item Styles */
.notification-item {
  transition: all 0.3s ease;
  box-shadow: var(--shadow-xs);
}

.notification-item:hover {
  box-shadow: var(--shadow-hover-sm);
  transform: translateY(-1px);
}
.kpi-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 2.5rem;
  padding: var(--space-4);
  height: 100%;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: var(--gray-200);
  z-index: 1;
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  background-color: var(--progress-color, var(--gray-300));
  width: var(--progress-width, 0%);
  z-index: 2;
  transition: width 0.5s ease;
}
.kpi-title {
  margin: 0;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #1e293b;
  line-height: 1.25;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 3;
}
.kpi-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 2rem;
  font-size: clamp(1.75rem, 3vw + 1rem, 2.25rem);
  line-height: 1.05;
  font-weight: 700;
  border-radius: var(--radius-lg);
  padding: var(--space-1) var(--space-2);
  position: relative;
  z-index: 3;
}
.dark .kpi-title { color: #e2e8f0; }
@media (max-width: 768px) {
  .kpi-card {
    min-height: 2rem;
    padding: var(--space-3);
    gap: var(--space-1);
  }
  .kpi-value {
    font-size: 1.75rem;
    font-size: clamp(1.5rem, 6vw + .5rem, 2rem);
  }
}
.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-2);
  align-items: center;
  width: 100%;
}
.toolbar > * {
  width: 100%;
}
@media (min-width: 768px) {
  .toolbar {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
  }
}
@media (min-width: 1024px) {
  .toolbar {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-3);
  }
  .toolbar > * {
    width: auto;
  }
  .toolbar input[type="search"] {
    min-width: 16rem;
  }
}
.responsive-table {
  border-collapse: separate;
  border-spacing: 0;
}
.responsive-table th,
.responsive-table td {
  vertical-align: top;
}
.responsive-table td {
  word-break: break-word;
}
@media (max-width: 1280px) {
  .responsive-table th,
  .responsive-table td {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }
  .responsive-table td .status-pill,
  .responsive-table td .badge {
    font-size: .9rem;
  }
}
@media (max-width: 1024px) {
  .responsive-table {
    font-size: 1rem;
    line-height: 1.5;
  }
  .responsive-table th {
    font-size: .75rem;
    letter-spacing: .02em;
  }
  .kpi-card {
    min-height: 6.5rem;
  }
  .kpi-value {
    font-size: clamp(1.6rem, 3vw + .75rem, 2.25rem);
  }
}
.mono { font-variant-numeric: tabular-nums; }
.pulse-critical {
  animation: criticalPulse 1.5s ease-in-out infinite;
}

@keyframes criticalPulse {
  0%, 100% {
    background-color: inherit;
  }
  50% {
    background-color: rgba(250, 204, 21, 0.25);
  }
}
