* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #334155;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.app-container {
  width: 100%;
  background: white;
  min-height: 100vh;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px;
  background: linear-gradient(to right, #003478, #4a6fa3);
  color: white;
  min-height: 20px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: max-content;
}

.logo {
  width: 32px;
  height: 32px;
}

.app-title {
  font-size: 28px;
  font-weight: 700;
  white-space: nowrap;
  min-width: max-content;
  letter-spacing: -0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
}

.header-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Doctor Icon Button Styles */
.doctor-icon-btn {
  padding: 8px !important;
  margin: 0 8px;
  overflow: visible;
  border-radius: 8px;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none !important;
  box-shadow: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

/* .doctor-icon-btn:hover {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
} */

.profile-icon svg {
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px;
}

.logout-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logout-btn:hover {
  background: #dc2626;
}

.logout-text {
  display: inline;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: none;
  backdrop-filter: blur(2px);
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.mobile-menu-overlay.active ~ * {
  pointer-events: none;
}

body.mobile-menu-open {
  overflow: hidden;
}

.mobile-menu-content {
  background: white;
  width: 280px;
  height: 100%;
  padding: 20px;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  position: relative;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-menu-overlay.active .mobile-menu-content {
  transform: translateX(0);
}

.mobile-menu-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.mobile-menu-close:hover {
  background: #f1f5f9;
}

.mobile-menu-nav {
  margin-top: 40px;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  background: none;
  border: none;
  color: #374151;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  border-radius: 8px;
}

.mobile-menu-item:hover {
  background: #f1f5f9;
}

.mobile-menu-item.active {
  background: #eff6ff;
  color: #3b82f6;
}

.mobile-menu-item svg {
  flex-shrink: 0;
}

/* Tabs */
.tabs {
  display: flex;
  background: white;
  border-bottom: 2px solid #f1f5f9;
  padding: 0 48px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tab {
  padding: 20px 32px;
  background: none;
  border: none;
  font-size: 17px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
  text-align: center;
  min-width: 180px;
}

.tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 80px;
  bottom: 0;
  width: 200px;
  background: linear-gradient(to bottom, #003478, #4a6fa3);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: block; /* Shown by default */
}

.sidebar-nav {
  padding: 20px 0;
}

/* Content */
.content {
  margin-left: 200px;
  margin-top: 80px;
  padding: 20px 20px;
  max-width: none;
  background: #fafbfc;
  min-height: calc(100vh - 160px);
}

.sidebar-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
}

.sidebar-tab:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-tab.active {
  background: rgba(255, 255, 255, 0.2);
  border-right: 3px solid #3b82f6;
}

.sidebar-tab svg {
  flex-shrink: 0;
}

.hamburger-btn {
  display: block;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hamburger-btn svg {
  display: block;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: start;
  align-items: center;
  margin-bottom: 32px;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 32px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
}

.search-container {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  background: white;
  transition: all 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  width: 20px;
  height: 20px;
}

.add-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.add-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.btn-secondary:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Muted disabled button style used across the extension */
.btn-disabled-muted {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none; /* prevent clicks */
}

/* Delete button style for inline modal actions */
.btn-delete {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}
.btn-delete:hover {
  background: #dc2626;
  transform: translateY(-1px);
}
/* spacing when delete sits next to other buttons */
.btn-delete {
  margin-right: 8px;
}

/* Small inline action buttons inside SOAP blocks/tables */
.soap-table-toolbar .edit-table-add,
.soap-table td .edit-table-edit {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.soap-table td .edit-table-edit {
  background: #64748b;
  color: #fff;
  border: none;
}
.soap-table td .edit-table-edit:hover {
  background: #4b5563;
}

/* Style applied to disabled buttons (attribute or class) */
button[disabled],
.btn-disabled-muted {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Filters */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: nowrap;
  align-items: center;
  background: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-select {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

#locationSelect {
  min-width: 150px;
  max-width: 200px;
}

#appointment-date-wrapper {
  min-width: 120px;
  max-width: 140px;
}

#appointmentDate {
  width: 100%;
}

/* .filter-select:focus {
  outline: none;
  border: none;
  box-shadow: none;
} */

.filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#appointmentDate:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

/* List Container */
.list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  max-height: none;
  padding: 0;
}

.referral-item,
.appointment-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 24px;
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  min-height: 120px;
}

.referral-item:hover,
.appointment-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
  border-color: #cbd5e1;
}

.checkin-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); /* Teal */
  color: white;
  border: none;
  border-radius: 5px;
  padding: 6px 15px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin: 5px;
  /* animate background, transform and shadow for a smooth hover effect */
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  height: fit-content;
}

.checkin-btn:hover {
  /* Slightly shift colors on hover for a subtle visual change */
  background: linear-gradient(135deg, #60a5fa, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(30, 64, 175, 0.12);
}

.check-in-view {
  padding: 1.5rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.check-in-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.check-in-header h2 {
  margin: 0;
  font-family: sans-serif;
  font-size: 15px;
}
.check-in-form .form-grid.small-textareas {
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}
.check-in-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  margin-top: 1.5rem;
  font-size: small;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

.content-main {
  flex: 1;
}

.name {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.pname {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}
.notes {
  font-size: 15px;
  color: #475569;
  margin-bottom: 8px;
  line-height: 1.6;
  font-weight: 400;
}

.status-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.status-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: default;
  text-transform: uppercase;
  background: #fff7e6;
  color: #92400e;
  border: 1px solid #fcd34d;
  min-width: 100px;
  text-align: center;
  white-space: nowrap;
  display: inline-block;
  letter-spacing: 0.5px;
}

.reason {
  padding: 4px 8px;
  align-self: flex-end;
  border: none;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 400;
  cursor: default;
  text-transform: uppercase;
}

.status-booked {
  background: #dcfce7;
  color: #166534;
}
.status-completed,
.status-confirmed {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.status-checked-in {
  background: #dbeafe;
  color: #0099ff;
  border: 1px solid #89b7ef;
}

.status-checked-out {
  background: #e0e7ff;
  color: #0052af;
  border: 1px solid #879ae4;
}

.status-contacted,
.status-need-action,
.status-rescheduled,
.status-no-show {
  background: #fed7d7;
  color: #dc2626;
  border: 1px solid #f49999;
}

.status-new {
  background: #fff7e6; /* very soft cream/yellow */
  color: #b45309; /* warm brown/orange text */
  border: 1px solid #fbbf24; /* subtle yellow border */
}

.reason-new-patient,
.status-default {
  background: #fff7e6; /* light warning background (soft yellow) */
  color: black; /* darker amber/orange text */
  border: 1px solid #fcd34d; /* subtle yellow border */
}

.reason-default {
  /* default gray style for unspecified reasons */
  background: #fff7ed; /* very light orange */
  color: black; /* dark orange/brown text */
  border: 1px solid #fed7aa; /* subtle orange border */
}

.reason-follow-up {
  /* light background, darker text and subtle border — matches .status-new style */
  background: #dcfce7; /* pale green */
  color: black; /* dark green text */
  border: 1px solid #bbf7d0; /* subtle green border */
}

.reason-injection {
  /* pale orange background with darker orange text and border */
  background: #fff7ed; /* very light orange */
  color: black; /* dark orange/brown text */
  border: 1px solid #fed7aa; /* subtle orange border */
}

.reason-new {
  /* pale purple background with deeper purple text and border */
  background: #f3e8ff; /* pale purple */
  color: #6b21a8; /* deep purple text */
  border: 1px solid #e9d5ff; /* subtle purple border */
}

/*Logout Modal*/
/* Logout Modal Styles */
#logoutModal .modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.btn-cancel {
  flex: 1;
  padding: 12px 20px;
  background: #f9fafb;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background: #fef2f2;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.btn-logout {
  flex: 1;
  padding: 12px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s;
}

.modal.show .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
  font-size: 14px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #9ca3af;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.close-btn:hover {
  background: #f3f4f6;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  padding: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s;
}

/* Flatpickr / custom date input styling - single bordered container with icon inside */
.flatpickr {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden; /* keep the icon inside the rounded corners */
  background: #fff;
  height: auto;
  flex-shrink: 0;
}

.flatpickr input[data-input],
.flatpickr .flatpickr-alt-input {
  flex: 1;
  padding: 8px 10px !important;
  border: none;
  font-size: 14px;
  background: transparent;
  color: #0f172a;
}

.flatpickr input[data-input]::placeholder,
.flatpickr .flatpickr-alt-input::placeholder {
  color: #94a3b8;
}

/* calendar toggle appears as an inset icon with a separator */
.flatpickr .input-button {
  background: transparent;
  border: none;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-left: 1px solid #e6e9ee; /* subtle separator */
  flex-shrink: 0;
}

.flatpickr .input-button svg {
  width: 16px;
  height: 16px;
  color: #475569;
}

.flatpickr .input-button:active {
  transform: translateY(1px);
}

.flatpickr:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.06);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.phone-input {
  display: flex;
  gap: 8px;
}

.phone-input select,
.phone-input input {
  flex: 1;
}

.full-width {
  grid-column: 1 / -1;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

/* Updated .submit-btn in style.css for centering */
.submit-btn {
  width: auto;
  max-width: 200px;
  padding: 16px 32px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin: 24px auto 0;
  margin-bottom: 20px;
  display: block;
  text-align: center;
}

.submit-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Add to style.css for .btn-primary if needed */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 16px;
}

.btn-primary:hover {
  background: #2563eb;
}

/* Modal button alignment - make both buttons consistent size */
.modal-body .btn-primary,
.modal-body .checkin-btn {
  width: auto;
  padding: 12px 20px;
  margin: 0;
  font-size: 14px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-body .checkin-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  font-weight: 600;
}

.modal-body .checkin-btn:hover {
  background: linear-gradient(135deg, #60a5fa, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(30, 64, 175, 0.12);
}

.required {
  color: #ef4444;
}

.error-message {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
}

/* Loader */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Appointment Card - Intake Progress */
.intake-progress {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  width: 100%;
}

/* .progress-label {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 4px;
  display: block;
} */

.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
  min-width: 30px;
  text-align: right;
}

/* Responsive Design */
/* Override previous tablet behavior for section-header */
@media (max-width: 768px) {
  /* Force section-header to stay horizontal with wrapping */
  .section-header {
    flex-direction: row !important; /* Override any column forcing */
    flex-wrap: wrap; /* Allow buttons to wrap to next line if needed */
    justify-content: flex-start; /* Left-align items */
    align-items: center;
    gap: 12px 16px; /* Row gap 12px, column gap 16px */
    padding: 16px 20px;
  }

  /* Make action buttons more compact but not full-width */
  #addReferralBtn,
  #uploadPdfBtn {
    flex: 0 1 auto; /* Don't grow, shrink if needed */
    min-width: 140px; /* Prevent too small */
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
  }

  /* Refresh button: keep it aligned to the right on the same row if space allows */
  #refreshReferralBtn {
    margin-left: auto; /* Push to the right */
    order: 3; /* Ensure it appears last in flex order */
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
  }

  /* If buttons wrap, ensure refresh stays right-aligned on its row */
  .section-header > *:not(#refreshReferralBtn) {
    flex: 1 1 200px; /* Allow buttons to grow/shrink reasonably */
    max-width: 300px;
  }
}


/* Optional: Improve header on very small screens */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
    justify-content: space-between;
  }

  .header-left {
    gap: 8px;
    flex: 1;
  }

  .app-title {
    font-size: 16px;
  }

  .logo {
    width: 20px;
    height: 20px;
  }

  .header-right {
    gap: 4px;
    flex-shrink: 0;
  }

  .logout-btn {
    padding: 6px 8px;
    font-size: 12px;
  }

  .sidebar {
    width: 160px;
    display: block;
  }

  .content {
    margin-left: 160px;
    margin-top: 80px;
  }
}

/* Only on very small phones (<550px), go full column */
@media (max-width: 550px) {
  .section-header {
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;
  }

  #addReferralBtn,
  #uploadPdfBtn {
    width: 100%;
    min-width: auto;
  }

  #refreshReferralBtn {
    margin-left: 0;
    align-self: flex-end; /* Still push refresh to right */
    order: 0;
  }
}

/* Hide sidebar on very small screens */
@media (max-width: 480px) {
  .hamburger-btn {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .header {
    padding: 12px 16px;
    justify-content: space-between;
  }

  .header-left {
    gap: 6px;
    flex: 1;
    min-width: 0;
  }

  .header-right {
    gap: 6px;
    flex-shrink: 0;
  }

  .app-title {
    font-size: 14px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .logo {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .sidebar {
    display: none;
  }

  .logout-btn {
    background: none;
    padding: 8px;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .logout-text {
    display: none;
  }

  .filters {
    padding: 12px;
  }

  .content {
    margin-left: 0;
    margin-top: 80px;
  }
  }
}

@media (max-width: 480px) {
  .header-right {
    gap: 8px;
  }

  .logout-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .filters {
    /* flex-direction: column; */
    gap: 5px;
  }

  .filter-select {
    max-width: 100px;
  }
}

.modal-body {
  padding: 0 24px 24px;
}

/* New: Two-column layout for referral details */
.detail-grid {
  display: grid;
  grid-template-columns: min-content 1fr;
  gap: 4px 0px;
  margin-bottom: 16px;
  align-items: start;
}

.detail-row {
  display: contents;
}

.detail-row strong {
  color: #374151;
  font-weight: 600;
  font-size: 14px;
  padding-right: 0px;
  white-space: nowrap;
}

.detail-row span {
  color: #6b7280;
  font-size: 14px;
  word-break: break-word;
  line-height: 1.5;
}

.modal-body h3 {
  margin-bottom: 16px;
  color: #1f2937;
  font-size: 1.25rem;
  font-weight: 600;
  grid-column: 1 / -1; /* Full width for h3 if needed */
}

.modal-body p {
  margin: 8px 0;
  color: #6b7280;
}

.modal-body strong {
  color: #374151;
  min-width: 140px;
  display: inline-block;
}

.icon-btn {
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.3s;
  flex-shrink: 0;
  min-height: 44px;
  min-width: 44px;
}

.icon-btn:hover {
  background-color: #e2e8f0;
  border-color: #cbd5e1;
  color: #334155;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Provider Priorities Section - Optimized */
#provider-priorities-section {
  padding: 0;
}

/* Header - Compact */
#provider-priorities-section .section-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 16px;
  padding: 0;
}

#provider-priorities-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

/* Refresh Button - Compact */
#refreshPriorityBtn {
  display: flex;
  align-items: center;
  gap: 6px;
  /* background: #3b82f6; */
  color: black;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 13px;
}

/* #refreshPriorityBtn:hover {
  background: #2563eb;
} */

/* Table Container - Remove Extra Padding */
#priorityTableContainer {
  background: #ffffff;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow-x: auto;
  width: 100%;
  display: block;
  border: 1px solid #e2e8f0;
}

/* Table - Compact Design */
.priority-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.priority-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.priority-table th {
  text-align: left;
  padding: 10px 12px;
  color: #475569;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
  border-bottom: 2px solid #e2e8f0;
}

.priority-table td {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

/* Remove bottom border from last row */
.priority-table tbody tr:last-child td {
  border-bottom: none;
}

/* Hover Effect */
.priority-table tbody tr {
  transition: background 0.15s ease;
}

.priority-table tbody tr:hover {
  background: #f8fafc;
}

/* Column Specific Styling */
.col-id {
  width: 60px;
  text-align: center;
  font-weight: 600;
  color: #64748b;
  font-family: "Courier New", monospace;
}

.col-name {
  font-weight: 500;
  color: #0f172a;
  min-width: 180px;
}

.col-loc_name {
  color: #475569;
  min-width: 150px;
}

/* Priority Badge - Compact */
.priority-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  font-weight: 600;
  font-size: 11px;
  text-align: center;
  min-width: 28px;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

/* Loader - Compact */
#priorityLoader {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0;
  color: #64748b;
}

#priorityLoader .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #dbeafe;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}

/* Empty State - Compact */
#priorityEmptyState {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 14px;
}

/* Responsive - Mobile Optimization */
@media (max-width: 768px) {
  #priorityTableContainer {
    border-radius: 6px;
    margin: 4px;
  }

  .priority-table {
    font-size: 13px;
  }

  .priority-table th {
    padding: 8px 10px;
    font-size: 11px;
  }

  .priority-table td {
    padding: 8px 10px;
  }

  /* .col-name {
    min-width: 100px;
  }

  .col-loc_name {
    min-width: 120px;
  } */
}

@media (max-width: 480px) {
  #provider-priorities-section .section-header {
    margin-bottom: 12px;
  }

  #provider-priorities-section h2 {
    font-size: 16px;
  }

  .priority-table {
    font-size: 12px;
    min-width: 400px;
  }

  .priority-table th,
  .priority-table td {
    padding: 8px;
  }

  .col-id {
    width: 50px;
    font-size: 11px;
  }

  #priorityLoader {
    padding: 30px 0;
  }

  #priorityEmptyState {
    padding: 30px 16px;
  }

  .tab {
    /* max-width: 150px; */
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    text-align: center;
  }
}

/* WebSocket Status Indicator */
.ws-status-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 20px;
  padding: 6px 12px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.ws-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
  transition: all 0.3s ease;
}

/* Disconnected State - Red */
.ws-status-dot.ws-disconnected {
  background-color: #f44336;
  box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
}

/* Connecting State - Yellow */
.ws-status-dot.ws-connecting {
  background-color: #ff9800;
  box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
  animation: pulse-yellow 2s infinite;
}

/* Connected State - Green with Pulse */
.ws-status-dot.ws-connected {
  background-color: #4caf50;
  box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  animation: pulse-green 2s infinite;
}

.ws-status-text {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
}

/* Pulse Animation for Connected */
@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

/* Pulse Animation for Connecting */
@keyframes pulse-yellow {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 152, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 152, 0, 0);
  }
}

/* Responsive: Hide text on small screens */
@media (max-width: 768px) {
  .ws-status-text {
    display: none;
  }

  .ws-status-container {
    padding: 6px;
    margin-left: 10px;
  }
}

/* === SOAP COLLAPSIBLE SECTIONS === */
#soap-sections {
  margin: 24px 0;
}

.soap-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.soap-toggle {
  width: 100%;
  padding: 14px 16px;
  background: #f8fafc;
  border: none;
  text-align: left;
  font-weight: 600;
  font-size: 15px;
  color: #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.soap-toggle:hover {
  background: #f1f5f9;
}

.soap-toggle .chevron {
  transition: transform 0.2s;
}

.soap-content {
  padding: 16px;
  background: white;
  border-top: 1px solid #e5e7eb;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
}

.cms-block {
  margin-bottom: 16px;
}

.cms-block strong {
  color: #1e293b;
  display: block;
  margin-bottom: 6px;
}

.cms-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 13px;
}

.cms-table th,
.cms-table td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
}

.cms-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
}

.flag-abnormal {
  color: #dc2626;
  font-weight: 600;
}

.hidden-textarea {
  display: none !important;
}
.care-plan-list {
  list-style-type: disc;
  padding-left: 20px;
}

.no-intake {
  font-style: italic;
  color: red;
}

/* AI Generate Button Container */
.generate-button-container {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  gap: 12px;
  margin-top: 12px;
}

/* Main AI Generate Button */
.ai-generate-btn {
  padding: 12px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  min-height: 44px;
  box-sizing: border-box;
}

/* Button Content Wrapper */
.btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* AI Label Badge */
.ai-label {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Shimmer Effect Removed */

/* Hover State */
.ai-generate-btn:hover {
  background: #2563eb;
}

.ai-generate-btn:hover .sparkle-icon {
  animation: sparkleRotate 1s ease-in-out infinite;
}

/* Active/Click State */
.ai-generate-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Loading State (Optional) */
.ai-generate-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.ai-generate-btn.loading .sparkle-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Disabled State */
.ai-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Send Appointment Button */
.send-appointment-btn {
  padding: 12px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  min-height: 44px;
  box-sizing: border-box;
}

.send-appointment-btn:hover {
  background: #2563eb;
}

/* Responsive Adjustments */
@media screen and (max-width: 480px) {
  .ai-generate-btn {
    font-size: 14px;
    padding: 10px 18px;
    min-width: 120px;
    max-width: 180px;
  }

  .ai-label {
    font-size: 10px;
    padding: 1px 5px;
  }

  .sparkle-icon {
    width: 16px;
    height: 16px;
  }
}

@media screen and (max-width: 360px) {
  .generate-button-container {
    justify-content: center;
  }

  .ai-generate-btn {
    font-size: 13px;
    padding: 8px 16px;
  }
}

/* Reuse existing .modal but force display */
#attorneyModal {
  z-index: 1001;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

#attorneyModal .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%; /* ← Ensure full width */
}

#attorneyModal .modal-content {
  animation: fadeIn 0.3s ease;
  width: 90%;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Style inputs to match your theme */
#attorneyModal input,
#attorneyModal .form-group select {
  width: 100% !important;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

#attorneyModal input:focus,
#attorneyModal .form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Attorney checkbox specific styles - override general input styles */
.attorney-checkbox-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  margin: 12px 0 16px 0 !important;
  padding: 2px 3px !important;
  width: auto !important;
  max-width: fit-content !important;
}

.attorney-checkbox-row input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  background: #fff !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}

.attorney-checkbox-row label {
  margin: 0 !important;
  padding: 0 2px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #374151 !important;
  cursor: pointer !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal .modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 90%;
  animation: modalPop 0.3s ease;
}

@keyframes modalPop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* PDF Viewer Modal */
#cmsPdfModal .modal-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

#cmsPdfModal .modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#cmsPdfModal .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

#cmsPdfModal .modal-body {
  flex: 1;
  overflow: hidden;
}

#cmsPdfFrame {
  display: block;
}

/* settings view styles */
#settingsView {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#settingsView .section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.5rem;
}

#settingsView .table-container {
  flex: 1;
  overflow: auto;
  margin-top: 0;
}

.loader,
.empty-state {
  text-align: center;
  padding: 2rem;
  color: #666;
}

/* auth loader */
/* Auth Loader Styles */
.auth-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(to right, #003478, #4a6fa3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.auth-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.auth-loader-content {
  text-align: center;
  color: white;
}

.auth-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #3498db;
  border-radius: 50%;
  animation: auth-spin 1s linear infinite;
  margin: 0 auto 24px;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-loader-content h2 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: white;
}

.auth-loader-content p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

select:invalid {
  color: #888;
}

select option {
  color: #000;
}

/* SOAP styles */
.soap-block {
  margin: 8px 0 12px;
  padding: 6px 8px;
  border-left: 3px solid #e2e8f0;
  background: #fafafa;
  border-radius: 4px;
  overflow-x: auto;
  max-width: 100%;
}
.soap-block > strong {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: #0f172a;
}
.soap-subblock {
  margin: 6px 0;
}
.soap-subblock > strong {
  display: block;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}
.soap-list {
  margin: 6px 0 6px 18px;
  padding: 0;
}
.soap-list li {
  margin: 4px 0;
}
.soap-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  table-layout: auto;
}
.soap-table thead th {
  text-align: left;
  padding: 8px 10px;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.soap-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: top;
  word-break: break-word;
  white-space: normal;
}
.soap-content p {
  margin: 6px 0;
  color: #0f172a;
}
.ai-generate-btn.loading {
  opacity: 0.7;
  cursor: progress;
}
.soap-block pre {
  background: #f8fafc;
  padding: 8px;
  border-radius: 4px;
  overflow: auto;
}
@media (max-width: 600px) {
  .header {
    padding: 10px 8px;
    min-height: 0;
    flex-wrap: nowrap;
    gap: 0;
    justify-content: space-between;
    align-items: center;
  }
  .header-left {
    gap: 4px;
    min-width: 0;
    flex: 1 1 0%;
    align-items: center;
    flex-wrap: nowrap;
  }
  .logo {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  .app-title {
    font-size: 13px;
    min-width: 0;
    flex: 1 1 0%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0;
  }
  .header-right {
    gap: 4px;
    flex-shrink: 0;
    flex-wrap: nowrap;
  }
  .logout-btn {
    padding: 6px;
    border-radius: 4px;
    min-width: unset;
    font-size: 0;
  }
  .logout-btn svg {
    width: 18px;
    height: 18px;
  }
  .logout-text {
    display: none;
  }
}

/* Disabled error state for Check In button when backend returns HTTP 500 */
#check-in.disabled-error,
.btn-primary.disabled-error {
  background: #b91c1c; /* dark red */
  border-color: #991b1b;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.9;
}
#check-in.disabled-error[title] {
  cursor: not-allowed;
}

/* Disabled success state: used after successful send to indicate checked-in state */
#check-in.disabled-success,
.btn-primary.disabled-success {
  background: #059669; /* emerald */
  border-color: #047857;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 0.95;
}

#check-in.disabled-success[title] {
  cursor: not-allowed;
}

/* Prefill loader overlay inside check-in view */
.prefill-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  z-index: 9999;
}
.prefill-loader .spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 8px;
}
.prefill-loader .prefill-text {
  color: #0f172a;
  font-weight: 600;
  margin-top: 8px;
  text-align: center;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .header {
    padding: 20px 32px;
  }

  .content {
    padding: 32px 32px;
  }

  .section-header {
    padding: 20px 24px;
  }

  .list-container {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 16px 20px;
    flex-direction: column;
    gap: 16px;
    min-height: auto;
  }

  .app-title {
    font-size: 24px;
  }

  .tabs {
    padding: 0 20px;
  }

  .tab {
    padding: 16px 20px;
    font-size: 16px;
    min-width: auto;
    flex: 1;
  }

  .content {
    padding: 24px 20px;
  }

  .section-header {
    padding: 16px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .list-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .referral-item,
  .appointment-card {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 12px 16px;
  }

  .content {
    padding: 20px 16px;
  }

  .section-header {
    padding: 16px;
    margin-bottom: 20px;
  }

  .avatar {
    width: 48px;
    height: 48px;
    font-size: 16px;
  }

  .name {
    font-size: 15px;
  }

  .notes {
    font-size: 14px;
  }
}

/* Responsive sidebar adjustments */
@media (max-width: 768px) {
  .sidebar {
    width: 160px;
  }

  .content {
    margin-left: 160px;
  }
}

@media (max-width: 480px) {
  .hamburger-btn {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .content {
    margin-left: 0;
  }
}
