/* SoftMed Enterprise Premium Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Cairo:wght@300;400;600;700&display=swap');

:root {
  /* Color Palette matching SoftMed Brand Spec */
  --bg-primary: #f2f5f9;       /* Lightest gray background */
  --bg-secondary: #ffffff;     /* White card bodies */
  --bg-surface: #f7fafc;       /* Off-white input bodies */
  --border-color: #e6eef6;     /* Soft blue-gray lines */
  
  --sidebar-bg: #0d2b45;       /* Primary Dark Navy */
  --sidebar-hover: #1b4f7a;    /* Medium Blue */
  --sidebar-text: #e6eef6;     /* Light text for sidebar */
  
  --primary: #4a90e2;          /* Bright Blue Accent */
  --primary-hover: #1b4f7a;
  --primary-glow: rgba(74, 144, 226, 0.2);
  
  --accent: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #06b6d4;
  
  --text-primary: #0d2b45;     /* Dark Navy text on light background */
  --text-muted: #8e9bb2;
  
  /* Brand specific colors */
  --color-wave: #00d2c4;
  --color-om: #ff6600;
  --color-yas: #ffc800;
  --color-spi: #0056b3;
  --color-card: #635bff;

  /* Font settings */
  --font-latin: 'Poppins', sans-serif;
  --font-arabic: 'Cairo', sans-serif;
  --font-family: var(--font-latin);

  /* Layout dimensions */
  --sidebar-width: 260px;
  --header-height: 70px;
  
  /* Transition timings */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body[dir="rtl"] {
  --font-family: var(--font-arabic);
}

/* Base resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  height: 100vh;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* App shell container layout */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar navigation styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition-smooth);
  z-index: 10;
}

body[dir="rtl"] .sidebar {
  border-right: none;
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  color: #ffffff;
  gap: 10px;
}

.sidebar-brand-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.sidebar-menu {
  flex: 1;
  padding: 20px 12px;
  list-style: none;
  overflow-y: auto;
}

.sidebar-section-header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #7ba2c5;
  padding: 14px 12px 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.9;
}

body[dir="rtl"] .sidebar-section-header {
  letter-spacing: 0;
}

.menu-item {
  margin-bottom: 4px;
}

.menu-link {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.92rem;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.menu-link i {
  margin-right: 12px;
  font-size: 1.05rem;
  opacity: 0.85;
  width: 20px;
  text-align: center;
}
body[dir="rtl"] .menu-link i {
  margin-right: 0;
  margin-left: 12px;
}

.menu-link:hover, .menu-item.active .menu-link {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

.menu-item.active .menu-link {
  border-left: 4px solid var(--primary);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background-color: rgba(74, 144, 226, 0.18);
}
body[dir="rtl"] .menu-item.active .menu-link {
  border-left: none;
  border-right: 4px solid var(--primary);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* User Profile drawer */
.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #5c9df5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
}

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

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.btn-logout {
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 5px;
  transition: var(--transition-smooth);
}
.btn-logout:hover {
  color: var(--danger);
  background-color: rgba(239, 68, 68, 0.1);
}

/* Main workspace area styling */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.header {
  height: var(--header-height);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Page body workspace */
.content-body {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

/* Card structures */
.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(13, 43, 69, 0.03);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

/* Input Fields and Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230d2b45'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}
body[dir="rtl"] select.form-control {
  background-position: left 16px center;
  padding-right: 16px;
  padding-left: 40px;
}

/* Premium Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.925rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: #357abd;
  box-shadow: 0 4px 10px var(--primary-glow);
}

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

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background-color: #dc2626;
}

.btn-success {
  background-color: var(--success);
  color: white;
}
.btn-success:hover {
  background-color: #059669;
}

/* Language selector */
.lang-selector {
  display: flex;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px;
}

.lang-btn {
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition-smooth);
  color: var(--text-muted);
}
.lang-btn.active {
  background-color: var(--primary);
  color: #ffffff;
}

/* Dashboard Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 12px rgba(13, 43, 69, 0.02);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.primary { background-color: rgba(74, 144, 226, 0.1); color: var(--primary); }
.stat-icon.success { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon.warning { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-icon.info { background-color: rgba(6, 182, 212, 0.1); color: var(--info); }

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Calendar & Grid layout */
.agenda-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.practitioner-list {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  height: fit-content;
}

.practitioner-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: var(--transition-smooth);
}
.practitioner-item:hover, .practitioner-item.active {
  background-color: var(--bg-surface);
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.calendar-view {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
}

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

.calendar-slots {
  display: grid;
  grid-template-columns: 80px 1fr;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.slot-hour {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}
body[dir="rtl"] .slot-hour {
  border-right: none;
  border-left: 1px solid var(--border-color);
}

.slot-content {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.appt-pill {
  background-color: rgba(74, 144, 226, 0.08);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  width: 100%;
}
body[dir="rtl"] .appt-pill {
  border-left: none;
  border-right: 4px solid var(--primary);
}

.appt-pill-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

/* Table styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 15px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
body[dir="rtl"] .table {
  text-align: right;
}

.table th, .table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.table th {
  background-color: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

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

/* Aging Receivables Brackets */
.aging-bracket-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.aging-bracket-badge.current { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.aging-bracket-badge.delay-30 { background-color: rgba(74, 144, 226, 0.1); color: var(--primary); }
.aging-bracket-badge.delay-60 { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
.aging-bracket-badge.delay-90 { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* Online Payment Configurations settings */
.payment-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.payment-setup-card {
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  border-radius: 16px;
  padding: 24px;
  transition: var(--transition-smooth);
}

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

.payment-brand-title {
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
}
.brand-icon.wave { background-color: var(--color-wave); }
.brand-icon.om { background-color: var(--color-om); }
.brand-icon.yas { background-color: var(--color-yas); color: #000; }
.brand-icon.spi { background-color: var(--color-spi); }
.brand-icon.card { background-color: var(--color-card); }

/* Switch UI */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

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

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(24px);
}
body[dir="rtl"] input:checked + .slider:before {
  transform: translateX(-24px);
}

/* Modal Popup Window */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(13, 43, 69, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 500px;
  max-width: 90%;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(13, 43, 69, 0.08);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.modal-close:hover {
  color: var(--text-primary);
}

/* Toast message alerts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body[dir="rtl"] .toast-container {
  right: auto;
  left: 24px;
}

.toast {
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(13, 43, 69, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  color: var(--text-primary);
  animation: slideIn 0.3s ease-out;
}
body[dir="rtl"] .toast {
  border-left: none;
  border-right: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
body[dir="rtl"] .toast.success { border-right-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
body[dir="rtl"] .toast.error { border-right-color: var(--danger); }

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

/* Prescription Details & QR display */
.prescription-view-box {
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  padding: 20px;
  margin-top: 15px;
  font-family: monospace;
}

.qr-placeholder {
  width: 140px;
  height: 140px;
  background-color: white;
  border: 4px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(13, 43, 69, 0.05);
}

.qr-url-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  word-break: break-all;
}

/* Inpatient status badges */
.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.status-badge.interne { background-color: rgba(74, 144, 226, 0.12); color: var(--primary); }
.status-badge.externe { background-color: rgba(142, 155, 178, 0.12); color: var(--text-muted); }

/* ============================================================================
   Landing / Home Page Premium Styling
   ============================================================================ */
.landing-page {
  background: radial-gradient(circle at 10% 20%, rgba(13, 43, 69, 0.95) 0%, rgba(13, 27, 42, 1) 90.1%);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

body[dir="rtl"] .landing-page {
  text-align: right;
}

.landing-nav {
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  background-color: rgba(13, 43, 69, 0.6);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(230, 238, 246, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-brand-logo {
  width: 42px;
  height: 42px;
  color: #ffffff;
}

.landing-brand span {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 80px 20px;
  max-width: 900px;
  margin: 0 auto;
}

.landing-hero h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #ffffff 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body[dir="rtl"] .landing-hero h1 {
  font-size: 2.8rem;
}

.landing-hero p {
  font-size: 1.25rem;
  color: #b0c0d0;
  margin-bottom: 40px;
  line-height: 1.6;
  max-width: 700px;
}

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

.btn-lg {
  padding: 15px 30px;
  font-size: 1.1rem;
  border-radius: 12px;
}

.landing-features {
  padding: 80px 40px;
  background-color: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.landing-features h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 50px;
  font-weight: 600;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

body[dir="rtl"] .feature-card {
  align-items: flex-start;
}

.feature-card:hover {
  transform: translateY(-5px);
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  border-color: rgba(74, 144, 226, 0.2);
}

.feature-icon {
  width: 50px;
  height: 50px;
  background-color: rgba(74, 144, 226, 0.1);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  font-weight: 600;
}

.feature-card p {
  color: #a0aec0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.landing-footer {
  padding: 40px;
  text-align: center;
  background-color: #081624;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #8e9bb2;
  font-size: 0.9rem;
}

.landing-footer p {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Modal animation */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Print optimization for invoices, prescriptions & Appointment Passes */
@media print {
  body * {
    visibility: hidden;
  }
  
  /* Make Invoices and Appointment Passes visible */
  #invoice-sheet, #invoice-sheet *,
  #appointment-pass, #appointment-pass *,
  .printable-pass, .printable-pass * {
    visibility: visible;
  }
  
  #invoice-sheet, #appointment-pass, .printable-pass {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 25px !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #e2e8f0 !important;
  }
  
  #appointment-pass {
    border-radius: 8px !important;
  }

  .no-print, .btn-no-print, .modal-header, .modal-close, .sidebar, .header, .toast-container {
    display: none !important;
  }
  .modal-overlay {
    background: transparent !important;
    position: static !important;
    padding: 0 !important;
    display: block !important;
  }
  .modal-container {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
}

/* ==========================================================================
   Voice Agent & WhatsApp Interactive Chat Styles
   ========================================================================== */
.voice-pulse-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a90e2 0%, #10b981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7);
  animation: voicePulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
  cursor: pointer;
  margin: 0 auto 15px auto;
  transition: all 0.3s ease;
}

.voice-pulse-circle.listening {
  background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: voicePulseRed 1.2s infinite cubic-bezier(0.66, 0, 0, 1);
}

.voice-pulse-circle.speaking {
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: voicePulseGreen 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes voicePulse {
  to {
    box-shadow: 0 0 0 25px rgba(74, 144, 226, 0);
  }
}

@keyframes voicePulseRed {
  to {
    box-shadow: 0 0 0 30px rgba(239, 68, 68, 0);
  }
}

@keyframes voicePulseGreen {
  to {
    box-shadow: 0 0 0 25px rgba(16, 185, 129, 0);
  }
}

/* Waveform bars */
.voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 35px;
  margin: 10px 0;
}

.voice-wave-bar {
  width: 4px;
  height: 10px;
  background: var(--primary);
  border-radius: 2px;
  animation: waveAnimation 1s infinite ease-in-out;
}

.voice-wave-bar:nth-child(1) { animation-delay: 0.1s; }
.voice-wave-bar:nth-child(2) { animation-delay: 0.2s; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.3s; }
.voice-wave-bar:nth-child(4) { animation-delay: 0.4s; }
.voice-wave-bar:nth-child(5) { animation-delay: 0.5s; }

@keyframes waveAnimation {
  0%, 100% { height: 8px; }
  50% { height: 32px; background: #10b981; }
}

/* WhatsApp Chat Box */
.whatsapp-chat-box {
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  height: 480px;
}

.whatsapp-chat-header {
  background-color: #202c33;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.whatsapp-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wa-msg {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.4;
  position: relative;
  word-break: break-word;
}

.wa-msg.incoming {
  align-self: flex-start;
  background-color: #202c33;
  color: #e9edef;
  border-top-left-radius: 2px;
}

.wa-msg.outgoing {
  align-self: flex-end;
  background-color: #005c4b;
  color: #e9edef;
  border-top-right-radius: 2px;
}

.wa-time {
  font-size: 0.68rem;
  opacity: 0.6;
  text-align: right;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.wa-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.wa-chip-btn {
  background: rgba(0, 168, 132, 0.15);
  border: 1px solid #00a884;
  color: #00a884;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.wa-chip-btn:hover {
  background: #00a884;
  color: #fff;
}

.whatsapp-chat-footer {
  background-color: #202c33;
  padding: 10px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ==========================================================================
   AI Medical Voice Copilot Styles & Soundwave Animations
   ========================================================================== */
.copilot-pulse-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.copilot-pulse-circle:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

.copilot-pulse-circle.listening {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  animation: copilotListeningPulse 1.4s infinite;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
}

.copilot-pulse-circle.speaking {
  background: linear-gradient(135deg, #10b981, #059669);
  animation: copilotSpeakingPulse 1.6s infinite;
}

@keyframes copilotListeningPulse {
  0% {
    transform: scale(0.96);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1.06);
    box-shadow: 0 0 0 18px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.96);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@keyframes copilotSpeakingPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 14px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Sound Wave Bars */
.copilot-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 24px;
  margin-top: 8px;
}

.copilot-wave-bar {
  width: 4px;
  height: 100%;
  background-color: var(--primary);
  border-radius: 3px;
  animation: copilotWaveAnim 1s ease-in-out infinite alternate;
}

.copilot-wave-bar:nth-child(2) { animation-delay: 0.15s; height: 75%; }
.copilot-wave-bar:nth-child(3) { animation-delay: 0.3s; height: 100%; }
.copilot-wave-bar:nth-child(4) { animation-delay: 0.45s; height: 60%; }
.copilot-wave-bar:nth-child(5) { animation-delay: 0.6s; height: 85%; }

@keyframes copilotWaveAnim {
  0% { height: 15%; }
  100% { height: 100%; }
}

.copilot-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.copilot-chip:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.copilot-chat-bubble-user {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px 14px 2px 14px;
  padding: 12px 16px;
  margin-left: auto;
  max-width: 85%;
  font-size: 0.92rem;
  color: #1e3a8a;
  font-weight: 500;
}

.copilot-chat-bubble-ai {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px 14px 14px 2px;
  padding: 16px;
  max-width: 95%;
  font-size: 0.9rem;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  line-height: 1.6;
}

.copilot-alert-box {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 0.85rem;
  color: #991b1b;
  font-weight: 600;
}

/* ============================================================================
   Dashboard Analytics & Visual Charts Design System
   ============================================================================ */

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.dashboard-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  border-color: rgba(37, 99, 235, 0.3);
}

.dashboard-stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0.8;
}
.dashboard-stat-card.stat-finance::after { background: linear-gradient(180deg, #10b981, #059669); }
.dashboard-stat-card.stat-patients::after { background: linear-gradient(180deg, #3b82f6, #1d4ed8); }
.dashboard-stat-card.stat-doctors::after { background: linear-gradient(180deg, #8b5cf6, #6d28d9); }
.dashboard-stat-card.stat-activity::after { background: linear-gradient(180deg, #f59e0b, #d97706); }
.dashboard-stat-card.stat-alerts::after { background: linear-gradient(180deg, #ef4444, #b91c1c); }

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stat-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.stat-icon-wrap.blue { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.stat-icon-wrap.green { background: rgba(16, 185, 129, 0.12); color: #059669; }
.stat-icon-wrap.purple { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.stat-icon-wrap.amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.stat-icon-wrap.red { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

.stat-main-number {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-sub-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-tags-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-tag {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.stat-tag.success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.stat-tag.info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.stat-tag.warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }

/* 2-Columns & Full-Width Analytics Layout */
.dashboard-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .dashboard-grid-2col {
    grid-template-columns: 1fr;
  }
}

.analytics-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.analytics-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.analytics-panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

/* 12-Month Monthly Growth Bar Chart */
.monthly-chart-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 200px;
  padding: 20px 10px 10px;
  background: var(--bg-primary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-top: 10px;
  position: relative;
}

.chart-bar-column {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

.chart-bar-fill {
  width: 100%;
  max-width: 32px;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  border-radius: 6px 6px 0 0;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
  min-height: 4px;
  position: relative;
  cursor: pointer;
}

.chart-bar-fill:hover {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.chart-bar-value {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-surface);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.chart-bar-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 8px;
  text-align: center;
  white-space: nowrap;
}

/* Doctors & Pathology Data Lists */
.data-metric-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.data-metric-item {
  padding: 12px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.data-metric-item:hover {
  background: var(--bg-surface);
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.data-metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.data-metric-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-metric-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.progress-fill.green { background: linear-gradient(90deg, #10b981, #059669); }
.progress-fill.purple { background: linear-gradient(90deg, #8b5cf6, #6d28d9); }
.progress-fill.amber { background: linear-gradient(90deg, #f59e0b, #d97706); }

