/* ================================================================
   HIMS - Hospital Information Management System
   Premium Enterprise Design System v3.0
   ================================================================ */

/* ===== CSS Custom Properties (Design Tokens) ===== */
:root {
  /* Primary palette - Premium Medical Blue */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #2563eb;
  --primary-600: #1d4ed8;
  --primary-700: #1e40af;
  --primary-800: #1e3a8a;
  --primary-900: #172554;

  /* Success - Health Green */
  --success-50: #ecfdf5;
  --success-100: #d1fae5;
  --success-400: #34d399;
  --success-500: #10b981;
  --success-600: #059669;

  /* Warning - Amber */
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-400: #fbbf24;
  --warning-500: #f59e0b;
  --warning-600: #d97706;

  /* Danger - Rose/Red */
  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-400: #f87171;
  --danger-500: #ef4444;
  --danger-600: #dc2626;

  /* Info - Teal/Cyan */
  --info-50: #ecfeff;
  --info-100: #cffafe;
  --info-400: #22d3ee;
  --info-500: #06b6d4;
  --info-600: #0891b2;

  /* Neutral - Slate */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Semantic aliases */
  --primary: var(--primary-500);
  --primary-dark: var(--primary-600);
  --success: var(--success-500);
  --warning: var(--warning-500);
  --danger: var(--danger-500);
  --info: var(--info-500);
  --light: var(--slate-50);
  --dark: var(--slate-800);
  --body-bg: #f0f4f8;

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 0px;
  --navbar-height: 52px;
  --card-radius: 12px;
  --card-radius-sm: 8px;
  --btn-radius: 8px;

  /* Shadows - Subtle enterprise-grade */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography Scale - User Specified */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas',
    monospace;
  
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1rem;
  --text-xl: 1.125rem;
  --text-2xl: 1.375rem;
  --text-3xl: 1.875rem;  /* 30px - Dashboard Title */
  --text-4xl: 2.5rem;    /* 40px - Card Numbers */
  --text-5xl: 3rem;      /* 48px - Hero Numbers */

  /* Spacing System - Consistent 8px base */
  --space-0: 0;
  --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;
}

/* ===== Base Reset & Typography ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--body-bg);
  color: var(--slate-800);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100vh;
  font-size: var(--text-base);
  max-width: 100vw;
}

/* Standardized Typography Scale */
h1, h2, h3, h4, h5, h6 {
  color: var(--slate-900);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { color: var(--slate-600); line-height: 1.6; }

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

small, .small { font-size: var(--text-xs); }

/* Smooth scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ================================================================
   NAVIGATION BAR - Reduced height, premium look
   ================================================================ */
.navbar {
  padding: 0 var(--space-4);
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 50%, #2563eb 100%) !important;
  box-shadow: 0 2px 12px rgba(30, 64, 175, 0.25);
  z-index: 1030;
  height: var(--navbar-height);
  min-height: var(--navbar-height);
  max-height: var(--navbar-height);
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
}

.navbar-brand {
  font-size: var(--text-lg);
  letter-spacing: 0.3px;
  padding: 0;
  gap: var(--space-2);
  display: flex;
  align-items: center;
  text-decoration: none;
}

.navbar-brand .brand-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.navbar-brand .brand-icon i {
  font-size: 0.95rem;
  color: #fff;
}

.navbar-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.navbar-brand .brand-name {
  font-weight: 700;
  font-size: var(--text-base);
  color: #fff;
  letter-spacing: 0.5px;
}

.navbar-brand .brand-tagline {
  font-weight: 400;
  font-size: 0.625rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

/* Nav Links */
.navbar .nav-link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--btn-radius);
  transition: all var(--transition-fast);
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8) !important;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.navbar .nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff !important;
}

.navbar .nav-link i {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Header Right - Profile & Notifications */
.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  font-size: 0.875rem;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

.header-icon-btn .notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid rgba(30, 64, 175, 0.8);
}

/* Profile Dropdown */
.profile-dropdown {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1);
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.profile-dropdown:hover {
  background: rgba(255, 255, 255, 0.12);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  color: #fff;
}

.profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.profile-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: #fff;
}

.profile-role {
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sidebar toggle button */
.navbar .sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-right: var(--space-2);
  backdrop-filter: blur(4px);
}

.navbar .sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.navbar .sidebar-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Dropdown */
.dropdown-menu {
  border: 1px solid var(--slate-100);
  box-shadow: var(--shadow-lg);
  border-radius: var(--card-radius-sm);
  padding: var(--space-1);
  animation: dropdownIn var(--transition-fast) ease-out;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item {
  border-radius: 6px;
  padding: var(--space-2) var(--space-3);
  transition: all var(--transition-fast);
  font-size: var(--text-sm);
  color: var(--slate-700) !important;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.dropdown-item:hover {
  background: var(--primary-50);
  color: var(--primary) !important;
  transform: translateX(2px);
}

.dropdown-item i {
  width: 18px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--slate-400);
  transition: color var(--transition-fast);
}

.dropdown-item:hover i { color: var(--primary); }

/* ================================================================
   SIDEBAR - Reduced width, improved states
   ================================================================ */
.sidebar {
  position: fixed;
  top: var(--navbar-height);
  bottom: 0;
  left: 0;
  z-index: 1020;
  width: var(--sidebar-width);
  background: #fff !important;
  border-right: 1px solid var(--slate-200);
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(-100%);
  transition: transform var(--transition-base);
  box-shadow: none;
}

.sidebar.show {
  transform: translateX(0);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
}

.sidebar-sticky {
  padding: var(--space-3) 0 var(--space-6);
  min-height: calc(100vh - var(--navbar-height));
  display: flex;
  flex-direction: column;
}

.sidebar-heading {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--slate-400) !important;
  padding: var(--space-4) var(--space-4) var(--space-2) !important;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sidebar-heading i {
  font-size: 0.6875rem;
  opacity: 0.7;
}

.sidebar .nav {
  padding: 0 var(--space-2);
}

.sidebar .nav-link {
  padding: var(--space-2) var(--space-3);
  color: var(--slate-600);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--btn-radius);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 2px;
  position: relative;
}

.sidebar .nav-link:hover {
  background: var(--primary-50);
  color: var(--primary);
}

.sidebar .nav-link i {
  width: 18px;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--slate-400);
  transition: all var(--transition-fast);
}

.sidebar .nav-link:hover i {
  color: var(--primary);
}

/* Active sidebar state */
.sidebar .nav-link.active {
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.sidebar .nav-link.active i {
  color: #fff !important;
}

.sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: #fff;
  border-radius: 0 2px 2px 0;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1015;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.sidebar-overlay.show { display: block; }

/* ================================================================
   MAIN CONTENT
   ================================================================ */
main, .main-content {
  min-height: calc(100vh - var(--navbar-height) - 56px);
  padding: var(--space-6) var(--space-4) var(--space-8);
  transition: margin-left var(--transition-base), width var(--transition-base);
  position: relative;
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

/* ================================================================
   PAGE HEADER - Improved spacing
   ================================================================ */
.page-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.page-header h2 {
  font-size: 1.875rem;  /* 30px - Dashboard Title */
  font-weight: 700;
  margin-bottom: var(--space-1);
  color: var(--slate-900);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.page-header h2 i {
  color: var(--primary);
  font-size: 1.5rem;
}

.page-header .page-subtitle {
  color: var(--slate-500);
  font-size: var(--text-base);
  font-weight: 400;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.header-actions .btn {
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--btn-radius);
}

/* ================================================================
   CARDS - Enterprise-grade styling
   ================================================================ */
.card {
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  margin-bottom: var(--space-5);
  background: #fff;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid var(--slate-100);
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
}

.card-header:first-child {
  border-radius: var(--card-radius) var(--card-radius) 0 0;
}

.card-header h5, .card-header h6 {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
}

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

.card-footer {
  background: var(--slate-50);
  border-top: 1px solid var(--slate-100);
  padding: var(--space-3) var(--space-5);
}

/* ================================================================
   STAT CARDS - Larger icons, bigger numbers, equal width
   ================================================================ */
.stat-card {
  border-radius: var(--card-radius);
  padding: var(--space-5) var(--space-4);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 140px;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: currentColor;
  opacity: 0.3;
}

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

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-3);
  font-size: 1.25rem;
  opacity: 0.95;
}

.stat-card .stat-icon i {
  font-size: 1.25rem;
}

.stat-card .stat-number {
  font-size: 2.5rem;  /* 40px - Card Numbers */
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-card .stat-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  opacity: 0.85;
  margin-top: var(--space-1);
}

/* Stat card color variants */
.stat-card.bg-primary {
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
.stat-card.bg-info {
  color: #fff;
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}
.stat-card.bg-success {
  color: #fff;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.stat-card.bg-warning {
  color: #fff;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}
.stat-card.bg-danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}
.stat-card.bg-secondary {
  color: #fff;
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

/* ================================================================
   TOKEN / CONSULTATION CARDS - Enhanced emphasis
   ================================================================ */
.consultation-card {
  border-radius: var(--card-radius);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  height: 100%;
}

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

.consultation-card .status-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.consultation-card .token-number {
  font-size: 2.5rem;  /* 40px */
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
  margin-bottom: var(--space-3);
}

.consultation-card .patient-name {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--slate-800);
  margin-bottom: var(--space-3);
}

.consultation-card .patient-meta {
  font-size: var(--text-sm);
  color: var(--slate-500);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.consultation-card .patient-meta i {
  font-size: var(--text-xs);
  opacity: 0.7;
}

/* Status pulse animation for active consultation */
.status-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  animation: statusPulse 2s ease-in-out infinite;
}

.status-pulse.active {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
}

.status-pulse.waiting {
  background: var(--warning);
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

/* ================================================================
   TABLES - Improved header, row height, badges
   ================================================================ */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.table {
  margin-bottom: 0;
  font-size: var(--text-sm);
  min-width: 0;
}

.table thead th {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--slate-500);
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--slate-200);
  background: var(--slate-50);
  white-space: nowrap;
}

.table tbody td {
  padding: var(--space-3) var(--space-4);
  vertical-align: middle;
  border-bottom: 1px solid var(--slate-100);
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table-hover tbody tr:hover {
  background: var(--primary-50);
}

.table-sm thead th {
  padding: var(--space-2) var(--space-3);
  font-size: 0.625rem;
}

.table-sm tbody td {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

/* Borderless table variant */
.table-borderless td,
.table-borderless th {
  border: none;
}

/* ================================================================
   RESPONSIVE STACK TABLES (Mobile card layout)
   ================================================================ */
@media (max-width: 767.98px) {
  .table-responsive-stack thead { display: none !important; }

  .table-responsive-stack tbody tr {
    display: block;
    border: 1px solid var(--slate-200);
    border-radius: var(--card-radius-sm);
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    background: white;
    box-shadow: var(--shadow-xs);
  }

  .table-responsive-stack tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    border: none;
    border-bottom: 1px solid var(--slate-100);
    text-align: right;
    font-size: var(--text-sm);
  }

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

  .table-responsive-stack tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: var(--text-xs);
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding-right: var(--space-3);
    flex: 0 0 auto;
  }

  .table-responsive-stack tbody td > * { text-align: right; flex: 1; }
  .table-responsive-stack .btn-group { justify-content: flex-end; }
}

/* ================================================================
   BUTTONS - Consistent styling
   ================================================================ */
.btn {
  border-radius: var(--btn-radius);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  transition: all var(--transition-fast);
  font-size: var(--text-sm);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--transition-fast);
}

.btn:hover::after { background: rgba(255, 255, 255, 0.1); }
.btn:active::after { background: rgba(255, 255, 255, 0.2); }

.btn-lg {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
  border-radius: var(--card-radius-sm);
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  border-radius: 6px;
}

.btn-xs {
  padding: 2px var(--space-2);
  font-size: 0.6875rem;
  border-radius: 5px;
}

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

.btn-primary:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  color: #fff;
}

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

.btn-success:hover {
  background: var(--success-600);
  border-color: var(--success-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  color: #fff;
}

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

.btn-warning:hover {
  background: var(--warning-600);
  border-color: var(--warning-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  color: #fff;
}

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

.btn-danger:hover {
  background: var(--danger-600);
  border-color: var(--danger-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  color: #fff;
}

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

.btn-info:hover {
  background: var(--info-600);
  border-color: var(--info-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
  color: #fff;
}

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

.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline-secondary:hover,
.btn-outline-info:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-outline-danger:hover {
  transform: translateY(-1px);
}

/* ================================================================
   FORMS
   ================================================================ */
.form-control, .form-select {
  border-radius: var(--btn-radius);
  border: 1.5px solid var(--slate-200);
  padding: var(--space-2) var(--space-3);
  transition: all var(--transition-fast);
  font-size: var(--text-sm);
  color: var(--slate-800);
  background: #fff;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control-lg {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  border-radius: var(--card-radius-sm);
}

.form-control-sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  border-radius: 6px;
}

.form-label {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--slate-700);
  margin-bottom: var(--space-1);
}

.form-text {
  font-size: var(--text-xs);
  color: var(--slate-500);
}

.form-check-input {
  border: 1.5px solid var(--slate-300);
  transition: all var(--transition-fast);
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Validation states */
.was-validated .form-control:valid,
.form-control.is-valid {
  border-color: var(--success);
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
  border-color: var(--danger);
}

.invalid-feedback {
  font-size: var(--text-xs);
  color: var(--danger);
}

/* ================================================================
   BADGES - Improved styling
   ================================================================ */
.badge {
  font-weight: 600;
  padding: 0.3em 0.65em;
  border-radius: 6px;
  font-size: var(--text-xs);
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.badge.bg-primary { background: var(--primary) !important; }
.badge.bg-success { background: var(--success) !important; }
.badge.bg-warning { background: var(--warning) !important; }
.badge.bg-danger { background: var(--danger) !important; }
.badge.bg-info { background: var(--info) !important; }
.badge.bg-secondary { background: var(--slate-500) !important; }

.badge.fs-5 { font-size: 1rem !important; }
.badge.fs-6 { font-size: 0.875rem !important; }

/* Token badges */
.token-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-3);
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
  border: none;
  border-radius: var(--card-radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  animation: slideDown 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

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

.alert-success {
  background: var(--success-50);
  color: var(--success-600);
  border-left: 4px solid var(--success);
}

.alert-danger, .alert-error {
  background: var(--danger-50);
  color: var(--danger-600);
  border-left: 4px solid var(--danger);
}

.alert-warning {
  background: var(--warning-50);
  color: var(--warning-600);
  border-left: 4px solid var(--warning);
}

.alert-info {
  background: var(--info-50);
  color: var(--info-600);
  border-left: 4px solid var(--info);
}

.alert-dismissible .btn-close {
  padding: 0.9rem;
  opacity: 0.5;
}

.alert-dismissible .btn-close:hover { opacity: 1; }

/* ================================================================
   ACCORDION
   ================================================================ */
.accordion-item {
  border: none;
  border-bottom: 1px solid var(--slate-100);
}

.accordion-button {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  background: transparent;
  box-shadow: none !important;
  font-weight: 500;
  color: var(--slate-700);
  transition: all var(--transition-fast);
}

.accordion-button:not(.collapsed) {
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 600;
}

.accordion-button::after {
  background-size: 1rem;
  transition: transform var(--transition-fast);
}

.accordion-button:focus {
  border-color: transparent;
  box-shadow: none;
}

.accordion-body {
  padding: var(--space-4);
  background: var(--slate-50);
  font-size: var(--text-sm);
}

/* ================================================================
   ANIMATIONS & TRANSITIONS
   ================================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

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

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

.card, .alert, .modal-content {
  animation: fadeIn 0.3s ease-out;
}

.fade-in-up {
  animation: fadeInUp 0.4s ease-out;
}

.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--btn-radius);
}

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

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: var(--space-3);
}

.skeleton-circle {
  border-radius: 50%;
}

/* ================================================================
   QUEUE ITEMS
   ================================================================ */
.queue-item {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--slate-100);
  transition: all var(--transition-fast);
  gap: var(--space-3);
}

.queue-item:hover {
  background: var(--slate-50);
}

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

.queue-item .token-number {
  font-weight: 700;
  font-size: var(--text-base);
  min-width: 48px;
  font-family: var(--font-mono);
}

.queue-item .patient-info {
  flex: 1;
  min-width: 0;
}

.queue-item .patient-info .name {
  font-weight: 600;
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item .patient-info .meta {
  font-size: var(--text-xs);
  color: var(--slate-500);
}

/* ================================================================
   TOKEN DISPLAY
   ================================================================ */
.token-display {
  font-family: var(--font-mono);
  font-weight: 800;
  line-height: 1;
}

.display-1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.display-3 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ================================================================
   FILTER BUTTON GROUP
   ================================================================ */
.filter-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.filter-btn-group .btn {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: 6px;
}

.filter-btn-group .btn.active {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

/* ================================================================
   EMPTY STATES
   ================================================================ */
.empty-state {
  padding: var(--space-10) var(--space-4);
  text-align: center;
}

.empty-state i {
  font-size: 2.5rem;
  color: var(--slate-300);
  margin-bottom: var(--space-4);
}

.empty-state h5 {
  color: var(--slate-500);
  font-size: var(--text-lg);
  font-weight: 600;
}

.empty-state p {
  color: var(--slate-400);
  font-size: var(--text-sm);
  max-width: 320px;
  margin: 0 auto var(--space-4);
}

/* ================================================================
   VITAL SIGNS
   ================================================================ */
.vital-sign {
  text-align: center;
  padding: var(--space-2);
  background: white;
  border-radius: var(--btn-radius);
  border: 1px solid var(--slate-200);
  transition: all var(--transition-fast);
}

.vital-sign:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-sm);
}

.vital-sign .value {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--slate-800);
  font-family: var(--font-mono);
}

.vital-sign .label {
  font-size: 0.5625rem;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-top: 2px;
}

.vital-signs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

/* ================================================================
   PATIENT INFO DISPLAY
   ================================================================ */
.patient-info-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--slate-500);
  letter-spacing: 0.6px;
  margin-bottom: 2px;
}

.patient-info-value {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-800);
  margin-bottom: var(--space-2);
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  background: #fff !important;
  border-top: 1px solid var(--slate-200) !important;
  font-size: var(--text-sm);
  padding: var(--space-3) 0;
  color: var(--slate-500);
}

/* ================================================================
   LOADING STATE
   ================================================================ */
.loading {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.3);
  border-radius: inherit;
}

/* Spinner */
.spinner-border {
  width: 1.1rem;
  height: 1.1rem;
  border-width: 2px;
}

/* ================================================================
   STATUS COLORS
   ================================================================ */
.status-pending { color: var(--warning); }
.status-in_consultation { color: var(--info); }
.status-completed { color: var(--success); }
.status-cancelled { color: var(--danger); }
.status-missed { color: var(--slate-500); }

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

/* === X-Small (xs) < 576px === */
@media (max-width: 575.98px) {
  .navbar { padding: 0 var(--space-2); }
  .navbar .sidebar-toggle { display: flex; }
  .navbar-brand .brand-tagline { display: none; }

  main, .main-content {
    padding: var(--space-3) var(--space-3) var(--space-6);
  }

  .page-header { margin-bottom: var(--space-5); }
  .page-header h2 { font-size: var(--text-2xl); }

  .display-1 { font-size: 1.75rem; }
  .display-3 { font-size: 1.25rem; }

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

  .stat-card { padding: var(--space-3) var(--space-2); min-height: 120px; }
  .stat-card .stat-number { font-size: 2rem; }
  .stat-card .stat-icon { width: 40px; height: 40px; font-size: 1rem; }

  .btn-lg {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    width: 100%;
  }

  .btn { font-size: var(--text-sm); }

  form .btn-lg,
  form .d-flex.gap-2 .btn { width: 100%; }

  form .d-flex.gap-2 {
    flex-direction: column;
    gap: var(--space-2) !important;
  }

  .vital-signs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .vital-sign .value { font-size: 0.9375rem; }

  .filter-btn-group { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .filter-btn-group .btn { flex-shrink: 0; }

  .table thead th { font-size: 0.625rem; padding: var(--space-2); }
  .table tbody td { padding: var(--space-2); font-size: var(--text-sm); }

  .accordion-button { font-size: var(--text-sm); padding: var(--space-2) var(--space-3); }
  .accordion-body { padding: var(--space-2) var(--space-3); }

  .header-actions .btn {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-2);
  }

  /* Token cards */
  .token-card .display-3 { font-size: 1.125rem; }

  /* Queue */
  .queue-item { padding: var(--space-2) var(--space-3); }
  .queue-item .token-number { font-size: var(--text-sm); min-width: 40px; }

  /* Patient info grid */
  .patient-info-value { font-size: var(--text-sm); }

  /* Consultation cards */
  .consultation-card .token-number { font-size: 2rem; }
  .consultation-card .patient-name { font-size: var(--text-lg); }

  /* Hide profile info on mobile */
  .profile-info { display: none; }
}

/* === Small (sm) 576px - 767px === */
@media (min-width: 576px) and (max-width: 767.98px) {
  .navbar .sidebar-toggle { display: flex; }

  main, .main-content { padding: var(--space-4) var(--space-3) var(--space-6); }

  .page-header h2 { font-size: var(--text-2xl); }

  .stat-card .stat-number { font-size: 2.25rem; }

  .vital-signs-grid { grid-template-columns: repeat(3, 1fr); }
}

/* === Medium / Tablet (md) 768px - 991px === */
@media (min-width: 768px) and (max-width: 991.98px) {
  .navbar .sidebar-toggle { display: flex; }

  .sidebar { width: 220px; }
  .sidebar .nav-link { font-size: var(--text-sm); padding: var(--space-2) var(--space-3); }
  .sidebar .nav-link i { width: 16px; font-size: var(--text-base); }

  main, .main-content { padding: var(--space-5) var(--space-4) var(--space-6); }

  .page-header h2 { font-size: var(--text-2xl); }

  .display-3 { font-size: 1.5rem; }

  .stat-card .stat-number { font-size: 2.25rem; }

  .vital-signs-grid { grid-template-columns: repeat(3, 1fr); }

  .card-body { padding: var(--space-4); }
  .card-header { padding: var(--space-3) var(--space-4); }
}

/* === Large / Desktop (lg) >= 992px === */
@media (min-width: 992px) {
  .sidebar {
    transform: translateX(0);
    display: block !important;
  }

  .sidebar-overlay { display: none !important; }

  /* Prevent container-fluid from adding extra width */
  .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100vw !important;
    overflow-x: hidden;
  }

  main {
    margin-left: var(--sidebar-width) !important;
    width: calc(100vw - var(--sidebar-width) - var(--space-6) * 2) !important;
    max-width: calc(100vw - var(--sidebar-width) - var(--space-6) * 2) !important;
    padding: var(--space-6) var(--space-6) var(--space-8);
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .page-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .page-header .header-actions { flex-shrink: 0; }
  .page-header h2 { font-size: var(--text-3xl); }

  .display-1 { font-size: 2.5rem; }
  .display-3 { font-size: 2rem; }

  .navbar .sidebar-toggle { display: none !important; }

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

  .table thead th { padding: var(--space-3) var(--space-4); font-size: var(--text-xs); }
  .table tbody td { padding: var(--space-3) var(--space-4); }

  .btn { padding: var(--space-2) var(--space-4); font-size: var(--text-sm); }
  .btn-lg { padding: var(--space-3) var(--space-5); font-size: var(--text-base); }

  .stat-card .stat-number { font-size: 2.5rem; }
  .stat-card .stat-icon { width: 52px; height: 52px; font-size: 1.375rem; }

  .vital-signs-grid { grid-template-columns: repeat(4, 1fr); }

  form .d-flex.gap-2 { flex-direction: row; }
  form .btn-lg { width: auto; margin-bottom: 0; }
}

/* === Extra Large (xl) >= 1200px === */
@media (min-width: 1200px) {
  main { 
    padding: var(--space-6) var(--space-8) var(--space-10);
    width: calc(100vw - var(--sidebar-width) - var(--space-8) * 2) !important;
    max-width: calc(100vw - var(--sidebar-width) - var(--space-8) * 2) !important;
  }

  .vital-signs-grid { grid-template-columns: repeat(4, 1fr); }
}

/* === 2XL (xxl) >= 1400px === */
@media (min-width: 1400px) {
  .vital-signs-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ================================================================
   RESPONSIVE UTILITY CLASSES
   ================================================================ */
.d-none-mobile { display: none; }
@media (min-width: 768px) { .d-none-mobile { display: initial; } }

.d-block-mobile { display: block; }
@media (min-width: 768px) { .d-block-mobile { display: none; } }

.text-truncate-mobile {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 768px) { .text-truncate-mobile { max-width: none; } }

/* ================================================================
   MISC UTILITIES
   ================================================================ */
img, svg, video, canvas { max-width: 100%; height: auto; }

.row { --bs-gutter-x: var(--space-5); }
@media (max-width: 575.98px) {
  .row { --bs-gutter-x: var(--space-3); }
}

hr { border-color: var(--slate-200); opacity: 0.6; }

/* Section title within cards */
.form-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--primary-100);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ================================================================
   GRID LAYOUT - Stat cards responsive
   ================================================================ */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden;
  box-sizing: border-box;
}

.stat-cards-grid > .stat-card {
  min-width: 0;
  max-width: 100% !important;
  overflow: hidden;
  box-sizing: border-box;
}

@media (max-width: 1199.98px) {
  .stat-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .stat-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
}

/* ================================================================
   PRINT STYLES
   ================================================================ */
@media print {
  .navbar, .sidebar, .sidebar-overlay, footer, .btn,
  .no-print, .header-actions, .page-header .btn {
    display: none !important;
  }

  main { margin-left: 0 !important; padding: 0 !important; }

  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }

  .card-header { background: var(--slate-800) !important; color: #fff !important; }

  body { font-size: 11pt; color: #000; }

  .container-fluid { max-width: 100% !important; padding: 0 !important; }

  a[href]::after { content: none !important; }
}

/* ================================================================
   QUEUE STATUS PAGE SPECIFIC
   ================================================================ */
.queue-status-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .queue-status-container { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 992px) {
  .queue-status-container { grid-template-columns: 1fr 1fr 1fr; }
}

/* ================================================================
   DOCTOR DASHBOARD SPECIFIC
   ================================================================ */
.current-patient-card {
  position: relative;
}

.current-patient-card .call-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all var(--transition-base);
}

.current-patient-card:hover .call-btn {
  opacity: 1;
}

/* ================================================================
   DATE PICKER INPUT
   ================================================================ */
input[type="date"]::-webkit-calendar-picker-indicator {
  padding: 2px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* ================================================================
   QUEUE TABLE ROW HIGHLIGHTS
   ================================================================ */
tr.queue-patient {
  transition: all var(--transition-fast);
}

tr.queue-patient td {
  padding: var(--space-4) var(--space-4);
  vertical-align: middle;
}

tr.queue-patient:hover {
  background: var(--primary-50) !important;
}

tr.queue-patient.table-success {
  background: rgba(16, 185, 129, 0.12) !important;
  border-left: 3px solid var(--success);
}

tr.queue-patient.table-success:hover {
  background: rgba(16, 185, 129, 0.18) !important;
}

tr.queue-patient td:first-child {
  position: relative;
}

/* ================================================================
   DOCTOR QUEUE TABLE - Compact responsive design
   ================================================================ */
.queue-table-wrapper {
  overflow-x: hidden !important;
  max-width: 100%;
}

#doctorQueueTable {
  width: 100% !important;
  table-layout: fixed;
}

#doctorQueueTable th,
#doctorQueueTable td {
  padding: var(--space-3) var(--space-2) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Column widths */
#doctorQueueTable th:nth-child(1),
#doctorQueueTable td:nth-child(1) { width: 70px; }  /* Token */
#doctorQueueTable th:nth-child(2),
#doctorQueueTable td:nth-child(2) { width: 130px; } /* Patient Name */
#doctorQueueTable th:nth-child(3),
#doctorQueueTable td:nth-child(3) { width: 60px; }  /* Age/Sex */
#doctorQueueTable th:nth-child(4),
#doctorQueueTable td:nth-child(4) { width: 90px; }  /* Department */
#doctorQueueTable th:nth-child(5),
#doctorQueueTable td:nth-child(5) { width: 65px; }  /* Time */
#doctorQueueTable th:nth-child(6),
#doctorQueueTable td:nth-child(6) { width: auto; }  /* Reason */
#doctorQueueTable th:nth-child(7),
#doctorQueueTable td:nth-child(7) { width: 80px; text-align: right; } /* Action */

/* Truncate patient name */
.queue-patient-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  max-width: 100%;
}

.queue-patient-id {
  font-size: var(--text-xs);
  color: var(--slate-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

/* Reason column truncation */
.queue-reason {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  cursor: default;
  display: block;
  max-width: 100%;
}

/* Compact action buttons */
.queue-actions .btn {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  min-width: 32px;
}

.queue-actions .btn i {
  font-size: 0.75rem;
}

/* Token badge compact */
.queue-token-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: var(--space-1) var(--space-2);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-xs);
}

/* Action button spacing */
.queue-actions .btn {
  padding: var(--space-2) var(--space-4);
  margin-left: var(--space-1);
}

/* Token badge in queue table */
.queue-token-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: var(--space-1) var(--space-3);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-sm);
}

/* ================================================================
   SLIP / PRINT CARD
   ================================================================ */
.slip-container {
  max-width: 500px;
  margin: 0 auto;
}

.slip-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-700));
  color: white;
  padding: 1.5rem;
  text-align: center;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
}

.slip-token {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: 4px;
}

@media (max-width: 575.98px) {
  .slip-token { font-size: 1.75rem; }
}

/* ================================================================
   PATIENT AVATAR
   ================================================================ */
.patient-avatar {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--primary-100);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.patient-avatar.waiting {
  background: var(--warning-100);
  color: var(--warning);
}

.patient-avatar.success {
  background: var(--success-100);
  color: var(--success);
}

/* ================================================================
   MICRO-INTERACTIONS
   ================================================================ */
.btn:active {
  transform: translateY(0) scale(0.98);
}

.card {
  will-change: box-shadow;
}

.sidebar .nav-link {
  will-change: background-color, color;
}

/* Stagger animation for stat cards */
.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 50ms; }
.stat-card:nth-child(3) { animation-delay: 100ms; }
.stat-card:nth-child(4) { animation-delay: 150ms; }

.stat-card {
  animation: fadeInUp 0.4s ease-out both;
}

/* Focus visible styles for accessibility */
.btn:focus-visible,
.nav-link:focus-visible,
.form-control:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
