/*--------------------------------------------------------------
🧠 Fonts
--------------------------------------------------------------*/
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400&display=swap');

/*--------------------------------------------------------------
📊 LABS table
--------------------------------------------------------------*/

#labsTableWrapper {
  overflow-x: auto;
  max-width: 100%;
  position: relative;
}

.right-scroll-shadow {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 100%;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.08), transparent);
  pointer-events: none;
  z-index: 10;
}

.labs-table th:first-child,
.labs-table td:first-child {
  position: sticky;
  left: 0;
  background: rgb(248, 251, 253); /* match your table header */
  z-index: 2;
  white-space: nowrap;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05); /* subtle divider shadow */
	width: 200px;
	
}


.labs-table {
  border-collapse: collapse;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  table-layout: fixed;
  min-width: 800px;
  width: 100%;
  border: 1px solid #ccc;
}

.labs-table th,
.labs-table td {
  /* border: 1px solid #ccc; */
	border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  border-right: 1px solid #eee; /* 👈 fainter gray for vertical lines */
  padding: 6px 10px;
  text-align: center;
  min-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ✅ Restore fire header bg */
.labs-table th {
  background-color: rgb(248, 251, 253);
  font-weight: 600;
  color: #333;
}

/* ✅ Section label rows */
.labs-table td[colspan] {
  background-color: #eef7fd;
  font-weight: bold;
  text-align: left;
  color: #333;
}

/* ✅ Edit mode highlight */
.labs-table td.editing {
  background-color: #fff7d0 !important;
}

/* ✅ Flash green on save */
.labs-table td.saved {
  background-color: #c7f5c7 !important;
  transition: background-color 0.5s ease;
}

.labs-table td {
  background-color: white; /* 👈 ensures transition to green is visible */
}








/*--------------------------------------------------------------
📊 Tabs in the Consultation timeline and labs
--------------------------------------------------------------*/

.tab-controls {
  display: flex;
  gap: 8px;
}

.tab-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 2px solid #2E70CE;
  background-color: transparent;
  color: #2E70CE;
  font-weight: 400;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s ease;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 rgba(0,0,0,0); /* subtle inner shadow placeholder */
}

.tab-btn.active {
  background-color: rgba(46, 112, 206, 0.2); /* ivycare blue tint */
  color: #2E70CE;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}



/*--------------------------------------------------------------
📊 Reports & Charts
--------------------------------------------------------------*/
.report-layout {
  display: flex;
  gap: 30px;
  padding: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.report-sidebar {
  flex: 1;
  max-width: 300px;
  min-width: 220px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.92rem;
}

.report-chart-container {
  flex: 2;
  min-width: 300px;
}

.filter-group {
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid #e0e6f1;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  padding: 12px 14px;
}

.filter-group h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2E70CE;
  text-transform: capitalize;
}

.filter-options {
  max-height: 140px;
  overflow-y: auto;
  padding-right: 5px;
}

.filter-options::-webkit-scrollbar {
  width: 6px;
}

.filter-options::-webkit-scrollbar-thumb {
  background-color: #d0d0d0;
  border-radius: 3px;
}

.filter-options label {
  display: block;
  margin: 5px 0;
  cursor: pointer;
  white-space: nowrap;
}

/*--------------------------------------------------------------
🧑‍⚕️ Patient Cards & Grid
--------------------------------------------------------------*/
.patients-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px;
}

.patient-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
  background: #f6fbff;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.patient-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.photo-wrapper {
  width: 170px;
  height: 170px;
  border-radius: 12px;
  overflow: hidden;
  flex: none;
  display: flex;
}

.patient-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.patient-info {
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.patient-info h3 {
  margin: 0;
  font-weight: 400;
  font-size: 1.2em;
  color: #2678ab;
}

.patient-info .address {
  font-style: italic;
  color: #68a1cf;
  font-size: 0.85em;
  margin-bottom: 5px;
}

.patient-info p {
  margin: 2px 0;
  font-size: 0.85em;
  color: #444;
  font-weight: 300;
}

/*--------------------------------------------------------------
🔍 Top Bar Controls
--------------------------------------------------------------*/
.top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px;
  gap: 10px;
}

.search-and-add {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 220px;
}

.search-and-add input {
  padding: 10px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #68a1cf;
  flex: 1;
}

.search-and-add button {
  background-color: #3498db;
  border: none;
  border-radius: 8px;
  color: white;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.tab-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.tab-button {
  padding: 10px 18px;
  border-radius: 8px;
  border: 2px solid #2E70CE;
  background-color: white;
  color: #2E70CE;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.tab-button.tab-active {
  background-color: #2E70CE;
  color: white;
}

/*--------------------------------------------------------------
🪟 Modals
--------------------------------------------------------------*/
.modal-backdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: flex-start; /* this prevents cutoff */
  z-index: 1000;
  overflow-y: auto;
  padding: 40px 20px;
  box-sizing: border-box;
}


.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  overflow-y: auto;
  width: 95%;
  max-width: 700px;
  font-family: 'Poppins', sans-serif;
  margin-top: auto;
  margin-bottom: auto;
  max-height: calc(100vh - 80px); /* ensures breathing room */
  overflow-y: auto;
}

.modal.large .modal-content {
  padding: 2rem;
}

/*--------------------------------------------------------------
📄 Forms (Patient + Consultation)
--------------------------------------------------------------*/
.form-section,
.consultation-form .form-row {
  margin-bottom: 20px;
}

.form-section label,
.consultation-form label {
  display: block;
  margin-top: 10px;
  font-weight: 500;
  font-size: 0.95rem;
}

.form-section input,
.form-section select,
.form-section textarea,
.consultation-form input,
.consultation-form textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-top: 4px;
  font-size: 0.9rem;
}

.form-section textarea,
.consultation-form textarea {
  min-height: 60px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  cursor: pointer;
}

.modal-actions button[type="submit"] {
  background-color: #2678ab;
  color: white;
}

.modal-actions button[type="button"] {
  background-color: #ddd;
}

.vital-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.vital-group input {
  flex: 1 1 45%;
}

/*--------------------------------------------------------------
📁 Patient Detail Modal
--------------------------------------------------------------*/
.patient-detail-grid {
  display: flex;
  gap: 48px;
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  max-width: 1100px;
  width: 100%;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  font-family: system-ui, sans-serif;
  position: relative;
}

.patient-summary {
  flex: 1;
  min-width: 280px;
}

.consultation-history {
  flex: 2;
  min-width: 400px;
}

.photo-and-name {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

img.detail-photo {
  width: 140px !important;
  height: 140px !important;
  border-radius: 10% !important;
  object-fit: cover !important;
  border: 2px solid #ccc !important;
  flex-shrink: 0 !important;
}

.text-info h2 {
  font-size: 1.5rem;
  margin: 0;
}

.text-info p {
  margin: 4px 0;
  color: #444;
  font-size: 0.95rem;
}

.summary-block {
  margin-top: 24px;
}

.summary-block h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
  color: #2E70CE;
}

#timelineEntries {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.95rem;
  max-height: 90vh;
  overflow-y: auto;
  margin-top: 1rem;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  
}

.timeline-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #2E70CE;
}

#btnAddConsultation {
  background-color: #2E70CE;
  color: white;
  border: none;
  padding: 10px 16px;
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
  transition: 
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#btnAddConsultation:hover {
  background-color: #245aad;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}


.close-modal-btn {
  position: absolute;
  top: 15px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1rem;
  color: #444;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.close-modal-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/*--------------------------------------------------------------
🩺 Consultation Entries
--------------------------------------------------------------*/
.consultation-entry {
  padding: 1.2rem;
  background: #f6f8fa;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.consultation-entry.editing {
  background: #fdfdfd;
  border: 1px solid #ccc;
}

.consultation-grid {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  margin-top: 8px;
  flex-wrap: wrap;
  font-size: 1rem;
}

.consultation-grid > div {
  flex: 1 1 45%;
  min-width: 200px;
}

.consult-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.edit-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #555;
  transition: color 0.2s;
}

.edit-btn:hover {
  color: #000;
}

/*--------------------------------------------------------------
📱 Mobile Responsiveness
--------------------------------------------------------------*/
@media (max-width: 768px) {
  .report-layout,
  .report-sidebar,
  .report-chart-container,
  .patients-grid {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
  }

  .patients-grid {
    grid-template-columns: 1fr;
  }

  .patient-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .photo-wrapper {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1 / 1;
    margin-bottom: 10px;
  }

  .patient-photo {
    width: 100%;
    height: 100%;
  }

  .patient-info {
    align-items: center;
  }

  .filter-options {
    max-height: 200px;
  }
}

@media (max-width: 600px) {
  .tab-buttons {
    width: 100%;
    justify-content: center;
  }

  .top-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .search-and-add input {
    width: 100%;
  }

  #patientDetailModal {
    padding: 1rem;
  }

  #timelineEntries {
    max-height: 200px;
  }

  #patientDetailModal .patient-info h3 {
    font-size: 1rem;
  }

  #patientDetailModal .consultation-entry {
    font-size: 0.95rem;
  }
}


/*--------------------------------------------------------------
🖋 General Catch All styling
--------------------------------------------------------------*/
/* ️ Headings */
h2 {
  font-family: 'Poppins', sans-serif;
  font-weight: 200;
  font-size: 1.4rem; /* adjust to match rest of layout */
  line-height: 1.3;
  margin-bottom: 0.5em;
  color: #222; /* optional, for consistent dark tone */
}

/*Baseline Consultation Data font size and style */

#baselineConsultation p {
  font-size: 1rem;
  margin-bottom: 10px;
  line-height: 1.4;
}
#baselineConsultation strong {
  font-weight: 400;
}

#detailFH{
  font-size: 1rem;
}

#detailPMH{
  font-size: 1rem;
}

/*scrolling blocks in patient view*/

.scrollable-block {
  max-height: 180px; /* Adjust height as needed */
  overflow-y: auto;
  padding-right: 6px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.scrollable-block p {
  margin-bottom: 10px;
}

/* ma arte scrollbars para yayamanin */

/* 🌐 Global custom scrollbar styles for all scrollable areas */
* {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}


/* Nicer camera */

.photo-capture-card {
  margin-top: 20px;
  padding: 20px;
  background: #f6fbff;
  border: 1px solid #dbe8f5;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.photo-capture-card h4 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1rem;
  color: #2678ab;
}

.photo-preview-area {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#cameraStream,
#photoCanvas,
#photoPreview {
  display: none;
  width: 100%;
  max-width: 300px;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.photo-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.photo-button-group input[type="file"] {
  padding: 8px 12px;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #ffffff;
  cursor: pointer;
}

.photo-button-group button {
  background-color: #2E70CE;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.photo-button-group button:hover {
  background-color: #225aa3;
}




/* add patient button hover effect */

#btn_add_patient {
  background-color: #2E70CE;
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 
    background-color 0.2s ease, 
    box-shadow 0.2s ease, 
    transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
}

#btn_add_patient:hover {
  background-color: #245aad;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px); /* 👈 the smooth bump up */
}



/* inline edit PMH */

.edit-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #555;
  margin-left: 8px;
}

.edit-btn:hover {
  color: #000;
}

.btn-save, .btn-cancel {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
}

.btn-save {
  background-color: #2E70CE;
  color: white;
  margin-right: 8px;
}

.btn-cancel {
  background-color: #ddd;
}


/* textarea in inline edits more modern */

textarea.inline-edit {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-family: 'Poppins', sans-serif;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
  resize: vertical;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  font-weight: 300;
}

textarea.inline-edit:focus {
  outline: none;
  border-color: #2E70CE;
  box-shadow: 0 0 0 2px rgba(46, 112, 206, 0.15);
}

/* inline edit modern for consultation history */

.modern-field {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.modern-field:focus {
  border-color: #2E70CE;
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 112, 206, 0.2);
}

/* custom alert box */


#ivyAlertBox {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #d5f5e3; /* soft green */
  color: #1e5631; /* deep green text */
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  z-index: 9999;
  opacity: 0;
  transition: top 0.4s ease, opacity 0.4s ease;
}

#ivyAlertBox.show {
  top: 40px;
  opacity: 1;
}

/* classification flares */

.consult-badge-container {
	margin-top: 10px;
	display: flex;
	justify-content: flex-end;
}

.consult-badge {
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 600;
	color: white;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.badge-ambulatory {
	background-color: #62ade4;
}

.badge-urgentcare {
	background-color: #f59e0b; /* amber */
}

.badge-inpatientcare {
	background-color: #ef4444;
}

/* classification and census reports */

.report-section {
  margin: 20px auto;
  max-width: 600px;
  background: #f9fbfd;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.report-section h3 {
  margin-top: 0;
  color: #2e70ce;
  font-weight: bold;
}

.report-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.report-list li {
  padding: 6px 0;
  font-size: 1.1rem;
}


/* Report Rows side by side */

.report-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.report-row .report-section {
  flex: 1;
  min-width: 280px;
}

/* calendar navigation */

#calendarNav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#calendarMonthHeader {
  font-weight: bold;
}

/* test calendar view */

#calendarNav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

#calendarMonthHeader {
  font-weight: 400;
  font-size: 1.6rem;
  text-align: center;
  margin: 12px 0;
}


#prevMonth, #nextMonth {
  background-color: #eaf4fb;
  color: #2b4d38;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#prevMonth:hover,
#nextMonth:hover {
  background-color: #cde7d4;
}

#calendarGrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 0 10px;
}

.calendar-header {
  font-weight: 600;
  text-align: center;
  padding: 10px 0;
  background-color: #f0f4f2;
  border-bottom: 1px solid #ccc;
  border-radius: 6px;
  color: #4b6651;
}

.calendar-cell {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 6px;
  font-size: 0.85rem;
  min-height: 80px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.calendar-cell strong {
  font-weight: 600;
  margin-bottom: 4px;
  color: #2f4f39;
}

.calendar-cell span.no-activity {
  font-style: italic;
  color: #999;
}

.calendar-cell .classification-line {
  display: block;
  line-height: 1.3;
  margin: 0;
  padding: 0;
  color: #333;
  font-style: normal;
}

/* add pencil to photo in edit patient details */

.photo-edit-btn {
  position: absolute;
  bottom: 38px;   /* move it upward */
  right: 38px;    /* move it inward */
  background: #ffffff33; 
  border: none;
  border-radius: 50%;
  padding: 6px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: background 0.2s, transform 0.2s;
}

.photo-edit-btn:hover {
  background: #eaeaea;
  transform: scale(1.1);
}




