/** 
 * Finalized Clinical Master CSS - Premium Restoration 
 **/
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --primary: #00897b;
  --primary-dark: #00695c;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --sidebar-bg: #004d40;
  --surface: #ffffff;
  --bg-light: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --radius-lg: 0.625rem;
  /* 10px */
  --radius-md: 0.5rem;
  /* 8px */
  --radius-sm: 0.375rem;
  /* 6px */
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none !important;
  text-transform: none;
}

html {
  font-size: clamp(14px, 1vw, 16px);
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--sidebar-bg);
}

body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: "Inter", sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  display: flex;
  font-size: 0.8125rem;
  /* 13px */
  margin: 0;
  line-height: 1.5;
}

/* Sidebar Restoration - 13.75rem (220px) */
aside#sidebar {
  width: 13.75rem;
  background: var(--sidebar-bg);
  color: white;
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 2000;
  flex-shrink: 0;
  position: relative;
}

.sidebar-logo {
  padding: 0 5px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  background: white;
  height: 64px;
  /* Matching main header height */
}

.logo-container-shm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.logo-container-shm img {
  max-height: 54px;
  max-width: 210px;
  object-fit: contain;
}

/* .logo-icon-premium and other logo styles removed or replaced */

.nav-menu {
  flex: 1;
  padding: 15px 0;
  overflow-y: auto;
}

.nav-item {
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: 0.2s;
  border-left: 0.25rem solid transparent;
  font-weight: 600;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border-left-color: #4db6ac;
}

/* Side Bar Footer Compact Logout button */
.sidebar-footer {
  padding: 0.9375rem;
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
}

.btn-logout-compact {
  background: var(--danger) !important;
  color: white !important;
  border: none;
  border-radius: 0.25rem;
  height: 2rem;
  padding: 0 0.9375rem;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: auto;
}

/* Dashboard UI Premium Restoration */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  height: 100%;
  background: white;
  position: relative;
}

header {
  height: 4rem;
  background: var(--sidebar-bg);
  padding: 0 1.5625rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.1);
  z-index: 1500;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.9375rem;
}

.btn-menu-mobile {
  display: none;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.3125rem;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 1.5625rem;
  font-size: 0.8125rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.8);
}

.header-info i {
  color: var(--danger);
  font-size: 0.9375rem;
}

/* Updated to red */
.btn-appointment-white {
  background: white !important;
  color: var(--primary) !important;
  border: none;
  box-shadow: 0 0.25rem 0.625rem rgba(0, 0, 0, 0.1);
}

.btn-appointment-white i {
  color: var(--primary) !important;
}

/* Compact Header Status Pills */
.header-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding: 0.3125rem 0.75rem;
  border-radius: 1.25rem;
  font-weight: 700;
  font-size: 0.625rem;
  cursor: pointer;
  border: 0.09375rem solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.header-status-pill i {
  font-size: 0.875rem;
}

.header-status-pill.badge-wa-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

.header-status-pill.badge-wa-ok i {
  color: #10b981;
}

.header-status-pill.badge-wa-err {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.header-status-pill.badge-wa-err i {
  color: #ef4444;
}

.gdrive-pill {
  background: rgba(66, 133, 244, 0.12);
  color: #4285f4;
  border-color: rgba(66, 133, 244, 0.25);
}

.gdrive-pill i {
  color: #4285f4;
}

.gdrive-pill.linked {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Legacy status-badge for settings page */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 1.25rem;
  font-weight: 800;
  font-size: 0.625rem;
  cursor: pointer;
}

.badge-wa-ok {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bcf0cd;
}

.badge-wa-err {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.content-wrapper {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  background: #f8fafc;
  height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
}

.module-view {
  display: none;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.module-view.active {
  display: flex !important;
  flex-direction: column;
}

/* Premium Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

.stat-card {
  padding: 0.9375rem 1.125rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-left: 0.375rem solid transparent;
  background: white;
  box-shadow: 0 0.25rem 0.9375rem rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  border-top: 0.0625rem solid rgba(0, 0, 0, 0.02);
  border-right: 0.0625rem solid rgba(0, 0, 0, 0.02);
  border-bottom: 0.0625rem solid rgba(0, 0, 0, 0.02);
}

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

.stat-card:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 0.5rem 1.5625rem rgba(0, 0, 0, 0.08);
}

.stat-card.active {
  transform: scale(1.05);
  box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.12);
  z-index: 5;
}

.stat-card.blue {
  background: #f0f7ff;
  border-left-color: #006adc;
  color: #003f88;
}

.stat-card.cyan {
  background: #ecfeff;
  border-left-color: #0891b2;
  color: #164e63;
}

.stat-card.orange {
  background: #fff7ed;
  border-left-color: #f59e0b;
  color: #7c2d12;
}

.stat-card.green {
  background: #f0fdf4;
  border-left-color: #22c55e;
  color: #14532d;
}

.stat-card.whatsapp {
  background: #f0fff4;
  border-left-color: #25d366;
  color: #064e3b;
}

.stat-card.red {
  background: #fef2f2;
  border-left-color: #ef4444;
  color: #7f1d1d;
}

.text-deep-blue {
  color: #006adc;
}

.text-deep-cyan {
  color: #0891b2;
}

.text-deep-orange {
  color: #f59e0b;
}

.text-deep-green {
  color: #22c55e;
}

.text-deep-wa {
  color: #25d366;
}

.text-deep-red {
  color: #ef4444;
}

.stat-info h4 {
  font-size: 1.625rem;
  /* 26px */
  font-weight: 800;
  line-height: 1;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 20rem 1fr;
  /* 320px */
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  flex: 1;
}

.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 0.0625rem solid var(--border);
  box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.1);
}

/* Interactive Calendar Preservation */
#calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.375rem;
  padding: 0.3125rem;
}

.calendar-date {
  padding: 0.75rem 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 0.25rem;
  cursor: pointer;
  color: #475569;
  position: relative;
  border: 0.0625rem solid #eff6ff;
  background: #fff;
  transition: 0.2s;
}

.calendar-date:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.calendar-date.selected {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary-dark) !important;
  box-shadow: 0 4px 12px rgba(0, 137, 123, 0.3);
}

.calendar-date.today {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.calendar-date.sunday {
  color: var(--danger);
  background: #fff5f5;
}

.calendar-date.empty {
  border: none;
  background: transparent;
  cursor: default;
}

.app-badge {
  position: absolute;
  top: -0.375rem;
  right: -0.375rem;
  background: var(--danger);
  color: white;
  font-size: 0.5625rem;
  font-weight: 800;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0.125rem solid white;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

/* Table Registry Restoration */
.data-table-container {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

/* Default data-table th — VDC overrides this via .tbl-header-vdc */
.data-table th {
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1.5px solid #e2e8f0;
  font-size: 0.78125rem;
  font-weight: 600;
  vertical-align: middle;
}

.registry-table tbody tr {
  border-bottom: 2px solid #e2e8f0;
  transition: all 0.2s ease;
}

/* Default hover — VDC overrides this */
.data-table tbody tr:hover {
  cursor: pointer;
}

/* ========== EXACT VDC TABLE STYLES ========== */
.tbl-header {
  background: #0f766e;
  color: #fff;
}

.tbl-header th {
  color: #fff !important;
  border-bottom: 2px solid #0d9488 !important;
}

.tbl-header th:hover {
  background: #0d9488 !important;
}

/* Alternating rows */
.tbl-row-even {
  background: #ffffff;
}

.tbl-row-odd {
  background: #f0fdf9;
}

/* Override status/completed rows with emerald green */
.tbl-row-completed {
  background: #ecfdf5 !important;
  opacity: 1;
  color: #064e3b !important;
  transition: all 0.3s ease;
}

.tbl-row-completed .time-cell-time {
  color: #064e3b !important;
}

/* Override status/cancelled rows with rose red */
.tbl-row-cancelled {
  background: #fef2f2 !important;
  opacity: 1;
  color: #7f1d1d !important;
  filter: none;
  transition: all 0.3s ease;
}

.tbl-row-cancelled .time-cell-time,
.tbl-row-cancelled .patient-name {
  color: #991b1b !important;
  text-decoration-color: rgba(153, 27, 27, 0.4) !important;
}

.tbl-row-cancelled .badge-due {
  background: #ffe4e6 !important;
  color: #9f1239 !important;
  border-color: #fecdd3 !important;
}

.tbl-row-cancelled .patient-name:hover {
  color: #7f1d1d !important;
  text-decoration-color: #991b1b !important;
}

.tbl-row-completed:hover {
  background: #d1fae5 !important;
}

.tbl-row-cancelled:hover {
  background: #fee2e2 !important;
}

/* Hover row */
#app-list-body tr:hover {
  background: #ccfbf1 !important;
  transition: background 0.15s;
}

/* Time cell */
.time-cell-time {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.time-cell-date {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 1px;
}

/* Patient name always bright green link */
.patient-name {
  color: #10b981 !important;
  font-weight: 800;
  font-size: 12.5px;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2.5px;
  text-decoration-color: rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
}

.patient-name:hover {
  color: #059669 !important;
  text-decoration-color: #10b981;
  transform: scale(1.02);
  display: inline-block;
}

/* Status badge */
.badge-pending {
  background: #fef9c3;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-completed {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.badge-cancelled {
  background: #ffe4e6;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

.badge-paid {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.badge-due {
  background: #fef9c3;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-na {
  background: #f3f4f6;
  color: #9ca3af;
  border: 1px solid #e5e7eb;
}

/* Legacy status highlights removed — handled by VDC classes in JS */

/* ========== VDC DOCTOR SELECT IN TABLE ========== */
.vdc-doc-select {
  height: 26px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: white;
  cursor: pointer;
  min-width: 110px;
}

.vdc-doc-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* ========== VDC ACTION BUTTON STYLES ========== */
.vdc-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  transition: transform 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vdc-action-btn:hover {
  transform: scale(1.25);
}

.vdc-action-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  filter: grayscale(1) brightness(1.5);
}

.vdc-action-btn:disabled:hover {
  transform: none;
}

/* Premium Modal Interaction */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(0.5rem);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 1.25rem;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 53.125rem;
  /* 850px */
  max-height: 95vh;
  overflow-y: auto;
  box-shadow: 0 1.875rem 3.75rem rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 18px 25px;
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.btn-close-modal {
  font-size: 20px;
  cursor: pointer;
  transition: 0.2s;
  padding: 5px;
}

.btn-close-modal:hover {
  color: #ff5252 !important;
  transform: scale(1.2) rotate(90deg);
}

/* Forms & Clinical Inputs */
.form-group {
  margin-bottom: 15px;
  margin-bottom: 0.9375rem;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.8125rem;
}

.form-control {
  width: 100%;
  height: 2.375rem;
  border: 0.09375rem solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0 0.75rem 0 2.1875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.1875rem rgba(0, 137, 123, 0.08);
}

.row-triple {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9375rem;
}

.row-cols-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.9375rem;
}

/* Buttons & Toasts */
.btn {
  height: 2.25rem;
  padding: 0 1.25rem;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  transition: 0.2s;
}

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

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

.btn-outline {
  background: white;
  border: 1.5px solid #cbd5e1;
  color: var(--text-secondary);
}

.service-card {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
}
.service-card img {
  display: block;
  width: 100%;
  height: auto;
}
.service-card h3,
.service-card p {
  word-break: break-word;
}
.service-tools input.form-control {
  min-height: 44px;
}

/* Responsive Utility */
@media (max-width: 1024px) {
  .btn-menu-mobile {
    display: block;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  aside#sidebar {
    position: fixed;
    left: -13.75rem;
    transition: left 0.3s ease;
  }

  aside#sidebar.active {
    left: 0;
  }

  /* Overlay when sidebar is open */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
  }

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

  header {
    padding: 0 15px;
  }

  .header-info {
    display: none;
  }

  /* Hide clock on small screens to save space */
  .header-actions {
    gap: 8px;
  }

  .btn span {
    display: none;
  }

  /* Show only icons on small screens */
  .btn {
    padding: 0 10px;
  }

  .status-badge span {
    display: none;
  }

  .status-badge {
    padding: 6px 10px;
  }
}

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

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Settings QR Box Premium */
.wa-qr-container {
  background: #fcfcfc;
  border: 0.09375rem dashed #cbd5e1;
  border-radius: var(--radius-md);
  height: 12.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9375rem;
}

.card-header-styled {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.25rem;
  font-weight: 800;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.card-body-styled {
  padding: 1.25rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.25rem;
  align-items: stretch;
}

/* ═══ Settings Premium Logo Upload ═══ */
.stg-logo-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stg-logo-zone {
  width: 110px;
  height: 70px;
  border: 2px dashed #cbd5e1;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #f8fafc;
  transition: all 0.25s ease;
  flex-shrink: 0;
  overflow: hidden;
}

.stg-logo-zone:hover {
  border-color: var(--primary);
  background: #f0fdf4;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 137, 123, 0.1);
}

.stg-logo-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.stg-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* ═══ Main Row (Name / Address / GMB) ═══ */
.stg-main-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9375rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ═══ Three Mini Cards Row ═══ */
.stg-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9375rem;
}

.stg-mini-card {
  border-radius: 0.625rem;
  padding: 1rem;
  border: 1px solid;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.stg-mini-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.stg-mini-header {
  font-weight: 800;
  font-size: 0.75rem;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Teal card */
.stg-card-teal {
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border-color: #99f6e4;
}

.stg-card-teal .stg-mini-header {
  color: #0f766e;
}

.stg-card-teal .stg-mini-header i {
  color: #14b8a6;
}

/* Purple card */
.stg-card-purple {
  background: linear-gradient(135deg, #faf5ff, #f3e8ff);
  border-color: #e9d5ff;
}

.stg-card-purple .stg-mini-header {
  color: #7c3aed;
}

.stg-card-purple .stg-mini-header i {
  color: #a78bfa;
}

/* Amber card */
.stg-card-amber {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #fde68a;
}

.stg-card-amber .stg-mini-header {
  color: #b45309;
}

.stg-card-amber .stg-mini-header i {
  color: #f59e0b;
}

/* ═══ Timing Card ═══ */
.stg-timing-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-top: 0.75rem;
}

.stg-timing-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stg-timing-body {
  display: flex;
  gap: 0;
  padding: 1rem 1.25rem;
}

.stg-timing-group {
  flex: 1;
}

.stg-timing-divider {
  width: 1px;
  background: #e2e8f0;
  margin: 0 1.25rem;
  align-self: stretch;
}

.stg-timing-label-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ═══ Save Button Premium ═══ */
.stg-save-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  height: 2.5rem;
  padding: 0 2.5rem;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(0, 137, 123, 0.3);
  transition: all 0.25s ease;
  letter-spacing: 0.02em;
}

.stg-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 137, 123, 0.4);
}

/* ═══ Settings Responsive ═══ */
@media (max-width: 1100px) {
  .stg-cards-row {
    grid-template-columns: 1fr;
  }

  .stg-main-row {
    grid-template-columns: 1fr;
  }

  .stg-timing-body {
    flex-direction: column;
  }

  .stg-timing-divider {
    width: 100%;
    height: 1px;
    margin: 0.75rem 0;
  }
}

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

/* =========== DOCTOR MODULE STYLES =========== */

/* Module Header */
.doctors-module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.doctors-header-left {
  display: flex;
  align-items: center;
  gap: 0.9375rem;
  /* 15px */
}

.doctors-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.25rem;
  /* 20px */
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  /* 10px */
}

.doctors-title i {
  color: var(--primary);
  font-size: 1.375rem;
  /* 22px */
}

.doctors-count {
  background: linear-gradient(135deg, #e0f2f1, #b2dfdb);
  color: var(--primary-dark);
  padding: 0.25rem 0.875rem;
  border-radius: 1.25rem;
  font-size: 0.6875rem;
  font-weight: 800;
}

.doctors-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.doctors-search-wrap {
  position: relative;
}

.doctors-search-wrap > i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.8125rem;
  z-index: 2;
}

.btn-create-doctor {
  height: 2.375rem;
  font-size: 0.8125rem;
  padding: 0 1.125rem;
  border-radius: 0.375rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 137, 123, 0.2);
  transition: all 0.2s ease;
}

.btn-create-doctor:hover {
  transform: translateY(-0.125rem);
  box-shadow: 0 0.375rem 1.125rem rgba(0, 137, 123, 0.3);
}

/* Doctors Table Card */
.doctors-table-card {
  border-radius: 10px;
  overflow: hidden;
}

/* Alternate Row Coloring */
.doctor-data-table tbody tr:nth-child(odd) {
  background-color: #f0faf5;
}

.doctor-data-table tbody tr:nth-child(even) {
  background-color: #ffffff;
}

.doctor-data-table tbody tr:hover {
  background-color: #e0f2ee !important;
  cursor: default;
}

.doctor-data-table th {
  background: #004d40 !important;
  color: white !important;
  font-size: 0.6875rem;
  padding: 0.6875rem 0.75rem;
  white-space: nowrap;
  letter-spacing: 0.025rem;
}

.doctor-data-table td {
  padding: 0.625rem 0.75rem;
  font-size: 0.78125rem;
  vertical-align: middle;
}

/* Doctor Photo in Table */
.doc-photo-thumb {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 0.125rem solid #e0f2f1;
  box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.08);
}

.doc-photo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0f2f1, #b2dfdb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  font-size: 16px;
  font-weight: 800;
  border: 2px solid #c8e6c9;
}

/* Availability Container in Table */
.avail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1875rem;
  /* 3px */
}

.avail-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  /* 4px */
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  color: #1b5e20;
  padding: 0.1875rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  white-space: nowrap;
  border: 0.0625rem solid #a5d6a7;
}

.avail-chip .avail-day {
  font-weight: 800;
  color: var(--primary-dark);
  min-width: 1.625rem;
}

.avail-chip .avail-time {
  color: #2e7d32;
}

/* Action Buttons */
.btn-edit-doc {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 0.3125rem;
  height: 1.75rem;
  padding: 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  transition: all 0.2s;
}

.btn-edit-doc:hover {
  background: var(--primary-dark);
  transform: translateY(-0.0625rem);
  box-shadow: 0 0.1875rem 0.5rem rgba(0, 137, 123, 0.3);
}

/* Doctor Modal - Photo Preview */
.doc-photo-preview {
  width: 5rem;
  /* 80px */
  height: 5rem;
  border-radius: 50%;
  border: 0.1875rem dashed #b2dfdb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f0faf5;
  color: #80cbc4;
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.doc-photo-preview:hover {
  border-color: var(--primary);
}

.doc-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Availability Section in Modal */
.availability-section {
  background: linear-gradient(135deg, #f8fffe 0%, #f0faf5 100%);
  border: 1.5px solid #e0f2f1;
  border-radius: 10px;
  padding: 14px;
  margin-top: 5px;
}

.availability-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-dark);
}

.availability-header i {
  margin-right: 6px;
}

.availability-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}

/* Slot Row - Premium Color-Coded Card */
.slot-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: white;
  border: 1.5px solid #e0f2f1;
  border-left: 3px solid #e0f2f1;
  border-radius: 8px;
  animation: slotIn 0.25s ease-out;
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}

.slot-row:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

@keyframes slotIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Day Pills Row */
.slot-days-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.slot-days-row .slot-label {
  min-width: 38px;
}

.day-pills-wrap {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.day-pill {
  padding: 0.2rem 0.5rem;
  border-radius: 0.75rem;
  font-size: 0.65rem;
  font-weight: 700;
  border: 1.5px solid #e2e8f0;
  background: #f1f5f9;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.day-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.day-pill.active {
  font-weight: 800;
  transform: translateY(-1px);
}

/* "To" label between time inputs */
.slot-to-label {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  padding: 0 2px;
}

/* Times Row */
.slot-times-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.slot-time-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 100px;
}

.slot-time-separator {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  padding-bottom: 8px;
  flex-shrink: 0;
}

.time-input-styled {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}

.time-input-styled i {
  position: absolute;
  left: 8px;
  color: var(--primary);
  font-size: 11px;
  pointer-events: none;
}

.time-input-styled input {
  width: 100%;
  height: 1.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  padding: 0 0.5rem 0 1.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
  background: white;
  font-family: "Inter", monospace;
  letter-spacing: 0.01875rem;
  transition: all 0.2s;
}

.time-input-styled input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 137, 123, 0.08);
}

.time-input-styled input::placeholder {
  color: #b0bec5;
  font-weight: 500;
}

.slot-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* X Delete Button for Slots */
.btn-slot-x {
  background: transparent;
  color: #94a3b8;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-slot-x:hover {
  background: #fef2f2;
  color: #ef4444;
  transform: scale(1.15);
}

.btn-remove-slot {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 5px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-remove-slot:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* Required asterisk */
.required {
  color: var(--danger);
  font-weight: 800;
}

/* Toast styling */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transition: opacity 0.5s;
  min-width: 200px;
}

.toast-success {
  background: #10b981;
  color: white;
}

.toast-danger {
  background: #ef4444;
  color: white;
}

/* Doctor Name Style in Table */
.doc-name-cell {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 12.5px;
}

.doc-spec-badge {
  display: inline-block;
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  color: #e65100;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid #ffe0b2;
}

.doc-qual-text {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
}

/* =========== RESPONSIVE DOCTOR MODULE =========== */
@media (max-width: 1024px) {
  .doctors-module-header {
    flex-direction: column;
    align-items: stretch;
  }

  .doctors-header-right {
    flex-direction: row;
    width: 100%;
  }

  .doctors-search-wrap {
    flex: 1;
  }

  .doctors-search-wrap .form-control {
    width: 100% !important;
  }

  .doctor-data-table {
    min-width: 56.25rem;
    /* 900px */
  }
}

@media (max-width: 600px) {
  .doctors-header-right {
    flex-direction: column;
  }

  .doctors-search-wrap .form-control {
    width: 100% !important;
  }

  .btn-create-doctor {
    width: 100%;
    justify-content: center;
  }

  .day-pills-wrap {
    gap: 0.1875rem;
  }

  .day-pill {
    padding: 0.1rem 0.3rem;
    font-size: 0.55rem;
  }

  .slot-times-row {
    gap: 4px;
  }

  .slot-to-label {
    font-size: 8px;
  }

  .slot-time-group {
    min-width: unset;
  }

  .slot-time-group {
    min-width: unset;
  }

  .row-triple {
    grid-template-columns: 1fr;
  }

  .row-cols-2-1 {
    grid-template-columns: 1fr;
  }
}

/* Row double for completion modal */
.row-double {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9375rem;
}

.row-single {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9375rem;
}

/* ============================================
   UNIFORM TABLE STYLES - All modules match
   ============================================ */
.uniform-table {
  font-size: 12px;
}

.uniform-table thead th {
  background: #004d40 !important;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 0.65625rem;
  /* 10.5px */
  text-transform: uppercase;
  letter-spacing: 0.03125rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 0.125rem solid #00352d;
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
}

.uniform-table tbody tr {
  transition: background 0.15s;
}

.uniform-table tbody tr:nth-child(even) {
  background: #f0faf5;
}

.uniform-table tbody tr:hover {
  background: #e0f2f1 !important;
}

.uniform-table tbody td {
  padding: 0.5rem 0.75rem;
  border-bottom: 0.0625rem solid #f1f5f9;
  vertical-align: middle;
}

/* Sortable Table Headers */
.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.sortable-th:hover {
  color: #80cbc4;
}

.sort-arrow {
  font-size: 9px;
  margin-left: 3px;
  opacity: 0.5;
  transition: opacity 0.2s;
  color: rgba(255, 255, 255, 0.6);
}

/* Premium Table Pagination */
.pagination-premium {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #fff;
  border-top: 0.0625rem solid #f1f5f9;
  border-radius: 0 0 0.625rem 0.625rem;
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

.pagination-select {
  height: 1.875rem;
  padding: 0 0.5rem;
  border: 0.09375rem solid #e2e8f0;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e293b;
  outline: none;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color 0.2s;
}

.pagination-select:focus {
  border-color: var(--primary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-btn {
  width: 2.125rem;
  height: 2.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 0.09375rem solid #e2e8f0;
  border-radius: 0.5rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.8125rem;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-0.125rem);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 137, 123, 0.2);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f1f5f9;
}

.pagination-current {
  font-size: 0.75rem;
  font-weight: 800;
  color: #1e293b;
  min-width: 4rem;
  text-align: center;
}

/* Premium Action Icons */
.action-icon-group {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.action-btn {
  background: transparent;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0.375rem;
}

.action-btn i {
  font-size: 1.0625rem;
  /* ~17px */
}

.action-btn:hover {
  transform: scale(1.3);
}

.action-btn.btn-edit {
  color: #3b82f6;
}

.action-btn.btn-delete {
  color: #ef4444;
}

.action-btn.btn-whatsapp {
  color: #22c55e;
}

.action-btn.btn-view {
  color: var(--primary);
}

.action-btn.btn-complete {
  color: #10b981;
}

/* Patient Search Dropdown in Booking Modal */
.patient-search-dropdown {
  display: none;
  position: absolute;
  z-index: 500;
  background: white;
  width: 100%;
  left: 0;
  top: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  max-height: 150px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  margin-top: 2px;
  scrollbar-width: thin;
  scrollbar-color: #b2dfdb transparent;
}

.patient-search-dropdown::-webkit-scrollbar {
  width: 4px;
}

.patient-search-dropdown::-webkit-scrollbar-thumb {
  background: #b2dfdb;
  border-radius: 4px;
}

.patient-search-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.pat-search-item {
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid #f8fafc;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
  line-height: 1.3;
}

.pat-search-item:hover {
  background: #f0faf5;
}

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

.pat-search-new {
  background: #f0faf5;
  color: var(--primary);
  font-weight: 800;
  font-size: 10px;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
}

.pat-search-new:hover {
  background: #e0f2f1;
}

/* Doctor Status Toggle Switch */
.doc-toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

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

.doc-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #cbd5e1;
  border-radius: 20px;
  transition: 0.25s;
}

.doc-toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.25s;
}

.doc-toggle-switch input:checked + .doc-toggle-slider {
  background: var(--success);
}

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

/* Doctor Default Radio */
.doc-default-radio {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* WhatsApp Contact Link */
.wa-contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #25d366;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}

.wa-contact-link:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.4);
}

/* Dashboard Row Status — handled by VDC classes */

/* Status Pill Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 10px;
  text-transform: capitalize;
}

.status-pill.s-booked {
  background: #fef3cd;
  color: #856404;
}

.status-pill.s-completed {
  background: #d4edda;
  color: #155724;
}

.status-pill.s-cancelled {
  background: #f8d7da;
  color: #721c24;
}

/* Compact Doctor Modal Styles */
.modal-doctor .modal-card {
  width: 37.5rem;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-doctor .modal-body {
  overflow-y: auto;
  padding: 1rem;
}

.modal-doctor .form-group label {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.modal-doctor .form-control {
  height: 2rem;
  font-size: 0.75rem;
  padding: 0 0.5rem;
}

.doc-photo-preview-wrap {
  width: 4rem;
  height: 4rem;
}

/* Availability Slots Container - 2 column grid */
#availability-slots-container,
.availability-slots-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 16rem;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 8px;
  background: #f8fafb;
  scrollbar-width: thin;
  scrollbar-color: #b2dfdb transparent;
}

#availability-slots-container::-webkit-scrollbar {
  width: 5px;
}

#availability-slots-container::-webkit-scrollbar-thumb {
  background: #b2dfdb;
  border-radius: 4px;
}

#availability-slots-container::-webkit-scrollbar-track {
  background: transparent;
}

/* Compact slot-row overrides inside container */
.slot-row {
  margin-bottom: 0;
  padding: 8px 10px;
}

.slot-days-row {
  font-size: 0.62rem;
  margin-bottom: 3px;
  gap: 3px;
}

.day-pill {
  padding: 0.12rem 0.35rem;
  font-size: 0.58rem;
  border-radius: 0.625rem;
}

.slot-times-row {
  font-size: 0.65rem;
  gap: 6px;
  margin-top: 2px;
}

.slot-to-label {
  font-size: 9px;
}

.time-input-styled input {
  height: 1.5rem;
  font-size: 0.62rem;
  padding: 0 0.4rem 0 1.4rem;
}

.time-input-styled i {
  font-size: 0.58rem;
  left: 6px;
}

.btn-slot-x {
  width: 18px;
  height: 18px;
  font-size: 11px;
}

/* Responsive: 1 column on small screens */
@media (max-width: 600px) {
  #availability-slots-container,
  .availability-slots-container {
    grid-template-columns: 1fr;
  }
}

/* Doctor Legend - Enhanced with Photo and Details */
.legend-item-enhanced {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 0.0625rem solid transparent;
}

.legend-item-enhanced:hover {
  background: #f0faf5;
  border-color: #e0f2f1;
}

.legend-item-enhanced.active {
  background: #e0f2f1;
  border-color: var(--primary);
}

.legend-doc-photo {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  border: 0.09375rem solid #fff;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
}

.legend-doc-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.6875rem;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
}

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

.legend-doc-name {
  font-weight: 800;
  font-size: 0.7rem;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.legend-doc-detail {
  font-size: 0.58rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

/* Patient History Modal */
.history-section {
  margin-bottom: 1.25rem;
}

.history-section-title {
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 0.625rem;
  padding-bottom: 0.375rem;
  border-bottom: 0.09375rem solid #e0f2f1;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.history-visit-card {
  padding: 0.75rem 0.875rem;
  border: 0.0625rem solid #f1f5f9;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  transition: background 0.15s;
}

.history-visit-card:hover {
  background: #f8fffe;
}

.history-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0.125rem;
}

.history-file-chip:hover {
  background: #dbeafe;
}

/* Doctor table contact cell */
.doc-contact-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
}

.doc-contact-cell .doc-mobile {
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.doc-contact-cell .doc-email {
  font-size: 10.5px;
  color: #64748b;
}

/* Doc Select in Booking Modal */
.doc-select-styled {
  padding-left: 10px !important;
  font-weight: 600;
}

/* ---------------------------------------------------------
   Premium Toast Notification System
   --------------------------------------------------------- */
#toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.toast {
  background: #ffffff !important;
  color: #1e293b !important;
  padding: 0.875rem 1.25rem !important;
  border-radius: 0.625rem !important;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.12),
    0 0 1px rgba(0, 0, 0, 0.05) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  font-size: 0.8125rem !important;
  font-weight: 700 !important;
  min-width: 18.75rem !important;
  max-width: 25rem !important;
  animation: toast-slide-in 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transition: opacity 0.4s ease !important;
  border-left: 0.375rem solid #e2e8f0 !important;
  margin-bottom: 5px !important;
}

.toast i {
  font-size: 1.125rem !important;
}

.toast-success {
  border-left-color: #10b981 !important;
}

.toast-success i {
  color: #10b981 !important;
}

.toast-danger {
  border-left-color: #ef4444 !important;
}

.toast-danger i {
  color: #ef4444 !important;
}

.toast-info {
  border-left-color: #3b82f6 !important;
}

.toast-info i {
  color: #3b82f6 !important;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM CALENDAR MODULE — Practo / Google Calendar Style  
   ═══════════════════════════════════════════════════════════════ */

#calendar-root {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 8rem);
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  position: relative;
}

/* ── Header ── */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(
    180deg,
    rgba(236, 253, 245, 0.95) 0%,
    rgba(255, 255, 255, 1) 100%
  );
  border-bottom: 1px solid rgba(16, 185, 129, 0.18);
  flex-shrink: 0;
  gap: 14px;
  z-index: 20;
  box-shadow: 0 18px 40px rgba(16, 185, 129, 0.08);
}

.cal-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.cal-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.cal-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f766e;
  white-space: nowrap;
  margin: 0;
  letter-spacing: 0.03em;
}

.cal-nav-group {
  display: flex;
  align-items: center;
  background: #ecfdf5;
  border-radius: 10px;
  padding: 2px;
  gap: 1px;
}

.cal-nav-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 12px;
  transition: all 0.15s;
}

.cal-nav-btn:hover {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  color: var(--primary);
}

.cal-today-btn {
  height: 32px;
  padding: 0 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  transition: all 0.15s;
}

.cal-today-btn:hover {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  color: var(--primary);
}

/* Legend */
.cal-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 8px;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.cal-legend-name {
  font-size: 11px;
}

/* View Switcher */
.cal-view-switcher {
  display: flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 2px;
  gap: 1px;
}

.cal-view-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  transition: all 0.15s;
}

.cal-view-btn:hover {
  color: #334155;
}

.cal-view-btn.active {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.18);
  font-weight: 800;
}

/* Add Button */
.cal-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 137, 123, 0.3);
  transition: all 0.2s;
}

.cal-add-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(0, 137, 123, 0.4);
}

/* ── Body ── */
.cal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Loading */
.cal-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
}

.cal-loading i {
  font-size: 28px;
  color: var(--primary);
}

/* ── Time Grid (Day + Week) ── */
.cal-time-grid-wrapper {
  display: flex;
  flex: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.cal-time-grid-wrapper::-webkit-scrollbar {
  width: 6px;
}

.cal-time-grid-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.cal-time-grid-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

/* Gutter (time labels) */
.cal-gutter {
  width: 56px;
  min-width: 56px;
  position: relative;
  background: #fafbfc;
  border-right: 1px solid rgba(16, 185, 129, 0.4);
  flex-shrink: 0;
  padding-top: 0;
}

.cal-gutter-label {
  position: absolute;
  right: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #0f766e;
  transform: translateY(-50%);
  white-space: nowrap;
  text-align: right;
  letter-spacing: 0.02em;
}

/* Column area */
.cal-columns-scroll {
  flex: 1;
  height: 100%;
  overflow-x: auto;
  min-width: 0;
}

.cal-columns {
  display: flex;
  min-width: 100%;
  height: 100%;
}

.cal-day-col {
  flex: 1;
  min-width: 120px;
  border-right: 1px solid rgba(16, 185, 129, 0.4);
  display: flex;
  flex-direction: column;
}

.cal-day-col:last-child {
  border-right: none;
}

/* Day Header */
.cal-day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 6px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.3);
  background: #f4fffa;
  position: sticky;
  top: 0;
  z-index: 15;
}

.cal-day-name {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cal-day-num {
  font-size: 20px;
  font-weight: 800;
  color: #0f766e;
  line-height: 1.1;
}

.cal-today-header {
  background: #eff6ff !important;
  border-bottom-color: #bfdbfe !important;
}

.cal-today-num {
  color: #3b82f6 !important;
  position: relative;
}

.cal-today-num::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background: #3b82f6;
  border-radius: 50%;
}

.cal-sunday-col .cal-day-name {
  color: var(--danger);
}

/* Day Body (slot grid) */
.cal-day-body {
  position: relative;
  flex: 1;
}

.cal-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid rgba(16, 185, 129, 0.4);
  z-index: 1;
  pointer-events: none;
}

.cal-half-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed rgba(16, 185, 129, 0.3);
  z-index: 1;
  pointer-events: none;
}

/* Current Time */
.cal-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 3px solid #10b981;
  z-index: 12;
  pointer-events: none;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.22);
}

.cal-now-dot {
  position: absolute;
  left: -5px;
  top: -6px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

/* Clickable slot cells */
.cal-slot-cell {
  position: absolute;
  left: 0;
  right: 0;
  cursor: pointer;
  z-index: 0;
  transition: background 0.1s;
}

.cal-slot-cell:hover {
  background: rgba(16, 185, 129, 0.08);
}

/* Appointment Cards */
.cal-appt-card {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 6px;
  padding: 3px 6px;
  cursor: pointer;
  z-index: 10;
  overflow: hidden;
  transition:
    box-shadow 0.15s,
    transform 0.15s;
  border-top: none;
  border-right: none;
  border-bottom: none;
}

.cal-appt-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transform: translateX(1px);
  z-index: 11;
}

@keyframes cal-soft-blink {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.88; transform: scale(0.99); }
  100% { opacity: 1; transform: scale(1); }
}

.cal-appt-pending {
  animation: cal-soft-blink 2s infinite ease-in-out;
}

.cal-appt-cancelled {
  background: #fecaca !important;
  border-left: 4px solid #ef4444 !important;
  opacity: 1;
  pointer-events: none !important;
  cursor: default !important;
  box-shadow: none !important;
}

.cal-appt-cancelled .cal-appt-name,
.cal-appt-cancelled .cal-appt-time,
.cal-appt-cancelled .cal-appt-time i,
.cal-appt-cancelled div {
  color: #991b1b !important;
}

.cal-appt-completed {
  opacity: 0.45;
  filter: grayscale(0.4);
  cursor: default;
}

.cal-appt-time {
  font-size: 10px;
  font-weight: 800;
  color: #334155;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-appt-name {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-appt-doc {
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ── Month View ── */
.cal-month-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cal-month-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.cal-month-day-header {
  padding: 8px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #fafbfc;
}

.cal-sunday-text {
  color: var(--danger) !important;
}

.cal-month-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.cal-month-body::-webkit-scrollbar {
  width: 5px;
}

.cal-month-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.cal-month-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  flex: 1;
  min-height: 100px;
}

.cal-month-cell {
  border-right: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  padding: 4px 5px;
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cal-month-cell:last-child {
  border-right: none;
}

.cal-month-cell:hover {
  background: #f8fafc;
}

.cal-month-empty {
  background: #cbd5e1;
  cursor: default;
}

.cal-month-empty:hover {
  background: #cbd5e1 !important;
}

.cal-month-today {
  background: #f0fdf4 !important;
}

.cal-month-sunday {
  background: #fecaca;
}

.cal-month-date {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  text-align: right;
  padding: 2px 4px;
  line-height: 1;
}

.cal-month-date-today {
  color: #ffffff !important;
  background: var(--primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  font-size: 11px;
}

.cal-month-events {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 3px;
  overflow-y: auto;
}

.cal-month-events::-webkit-scrollbar {
  display: none;
}

.cal-month-appt {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity 0.15s;
  line-height: 1.4;
}

.cal-month-appt:hover {
  opacity: 0.8;
}

.cal-month-appt-done,
.cal-month-appt-completed {
  opacity: 0.4;
  filter: grayscale(0.5);
}

.cal-month-appt-pending {
  animation: cal-soft-blink 3s infinite ease-in-out;
}

.cal-month-appt-cancelled {
  background: #ef4444 !important;
  opacity: 0.8;
  pointer-events: none !important;
  text-decoration: line-through;
}

.cal-month-appt-time {
  font-weight: 800;
}

.cal-month-more {
  font-size: 10px;
  font-weight: 800;
  color: var(--primary);
  padding: 2px 4px;
  cursor: pointer;
}

/* ── Appointment Action Dropdown ── */
.cal-dropdown {
  position: fixed;
  z-index: 5001;
  background: #ffffff;
  border-radius: 10px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  width: 280px;
  overflow: hidden;
  animation: cal-dd-in 0.15s ease-out;
  /* right: 20px; */ /* Removed fixed right */
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes cal-dd-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cal-dd-header {
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.cal-dd-patient {
  font-size: 14px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}

.cal-dd-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.cal-dd-meta i {
  margin-right: 3px;
  font-size: 10px;
}

.cal-dd-symptoms {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  font-style: italic;
}

.cal-dd-symptoms i {
  margin-right: 3px;
}

.cal-dd-status {
  font-size: 10px;
  font-weight: 800;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cal-dd-actions {
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.cal-dd-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.15s;
}

.cal-dd-btn:hover:not(:disabled) {
  background: #f1f5f9;
}

.cal-dd-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cal-dd-complete {
  color: #10b981;
}

.cal-dd-reschedule {
  color: #3b82f6;
}

.cal-dd-cancel {
  color: #ef4444;
}

.cal-dd-payment {
  color: #f59e0b;
}

/* ── Calendar Responsive ── */
@media (max-width: 900px) {
  .cal-legend {
    display: none;
  }

  .cal-header {
    padding: 8px 12px;
  }

  .cal-title {
    font-size: 0.9rem;
  }

  .cal-view-btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  .cal-day-col {
    min-width: 80px;
  }
}

@media (max-width: 600px) {
  .cal-header {
    flex-wrap: wrap;
  }

  .cal-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .cal-gutter {
    width: 40px;
    min-width: 40px;
  }

  .cal-gutter-label {
    font-size: 8px;
    right: 4px;
  }
}

/* Fix calendar module display */
#module-calendar {
  display: none;
  width: 100%;
  flex: 1;
  min-height: 0;
}

#module-calendar.active {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#calendar-root {
  flex: 1;
  width: 100%;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: white;
  overflow: hidden;
}

#module-calendar.active,
#module-calendar[style*="display: flex"] {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  height: 100% !important;
}
