:root {
  --primary: #0F5132;
  --primary-dark: #0A3622;
  --secondary: #20C997;
  --secondary-light: #E6FFFA;
  --accent: #0D6EFD;
  --bg-light: #F4F6F8;
  --surface: #FFFFFF;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --sam-red: #DC2626;
  --sam-bg: #FEF2F2;
  --mam-orange: #EA580C;
  --mam-bg: #FFF7ED;
  --normal-green: #16A34A;
  --normal-bg: #F0FDF4;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(15, 81, 50, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  display: flex;
  min-height: 100vh;
}

/* Full Screen Auth Overlay */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.not-authenticated .auth-overlay,
.auth-overlay.show {
  display: flex;
}

.auth-card {
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: fadeInScale 0.3s ease;
}

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

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  width: 60px;
  height: 60px;
  background: var(--secondary-light);
  color: var(--primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 14px;
}

.auth-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  background: var(--bg-light);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

/* Sidebar Layout */
.sidebar {
  width: 280px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #FFFFFF;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 24px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  opacity: 0.8;
  font-weight: 400;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  font-weight: 700;
  transform: translateX(3px);
}

.btn i {
  margin-right: 4px;
}

.palette-item i {
  width: 16px;
  text-align: center;
  margin-right: 4px;
}


.user-profile {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  background: var(--secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary-dark);
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 11px;
  opacity: 0.85;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.logout-btn:hover {
  background: var(--sam-red);
}

/* Main Content Area (Centered Dashboard Layout) */
.main-content {
  margin-left: 280px;
  flex: 1 1 auto;
  width: calc(100% - 280px);
  min-width: 0;
  padding: 28px 32px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-content > *,
.tab-content,
#top-tenant-switcher,
.welcome-banner {
  width: 100%;
  max-width: 1400px;
  box-sizing: border-box;
}

/* Header Banner */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #15803D 100%);
  color: white;
  border-radius: 16px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 28px;
}

.welcome-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}

.welcome-sub {
  font-size: 14px;
  opacity: 0.9;
}

/* Grid & Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.financial-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

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

.stat-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

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

.stat-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-dark);
}

.stat-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
  width: fit-content;
}

/* Section Cards */
.card {
  background: var(--surface);
  border-radius: 14px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(15, 81, 50, 0.25);
}

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dark);
}

.btn-outline:hover {
  background: var(--bg-light);
}

/* Data Table */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.data-table th {
  background: var(--bg-light);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover td {
  background: var(--bg-light);
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.badge-sam {
  background: var(--sam-bg);
  color: var(--sam-red);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.badge-mam {
  background: var(--mam-bg);
  color: var(--mam-orange);
  border: 1px solid rgba(234, 88, 12, 0.3);
}

.badge-normal {
  background: var(--normal-bg);
  color: var(--normal-green);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

/* Modals - Dynamic Content Sizing & Frosted Glass */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding: 16px;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border-radius: 18px;
  width: min(600px, 94vw);
  max-width: 600px;
  height: auto;
  max-height: min(92vh, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(226, 232, 240, 0.8);
  transform: scale(0.95) translateY(12px);
  opacity: 0;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease;
  overflow: hidden;
  margin: auto;
}

.modal-sm { max-width: 460px; width: min(460px, 94vw); }
.modal-md { max-width: 600px; width: min(600px, 94vw); }
.modal-lg { max-width: 760px; width: min(760px, 94vw); }
.modal-xl { max-width: 920px; width: min(920px, 95vw); }

.modal-backdrop.active .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-btn,
.modal-close,
.modal-close-btn {
  background: var(--bg-light);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  flex-shrink: 0;
}

.close-btn:hover,
.modal-close:hover,
.modal-close-btn:hover {
  background: rgba(220, 38, 38, 0.12) !important;
  color: #ef4444 !important;
  border-color: rgba(220, 38, 38, 0.3) !important;
  transform: rotate(90deg) scale(1.06);
}

.modal-form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-light);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Custom Modal Scrollbar */
.modal-body::-webkit-scrollbar,
.modal form::-webkit-scrollbar,
.modal::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.modal-body::-webkit-scrollbar-thumb,
.modal form::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.modal form::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Form Controls & Grids */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width,
.form-group[style*="grid-column: span 2"],
.form-group[style*="grid-column: 1 / -1"] {
  grid-column: 1 / -1;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

input, select, textarea {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
  outline: none;
  background-color: var(--surface);
  color: var(--text-dark);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select option {
  background-color: var(--surface);
  color: var(--text-dark);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Date, Time & Calendar Inputs */
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"] {
  cursor: pointer;
  position: relative;
  font-family: inherit;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  display: inline-block;
  width: 20px;
  height: 20px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%2310b981" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line><circle cx="8" cy="14" r="1" fill="%2310b981"></circle><circle cx="12" cy="14" r="1" fill="%2310b981"></circle><circle cx="16" cy="14" r="1" fill="%2310b981"></circle><circle cx="8" cy="18" r="1" fill="%2310b981"></circle><circle cx="12" cy="18" r="1" fill="%2310b981"></circle><circle cx="16" cy="18" r="1" fill="%2310b981"></circle></svg>') !important;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  opacity: 1 !important;
  filter: none !important;
  padding: 4px;
  border-radius: 6px;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
input[type="month"]:hover::-webkit-calendar-picker-indicator,
input[type="time"]:hover::-webkit-calendar-picker-indicator {
  opacity: 1 !important;
  transform: scale(1.18);
  background-color: rgba(16, 185, 129, 0.15);
}

/* Tab Sections */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    width: 80px;
    padding: 16px 8px;
  }
  .brand-title, .brand-subtitle, .nav-text, .user-info {
    display: none;
  }
  .main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
    padding: 20px 16px;
  }
}

/* ==========================================================================
   TOAST NOTIFICATION SYSTEM (Best UI/UX Floating Toast Notifications)
   ========================================================================== */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 14px 35px -6px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.toast.hiding {
  animation: toastSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(60px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
    max-height: 120px;
    margin-bottom: 0;
  }
  to {
    opacity: 0;
    transform: translateX(60px) scale(0.9);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: -10px;
  }
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dark);
}

.toast-message {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  word-break: break-word;
}

.toast-close {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
  align-self: flex-start;
  margin-top: -2px;
  margin-right: -4px;
}

.toast-close:hover {
  color: var(--text-dark);
  background: #F1F5F9;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left center;
  animation: toastCountdown linear forwards;
}

@keyframes toastCountdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Toast Variants */
.toast-success {
  border-left: 4px solid var(--normal-green);
}
.toast-success .toast-icon {
  background: #DCFCE7;
  color: var(--normal-green);
}
.toast-success .toast-progress {
  background: var(--normal-green);
}

.toast-error {
  border-left: 4px solid var(--sam-red);
}
.toast-error .toast-icon {
  background: var(--sam-bg);
  color: var(--sam-red);
}
.toast-error .toast-progress {
  background: var(--sam-red);
}

.toast-warning {
  border-left: 4px solid var(--mam-orange);
}
.toast-warning .toast-icon {
  background: var(--mam-bg);
  color: var(--mam-orange);
}
.toast-warning .toast-progress {
  background: var(--mam-orange);
}

.toast-info {
  border-left: 4px solid var(--accent);
}
.toast-info .toast-icon {
  background: #EFF6FF;
  color: var(--accent);
}
.toast-info .toast-progress {
  background: var(--accent);
}

/* ==========================================================================
   PRINT STYLES FOR OFFICIAL CHARITY RECEIPTS & CERTIFICATES
   ========================================================================== */
@media print {
  /* Hide standard UI elements */
  body, html {
    background: #FFFFFF !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    height: auto !important;
    width: 100% !important;
  }

  .sidebar,
  .main-content,
  .auth-overlay,
  #toast-container,
  #top-tenant-switcher,
  .modal-backdrop:not(#modal-printable-receipt),
  #modal-printable-receipt .modal-header,
  #modal-printable-receipt .modal-footer {
    display: none !important;
    visibility: hidden !important;
  }

  #modal-printable-receipt {
    position: static !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    inset: auto !important;
    overflow: visible !important;
  }

  #modal-printable-receipt .modal {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
  }

  #modal-printable-receipt .modal-body {
    padding: 0 !important;
    overflow: visible !important;
    max-height: none !important;
  }

  .printable-receipt-voucher {
    max-width: 520px !important;
    margin: 10px auto !important;
    border: 1.5px solid #0F5132 !important;
    border-radius: 8px !important;
    padding: 16px 18px !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* Sub-Tab Navigation for Roles & Permissions Console */
.sub-tab-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sub-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px 6px 0 0;
}

.sub-tab:hover {
  color: var(--text-dark);
  background: rgba(0, 0, 0, 0.02);
}

.sub-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(15, 81, 50, 0.06);
}

.roles-subtab-view {
  display: none;
}

.roles-subtab-view.active {
  display: block;
}

/* ========================================================
   📊 REPORTS & ANALYTICS DASHBOARD - UI/UX ENHANCEMENTS
   ======================================================== */
.reports-hero-banner {
  background: linear-gradient(135deg, #064E3B 0%, #047857 60%, #059669 100%);
  border-radius: 16px;
  padding: 24px 28px;
  color: white;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(4, 120, 87, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.reports-hero-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.reports-dataset-container {
  background: var(--surface);
  border-radius: 14px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.reports-dataset-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.report-pill-btn {
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.report-pill-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.report-pill-btn.active {
  background: #047857;
  color: white;
  border-color: #047857;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.3);
}

.report-pill-btn .pill-badge {
  background: rgba(0,0,0,0.06);
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 11px;
}

.report-pill-btn.active .pill-badge {
  background: rgba(255,255,255,0.25);
  color: white;
}

.reports-filter-deck {
  background: var(--surface);
  border-radius: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group-block label {
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.reports-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.reports-stat-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}

.reports-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(0,0,0,0.08);
}

.reports-stat-card .card-icon-watermark {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 26px;
  opacity: 0.15;
}

.reports-stat-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.reports-stat-val {
  font-size: 22px;
  font-weight: 900;
  margin-top: 6px;
  letter-spacing: -0.5px;
}

.reports-stat-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.reports-data-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.reports-table-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.reports-shimmer-row {
  animation: pulse-shimmer 1.5s infinite ease-in-out;
}

@keyframes pulse-shimmer {
  0% { opacity: 0.4; }
  50% { opacity: 0.8; }
  100% { opacity: 0.4; }
}

.reports-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.reports-empty-state-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

/* ==========================================================================
   PATIENT CARD FORM DESIGNER & DYNAMIC REGISTRATION CARD SELECTOR
   ========================================================================== */

/* --- Designer Filter Bar (inline single-row) --- */
.designer-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.designer-filter-search {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-light);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  transition: border-color 0.15s ease;
}

.designer-filter-search:focus-within {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.08);
}

.designer-filter-search-icon {
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
}

.designer-filter-search-input {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 13px;
  color: var(--text-dark);
  width: 100%;
  font-family: inherit;
}

.designer-filter-search-input::placeholder {
  color: #94a3b8;
}

.designer-filter-selects {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.designer-filter-select-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-light);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.designer-filter-select-wrap:focus-within {
  border-color: var(--primary);
  background: white;
}

.designer-filter-select-icon {
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
  pointer-events: none;
}

.designer-filter-select {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 16px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 2px center !important;
}

.designer-filter-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 4px 10px;
  background: var(--bg-light);
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* Template Card Selector Deck (Registration Page) */
.template-deck-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.template-deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.template-choice-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.template-choice-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.08);
}

.template-choice-card.selected {
  border: 1.5px solid var(--primary);
  background: linear-gradient(135deg, var(--secondary-light) 0%, var(--surface) 100%);
  box-shadow: 0 4px 14px -2px rgba(16, 185, 129, 0.15);
}

.template-choice-card .selected-badge {
  display: none;
}

.template-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.template-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.template-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.25;
}

.template-card-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: inline-block;
}

.template-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
  flex-grow: 1;
}

.template-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: auto;
}

.template-status-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.template-status-pill.active {
  color: var(--primary);
}

/* Dynamic Form Sections */
.dynamic-form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.dynamic-form-section-title {
  font-size: 14.5px;
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dynamic-form-input,
.dynamic-form-select,
.dynamic-form-textarea {
  width: 100%;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-dark);
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dynamic-form-input:focus,
.dynamic-form-select:focus,
.dynamic-form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* --- Designer Catalog Listing Cards (Manager Grid) --- */
.designer-template-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.designer-template-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.designer-template-card-header {
  padding: 18px 18px 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.designer-template-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.designer-template-card-body {
  padding: 0 18px 14px 18px;
  flex: 1;
}

.designer-template-card-meta {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.designer-template-card-stat {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.designer-template-card-stat-value {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-dark);
  line-height: 1;
}

.designer-template-card-stat-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.designer-template-card-stat-divider {
  width: 1px;
  background: var(--border);
  margin: 4px 0;
}

.designer-template-card-actions {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

/* Dynamic Registration Form Grid & Styling */
.dynamic-form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px 12px;
}

@media (max-width: 992px) {
  .dynamic-field-item[style*="span 3"],
  .dynamic-field-item[style*="span 4"] {
    grid-column: span 6 !important;
  }
}

@media (max-width: 640px) {
  .dynamic-field-item {
    grid-column: span 12 !important;
  }
}

/* --- Conditional Logic UI --- */
.canvas-conditional-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  background: #ede9fe;
  color: #7c3aed;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.canvas-conditional-badge.badge-hide {
  background: #fee2e2;
  color: #dc2626;
}

.condition-inspector-section {
  border-top: 2px solid var(--border);
  padding-top: 14px;
  margin-top: 10px;
}

.condition-rule-row {
  background: #faf5ff;
  border: 1.5px solid #e9d5ff;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 6px;
}

.condition-rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 28px;
  gap: 5px;
  align-items: center;
}

.condition-rule-select,
.condition-rule-input {
  font-size: 11px;
  padding: 4px 6px;
  border: 1.5px solid #d8b4fe;
  border-radius: 6px;
  background: white;
  color: var(--text-dark);
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.condition-rule-select:focus,
.condition-rule-input:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.condition-logic-btn {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.condition-logic-btn.active {
  background: #ede9fe;
  color: #7c3aed;
  border-color: #7c3aed;
}

.condition-add-btn {
  width: 100%;
  padding: 6px;
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 4px;
  border-style: dashed !important;
  color: #7c3aed !important;
  border-color: #c4b5fd !important;
  background: #faf5ff !important;
}

.condition-add-btn:hover {
  background: #ede9fe !important;
}

.conditional-field-wrapper {
  transition: opacity 0.25s ease;
}

.conditional-field-wrapper.hidden-by-condition {
  opacity: 0;
  height: 0 !important;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
}

.status-pill-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  background: #dcfce7;
  color: #15803d;
  letter-spacing: 0.3px;
}

.status-pill-draft {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #64748b;
  letter-spacing: 0.3px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid;
}

.designer-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

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

/* Designer Studio 3-Column Layout */
.designer-studio-container {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1280px) {
  .designer-studio-container {
    grid-template-columns: 240px 1fr 280px;
    gap: 12px;
  }
}

@media (max-width: 992px) {
  .designer-studio-container {
    grid-template-columns: 1fr;
  }
}

/* Left Palette */
.designer-palette {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  position: sticky;
  top: 20px;
  box-shadow: var(--shadow);
}

.palette-category {
  margin-bottom: 18px;
}

.palette-category-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.palette-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.palette-item i {
  color: var(--primary);
  margin-right: 6px;
  opacity: 0.9;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.palette-item:hover {
  background: var(--secondary-light);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--text-dark);
  transform: translateX(3px);
  box-shadow: 0 3px 10px -2px rgba(0, 0, 0, 0.06);
}

.palette-item:hover i {
  opacity: 1;
  transform: scale(1.08);
}

.palette-item > span:last-child {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.palette-item:hover > span:last-child {
  opacity: 1;
  transform: translateX(1px);
}

.palette-item:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.palette-add-btn {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* Center Canvas */
.designer-canvas-area {
  min-height: 500px;
}

.designer-canvas-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.canvas-section-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.canvas-section-box.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.canvas-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.canvas-section-title-input {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 8px;
  border-radius: 6px;
  width: 70%;
  transition: all 0.15s ease;
}

.canvas-section-title-input:hover,
.canvas-section-title-input:focus {
  background: var(--bg-light);
  border-color: var(--border);
}

.canvas-dropzone {
  min-height: 80px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: flex-start;
  transition: all 0.2s;
  background: var(--bg-light);
  box-sizing: border-box;
}

.canvas-dropzone.drag-over {
  border-color: var(--primary);
  background: var(--secondary-light);
}

.canvas-empty-prompt {
  width: 100%;
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* Canvas Field Cards */
.canvas-field-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.canvas-field-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.canvas-field-card.selected {
  border-color: var(--primary);
  background: var(--secondary-light);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.25);
}

.canvas-field-card[draggable="true"] {
  cursor: grab;
}

.canvas-field-card[draggable="true"]:active {
  cursor: grabbing;
}

.canvas-field-card.field-dragging {
  opacity: 0.35;
  border: 2px dashed #7c3aed !important;
  transform: scale(0.98);
}

.canvas-field-card.drag-over-before {
  border-top: 3px solid #7c3aed !important;
  box-shadow: 0 -4px 12px rgba(124, 58, 237, 0.25);
}

.canvas-field-card.drag-over-after {
  border-bottom: 3px solid #7c3aed !important;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.canvas-field-grip {
  cursor: grab;
  color: #94a3b8;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.canvas-field-grip:hover {
  color: #64748b;
  background: #f1f5f9;
}

/* Precise Width Calculations with 12px Gap */
.canvas-field-card.col-12 { width: 100%; }
.canvas-field-card.col-6  { width: calc(50% - 6px); }
.canvas-field-card.col-4  { width: calc(33.333% - 8px); }
.canvas-field-card.col-3  { width: calc(25% - 9px); }

@media (max-width: 992px) {
  .canvas-field-card.col-3 {
    width: calc(50% - 6px);
  }
}

@media (max-width: 640px) {
  .canvas-field-card.col-6,
  .canvas-field-card.col-4,
  .canvas-field-card.col-3 {
    width: 100%;
  }
}

.canvas-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.canvas-field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-field-type-pill {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.canvas-field-preview-box {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  transition: all 0.15s ease;
}

.canvas-field-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}

.canvas-width-chips {
  display: flex;
  gap: 2px;
}

.canvas-width-chip {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.1s ease;
}

.canvas-width-chip:hover {
  background: var(--surface);
  color: var(--text-dark);
  border-color: var(--primary);
}

.canvas-width-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.canvas-field-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.1s ease;
}

.canvas-field-btn:hover {
  background: var(--bg-light);
  color: var(--text-dark);
}

.canvas-field-btn.btn-delete:hover {
  background: rgba(220, 38, 38, 0.12);
  color: var(--sam-red);
}

/* Right Inspector */
.designer-inspector {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  position: sticky;
  top: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.inspector-header {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dark);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inspector-field-group {
  margin-bottom: 12px;
}

.inspector-field-group label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dark);
  display: block;
  margin-bottom: 4px;
}

.inspector-field-group input,
.inspector-field-group select,
.inspector-field-group textarea {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-dark);
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.inspector-field-group input:focus,
.inspector-field-group select:focus,
.inspector-field-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.grid-width-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.grid-width-btn {
  padding: 6px 2px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-light);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.grid-width-btn:hover {
  border-color: var(--primary);
}

.grid-width-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}


/* ==========================================================================
   ENTERPRISE DASHBOARD THEMES SYSTEM
   ========================================================================== */

/* 1. Executive Command Center (Dark Slate & Emerald Glow) */
[data-theme="executive_command"] {
  --bg-light: #0b1329;
  --surface: #111d38;
  --primary: #10b981;
  --primary-dark: #064e3b;
  --secondary: #34d399;
  --secondary-light: rgba(16, 185, 129, 0.15);
  --text-dark: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 40px -10px rgba(16, 185, 129, 0.2);
}

[data-theme="executive_command"] body {
  background-color: #0b1329;
  color: #f8fafc;
}

[data-theme="executive_command"] .main-content {
  background-color: #0b1329;
}

[data-theme="executive_command"] .stat-card,
[data-theme="executive_command"] .card,
[data-theme="executive_command"] .table-card,
[data-theme="executive_command"] .modal,
[data-theme="executive_command"] #top-tenant-switcher {
  background: #111d38 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="executive_command"] .sidebar {
  background: linear-gradient(180deg, #064e3b 0%, #0b1329 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="executive_command"] .data-table th {
  background: #0f172a !important;
  color: #94a3b8 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="executive_command"] .data-table td {
  border-color: rgba(255, 255, 255, 0.06) !important;
  color: #f1f5f9 !important;
}

[data-theme="executive_command"] input,
[data-theme="executive_command"] select,
[data-theme="executive_command"] textarea {
  background: #0b1329 !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}


/* 2. Clinical Operations & Malnutrition Triage (Fresh Light Mint & Forest Green) */
[data-theme="clinical_triage"] {
  --bg-light: #f0fdf4;
  --surface: #ffffff;
  --primary: #059669;
  --primary-dark: #064e3b;
  --secondary: #0d9488;
  --secondary-light: #dcfce7;
  --text-dark: #064e3b;
  --text-muted: #047857;
  --border: #bbf7d0;
  --shadow: 0 4px 12px rgba(5, 150, 105, 0.08);
}

[data-theme="clinical_triage"] body {
  background-color: #f0fdf4;
  color: #064e3b;
}

[data-theme="clinical_triage"] .sidebar {
  background: linear-gradient(180deg, #064e3b 0%, #047857 100%) !important;
}

[data-theme="clinical_triage"] .stat-card,
[data-theme="clinical_triage"] .card,
[data-theme="clinical_triage"] #top-tenant-switcher {
  border-color: #bbf7d0 !important;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.07) !important;
}


/* 3. Charity & Zakat Financial Ledger (Enterprise Fintech Forest Green & Navy) */
[data-theme="charity_ledger"] {
  --bg-light: #f8fafc;
  --surface: #ffffff;
  --primary: #047857;
  --primary-dark: #065f46;
  --secondary: #1e3a8a;
  --secondary-light: #e0e7ff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08);
}

[data-theme="charity_ledger"] body {
  background-color: #f8fafc;
  color: #0f172a;
}

[data-theme="charity_ledger"] .sidebar {
  background: linear-gradient(180deg, #065f46 0%, #1e3a8a 100%) !important;
}


/* 4. Unified Hospital Intelligence (High-Density Dark Navy & Cyan) */
[data-theme="hospital_intelligence"] {
  --bg-light: #030712;
  --surface: #0f172a;
  --primary: #06b6d4;
  --primary-dark: #083344;
  --secondary: #38bdf8;
  --secondary-light: rgba(6, 182, 212, 0.15);
  --text-dark: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --shadow: 0 10px 25px -5px rgba(6, 182, 212, 0.15);
}

[data-theme="hospital_intelligence"] body {
  background-color: #030712;
  color: #f1f5f9;
}

[data-theme="hospital_intelligence"] .main-content {
  background-color: #030712;
}

[data-theme="hospital_intelligence"] .stat-card,
[data-theme="hospital_intelligence"] .card,
[data-theme="hospital_intelligence"] .table-card,
[data-theme="hospital_intelligence"] .modal,
[data-theme="hospital_intelligence"] #top-tenant-switcher {
  background: #0f172a !important;
  border-color: #1e293b !important;
  color: #f1f5f9 !important;
}

[data-theme="hospital_intelligence"] .sidebar {
  background: linear-gradient(180deg, #083344 0%, #030712 100%) !important;
  border-right: 1px solid #1e293b !important;
}

[data-theme="hospital_intelligence"] .data-table th {
  background: #020617 !important;
  color: #06b6d4 !important;
  border-color: #1e293b !important;
}

[data-theme="hospital_intelligence"] .data-table td {
  border-color: #1e293b !important;
  color: #f1f5f9 !important;
}

[data-theme="hospital_intelligence"] input,
[data-theme="hospital_intelligence"] select,
[data-theme="hospital_intelligence"] textarea {
  background: #030712 !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}


/* 5. Minimalist Modern Healthcare (Glassmorphism & Swiss Neutral) */
[data-theme="minimalist_glass"] {
  --bg-light: #f1f5f9;
  --surface: rgba(255, 255, 255, 0.88);
  --primary: #0f766e;
  --primary-dark: #134e4a;
  --secondary: #14b8a6;
  --secondary-light: #ccfbf1;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border: rgba(255, 255, 255, 0.8);
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

[data-theme="minimalist_glass"] body {
  background: #e2e8f0;
}

[data-theme="minimalist_glass"] .stat-card,
[data-theme="minimalist_glass"] .card,
[data-theme="minimalist_glass"] #top-tenant-switcher {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 12px 30px -8px rgba(15, 23, 42, 0.07) !important;
  border-radius: 16px !important;
}

[data-theme="minimalist_glass"] .sidebar {
  background: linear-gradient(180deg, #134e4a 0%, #0f766e 100%) !important;
  backdrop-filter: blur(16px) !important;
}

/* Theme Picker Cards */
.theme-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.theme-preview-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: var(--surface);
  text-align: left;
}

.theme-preview-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.15);
}

.theme-preview-card.active {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 0 0 2px var(--primary);
}

.theme-preview-swatch {
  height: 48px;
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-card-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.theme-card-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}


/* ==========================================================================
   DARK THEME CONTRAST & COMPONENT FIXES (Executive Command & Hospital Intelligence)
   ========================================================================== */

[data-theme="executive_command"] .modal,
[data-theme="hospital_intelligence"] .modal {
  background: var(--surface) !important;
  color: var(--text-dark) !important;
  border: 1px solid var(--border) !important;
}

[data-theme="executive_command"] .modal-header,
[data-theme="hospital_intelligence"] .modal-header {
  background: rgba(0, 0, 0, 0.25) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-dark) !important;
}

[data-theme="executive_command"] .modal-header .modal-title,
[data-theme="hospital_intelligence"] .modal-header .modal-title {
  color: #f8fafc !important;
}

[data-theme="executive_command"] .modal-footer,
[data-theme="hospital_intelligence"] .modal-footer {
  background: rgba(0, 0, 0, 0.25) !important;
  border-top: 1px solid var(--border) !important;
}

[data-theme="executive_command"] .modal-body,
[data-theme="hospital_intelligence"] .modal-body {
  color: var(--text-dark) !important;
}

[data-theme="executive_command"] .modal-body label,
[data-theme="hospital_intelligence"] .modal-body label {
  color: #e2e8f0 !important;
}

/* Fix outline buttons in dark themes so text and icons are 100% crisp and readable */
[data-theme="executive_command"] .btn-outline,
[data-theme="hospital_intelligence"] .btn-outline {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #f8fafc !important;
  font-weight: 600 !important;
}

[data-theme="executive_command"] .btn-outline:hover,
[data-theme="hospital_intelligence"] .btn-outline:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
}

[data-theme="executive_command"] .close-btn,
[data-theme="hospital_intelligence"] .close-btn,
[data-theme="executive_command"] .modal-close,
[data-theme="hospital_intelligence"] .modal-close {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
}

[data-theme="executive_command"] .close-btn:hover,
[data-theme="hospital_intelligence"] .close-btn:hover,
[data-theme="executive_command"] .modal-close:hover,
[data-theme="hospital_intelligence"] .modal-close:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #f87171 !important;
}

/* Fix sub-containers and boxes inside modals for dark themes */
[data-theme="executive_command"] .modal-body [style*="background: var(--bg-light)"],
[data-theme="hospital_intelligence"] .modal-body [style*="background: var(--bg-light)"],
[data-theme="executive_command"] .modal-body [style*="background: #f8fafc"],
[data-theme="hospital_intelligence"] .modal-body [style*="background: #f8fafc"],
[data-theme="executive_command"] .modal-body [style*="background: #FAFCFE"],
[data-theme="hospital_intelligence"] .modal-body [style*="background: #FAFCFE"],
[data-theme="executive_command"] .modal-body [style*="background: white"],
[data-theme="hospital_intelligence"] .modal-body [style*="background: white"] {
  background: rgba(0, 0, 0, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f1f5f9 !important;
}

[data-theme="executive_command"] #modal-setting-qr-preview,
[data-theme="hospital_intelligence"] #modal-setting-qr-preview {
  color: #38bdf8 !important;
}

[data-theme="executive_command"] .modal-body [style*="background: #F0FDF4"],
[data-theme="hospital_intelligence"] .modal-body [style*="background: #F0FDF4"],
[data-theme="executive_command"] .modal-body [style*="background: #eff6ff"],
[data-theme="hospital_intelligence"] .modal-body [style*="background: #eff6ff"] {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #6ee7b7 !important;
}

[data-theme="executive_command"] .modal-body [style*="color: #166534"],
[data-theme="hospital_intelligence"] .modal-body [style*="color: #166534"] {
  color: #34d399 !important;
}

[data-theme="executive_command"] .modal-body code,
[data-theme="hospital_intelligence"] .modal-body code {
  color: #6ee7b7 !important;
}

[data-theme="executive_command"] .theme-preview-card,
[data-theme="hospital_intelligence"] .theme-preview-card {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="executive_command"] .theme-preview-card.active,
[data-theme="hospital_intelligence"] .theme-preview-card.active {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px var(--primary) !important;
}

[data-theme="executive_command"] .theme-card-title,
[data-theme="hospital_intelligence"] .theme-card-title {
  color: #f8fafc !important;
}

[data-theme="executive_command"] .theme-card-desc,
[data-theme="hospital_intelligence"] .theme-card-desc {
  color: #94a3b8 !important;
}

/* Custom confirmation dialog styling in dark themes */
[data-theme="executive_command"] #custom-dialog-modal,
[data-theme="hospital_intelligence"] #custom-dialog-modal {
  background: var(--surface) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-theme="executive_command"] #custom-dialog-modal h3,
[data-theme="hospital_intelligence"] #custom-dialog-modal h3 {
  color: #f8fafc !important;
}

[data-theme="executive_command"] #custom-dialog-modal [style*="background: #fafcfe"],
[data-theme="hospital_intelligence"] #custom-dialog-modal [style*="background: #fafcfe"] {
  background: rgba(0, 0, 0, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* --- Date & Calendar Picker Dark Theme Overrides --- */
[data-theme="executive_command"] input[type="date"],
[data-theme="executive_command"] input[type="datetime-local"],
[data-theme="executive_command"] input[type="month"],
[data-theme="executive_command"] input[type="time"] {
  color-scheme: dark !important;
  background-color: #0b1329 !important;
  color: #f8fafc !important;
}

[data-theme="hospital_intelligence"] input[type="date"],
[data-theme="hospital_intelligence"] input[type="datetime-local"],
[data-theme="hospital_intelligence"] input[type="month"],
[data-theme="hospital_intelligence"] input[type="time"] {
  color-scheme: dark !important;
  background-color: #020617 !important;
  color: #f8fafc !important;
}

[data-theme="executive_command"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="executive_command"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
[data-theme="executive_command"] input[type="month"]::-webkit-calendar-picker-indicator,
[data-theme="executive_command"] input[type="time"]::-webkit-calendar-picker-indicator {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%2334d399" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line><circle cx="8" cy="14" r="1.2" fill="%2334d399"></circle><circle cx="12" cy="14" r="1.2" fill="%2334d399"></circle><circle cx="16" cy="14" r="1.2" fill="%2334d399"></circle><circle cx="8" cy="18" r="1.2" fill="%2334d399"></circle><circle cx="12" cy="18" r="1.2" fill="%2334d399"></circle><circle cx="16" cy="18" r="1.2" fill="%2334d399"></circle></svg>') !important;
  opacity: 1 !important;
  filter: drop-shadow(0 0 3px rgba(52, 211, 153, 0.5)) !important;
}

[data-theme="hospital_intelligence"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="hospital_intelligence"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
[data-theme="hospital_intelligence"] input[type="month"]::-webkit-calendar-picker-indicator,
[data-theme="hospital_intelligence"] input[type="time"]::-webkit-calendar-picker-indicator {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%2338bdf8" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line><circle cx="8" cy="14" r="1.2" fill="%2338bdf8"></circle><circle cx="12" cy="14" r="1.2" fill="%2338bdf8"></circle><circle cx="16" cy="14" r="1.2" fill="%2338bdf8"></circle><circle cx="8" cy="18" r="1.2" fill="%2338bdf8"></circle><circle cx="12" cy="18" r="1.2" fill="%2338bdf8"></circle><circle cx="16" cy="18" r="1.2" fill="%2338bdf8"></circle></svg>') !important;
  opacity: 1 !important;
  filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.5)) !important;
}

[data-theme="executive_command"] input[type="date"]:hover::-webkit-calendar-picker-indicator,
[data-theme="hospital_intelligence"] input[type="date"]:hover::-webkit-calendar-picker-indicator {
  background-color: rgba(255, 255, 255, 0.12) !important;
  transform: scale(1.18);
}

/* --- Active Clinic Row in Dark Themes --- */
.active-clinic-row {
  background: rgba(16, 185, 129, 0.08) !important;
  border-left: 3px solid var(--primary);
}

[data-theme="executive_command"] .active-clinic-row,
[data-theme="hospital_intelligence"] .active-clinic-row {
  background: rgba(16, 185, 129, 0.15) !important;
  border-left: 3px solid #34d399 !important;
}

[data-theme="executive_command"] .active-clinic-row td,
[data-theme="hospital_intelligence"] .active-clinic-row td {
  color: #f8fafc !important;
  background: transparent !important;
}

[data-theme="executive_command"] .active-clinic-row code,
[data-theme="hospital_intelligence"] .active-clinic-row code {
  color: #6ee7b7 !important;
}

/* --- Template Choice Cards in Dark Themes --- */
[data-theme="executive_command"] .template-choice-card,
[data-theme="hospital_intelligence"] .template-choice-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="executive_command"] .template-choice-card:hover,
[data-theme="hospital_intelligence"] .template-choice-card:hover {
  border-color: var(--primary) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -2px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="executive_command"] .template-choice-card.selected {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, var(--surface) 100%) !important;
  border: 1.5px solid #10b981 !important;
  box-shadow: 0 4px 16px -2px rgba(16, 185, 129, 0.25) !important;
}

[data-theme="hospital_intelligence"] .template-choice-card.selected {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, var(--surface) 100%) !important;
  border: 1.5px solid #06b6d4 !important;
  box-shadow: 0 4px 16px -2px rgba(6, 182, 212, 0.25) !important;
}

[data-theme="executive_command"] .template-choice-card .template-card-title,
[data-theme="hospital_intelligence"] .template-choice-card .template-card-title {
  color: var(--text-dark) !important;
}

[data-theme="executive_command"] .template-choice-card .template-card-desc,
[data-theme="hospital_intelligence"] .template-choice-card .template-card-desc {
  color: var(--text-muted) !important;
}

[data-theme="executive_command"] .template-card-footer,
[data-theme="hospital_intelligence"] .template-card-footer {
  border-top-color: var(--border) !important;
}

/* --- Dynamic Registration Form Sections & Fields in Dark Themes --- */
[data-theme="executive_command"] .dynamic-form-section,
[data-theme="hospital_intelligence"] .dynamic-form-section {
  background: #111d38 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="executive_command"] .dynamic-form-section .dynamic-form-section-title,
[data-theme="hospital_intelligence"] .dynamic-form-section .dynamic-form-section-title {
  color: #34d399 !important;
}

[data-theme="executive_command"] .dynamic-form-input,
[data-theme="hospital_intelligence"] .dynamic-form-input,
[data-theme="executive_command"] .dynamic-form-select,
[data-theme="hospital_intelligence"] .dynamic-form-select,
[data-theme="executive_command"] .dynamic-form-textarea,
[data-theme="hospital_intelligence"] .dynamic-form-textarea {
  background: #0b1329 !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

[data-theme="executive_command"] .dynamic-form-input:focus,
[data-theme="hospital_intelligence"] .dynamic-form-input:focus,
[data-theme="executive_command"] .dynamic-form-select:focus,
[data-theme="hospital_intelligence"] .dynamic-form-select:focus,
[data-theme="executive_command"] .dynamic-form-textarea:focus,
[data-theme="hospital_intelligence"] .dynamic-form-textarea:focus {
  border-color: #34d399 !important;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2) !important;
}

[data-theme="executive_command"] .dynamic-field-item label,
[data-theme="hospital_intelligence"] .dynamic-field-item label {
  color: #e2e8f0 !important;
}


/* ============================================================
   COMPREHENSIVE DARK THEME COMPONENT OVERRIDES
   (executive_command + hospital_intelligence)
   ============================================================ */

/* --- Modals --- */
[data-theme="executive_command"] .modal-header,
[data-theme="hospital_intelligence"] .modal-header {
  background: #0b1329 !important;
  border-color: rgba(255,255,255,0.08) !important;
}
[data-theme="hospital_intelligence"] .modal-header {
  background: #020617 !important;
}
[data-theme="executive_command"] .modal-footer,
[data-theme="hospital_intelligence"] .modal-footer {
  background: #0f172a !important;
  border-color: rgba(255,255,255,0.08) !important;
}
[data-theme="hospital_intelligence"] .modal-footer {
  background: #020617 !important;
}
[data-theme="executive_command"] .modal-title,
[data-theme="hospital_intelligence"] .modal-title {
  color: #f8fafc !important;
}
[data-theme="executive_command"] .close-btn,
[data-theme="hospital_intelligence"] .close-btn {
  background: rgba(255,255,255,0.07) !important;
  color: #94a3b8 !important;
}
[data-theme="executive_command"] .close-btn:hover,
[data-theme="hospital_intelligence"] .close-btn:hover {
  background: rgba(220,38,38,0.18) !important;
  color: #f87171 !important;
}

/* --- Toast Notifications --- */
[data-theme="executive_command"] .toast,
[data-theme="hospital_intelligence"] .toast {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  box-shadow: 0 14px 35px -6px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3) !important;
}
[data-theme="executive_command"] .toast-title,
[data-theme="hospital_intelligence"] .toast-title {
  color: #f8fafc !important;
}
[data-theme="executive_command"] .toast-message,
[data-theme="hospital_intelligence"] .toast-message {
  color: #94a3b8 !important;
}
[data-theme="executive_command"] .toast-close:hover,
[data-theme="hospital_intelligence"] .toast-close:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #f8fafc !important;
}

/* --- Table Row Hover --- */
[data-theme="executive_command"] .data-table tr:hover td {
  background: rgba(255,255,255,0.04) !important;
}
[data-theme="hospital_intelligence"] .data-table tr:hover td {
  background: rgba(6, 182, 212, 0.05) !important;
}

/* --- Buttons (outline) --- */
[data-theme="executive_command"] .btn-outline,
[data-theme="hospital_intelligence"] .btn-outline {
  border-color: var(--border) !important;
  color: var(--text-dark) !important;
  background: transparent !important;
}
[data-theme="executive_command"] .btn-outline:hover,
[data-theme="hospital_intelligence"] .btn-outline:hover {
  background: rgba(255,255,255,0.07) !important;
}

/* --- Sub-Tab Navigation --- */
[data-theme="executive_command"] .sub-tab:hover,
[data-theme="hospital_intelligence"] .sub-tab:hover {
  background: rgba(255,255,255,0.05) !important;
  color: #f8fafc !important;
}
[data-theme="executive_command"] .sub-tab.active {
  background: rgba(16,185,129,0.1) !important;
}
[data-theme="hospital_intelligence"] .sub-tab.active {
  background: rgba(6,182,212,0.1) !important;
}

/* --- Filter Group Labels (Reports) --- */
[data-theme="executive_command"] .filter-group-block label,
[data-theme="hospital_intelligence"] .filter-group-block label {
  color: #94a3b8 !important;
}

/* --- Report Pill Buttons --- */
[data-theme="executive_command"] .report-pill-btn,
[data-theme="hospital_intelligence"] .report-pill-btn {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text-dark) !important;
}
[data-theme="executive_command"] .report-pill-btn:hover,
[data-theme="hospital_intelligence"] .report-pill-btn:hover {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.15) !important;
}
[data-theme="executive_command"] .report-pill-btn.active {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: white !important;
}
[data-theme="hospital_intelligence"] .report-pill-btn.active {
  background: #06b6d4 !important;
  border-color: #06b6d4 !important;
  color: white !important;
}

/* --- Designer Canvas Area --- */
[data-theme="executive_command"] .canvas-section-box,
[data-theme="hospital_intelligence"] .canvas-section-box {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

[data-theme="executive_command"] .canvas-dropzone,
[data-theme="hospital_intelligence"] .canvas-dropzone {
  background: rgba(0, 0, 0, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="executive_command"] .canvas-field-card,
[data-theme="hospital_intelligence"] .canvas-field-card {
  background: #111d38 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="hospital_intelligence"] .canvas-field-card {
  background: #0b132b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="executive_command"] .canvas-field-card:hover {
  border-color: #34d399 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="hospital_intelligence"] .canvas-field-card:hover {
  border-color: #38bdf8 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="executive_command"] .canvas-field-card.selected {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3) !important;
}

[data-theme="hospital_intelligence"] .canvas-field-card.selected {
  background: rgba(6, 182, 212, 0.12) !important;
  border-color: #06b6d4 !important;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.3) !important;
}

[data-theme="executive_command"] .canvas-field-preview-box,
[data-theme="hospital_intelligence"] .canvas-field-preview-box {
  background: rgba(0, 0, 0, 0.35) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
}

[data-theme="executive_command"] .canvas-field-label,
[data-theme="hospital_intelligence"] .canvas-field-label {
  color: #f8fafc !important;
}

[data-theme="executive_command"] .canvas-field-actions,
[data-theme="hospital_intelligence"] .canvas-field-actions {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="executive_command"] .canvas-width-chip,
[data-theme="hospital_intelligence"] .canvas-width-chip {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
}

[data-theme="executive_command"] .canvas-width-chip.active {
  background: #10b981 !important;
  color: white !important;
  border-color: #10b981 !important;
}

[data-theme="hospital_intelligence"] .canvas-width-chip.active {
  background: #06b6d4 !important;
  color: white !important;
  border-color: #06b6d4 !important;
}

[data-theme="executive_command"] .canvas-field-btn,
[data-theme="hospital_intelligence"] .canvas-field-btn {
  color: #94a3b8 !important;
}

[data-theme="executive_command"] .canvas-field-btn:hover,
[data-theme="hospital_intelligence"] .canvas-field-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

/* --- Designer Inspector Panel --- */
[data-theme="executive_command"] .designer-inspector,
[data-theme="hospital_intelligence"] .designer-inspector {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
[data-theme="executive_command"] .inspector-header,
[data-theme="hospital_intelligence"] .inspector-header {
  color: #f8fafc !important;
  border-bottom-color: var(--border) !important;
}
[data-theme="executive_command"] .inspector-field-group label,
[data-theme="hospital_intelligence"] .inspector-field-group label {
  color: #e2e8f0 !important;
}
[data-theme="executive_command"] .inspector-field-group input,
[data-theme="executive_command"] .inspector-field-group select,
[data-theme="executive_command"] .inspector-field-group textarea {
  background: #0b1329 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
}
[data-theme="hospital_intelligence"] .inspector-field-group input,
[data-theme="hospital_intelligence"] .inspector-field-group select,
[data-theme="hospital_intelligence"] .inspector-field-group textarea {
  background: #020617 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* --- Designer Palette Left Toolbox (Dark Themes) --- */
[data-theme="executive_command"] .designer-palette,
[data-theme="hospital_intelligence"] .designer-palette {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

[data-theme="executive_command"] .palette-category-title,
[data-theme="hospital_intelligence"] .palette-category-title {
  color: #94a3b8 !important;
}

[data-theme="executive_command"] .palette-item,
[data-theme="hospital_intelligence"] .palette-item {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
  box-shadow: none !important;
}

[data-theme="executive_command"] .palette-item span[style*="color: var(--primary)"],
[data-theme="executive_command"] .palette-item span[style*="color:var(--primary)"] {
  color: #34d399 !important;
}

[data-theme="hospital_intelligence"] .palette-item span[style*="color: var(--primary)"],
[data-theme="hospital_intelligence"] .palette-item span[style*="color:var(--primary)"] {
  color: #38bdf8 !important;
}

[data-theme="executive_command"] .palette-item:hover {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="hospital_intelligence"] .palette-item:hover {
  background: rgba(6, 182, 212, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="executive_command"] .palette-item .palette-add-btn,
[data-theme="hospital_intelligence"] .palette-item .palette-add-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="executive_command"] .palette-item:hover .palette-add-btn {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

[data-theme="hospital_intelligence"] .palette-item:hover .palette-add-btn {
  background: #06b6d4 !important;
  color: #ffffff !important;
  border-color: #06b6d4 !important;
}

/* --- Designer Filter Bar --- */
[data-theme="executive_command"] .designer-filter-bar,
[data-theme="hospital_intelligence"] .designer-filter-bar {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
[data-theme="executive_command"] .designer-filter-search,
[data-theme="executive_command"] .designer-filter-select-wrap,
[data-theme="hospital_intelligence"] .designer-filter-search,
[data-theme="hospital_intelligence"] .designer-filter-select-wrap {
  background: rgba(255,255,255,0.05) !important;
  border-color: var(--border) !important;
}
[data-theme="executive_command"] .designer-filter-search-input,
[data-theme="executive_command"] .designer-filter-select,
[data-theme="hospital_intelligence"] .designer-filter-search-input,
[data-theme="hospital_intelligence"] .designer-filter-select {
  color: var(--text-dark) !important;
  background: transparent !important;
}
[data-theme="executive_command"] .designer-filter-search-input::placeholder,
[data-theme="hospital_intelligence"] .designer-filter-search-input::placeholder {
  color: #64748b !important;
}

/* --- Grid Width Buttons in Inspector --- */
[data-theme="executive_command"] .grid-width-btn,
[data-theme="hospital_intelligence"] .grid-width-btn {
  background: rgba(255,255,255,0.06) !important;
  border-color: var(--border) !important;
  color: var(--text-dark) !important;
}
[data-theme="executive_command"] .grid-width-btn:hover,
[data-theme="hospital_intelligence"] .grid-width-btn:hover {
  border-color: var(--primary) !important;
}

/* --- Semantic Status Badges in Dark Mode --- */
[data-theme="executive_command"] .badge-normal,
[data-theme="hospital_intelligence"] .badge-normal {
  background: rgba(22,163,74,0.15) !important;
  color: #4ade80 !important;
  border-color: rgba(74,222,128,0.25) !important;
}
[data-theme="executive_command"] .badge-sam,
[data-theme="hospital_intelligence"] .badge-sam {
  background: rgba(220,38,38,0.15) !important;
  color: #f87171 !important;
  border-color: rgba(248,113,113,0.25) !important;
}
[data-theme="executive_command"] .badge-mam,
[data-theme="hospital_intelligence"] .badge-mam {
  background: rgba(234,88,12,0.15) !important;
  color: #fb923c !important;
  border-color: rgba(251,146,60,0.25) !important;
}

/* --- Theme Picker Preview Cards --- */
[data-theme="executive_command"] .theme-preview-card,
[data-theme="hospital_intelligence"] .theme-preview-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
[data-theme="executive_command"] .theme-preview-card:hover,
[data-theme="hospital_intelligence"] .theme-preview-card:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4) !important;
}

/* --- Scrollbars Global Dark --- */
[data-theme="executive_command"] ::-webkit-scrollbar-track,
[data-theme="hospital_intelligence"] ::-webkit-scrollbar-track {
  background: var(--bg-light) !important;
}
[data-theme="executive_command"] ::-webkit-scrollbar-thumb,
[data-theme="hospital_intelligence"] ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15) !important;
  border-radius: 4px;
}
[data-theme="executive_command"] ::-webkit-scrollbar-thumb:hover,
[data-theme="hospital_intelligence"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25) !important;
}

/* --- Top Tenant Switcher Select --- */
[data-theme="executive_command"] #tenant-switcher-select,
[data-theme="hospital_intelligence"] #tenant-switcher-select {
  background: var(--surface) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

/* --- Stat Cards Icon Accent backgrounds for dark --- */
[data-theme="executive_command"] .stat-card,
[data-theme="hospital_intelligence"] .stat-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

/* --- Main Nav (active clinic row) --- */
[data-theme="executive_command"] .active-clinic-row td,
[data-theme="hospital_intelligence"] .active-clinic-row td {
  background: rgba(16,185,129,0.08) !important;
}
[data-theme="hospital_intelligence"] .active-clinic-row td {
  background: rgba(6,182,212,0.08) !important;
}

/* =============================================================================
   TELE-CALLING WORKSTATION & CALL LOG MODAL STYLES
   ============================================================================= */
.call-outcomes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.outcome-choice-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  user-select: none;
  width: 100%;
}

.outcome-choice-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.outcome-choice-card .outcome-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.outcome-choice-card .outcome-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.25;
}

.outcome-choice-card.selected {
  border-color: var(--primary) !important;
  background: var(--secondary-light) !important;
  box-shadow: 0 0 0 1.5px var(--primary), 0 4px 12px rgba(16, 185, 129, 0.15) !important;
}

[data-theme="executive_command"] .outcome-choice-card,
[data-theme="hospital_intelligence"] .outcome-choice-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

[data-theme="executive_command"] .outcome-choice-card.selected,
[data-theme="hospital_intelligence"] .outcome-choice-card.selected {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 1.5px var(--primary), 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.call-history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

/* =============================================================================
   BLOOD BANK & LABORATORY (LIMS) THEME SUPPORT
   ============================================================================= */
.blood-subtab-btn,
.lims-subtab-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 9px 9px 0 0;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.lims-subtab-btn:hover {
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.blood-subtab-btn.active,
.lims-subtab-btn.active {
  background: var(--surface) !important;
  color: #0284c7 !important;
  border-color: var(--border) !important;
  border-bottom: 2px solid #0284c7 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.lims-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.lims-catalog-btn {
  border-radius: 8px !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  background: rgba(56, 189, 248, 0.06) !important;
  color: #38bdf8 !important;
}

.lims-catalog-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(3, 105, 161, 0.25)) !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.25) !important;
}

/* Tools Quick Access Popup Menu */
.quick-tool-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--surface);
  cursor: pointer;
}

.quick-tool-btn:hover {
  transform: translateY(-2px);
  border-color: #0284c7 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.18);
}

.tool-card-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.tool-card-item:hover {
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

[data-theme="executive_command"] #blood-stock-matrix-grid > div,
[data-theme="hospital_intelligence"] #blood-stock-matrix-grid > div {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

[data-theme="executive_command"] #lims-order-tests-container label,
[data-theme="hospital_intelligence"] #lims-order-tests-container label {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text-dark) !important;
}

[data-theme="executive_command"] #lab-receipt-printable-content,
[data-theme="hospital_intelligence"] #lab-receipt-printable-content,
[data-theme="executive_command"] #lab-report-printable-content,
[data-theme="hospital_intelligence"] #lab-report-printable-content {
  background: var(--surface) !important;
  color: var(--text-dark) !important;
  border-color: var(--border) !important;
}

/* Campaign Filter Pills */
.campaign-filter-pill {
  transition: all 0.15s ease;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.campaign-filter-pill:hover {
  background: var(--bg-light);
  color: var(--text-dark);
}
.campaign-filter-pill.active {
  background: #d97706 !important;
  border-color: #d97706 !important;
  color: white !important;
}

/* Beautiful Dialog Animation & Styling */
#beautiful-dialog-backdrop .modal {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}
[data-theme="executive_command"] #beautiful-dialog-backdrop .modal,
[data-theme="hospital_intelligence"] #beautiful-dialog-backdrop .modal {
  background: #111d38 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important;
}
[data-theme="executive_command"] #beautiful-dialog-backdrop .modal > div,
[data-theme="hospital_intelligence"] #beautiful-dialog-backdrop .modal > div {
  background: #111d38 !important;
}

/* Donor Leads Single-Line Status Navigation Pills */
.leads-pills-scroll-container {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-overflow-scrolling: touch;
}

.leads-pills-scroll-container::-webkit-scrollbar {
  height: 4px;
}

.leads-pills-scroll-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.lead-status-pill {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-dark);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.lead-status-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lead-status-pill .pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.lead-status-pill:hover {
  background: var(--bg-light);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.lead-status-pill.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
  transform: translateY(-1px);
}

.lead-status-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

.lead-status-pill.active .pill-dot {
  background: #ffffff !important;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

/* Dark theme pill styling overrides */
[data-theme="executive_command"] .lead-status-pill,
[data-theme="hospital_intelligence"] .lead-status-pill {
  background: #0b1329 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
}

[data-theme="executive_command"] .lead-status-pill .pill-count,
[data-theme="hospital_intelligence"] .lead-status-pill .pill-count {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}

[data-theme="executive_command"] .lead-status-pill:hover,
[data-theme="hospital_intelligence"] .lead-status-pill:hover {
  background: #111d38 !important;
  border-color: var(--primary) !important;
}

[data-theme="executive_command"] .lead-status-pill.active {
  background: linear-gradient(135deg, #059669 0%, #064e3b 100%) !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4) !important;
}

[data-theme="hospital_intelligence"] .lead-status-pill.active {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important;
  border-color: #06b6d4 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4) !important;
}

/* Visual Outcome Grid Cards */
.outcome-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  gap: 6px;
  user-select: none;
}

.outcome-choice-card:hover {
  border-color: var(--primary);
  background: var(--bg-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.outcome-choice-card.selected {
  border-color: var(--primary) !important;
  background: rgba(16, 185, 129, 0.08) !important;
  box-shadow: 0 0 0 2px var(--primary), 0 4px 12px rgba(16, 185, 129, 0.2) !important;
  transform: translateY(-2px);
}

.outcome-choice-card .outcome-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform 0.18s ease;
}

.outcome-choice-card:hover .outcome-icon {
  transform: scale(1.1);
}

.outcome-choice-card .outcome-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

/* Quick Disposition Buttons */
.quick-disposition-btn {
  transition: all 0.15s ease;
}
.quick-disposition-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Searchable User Dropdown in Lead Assignment */
.assign-user-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-dark);
}
.assign-user-option-item:hover {
  background: var(--bg-light);
  color: var(--primary);
}
.assign-user-option-item.selected {
  background: rgba(37, 99, 235, 0.12) !important;
  color: #2563eb !important;
  font-weight: 700;
}


