/* ============================================================
   Clinic Management System — Premium Healthcare Design System
   ============================================================ */

/* --- CSS Custom Properties (Light Mode) --------------------- */
:root {
  /* Brand */
  --color-primary: #16a34a;
  --color-primary-dark: #15803d;
  --color-primary-light: #f0fdf4;
  --color-primary-hover: #138a3f;
  --color-primary-rgb: 22, 163, 74;
  --color-accent: #0d9488;

  /* Neutrals */
  --color-bg: #f0f2f5;
  --color-white: #ffffff;
  --color-border: #e5e7eb;
  --color-text: #1a1d27;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);

  /* Status colours */
  --status-scheduled: #3b82f6;
  --status-confirmed: #16a34a;
  --status-checked-in: #8b5cf6;
  --status-in-progress: #1e40af;
  --status-completed: #06b6d4;
  --status-pending: #f59e0b;
  --status-cancelled: #ef4444;
  --status-no-show: #6b7280;

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 60px;
  --right-panel-width: 340px;

  /* Misc */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1), 0 16px 40px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.12), 0 24px 64px rgba(0, 0, 0, 0.08);
  --transition: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-stack: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* Sidebar */
  --sidebar-bg: #ffffff;
  --sidebar-hover-bg: #f0fdf4;
  --sidebar-active-bg: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

/* --- Dark Mode via data-theme attribute -------------------- */
[data-theme="dark"] {
  --color-primary: #16a34a;
  --color-primary-dark: #22c55e;
  --color-primary-light: rgba(22, 163, 74, 0.12);
  --color-primary-hover: #4ade80;
  --color-primary-rgb: 22, 163, 74;
  --color-accent: #14b8a6;

  --color-bg: #0f1117;
  --color-white: #1a1d27;
  --color-border: #2a2d3a;
  --color-text: #e4e4e7;
  --color-text-secondary: #a1a1aa;
  --color-text-muted: #71717a;

  --glass-bg: rgba(26, 29, 39, 0.8);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.25), 0 16px 40px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.3), 0 24px 64px rgba(0, 0, 0, 0.25);

  --sidebar-bg: #141721;
  --sidebar-hover-bg: rgba(22, 163, 74, 0.08);
  --sidebar-active-bg: linear-gradient(135deg, rgba(22, 163, 74, 0.12) 0%, rgba(13, 148, 136, 0.08) 100%);

  --status-scheduled: #60a5fa;
  --status-checked-in: #a78bfa;
  --status-in-progress: #60a5fa;
  --status-completed: #22d3ee;
  --status-pending: #fbbf24;
  --status-cancelled: #f87171;
  --status-no-show: #9ca3af;
}

[data-theme="dark"] body {
  background: var(--color-bg);
  color: var(--color-text);
}

[data-theme="dark"] .sidebar {
  background: var(--sidebar-bg);
  border-right-color: var(--color-border);
}

[data-theme="dark"] .top-header {
  background: var(--sidebar-bg);
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
  background: #0f1117;
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .modal {
  background: var(--color-white);
}

[data-theme="dark"] .calendar {
  background: var(--color-white);
}

[data-theme="dark"] .dropdown-menu {
  background: var(--color-white);
  border-color: var(--color-border);
}

[data-theme="dark"] .stat-card .stat-icon.green  { background: rgba(22, 163, 74, 0.15); }
[data-theme="dark"] .stat-card .stat-icon.blue   { background: rgba(59, 130, 246, 0.15); }
[data-theme="dark"] .stat-card .stat-icon.purple  { background: rgba(139, 92, 246, 0.15); }
[data-theme="dark"] .stat-card .stat-icon.amber   { background: rgba(245, 158, 11, 0.15); }
[data-theme="dark"] .stat-card .stat-icon.red     { background: rgba(239, 68, 68, 0.15); }
[data-theme="dark"] .stat-card .stat-icon.cyan    { background: rgba(6, 182, 212, 0.15); }

[data-theme="dark"] .status-badge.scheduled   { background: rgba(59, 130, 246, 0.15); }
[data-theme="dark"] .status-badge.confirmed   { background: rgba(22, 163, 74, 0.15); }
[data-theme="dark"] .status-badge.checked_in,
[data-theme="dark"] .status-badge.checked-in  { background: rgba(139, 92, 246, 0.15); }
[data-theme="dark"] .status-badge.in_progress,
[data-theme="dark"] .status-badge.in-progress { background: rgba(30, 64, 175, 0.15); }
[data-theme="dark"] .status-badge.completed   { background: rgba(6, 182, 212, 0.15); }
[data-theme="dark"] .status-badge.pending     { background: rgba(245, 158, 11, 0.15); }
[data-theme="dark"] .status-badge.cancelled   { background: rgba(239, 68, 68, 0.15); }
[data-theme="dark"] .status-badge.no_show,
[data-theme="dark"] .status-badge.no-show     { background: rgba(107, 114, 128, 0.15); }

[data-theme="dark"] .appt-badge.scheduled   { background: rgba(59, 130, 246, 0.15); }
[data-theme="dark"] .appt-badge.confirmed   { background: rgba(22, 163, 74, 0.15); }
[data-theme="dark"] .appt-badge.checked-in  { background: rgba(139, 92, 246, 0.15); }
[data-theme="dark"] .appt-badge.in-progress { background: rgba(30, 64, 175, 0.15); }
[data-theme="dark"] .appt-badge.completed   { background: rgba(6, 182, 212, 0.15); }
[data-theme="dark"] .appt-badge.pending     { background: rgba(245, 158, 11, 0.15); }
[data-theme="dark"] .appt-badge.cancelled   { background: rgba(239, 68, 68, 0.15); }

[data-theme="dark"] .alert-success { background: rgba(22, 101, 52, 0.2); color: #86efac; border-color: rgba(22, 163, 74, 0.3); }
[data-theme="dark"] .alert-info    { background: rgba(30, 64, 175, 0.2); color: #93c5fd; border-color: rgba(59, 130, 246, 0.3); }
[data-theme="dark"] .alert-warning { background: rgba(146, 64, 14, 0.2); color: #fcd34d; border-color: rgba(245, 158, 11, 0.3); }
[data-theme="dark"] .alert-error   { background: rgba(153, 27, 27, 0.2); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }

[data-theme="dark"] .toast {
  background: var(--color-white);
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .hero-banner {
  background: linear-gradient(135deg, #166534 0%, #14532d 100%);
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #2a2d3a 25%, #353845 50%, #2a2d3a 75%);
  background-size: 200% 100%;
}

[data-theme="dark"] .file-upload-area {
  border-color: var(--color-border);
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .queue-tv-mode {
  background: #050810;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(22, 163, 74, 0.4);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(22, 163, 74, 0.6);
}

/* --- Reset / Base ------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-stack);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-smooth), color var(--transition-smooth);
}

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

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* --- Custom Scrollbar --------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(22, 163, 74, 0.3);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(22, 163, 74, 0.5);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 163, 74, 0.3) transparent;
}

/* --- Keyframe Animations ------------------------------------ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

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

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

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.2); opacity: 0.8; }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px rgba(22, 163, 74, 0.2); }
  50%      { box-shadow: 0 0 20px rgba(22, 163, 74, 0.4); }
}

@keyframes borderGlow {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.8; }
}

/* --- Utility helpers ---------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--color-text-secondary); }
.font-bold   { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mr-1 { margin-right: 0.5rem; }
.ml-1 { margin-left: 0.5rem; }

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }

.fade-in   { animation: fadeIn 0.4s ease both; }
.slide-up  { animation: slideUp 0.4s ease both; }
.scale-in  { animation: scaleIn 0.3s ease both; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  transition: transform var(--transition-smooth), background var(--transition-smooth), border-color var(--transition-smooth);
  backdrop-filter: blur(12px);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.15rem;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}
/* Gradient underline on logo */
.sidebar-logo::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0.5;
}
.sidebar-logo img,
.sidebar-logo .logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.2);
}
.sidebar-logo .logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sidebar navigation */
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 0.5rem;
}
.sidebar-section-title {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  padding: 0.85rem 1.15rem 0.4rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 42px;
  padding: 0 1.15rem;
  margin: 2px 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-smooth);
  position: relative;
  animation: slideInLeft 0.3s ease both;
}
.sidebar-item:nth-child(1) { animation-delay: 0.02s; }
.sidebar-item:nth-child(2) { animation-delay: 0.04s; }
.sidebar-item:nth-child(3) { animation-delay: 0.06s; }
.sidebar-item:nth-child(4) { animation-delay: 0.08s; }
.sidebar-item:nth-child(5) { animation-delay: 0.1s; }
.sidebar-item:nth-child(6) { animation-delay: 0.12s; }

.sidebar-item i,
.sidebar-item .fa {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  transition: all var(--transition-smooth);
}
.sidebar-item:hover {
  background: var(--sidebar-hover-bg);
  color: var(--color-primary);
}
.sidebar-item:hover i {
  color: var(--color-primary);
  transform: translateX(4px);
}

/* Active state with gradient left border */
.sidebar-item.active {
  background: var(--sidebar-active-bg);
  color: var(--color-primary);
  font-weight: 600;
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, var(--color-primary), var(--color-accent)) 1;
  border-image-slice: 0 0 0 3;
}
.sidebar-item.active i {
  color: var(--color-primary);
}

.sidebar-item .badge {
  margin-left: auto;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 0.6rem;
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Sidebar footer / user */
.sidebar-footer {
  border-top: 1px solid var(--color-border);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-footer .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary-light);
}
.sidebar-footer .user-name {
  font-size: 0.85rem;
  font-weight: 700;
}
.sidebar-footer .user-role {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-smooth);
}

/* ============================================================
   TOP HEADER / TOOLBAR
   ============================================================ */
.top-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--topbar-height);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  transition: background var(--transition-smooth), border-color var(--transition-smooth);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--color-text);
  padding: 0.25rem;
  transition: color var(--transition);
}
.hamburger:hover {
  color: var(--color-primary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}
.breadcrumb a {
  color: var(--color-text-secondary);
  transition: color var(--transition);
}
.breadcrumb a:hover {
  color: var(--color-primary);
}
.breadcrumb .separator {
  color: var(--color-text-muted);
  font-size: 0.7rem;
}
.breadcrumb .current {
  color: var(--color-text);
  font-weight: 600;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-search {
  position: relative;
}
.header-search input {
  width: 240px;
  padding: 0.45rem 0.85rem 0.45rem 2.25rem;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-size: 0.85rem;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  transition: border-color var(--transition), box-shadow var(--transition), width var(--transition-smooth);
}
.header-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
  width: 300px;
}
.header-search input::placeholder {
  color: var(--color-text-muted);
}
.header-search i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 1rem;
  transition: all var(--transition-smooth);
  position: relative;
}
.icon-btn:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  transform: scale(1.05);
}
.icon-btn .notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--status-cancelled);
  border-radius: 50%;
  border: 2px solid var(--color-white);
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================================
   NOTIFICATION BELL & DROPDOWN
   ============================================================ */
.notification-bell {
  position: relative;
}
.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: var(--status-cancelled);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--color-white);
  animation: pulse 2s ease-in-out infinite;
}
.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition-smooth);
}
.notification-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.notification-dropdown .notif-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.9rem;
}
.notification-dropdown .notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
  cursor: pointer;
}
.notification-dropdown .notif-item:hover {
  background: var(--color-primary-light);
}
.notification-dropdown .notif-item:last-child {
  border-bottom: none;
}
.notification-dropdown .notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.notification-dropdown .notif-text {
  font-size: 0.82rem;
  line-height: 1.4;
}
.notification-dropdown .notif-time {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ============================================================
   PAGE CONTAINER
   ============================================================ */
.page-body {
  padding: 1.5rem;
  flex: 1;
}

/* Animate page children on load */
.page-body > * {
  animation: fadeIn 0.4s ease both;
}
.page-body > *:nth-child(1) { animation-delay: 0.05s; }
.page-body > *:nth-child(2) { animation-delay: 0.1s; }
.page-body > *:nth-child(3) { animation-delay: 0.15s; }
.page-body > *:nth-child(4) { animation-delay: 0.2s; }
.page-body > *:nth-child(5) { animation-delay: 0.25s; }

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}
.page-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

/* ============================================================
   CARDS (Glassmorphism)
   ============================================================ */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  transition: all var(--transition-smooth);
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, transparent 0%, rgba(22, 163, 74, 0) 40%, rgba(22, 163, 74, 0.2) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-smooth);
  pointer-events: none;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: rgba(22, 163, 74, 0.2);
}
.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Stat / metric cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(22, 163, 74, 0.03) 0%, transparent 70%);
  pointer-events: none;
}
.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: rgba(22, 163, 74, 0.25);
}
.stat-card .stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  position: relative;
}
.stat-card .stat-icon.green  { background: linear-gradient(135deg, #ecfdf5, #d1fae5); color: var(--color-primary); }
.stat-card .stat-icon.blue   { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #3b82f6; }
.stat-card .stat-icon.purple { background: linear-gradient(135deg, #f5f3ff, #ede9fe); color: #8b5cf6; }
.stat-card .stat-icon.amber  { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #f59e0b; }
.stat-card .stat-icon.red    { background: linear-gradient(135deg, #fef2f2, #fee2e2); color: #ef4444; }
.stat-card .stat-icon.cyan   { background: linear-gradient(135deg, #ecfeff, #cffafe); color: #06b6d4; }

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 0.2rem;
}
.stat-card .stat-change {
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.4rem;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.stat-change.up   { color: var(--color-primary); background: rgba(22, 163, 74, 0.1); }
.stat-change.down { color: var(--status-cancelled); background: rgba(239, 68, 68, 0.1); }

/* ============================================================
   GREEN HERO BANNER
   ============================================================ */
.hero-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 50%, #0d9488 100%);
  border-radius: var(--radius);
  color: var(--color-white);
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
}
.hero-banner::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 40%;
  height: 120%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  pointer-events: none;
}
.hero-banner h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}
.hero-banner p {
  opacity: 0.9;
  font-size: 0.95rem;
}
.hero-banner .hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-smooth);
  white-space: nowrap;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}
.btn:active {
  transform: scale(0.97);
}
.btn i { font-size: 0.85rem; }

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary-light);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15);
}

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

.btn-danger {
  background: var(--status-cancelled);
  color: var(--color-white);
  border-color: var(--status-cancelled);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.btn-ghost:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn-white {
  background: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-white);
}
.btn-white:hover {
  background: var(--color-primary-light);
}

.btn-sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
}
.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
}

.btn-group {
  display: inline-flex;
}
.btn-group .btn {
  border-radius: 0;
}
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 1.15rem;
}
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}
.form-label .required {
  color: var(--status-cancelled);
  margin-left: 2px;
}
.form-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.95rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition-smooth);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}
.form-input::placeholder {
  color: var(--color-text-muted);
}
.form-input.error,
.form-select.error {
  border-color: var(--status-cancelled);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
.form-error {
  font-size: 0.75rem;
  color: var(--status-cancelled);
  margin-top: 0.3rem;
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-row.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

.checkbox-label,
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: color var(--transition);
}
.checkbox-label input,
.radio-label input {
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
}

.input-group {
  display: flex;
}
.input-group .form-input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-group .btn {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ============================================================
   TABLES (Modern)
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table thead th {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.06) 0%, rgba(13, 148, 136, 0.04) 100%);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  padding: 0.85rem 1rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 2;
}
.table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  transition: background var(--transition);
}
.table tbody tr {
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.table tbody tr:nth-child(even) {
  background: rgba(22, 163, 74, 0.02);
}
.table tbody tr:hover {
  background: var(--color-primary-light);
  border-left-color: var(--color-primary);
}
.table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge.scheduled   { background: #eff6ff; color: var(--status-scheduled); }
.status-badge.scheduled::before   { background: var(--status-scheduled); }
.status-badge.confirmed   { background: #ecfdf5; color: var(--status-confirmed); }
.status-badge.confirmed::before   { background: var(--status-confirmed); }
.status-badge.checked_in,
.status-badge.checked-in  { background: #f5f3ff; color: var(--status-checked-in); }
.status-badge.checked_in::before,
.status-badge.checked-in::before  { background: var(--status-checked-in); }
.status-badge.in_progress,
.status-badge.in-progress { background: #eff6ff; color: var(--status-in-progress); }
.status-badge.in_progress::before,
.status-badge.in-progress::before { background: var(--status-in-progress); }
.status-badge.completed   { background: #ecfeff; color: var(--status-completed); }
.status-badge.completed::before   { background: var(--status-completed); }
.status-badge.pending     { background: #fffbeb; color: var(--status-pending); }
.status-badge.pending::before     { background: var(--status-pending); }
.status-badge.cancelled   { background: #fef2f2; color: var(--status-cancelled); }
.status-badge.cancelled::before   { background: var(--status-cancelled); }
.status-badge.no_show,
.status-badge.no-show     { background: #f3f4f6; color: var(--status-no-show); }
.status-badge.no_show::before,
.status-badge.no-show::before     { background: var(--status-no-show); }

/* ============================================================
   MODAL / DIALOG
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-white);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.98);
  transition: transform var(--transition-smooth);
}
.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}
.modal-close {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover {
  background: var(--color-bg);
  color: var(--status-cancelled);
}

.modal-body {
  padding: 1.5rem;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* Small confirmation modal */
.modal.modal-sm {
  max-width: 400px;
}

/* ============================================================
   CALENDAR
   ============================================================ */
.calendar-container {
  display: flex;
  gap: 1.5rem;
}

.calendar {
  flex: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.calendar-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}
.calendar-nav {
  display: flex;
  gap: 0.5rem;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.5rem;
}
.calendar-weekday {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.calendar-cell {
  min-height: 80px;
  padding: 0.4rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  border: 2px solid transparent;
}
.calendar-cell:hover {
  background: var(--color-primary-light);
}
.calendar-cell.today {
  background: var(--color-primary-light);
}
.calendar-cell.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.calendar-cell.other-month {
  opacity: 0.4;
}
.calendar-cell .date-number {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}
.calendar-cell.today .date-number {
  background: var(--color-primary);
  color: var(--color-white);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Appointment dot badges inside calendar cells */
.calendar-cell .appointment-dots {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
.appt-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appt-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.appt-badge.scheduled   { background: #eff6ff; color: var(--status-scheduled); }
.appt-badge.scheduled .dot   { background: var(--status-scheduled); }
.appt-badge.confirmed   { background: #ecfdf5; color: var(--status-confirmed); }
.appt-badge.confirmed .dot   { background: var(--status-confirmed); }
.appt-badge.checked-in  { background: #f5f3ff; color: var(--status-checked-in); }
.appt-badge.checked-in .dot  { background: var(--status-checked-in); }
.appt-badge.in-progress { background: #eff6ff; color: var(--status-in-progress); }
.appt-badge.in-progress .dot { background: var(--status-in-progress); }
.appt-badge.completed   { background: #ecfeff; color: var(--status-completed); }
.appt-badge.completed .dot   { background: var(--status-completed); }
.appt-badge.pending     { background: #fffbeb; color: var(--status-pending); }
.appt-badge.pending .dot     { background: var(--status-pending); }
.appt-badge.cancelled   { background: #fef2f2; color: var(--status-cancelled); }
.appt-badge.cancelled .dot   { background: var(--status-cancelled); }

/* ============================================================
   TODAY'S APPOINTMENTS PANEL (right sidebar)
   ============================================================ */
.right-panel {
  width: var(--right-panel-width);
  flex-shrink: 0;
}
.right-panel .panel-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.right-panel .panel-card .panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.appointment-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.appointment-list::-webkit-scrollbar {
  width: 4px;
}
.appointment-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 9999px;
}

.appointment-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.appointment-item:hover {
  background: var(--color-primary-light);
  border-left-color: var(--color-primary);
}
.appointment-item.status-scheduled   { border-left-color: var(--status-scheduled); }
.appointment-item.status-confirmed   { border-left-color: var(--status-confirmed); }
.appointment-item.status-checked-in  { border-left-color: var(--status-checked-in); }
.appointment-item.status-in-progress { border-left-color: var(--status-in-progress); }
.appointment-item.status-completed   { border-left-color: var(--status-completed); }
.appointment-item.status-pending     { border-left-color: var(--status-pending); }
.appointment-item.status-cancelled   { border-left-color: var(--status-cancelled); }

.appointment-item .appt-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  min-width: 52px;
}
.appointment-item .appt-info {
  flex: 1;
  min-width: 0;
}
.appointment-item .appt-patient {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appointment-item .appt-type {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* ============================================================
   QUEUE DISPLAY
   ============================================================ */
.queue-display {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.25rem;
  transition: all var(--transition);
}
.queue-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.queue-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  min-width: 60px;
  text-align: center;
}
.queue-info {
  flex: 1;
}
.queue-patient-name {
  font-weight: 700;
  font-size: 1rem;
}
.queue-detail {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* Full-screen TV mode for queue */
.queue-tv-mode {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #050810;
  color: var(--color-white);
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  overflow: hidden;
}
.queue-tv-mode .queue-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  backdrop-filter: blur(20px);
}
.queue-tv-mode .queue-number {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.queue-tv-mode .queue-patient-name {
  font-size: 1.25rem;
}
.queue-tv-mode .queue-detail {
  color: rgba(255, 255, 255, 0.6);
}

/* ============================================================
   PATIENT PROFILE / DETAIL
   ============================================================ */
.patient-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.patient-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-primary-light);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.15);
}
.patient-info h2 {
  font-size: 1.35rem;
  font-weight: 700;
}
.patient-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}
.patient-meta span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.detail-item .detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}
.detail-item .detail-value {
  font-size: 0.95rem;
  font-weight: 500;
}

/* ============================================================
   MEDICAL RECORDS / TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent), var(--color-border));
}
.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.55rem;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-white);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}
.timeline-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.timeline-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.timeline-body {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.25rem;
  gap: 0;
}
.tab-item {
  padding: 0.7rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-smooth);
  position: relative;
}
.tab-item:hover {
  color: var(--color-primary);
}
.tab-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ============================================================
   ALERTS / TOASTS
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
}
.alert i { margin-top: 2px; }
.alert-success { background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--color-white);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  min-width: 280px;
  animation: slideInRight 0.3s ease;
  backdrop-filter: blur(12px);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
}
.pagination .page-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-smooth);
}
.pagination .page-btn:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}
.pagination .page-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
}
.empty-state i {
  font-size: 3rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  opacity: 0.5;
}
.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.empty-state p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  max-width: 360px;
}

/* ============================================================
   LOADING / SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
.skeleton-line {
  height: 14px;
  margin-bottom: 0.65rem;
}
.skeleton-line:last-child { width: 60%; }
.skeleton-circle {
  border-radius: 50%;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ============================================================
   DROPDOWN MENU
   ============================================================ */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--color-white);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem 0;
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--transition-smooth), transform var(--transition-smooth), visibility var(--transition-smooth);
  backdrop-filter: blur(12px);
}
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
}
.dropdown-item:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.dropdown-item.danger { color: var(--status-cancelled); }
.dropdown-item.danger:hover { background: rgba(239, 68, 68, 0.08); }
.dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.35rem 0;
}

/* ============================================================
   AVATAR GROUP
   ============================================================ */
.avatar-group {
  display: flex;
}
.avatar-group .avatar-small {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--color-white);
  margin-left: -8px;
  object-fit: cover;
}
.avatar-group .avatar-small:first-child { margin-left: 0; }

/* ============================================================
   TOOLTIP
   ============================================================ */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: #1f2937;
  color: var(--color-white);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
[data-tooltip]:hover::after {
  opacity: 1;
}

/* ============================================================
   SETTINGS / CLINIC SETUP
   ============================================================ */
.settings-layout {
  display: flex;
  gap: 1.5rem;
}
.settings-sidebar {
  width: 200px;
  flex-shrink: 0;
}
.settings-sidebar .settings-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-smooth);
}
.settings-sidebar .settings-nav-item:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.settings-sidebar .settings-nav-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
  border-left: 2px solid var(--color-primary);
}
.settings-body {
  flex: 1;
}

/* ============================================================
   INVOICING / BILLING
   ============================================================ */
.invoice-box {
  background: var(--color-white);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  max-width: 800px;
}
.invoice-header-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.invoice-line-items {
  margin: 1.5rem 0;
}
.invoice-line-items .line-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.invoice-totals {
  text-align: right;
  font-size: 0.9rem;
}
.invoice-totals .total-row {
  display: flex;
  justify-content: flex-end;
  gap: 2rem;
  padding: 0.3rem 0;
}
.invoice-totals .grand-total {
  font-size: 1.15rem;
  font-weight: 800;
  border-top: 2px solid var(--color-text);
  padding-top: 0.5rem;
  margin-top: 0.35rem;
}

/* ============================================================
   SCHEDULE / TIME SLOTS
   ============================================================ */
.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}
.time-slot {
  padding: 0.5rem;
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-smooth);
}
.time-slot:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  transform: translateY(-1px);
}
.time-slot.selected {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}
.time-slot.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================================
   CHART CONTAINERS / DASHBOARD WIDGETS
   ============================================================ */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 300px;
}

.chart-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  min-height: 300px;
  transition: all var(--transition-smooth);
}
.chart-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.chart-header .chart-title {
  font-size: 1rem;
  font-weight: 700;
}
.chart-header .period-selector {
  display: flex;
  gap: 0.25rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.chart-header .period-selector button {
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
}
.chart-header .period-selector button.active {
  background: var(--color-white);
  color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

/* ============================================================
   COMMAND PALETTE
   ============================================================ */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
}
.cmd-overlay.active {
  opacity: 1;
  visibility: visible;
}
.cmd-palette {
  background: var(--color-white);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(-20px) scale(0.98);
  transition: transform var(--transition-smooth);
}
.cmd-overlay.active .cmd-palette {
  transform: translateY(0) scale(1);
}
.cmd-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.cmd-search i {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}
.cmd-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: transparent;
}
.cmd-search input::placeholder {
  color: var(--color-text-muted);
}
.cmd-search .cmd-shortcut {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}
.cmd-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.35rem;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.875rem;
}
.cmd-item:hover,
.cmd-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.cmd-item i {
  width: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
}
.cmd-item:hover i,
.cmd-item.active i {
  color: var(--color-primary);
}
.cmd-item .cmd-label {
  flex: 1;
}
.cmd-item .cmd-hint {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}
.cmd-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.7rem;
  color: var(--color-text-muted);
}
.cmd-footer kbd {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
}

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.activity-feed {
  position: relative;
  padding-left: 1.5rem;
}
.activity-feed::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-border));
}
.activity-item {
  position: relative;
  padding: 0.65rem 0 0.65rem 1rem;
  border-left: 3px solid transparent;
  margin-bottom: 0.25rem;
  transition: all var(--transition);
}
.activity-item::before {
  content: "";
  position: absolute;
  left: -1.4rem;
  top: 1rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-white);
}
.activity-item:hover {
  background: var(--color-primary-light);
  border-left-color: var(--color-primary);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.activity-item .activity-text {
  font-size: 0.85rem;
  line-height: 1.4;
}
.activity-item .activity-timestamp {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}
.activity-item.type-appointment { border-left-color: var(--status-scheduled); }
.activity-item.type-appointment::before { background: var(--status-scheduled); }
.activity-item.type-checkin      { border-left-color: var(--status-checked-in); }
.activity-item.type-checkin::before      { background: var(--status-checked-in); }
.activity-item.type-completed    { border-left-color: var(--status-completed); }
.activity-item.type-completed::before    { background: var(--status-completed); }
.activity-item.type-cancelled    { border-left-color: var(--status-cancelled); }
.activity-item.type-cancelled::before    { background: var(--status-cancelled); }

/* ============================================================
   QUICK ACTIONS GRID
   ============================================================ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1.25rem 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all var(--transition-smooth);
  text-align: center;
}
.quick-action-card .qa-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--color-primary-light), rgba(22, 163, 74, 0.15));
  color: var(--color-primary);
  transition: all var(--transition-smooth);
}
.quick-action-card .qa-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
}
.quick-action-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.25);
}
.quick-action-card:hover .qa-icon {
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.25);
}

/* ============================================================
   TAGS / CHIPS
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem;
  background: rgba(22, 163, 74, 0.1);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}
.tag .tag-remove {
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity var(--transition);
}
.tag .tag-remove:hover {
  opacity: 1;
}
/* Tag color variants */
.tag-blue   { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.tag-purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.tag-amber  { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.tag-red    { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.tag-cyan   { background: rgba(6, 182, 212, 0.1); color: #06b6d4; }
.tag-pink   { background: rgba(236, 72, 153, 0.1); color: #ec4899; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  height: 8px;
  background: var(--color-border);
  border-radius: 9999px;
  overflow: hidden;
}
.progress-bar .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* ============================================================
   DRAG & DROP / FILE UPLOAD
   ============================================================ */
.file-upload-area {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-smooth);
}
.file-upload-area:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  transform: translateY(-1px);
}
.file-upload-area i {
  font-size: 2rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

/* ============================================================
   WAITING ROOM / QUEUE STATUS BOARD
   ============================================================ */
.queue-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.queue-board .queue-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  text-align: center;
  transition: all var(--transition-smooth);
}
.queue-board .queue-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.queue-board .queue-card .queue-current {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.queue-board .queue-card .queue-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}
.queue-board .queue-card .queue-waiting {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ============================================================
   SIDEBAR MOBILE OVERLAY TOGGLE
   ============================================================ */
.sidebar-toggle-label {
  display: none;
}
#sidebar-toggle {
  display: none;
}

/* ============================================================
   PRINT STYLES — Receipts / Invoices
   ============================================================ */
@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  .sidebar,
  .top-header,
  .hamburger,
  .btn,
  .no-print,
  .toast-container,
  .cmd-overlay {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .page-body {
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
    backdrop-filter: none;
  }

  .invoice-box {
    box-shadow: none;
    padding: 0;
    max-width: 100%;
  }

  .hero-banner {
    background: none !important;
    color: black;
    border: 2px solid #333;
    padding: 1rem;
  }
  .hero-banner::before,
  .hero-banner::after {
    display: none;
  }

  .table thead th {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  a { color: black; }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
  }
  .print-header .clinic-name {
    font-size: 1.25rem;
    font-weight: 800;
  }
  .print-header .clinic-address {
    font-size: 0.8rem;
    color: #555;
  }
  .print-footer {
    margin-top: 2rem;
    padding-top: 0.75rem;
    border-top: 1px solid #ccc;
    font-size: 0.75rem;
    color: #777;
    text-align: center;
  }

  .notification-dropdown,
  .cmd-overlay {
    display: none !important;
  }
}

/* ============================================================
   PRINT RECEIPT SPECIFIC
   ============================================================ */
.receipt {
  max-width: 380px;
  margin: 0 auto;
  font-size: 0.85rem;
}
.receipt .receipt-header {
  text-align: center;
  border-bottom: 1px dashed #999;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}
.receipt .receipt-header h3 {
  font-size: 1rem;
  font-weight: 800;
}
.receipt .receipt-line {
  display: flex;
  justify-content: space-between;
  padding: 0.2rem 0;
}
.receipt .receipt-total {
  border-top: 1px dashed #999;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
}
.receipt .receipt-footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: #777;
}


/* ============================================================
   MISSING UTILITY CLASSES — Audit Fix
   ============================================================ */

/* Header user section */
.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary, #10b981), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    position: relative;
}
.online-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #fff;
    position: absolute;
    bottom: -1px;
    right: -1px;
}
.logo-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text, #1f2937);
    line-height: 1.2;
}
.logo-version {
    font-size: 10px;
    color: var(--color-text-muted, #9ca3af);
    font-weight: 500;
}
.header-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--color-border, #e5e7eb);
    background: var(--color-white, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-muted, #6b7280);
    transition: all 0.2s;
    font-size: 15px;
    position: relative;
}
.header-icon-btn:hover {
    background: var(--color-bg, #f9fafb);
    color: var(--color-primary, #10b981);
    border-color: var(--color-primary, #10b981);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}
.status-dot-green { background: #22c55e; }
.status-dot-yellow { background: #f59e0b; }
.status-dot-red { background: #ef4444; }
.status-dot-blue { background: #3b82f6; }
.status-dot-gray { background: #9ca3af; }
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--color-text-muted, #9ca3af);
}
.loading-spinner::after {
    content: '';
    width: 28px;
    height: 28px;
    border: 3px solid var(--color-border, #e5e7eb);
    border-top-color: var(--color-primary, #10b981);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--color-text-muted, #9ca3af);
    text-align: center;
    gap: 16px;
}
.coming-soon i { font-size: 48px; opacity: 0.4; }
.coming-soon p { font-size: 16px; }
.btn-success {
    background: #22c55e;
    color: #fff;
    border: none;
}
.btn-success:hover { background: #16a34a; }

/* Status badges */
.status-paid, .status-done, .status-confirmed, .status-completed, .status-available {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}
.status-partial, .status-processing, .status-busy, .status-in-progress, .status-serving {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}
.status-unpaid, .status-cancelled {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}
.status-waiting, .status-scheduled, .status-checked-in, .status-checked_in {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}
.status-released, .status-called {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}
.status-no-show, .status-offline {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}
.sidebar-overlay {
    display: none;
}
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border, #e5e7eb);
    border-top-color: var(--color-primary, #10b981);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
.detail-grid {
    display: grid;
    gap: 12px;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border, #f3f4f6);
}
.detail-row label {
    font-size: 13px;
    color: var(--color-text-muted, #6b7280);
    font-weight: 500;
}
.detail-row span {
    font-size: 13px;
    color: var(--color-text, #1f2937);
}
/* ============================================================
   RESPONSIVE — Mobile (< 768px)
   ============================================================ */
@media (max-width: 767px) {
  :root {
    --sidebar-width: 0px;
    --topbar-height: 52px;
  }

  /* Sidebar: hidden by default, overlay when open */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
  }
  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .hamburger {
    display: flex !important;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 999;
    background: var(--color-white, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--color-text, #1f2937);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    min-height: 100vh;
  }

  /* Top header mobile */
  .top-header {
    padding: 10px 12px 10px 58px;
    flex-wrap: wrap;
    gap: 8px;
    min-height: var(--topbar-height);
  }

  .breadcrumb {
    font-size: 12px;
    flex: 1;
    min-width: 0;
  }
  .breadcrumb-section { display: none; }
  .breadcrumb-sep { display: none; }
  .breadcrumb-page {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-actions {
    gap: 6px;
  }
  .header-cmd-btn {
    display: none !important;
  }
  .header-cmd-btn span, .header-cmd-btn kbd { display: none; }

  /* Page container mobile */
  .page-container {
    padding: 12px;
  }

  /* Hero banner mobile */
  .hero-banner {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
    gap: 12px;
    border-radius: 12px;
    margin-bottom: 16px;
  }
  .hero-banner .hero-content {
    flex-direction: column;
    align-items: center;
  }
  .hero-title {
    font-size: 20px;
  }
  .hero-subtitle {
    font-size: 13px;
  }
  .hero-banner .btn {
    width: 100%;
    justify-content: center;
  }

  /* Stats grid mobile */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 11px; }

  /* Cards mobile */
  .card {
    border-radius: 12px;
    margin-bottom: 12px;
  }
  .card-header {
    padding: 14px 16px;
  }
  .card-body {
    padding: 12px 16px;
  }

  /* Tables mobile — horizontal scroll */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table {
    font-size: 12px;
    min-width: 600px;
  }
  .table thead th,
  .table tbody td {
    padding: 8px 10px;
    white-space: nowrap;
  }

  /* Calendar mobile */
  .calendar-section {
    flex-direction: column;
  }
  .appointments-layout {
    flex-direction: column;
  }
  .today-panel {
    width: 100%;
    position: static;
    max-height: none;
  }
  .calendar-controls {
    flex-wrap: wrap;
    gap: 8px;
  }
  .calendar-filters {
    width: 100%;
  }
  .calendar-filters .form-select {
    flex: 1;
  }
  .calendar-grid {
    font-size: 11px;
  }
  .calendar-cell {
    min-height: 60px;
    padding: 4px;
  }
  .cell-apt-badge {
    font-size: 9px;
    padding: 1px 3px;
  }

  /* Charts mobile */
  .charts-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .chart-body {
    height: 220px;
  }

  /* Quick actions mobile */
  .quick-actions {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .quick-action-card {
    padding: 14px 8px;
  }
  .quick-action-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  .quick-action-card span {
    font-size: 11px;
  }

  /* Dashboard bottom */
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Forms mobile */
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-input, .form-select, .form-textarea {
    font-size: 16px; /* Prevents iOS zoom */
    padding: 10px 12px;
  }

  /* Modal mobile */
  .modal-overlay .modal {
    max-width: 100%;
    margin: 8px;
    max-height: 90vh;
    border-radius: 16px;
  }
  .modal-body {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
  }

  /* Settings mobile */
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Kiosk mobile */
  .kiosk-options {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .kiosk-option {
    padding: 20px 16px;
    flex-direction: row;
    text-align: left;
    gap: 16px;
  }
  .kiosk-option-icon {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }
  .kiosk-welcome h1 {
    font-size: 24px;
  }

  /* Notification dropdown mobile */
  .notification-dropdown {
    width: calc(100vw - 24px);
    right: -8px;
  }

  /* Section title mobile */
  .section-title {
    font-size: 12px;
    margin: 4px 0 12px;
  }

  /* Sidebar section titles */
  .nav-section-title,
  .nav-section-header .nav-section-title {
    font-size: 9px;
    letter-spacing: 1.5px;
  }
  .nav-item {
    padding: 8px 12px;
    font-size: 13px;
  }
  .nav-item span {
    font-size: 13px;
  }

  .header-search input {
    width: 150px;
  }
  .header-search input:focus {
    width: 180px;
  }

  .patient-header {
    flex-direction: column;
    text-align: center;
  }

  .invoice-header-block {
    flex-direction: column;
    gap: 1rem;
  }

  .calendar-cell {
    min-height: 50px;
  }
  .calendar-cell .appointment-dots {
    display: none;
  }

  .cmd-overlay {
    padding-top: 1rem;
  }
  .cmd-palette {
    max-width: 100%;
    margin: 0 0.5rem;
  }

  .notification-dropdown {
    width: 100%;
    right: -0.5rem;
    max-width: calc(100vw - 1rem);
  }

  .chart-card {
    min-height: 200px;
  }

  .activity-feed {
    padding-left: 1rem;
  }

  #sidebar-toggle:checked ~ .sidebar {
    transform: translateX(0);
  }
  #sidebar-toggle:checked ~ .sidebar-overlay {
    display: block;
  }
}

/* ============================================================
   RESPONSIVE — Tablet (768px – 1024px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3col {
    grid-template-columns: 1fr 1fr;
  }
  .right-panel {
    width: 280px;
  }
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   RESPONSIVE — Large Desktop (> 1440px)
   ============================================================ */
@media (min-width: 1441px) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .page-body {
    padding: 2rem 2.5rem;
  }
}

/* ============================================================
   LEGACY DARK MODE (class-based fallback)
   ============================================================ */
html.dark-mode {
  --color-bg: #0f1117;
  --color-white: #1a1d27;
  --color-border: #2a2d3a;
  --color-text: #e4e4e7;
  --color-text-secondary: #a1a1aa;
  --color-text-muted: #71717a;
  --glass-bg: rgba(26, 29, 39, 0.8);
  --glass-border: rgba(255, 255, 255, 0.06);
  --sidebar-bg: #141721;
}

html.dark-mode body {
  background: var(--color-bg);
  color: var(--color-text);
}

html.dark-mode .sidebar {
  background: var(--sidebar-bg);
  border-right-color: var(--color-border);
}

html.dark-mode .top-header {
  background: var(--sidebar-bg);
  border-bottom-color: var(--color-border);
}

html.dark-mode .table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

html.dark-mode .form-input,
html.dark-mode .form-select,
html.dark-mode .form-textarea {
  background: #0f1117;
  border-color: var(--color-border);
  color: var(--color-text);
}

html.dark-mode .modal {
  background: var(--color-white);
}

html.dark-mode .calendar {
  background: var(--color-white);
}

html.dark-mode .dropdown-menu {
  background: var(--color-white);
  border-color: var(--color-border);
}

html.dark-mode .skeleton {
  background: linear-gradient(90deg, #2a2d3a 25%, #353845 50%, #2a2d3a 75%);
  background-size: 200% 100%;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover,
  .stat-card:hover,
  .btn:hover {
    transform: none;
  }
}

/* ============================================================
   ENHANCED DASHBOARD ADDITIONS
   ============================================================ */

/* Header Command Button */
.header-cmd-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--glass-bg, rgba(255,255,255,0.7));
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-muted, #9ca3af);
  transition: all 0.2s ease;
  min-width: 180px;
}
.header-cmd-btn:hover {
  border-color: var(--color-primary, #16a34a);
  box-shadow: 0 0 0 2px rgba(22,163,74,0.1);
}
.header-cmd-btn i { font-size: 12px; }
.header-cmd-btn span { flex: 1; text-align: left; }
.header-cmd-btn kbd {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--color-bg, #f5f5f5);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 4px;
  font-family: inherit;
}

/* Hero Date */
.hero-date {
  font-size: 14px;
  opacity: 0.9;
  color: white;
}

/* Stat Trend */
.stat-trend {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.stat-trend.trend-up { color: #16a34a; }
.stat-trend.trend-down { color: #ef4444; }
.stat-trend.trend-neutral { color: #6b7280; }

/* Charts Row */
.charts-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--glass-bg, rgba(255,255,255,0.7));
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.2));
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,0.1));
  overflow: hidden;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.chart-header h3 {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text, #1f2937);
}
.chart-period {
  font-size: 12px;
  color: var(--color-text-muted, #9ca3af);
  background: var(--color-bg, #f5f5f5);
  padding: 4px 10px;
  border-radius: 20px;
}
.chart-body {
  padding: 16px;
  height: 280px;
  position: relative;
}

/* Section Title */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #1f2937);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.section-title i { color: var(--color-primary, #16a34a); }

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--glass-bg, rgba(255,255,255,0.7));
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.2));
  border-radius: var(--radius, 12px);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  text-align: center;
}
.quick-action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  border-color: var(--color-primary, #16a34a);
}
.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}
.quick-action-card span {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text, #1f2937);
}

/* Dashboard Bottom Grid */
.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Mini Table (for dashboard lists) */
.mini-table { display: flex; flex-direction: column; gap: 2px; }
.mini-table-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.2s;
  font-size: 13px;
}
.mini-table-row:hover { background: var(--color-primary-light, #f0fdf4); }
.mini-time {
  font-weight: 600;
  min-width: 70px;
  color: var(--color-text, #1f2937);
  font-variant-numeric: tabular-nums;
}
.mini-name { flex: 1; font-weight: 500; }
.mini-detail { color: var(--color-text-muted, #9ca3af); font-size: 12px; }

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 20px;
}
.activity-feed::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary, #16a34a), var(--color-border, #e5e7eb));
  border-radius: 2px;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0 10px 16px;
  border-left: 3px solid var(--color-border, #e5e7eb);
  position: relative;
}
.activity-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--color-primary, #16a34a);
}
.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: var(--color-bg, #f5f5f5);
  flex-shrink: 0;
}
.activity-content { flex: 1; }
.activity-text {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text, #1f2937);
}
.activity-time {
  font-size: 11px;
  color: var(--color-text-muted, #9ca3af);
}

/* Command Palette Additional */
.cmd-overlay.active { opacity: 1; visibility: visible; }
.cmd-item-active, .cmd-item-active:hover {
  background: var(--color-primary-light, #f0fdf4) !important;
  color: var(--color-primary, #16a34a) !important;
}
.cmd-item-info { flex: 1; display: flex; flex-direction: column; }
.cmd-item-name { font-weight: 500; }
.cmd-item-detail { font-size: 11px; color: var(--color-text-muted, #9ca3af); }
.cmd-item-section {
  font-size: 10px;
  color: var(--color-text-muted, #9ca3af);
  background: var(--color-bg, #f5f5f5);
  padding: 2px 8px;
  border-radius: 10px;
}
.cmd-item-type {
  font-size: 10px;
  color: var(--color-primary, #16a34a);
  text-transform: uppercase;
  font-weight: 600;
}
.cmd-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted, #9ca3af);
}
.cmd-empty i { font-size: 24px; margin-bottom: 8px; display: block; }
.cmd-footer {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--color-border, #e5e7eb);
  font-size: 11px;
  color: var(--color-text-muted, #9ca3af);
}
.cmd-footer kbd {
  font-size: 10px;
  padding: 1px 5px;
  background: var(--color-bg, #f5f5f5);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 3px;
  margin: 0 2px;
}
.cmd-search-icon {
  color: var(--color-text-muted, #9ca3af);
  font-size: 14px;
}
.cmd-kbd {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--color-bg, #f5f5f5);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 4px;
}
.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.cmd-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: var(--color-text, #1f2937);
}
.cmd-input::placeholder { color: var(--color-text-muted, #9ca3af); }

/* Notification System */
.notification-bell { position: relative; }
.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.badge-pulse { animation: pulse 0.6s ease; }
.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  max-height: 420px;
  background: var(--glass-bg, rgba(255,255,255,0.95));
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.2));
  border-radius: var(--radius, 12px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  z-index: 1000;
  overflow: hidden;
  display: none;
  margin-top: 8px;
}
.notification-dropdown.open { display: block; }
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.notif-header h4 { font-size: 14px; font-weight: 600; }
.notif-clear {
  font-size: 12px;
  color: var(--color-primary, #16a34a);
  background: none;
  border: none;
  cursor: pointer;
}
.notif-list {
  max-height: 340px;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.notif-item:hover { background: var(--color-primary-light, #f0fdf4); }
.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg, #f5f5f5);
  flex-shrink: 0;
}
.notif-content { flex: 1; }
.notif-content strong { display: block; font-size: 13px; }
.notif-content span { font-size: 12px; color: var(--color-text-muted, #9ca3af); }
.notif-time {
  font-size: 11px;
  color: var(--color-text-muted, #9ca3af);
  white-space: nowrap;
}
.notif-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted, #9ca3af);
}
.notif-empty i { font-size: 24px; margin-bottom: 8px; display: block; }

/* Responsive additions */
@media (max-width: 1024px) {
  .charts-row { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .dashboard-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .header-cmd-btn { display: none; }
}

/* ============================================================
   COLLAPSIBLE SIDEBAR SECTIONS
   ============================================================ */

.nav-divider {
  height: 1px;
  background: var(--color-border, #e5e7eb);
  margin: 8px 16px;
  opacity: 0.5;
}

.nav-section.collapsible .nav-section-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.nav-section.collapsible.open .nav-section-items {
  max-height: 300px;
  opacity: 1;
}

.nav-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 6px;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 6px;
  margin: 0 8px;
}

.nav-section-header:hover {
  background: var(--color-primary-light, #f0fdf4);
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted, #9ca3af);
}

.nav-chevron {
  font-size: 10px;
  color: var(--color-text-muted, #9ca3af);
  transition: transform 0.3s ease;
}

.nav-section.collapsible.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-section.collapsible .nav-item {
  padding-left: 24px;
}

/* ============================================================
   SIDEBAR FOOTER USER
   ============================================================ */

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text, #1f2937);
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--color-text-muted, #9ca3af);
}

/* ============================================================
   ENHANCED SPACING — More breathing room
   ============================================================ */

.page-container {
  padding: 24px 28px;
  gap: 24px;
}

.hero-banner {
  margin-bottom: 24px;
  padding: 28px 32px;
}

.stats-grid {
  margin-bottom: 24px;
  gap: 20px;
}

.charts-row {
  margin-bottom: 24px;
  gap: 20px;
}

.card {
  margin-bottom: 0;
}

.card-header {
  padding: 18px 24px;
}

.card-body {
  padding: 20px 24px;
}

.section-title {
  margin: 8px 0 18px;
}

.quick-actions {
  margin-bottom: 28px;
  gap: 16px;
}

/* ============================================================
   CHECK-IN KIOSK
   ============================================================ */

.kiosk-container {
  min-height: calc(100vh - var(--topbar-height, 56px) - 48px);
  display: flex;
  flex-direction: column;
}

.kiosk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 20px;
}

.kiosk-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary, #16a34a);
}

.kiosk-logo i {
  font-size: 28px;
}

.kiosk-time {
  font-size: 24px;
  font-weight: 300;
  color: var(--color-text-muted, #9ca3af);
  font-variant-numeric: tabular-nums;
}

.kiosk-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.kiosk-welcome {
  text-align: center;
}

.kiosk-welcome h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text, #1f2937);
}

.kiosk-welcome p {
  font-size: 18px;
  color: var(--color-text-muted, #9ca3af);
}

.kiosk-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 700px;
  width: 100%;
}

.kiosk-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px;
  background: var(--glass-bg, rgba(255,255,255,0.7));
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.2));
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  text-align: center;
}

.kiosk-option:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  border-color: var(--color-primary, #16a34a);
}

.kiosk-option-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
}

.kiosk-option h3 {
  font-size: 18px;
  font-weight: 600;
}

.kiosk-option p {
  font-size: 13px;
  color: var(--color-text-muted, #9ca3af);
}

.kiosk-form, .kiosk-queue, .kiosk-success {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.kiosk-form-card {
  background: var(--glass-bg, rgba(255,255,255,0.7));
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border, rgba(255,255,255,0.2));
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
}

.kiosk-form-card h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
}

.form-input-lg {
  font-size: 16px;
  padding: 14px 16px;
}

.btn-lg {
  font-size: 16px;
  padding: 14px 28px;
  border-radius: 12px;
}

.kiosk-back {
  align-self: flex-start;
}

.kiosk-success {
  text-align: center;
}

.kiosk-success-icon {
  font-size: 72px;
  color: var(--color-primary, #16a34a);
  animation: scaleIn 0.5s ease;
}

.kiosk-success h2 {
  font-size: 28px;
  font-weight: 700;
}

.kiosk-success p {
  font-size: 16px;
  color: var(--color-text-muted, #9ca3af);
}

.kiosk-queue-number {
  font-size: 48px;
  font-weight: 800;
  color: var(--color-primary, #16a34a);
  margin: 16px 0;
}

.kiosk-queue-list {
  max-width: 500px;
  width: 100%;
}

.kiosk-queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--glass-bg, rgba(255,255,255,0.7));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.2));
  border-radius: 12px;
  margin-bottom: 8px;
}

.kiosk-queue-item.kiosk-queue-waiting { border-left: 4px solid #f59e0b; }
.kiosk-queue-item.kiosk-queue-in_progress { border-left: 4px solid #3b82f6; }
.kiosk-queue-item.kiosk-queue-done { border-left: 4px solid #16a34a; }

.kiosk-queue-num {
  font-size: 20px;
  font-weight: 700;
}

.kiosk-empty {
  text-align: center;
  padding: 40px;
  color: var(--color-text-muted, #9ca3af);
}

/* ============================================================
   SETTINGS PAGE
   ============================================================ */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.settings-toggles {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.setting-toggle:last-child { border-bottom: none; }

.setting-toggle strong {
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
}

.setting-toggle p {
  font-size: 12px;
  color: var(--color-text-muted, #9ca3af);
  margin: 0;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 24px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-primary, #16a34a);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.backup-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.backup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

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

.backup-item strong {
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
}

.backup-item p {
  font-size: 12px;
  color: var(--color-text-muted, #9ca3af);
  margin: 0;
}

.hero-actions {
  display: flex;
  gap: 12px;
}

@media (max-width: 1024px) {
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .kiosk-options { grid-template-columns: 1fr; }
}

/* ============================================================
   SIDEBAR NAV GROUPS — Clean vertical list
   ============================================================ */

.nav-group {
  margin-bottom: 4px;
}

.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--color-text-muted, #9ca3af);
  padding: 12px 16px 6px;
  user-select: none;
}

.nav-group .nav-item {
  padding: 9px 16px 9px 20px;
  margin: 1px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  transition: all 0.2s ease;
}

.nav-group .nav-item:hover {
  background: var(--color-primary-light, #f0fdf4);
  padding-left: 24px;
}

.nav-group .nav-item:hover i {
  color: var(--color-primary, #16a34a);
}

.nav-group .nav-item.active {
  background: linear-gradient(135deg, rgba(22,163,74,0.1), rgba(22,163,74,0.05));
  border-left: 3px solid var(--color-primary, #16a34a);
  padding-left: 17px;
}

.nav-group .nav-item.active i {
  color: var(--color-primary, #16a34a);
}

.nav-group .nav-item.active span {
  font-weight: 600;
  color: var(--color-primary, #16a34a);
}

.nav-group .nav-item i {
  width: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted, #9ca3af);
  transition: color 0.2s;
}

.nav-group .nav-item span {
  flex: 1;
}

.nav-external {
  font-size: 10px;
  opacity: 0.5;
}

/* ============================================================
   NAV ITEM BASE — Single column vertical list
   ============================================================ */

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 2px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text-secondary, #6b7280);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted, #9ca3af);
  transition: color 0.2s;
  flex-shrink: 0;
}

.nav-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item:hover {
  background: var(--color-primary-light, #f0fdf4);
  color: var(--color-text, #1f2937);
}

.nav-item:hover i {
  color: var(--color-primary, #16a34a);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(22,163,74,0.1), rgba(22,163,74,0.05));
  border-left: 3px solid var(--color-primary, #16a34a);
  color: var(--color-primary, #16a34a);
}

.nav-item.active i {
  color: var(--color-primary, #16a34a);
}

.nav-item.active span {
  font-weight: 600;
}
