/*Dental page*/
.layout_dental_container {
  min-width: 500px;
  overflow-y: hidden;
  overflow-x: auto;

}

.layout_dental_header {
  font-weight: 700;

}

.layout_dental_rows_container {
  overflow-y: auto;
  overflow-x: hidden;
  /* reduce height so navigation fits on page and allow responsive max */
  height: 240px;
  max-height: 60vh;
  min-width: 800px;
}

.layout_dental_archive_rows_container {
  overflow-y: auto;
  overflow-x: hidden;
  height: 600px;
  min-width: 800px;
}


/*Dental table header*/
/*columns
Date,Code,Diagnosis,Type,TP,Tooth,Surface,Region,Description,Status,DocID,TreatingProv,BillingProv,SupervisingProv,Ticket*/
.dental-row {
  font-size: var(--fs-100);
  display: grid;
  grid-template-columns: 20px 100px 75px 100px 50px 50px 50px 50px 50px 200px 100px 130px 130px 160px 75px;
  align-items: center;
  /* Use rem so header/value gaps match even with different font-sizes */
  gap: 1rem;
  min-height: 35px;
  box-sizing: border-box;
  padding-left: .25rem;
}

/* Match data row font styling to header/theme */
.dental-row,
.dental-notes-row,
.dental-action-row {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  color: var(--fc-main);
  font-size: var(--fs-100);
}

/* Ensure the dental table header stays visible below the DentalHeader (height: 375px) */
.layout_header.dental-row {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 600;
  color: white;
  transition: all 0.2s ease;
  position: sticky;
  top: 0;
  z-index: 100;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.875rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  left: 0;
  gap: 1rem;
  box-sizing: border-box;
}

/* Override global .sortdiv padding that shifts header text */
.layout_header.dental-row .sortdiv {
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

.layout_header.dental-row div {
  display: flex;
  align-items: center;
  /* gap: 0.5em; */
  justify-content: flex-start;
  text-align: left;
  box-sizing: border-box;
}

/* Match header styling for Notes/Alerts table to the main dental table */
.layout_header.dental-notes-row,
.layout_header.dental-action-row {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: white;
  transition: all 0.2s ease;
  /* not sticky since these are smaller sub-tables */
  letter-spacing: 0.025em;
  text-transform: none;
  font-size: 0.875rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.layout_header.dental-notes-row div {
  display: flex;
  align-items: center;
  gap: 0.5em;
  justify-content: flex-start;
  text-align: left;
}

.dental-row div:nth-child(3),
.dental-row div:nth-child(4),
.dental-row div:nth-child(6),
.dental-row div:nth-child(7),
.dental-row div:nth-child(10),
.dental-row div:nth-child(12),
.dental-row div:nth-child(13),
.dental-row div:nth-child(14),
.dental-row div:nth-child(15) {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.dental-row div:nth-child(3),
.dental-row div:nth-child(4),
.dental-row div:nth-child(6),
.dental-row div:nth-child(7),
.dental-row div:nth-child(10):hover,
.dental-row div:nth-child(12):hover,
.dental-row div:nth-child(13):hover,
.dental-row div:nth-child(14):hover,
.dental-row div:nth-child(15) {
  cursor: pointer;
}

.disablelink {
  cursor: default;
  pointer-events: none;
  color: lightgrey;
}

.dental-row.inactive {
  color: var(--fc-inactive);
}

/**DentalArchiveRow*/
.dentalarchive-row {
  font-size: var(--fs-100);
  display: grid;
  grid-template-columns: 20px 65px 75px 50px 50px 50px 50px 50px 200px 100px 130px 130px 160px 75px;
  align-items: center;
  gap: 1em;
  min-height: 35px;
  font-size: var(--fs-100);
  padding-left: 10px;
}

.dentalarchive-row div:nth-child(3),
.dentalarchive-row div:nth-child(5),
.dentalarchive-row div:nth-child(6),
.dentalarchive-row div:nth-child(8),
.dentalarchive-row div:nth-child(10),
.dentalarchive-row div:nth-child(11),
.dentalarchive-row div:nth-child(12),
.dentalarchive-row div:nth-child(13),
.dentalarchive-row div:nth-child(14) {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/*center header text*/
.dental-row[data-header="true"] div:nth-child(5) {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Type header is a .sortdiv (#type) and needs an explicit center override */
.layout_header.dental-row #type {
  justify-content: center !important;
  text-align: center;
  width: 100%;
  position: relative;
}

/* Keep the sort icon from skewing the centered label */
.layout_header.dental-row #type .sort-arrow,
.layout_header.dental-row #type .sort-arrow-placeholder {
  position: absolute;
  right: 0.25rem;
}

/* Center Tooth column (header + values) */
.dental-row[data-header="true"] div:nth-child(7),
.dental-row[data-header="false"] div:nth-child(7) {
  display: flex;
  justify-content: start;
  align-items: center;
  text-align: center;
}

/*center header text and change background color*/
.dental-row[data-header="false"] div:nth-child(5) {
  display: flex;
  justify-content: center;
  align-items: center;
}

.dental-row[data-header="false"] div:nth-child(5) div {
  text-align: center;
  height: 25px;
  width: 25px;
  border-radius: 5px;
}

/* Table summary and nav styling */
.dental-table-summary {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  color: var(--fc-main);
  font-size: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--table-bg);
  border-bottom: 1px solid var(--table-border);
  font-weight: 500;
  letter-spacing: 0;
}

.darkmode .dental-table-summary {
  background: var(--table-row);
  color: var(--table-fc);
  border-bottom-color: var(--table-border);
}

.dental-table-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  background: var(--table-bg);
  border-top: 1px solid #e5e7eb;
  gap: 1rem;
  flex-shrink: 0;
  z-index: 200;
  position: relative;
}


.dental-table-nav>div:last-child {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-left: auto;
}

.dental-nav-btn {
  background: #7c3aed;
  color: white;
  border: 1px solid #7c3aed;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-weight: 500;
}

.dental-nav-btn:hover {
  background: #6d28d9;
  color: white;
  border-color: #6d28d9;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dental-nav-btn:hover i {
  color: white;
}

.dental-nav-btn:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 2px 4px var(--card-shadow);
}

.dental-nav-btn:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.dental-nav-btn:disabled:hover {
  background: #e5e7eb;
  color: #9ca3af;
  box-shadow: none;
  transform: none;
  scale: 1;
}

.dental-nav-btn:disabled i {
  color: #9ca3af;
}

.dental-nav-btn:disabled:hover i {
  color: #9ca3af;
}

.dental-nav-btn i {
  color: white;
}

.dental-table-nav span {
  color: #374151;
  font-weight: 500;
  min-width: 2em;
  text-align: center;
  font-size: 0.875rem;
}

/* ensure space for sticky nav so it isn't overlapped */
.dental-table-wrapper {
  display: block;
  height: calc(100% - 48px) !important;
}

/* Make dental rows container scrollable with a fixed height so scrollbar appears and nav stays visible */
.dental-table-wrapper .layout_dental_rows_container {
  overflow-y: auto;
  height: 240px;
  max-height: 60vh;
}

/* DentalArchive specific wrapper styling: full-height card with shadow and rounded corners */
.dental-archive-wrapper {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.06);
  padding: 0.5rem;
}

.dental-archive-wrapper .layout_container {
  height: calc(100% - 8px);
  display: flex;
  flex-direction: column;
}

.dental-archive-wrapper .layout_dental_rows_container {
  /* fill remaining space inside the archive wrapper */
  flex: 1 1 auto;
  height: auto;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

/* Notes/Alerts specific wrapper: fill parent height and show card styling when displayed */
.dental-notes-wrapper {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.10);
  border: 1px solid rgba(124, 58, 237, 0.06);
  padding: 0.5rem;
  height: 100%;
  box-sizing: border-box;
  min-height: 0;
}

.dental-notes-wrapper .layout_container {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dental-notes-wrapper .layout_dental_rows_container {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  /* allow flex child to shrink within parent */
  overflow-y: auto;
}

/* When shown inside the note modal, constrain wrapper height to modal size */
.note-container-style .dental-notes-wrapper {
  max-height: calc(100% - 24px);
}

/* Dedicated container for modal Notes/Alerts to avoid touching global layout_container */
.dental-modal-container {
  display: flex;
  flex-direction: column;
  height: calc(100% - 24px);
  min-height: 0;
}

.dental-modal-container .layout_dental_rows_container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.note-container-style .dental-modal-container {
  height: calc(100% - 48px);
}

/* When displayed inside the dental overlay/chart, ensure the layout_container and rows
   fit within the overlay and do not exceed its height (applies to Notes and Alerts) */
#dentaltoothchart .dental-notes-wrapper .layout_container,
#dentaltoothchart .dental-archive-wrapper .layout_container {
  height: calc(100% - 48px);
  /* leave room for summary/header */
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#dentaltoothchart .dental-notes-wrapper .layout_dental_rows_container,
#dentaltoothchart .dental-archive-wrapper .layout_dental_rows_container {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow-y: auto;
}

/* Extra constraints when inside the overlay to prevent any flex children from overflowing */
#dentaltoothchart .dental-notes-wrapper .layout_container,
#dentaltoothchart .dental-archive-wrapper .layout_container {
  max-height: calc(100% - 64px);
  overflow: hidden;
}

#dentaltoothchart .dental-notes-wrapper .layout_dental_rows_container,
#dentaltoothchart .dental-archive-wrapper .layout_dental_rows_container {
  max-height: calc(100% - 96px);
  overflow-y: auto;
}



/* Custom scrollbar for dental rows to match purple color scheme */
.layout_dental_rows_container::-webkit-scrollbar,
.layout_container::-webkit-scrollbar {
  width: 10px;
}

.layout_dental_rows_container::-webkit-scrollbar-track,
.layout_container::-webkit-scrollbar-track {
  background: var(--table-scroll-track);
  border-radius: 6px;
}

.layout_dental_rows_container::-webkit-scrollbar-thumb,
.layout_container::-webkit-scrollbar-thumb {
  background: var(--table-scroll-thumb);
  border-radius: 6px;
  border: 2px solid var(--table-scroll-track);
}

.layout_dental_rows_container::-webkit-scrollbar-thumb:hover,
.layout_container::-webkit-scrollbar-thumb:hover {
  background: var(--table-scroll-thumb-hover);
}

/* Firefox scrollbar settings */
.layout_dental_rows_container,
.layout_container {
  scrollbar-width: auto;
  scrollbar-color: var(--table-scroll-thumb) var(--table-scroll-track);
}

/* Firefox hover approximation (Firefox can't style thumb hover directly) */
.layout_dental_rows_container:hover,
.layout_container:hover {
  scrollbar-color: var(--table-scroll-thumb-hover) var(--table-scroll-track);
}

.dental_type_color_green {
  background-color: green;
  color: white;
}

.dental_type_color_blue {
  background-color: blue;
  color: white;
}

.dental_type_color_red {
  background-color: red;
  color: white;
}

/*Periodontal styling*/
.teethcontainer {
  height: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35em;
}

.teeth {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  display: grid;
  grid-template-columns: repeat(17, 34px);
  gap: .35em;
  align-items: center;
  justify-content: center;
}

.teethvalues {
  font-family: Arial, Helvetica, sans-serif;
  display: grid;
  grid-template-columns: 42px repeat(16, 34px);
  gap: .35em;
  align-items: center;
  justify-content: center;
}

.teethvalues div:not(.periolabel) {
  font-family: Arial, Helvetica, sans-serif;
  font-size: .75em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .1em;
}

.teeth div:not(.periolabel) {
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teethupperbottom {
  grid-column: 2/-1;
  background-color: lightgrey;
  height: 34px;
  width: 100%;
}

.teethuppertop {
  grid-column: 2/-1;
  background-color: pink;
  height: 34px;
  width: 100%;
}

.periolabel {
  width: 100%;
  font-size: .8em;
  text-align: right;
}

.periodropdowndatestyle {
  font-family: Arial, Helvetica, sans-serif;
}

.toothrow {
  display: grid;
  grid-template-columns: 150px 150px 150px 150px 300px 300px;
  gap: 1em;
}

.toothposition {
  display: grid;
  grid-template-columns: 18px 18px 18px;
  gap: .25em;
}

.toothmodeposition {
  display: grid;
  grid-template-columns: 82px 82px 82px;
  gap: .75em;
  justify-items: center;
  align-items: center;
}

.otheroverflow {
  width: 100px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.other-heading:first-child {
  grid-column: 1/-1;
  grid-row: 1;
  text-align: center;
}

.periowarning {
  color: red;
}

/**Dental Chart Teeth graphical 
representation*/
.dentalteethcontainer {
  display: grid;
  grid-template-columns: repeat(16, 40px);
  grid-template-rows: auto;
  gap: .7em;
  background-color: white;
  border-radius: 5px;
  padding: 10px;
  border: solid .5px lightgrey;
}

.toothcontainer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5em;
  height: 100px;
}

.toothlabelcontainer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5em;
  height: 15px;
}

.tooth {
  position: relative;
  height: 30px;
  width: 40px;
}

.tooth_top {
  position: absolute;
  left: 0;
  top: 0;
  height: 10px;
  width: 40px;
  border: 1px solid black;
}

.tooth_middle {
  position: absolute;
  left: 10px;
  top: 10px;
  right: 10px;
  bottom: 0;
  border: inset;
}

.tooth_left {
  position: absolute;
  left: 0;
  top: 10px;
  height: 20px;
  width: 10px;
  border: 1px solid black;

}

.tooth_right {
  position: absolute;
  right: 0;
  top: 10px;
  height: 20px;
  width: 10px;
  border: 1px solid black;

}

.tooth_bottom {
  position: absolute;
  left: 0;
  top: 30px;
  height: 10px;
  width: 40px;
  border: 1px solid black;
}

.decay {
  background-color: black;
}

.removed {
  background: transparent;
  height: 100%;
  width: 100%;
  z-index: 1000;
}

.removed:after {
  content: '';
  z-index: 1000;
  height: 100%;
  border-left: 3px solid red;
  position: absolute;
  right: 20px;
  top: 0;
  transform: rotate(45deg);
}

.removed:before {
  content: '';
  z-index: 1000;
  height: 100%;
  border-left: 3px solid red;
  position: absolute;
  top: 0;
  left: 20px;
  transform: rotate(-45deg);
}

.dentaltoothchart {
  display: none;
  position: absolute;
  top: 1vh;
  left: 90px;
  width: 85vw;
  height: 95vh;
  padding: 5px;
  border-radius: 6px;
  background-color: var(--bg-alt);
  z-index: 2001;
  color: var(--fc-main);
  transition: var(--tran-03);
}

.dentaltoothchart.active {
  left: 260px;
}

.dentaltoothview {
  font-family: Arial, Helvetica, sans-serif;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  padding: 0;
  margin: 0;
}

.toothnumber {
  font-family: Arial, Helvetica, sans-serif;
  font-size: var(--fs-75);
  border-radius: 5px;
  border: 1px solid #3B719F;
  color: #3B719F;
  background-color: white;
  height: 16px;
  width: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1px;
}

.toothnumber:hover {
  background-color: var(--bg-row-hover);
  cursor: pointer;
}

.DentalHeader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1em;
  height: 375px;
  width: calc(100% - 250px);
}

.DentalHeaderFirstRow {
  display: grid;

}

.ToothColor-Red {
  background-color: red;
}

.ToothColor-DarkRed {
  background-color: darkred;
}

.ToothColor-Blue {
  background-color: blue;
}

.ToothColor-Black {
  background-color: black;
}

.ToothColor-Green {
  background-color: green;
}

.ToothColor-LightBlue {
  background-color: lightblue;
}

.ToothColor-Purple {
  background-color: plum;
}

.ToothColor-DefectiveRestore {
  background-image: url('/Chartviewer/images/DefectiveRestore.png');
  background-size: cover;
}

.ToothHighlight {
  background-color: yellow;
}

.ToothNumberColorRed {
  color: red;
}



.ToothColor-Chipped {
  width: 40px;
  height: 10px;
  background-color: transparent;
}

.ToothColor-Chipped::before {
  content: "";
  position: absolute;
  top: 1.5px;
  /* Adjust positioning */
  left: 15px;
  /* Adjust positioning */
  width: 10px;
  /* Adjust as needed */
  height: 5px;
  /* Adjust as needed */
  background-color: blue;
  /* Darker gray for the pulp */
  border-radius: 50%;
  /* Create a rounded shape for the pulp */
}

/**roots*/
.rootcontainer {
  display: flex;
  justify-content: flex-start;
  column-gap: .2em;
  row-gap: .2em;
  padding-top: 10px;
}

.tooth-root-upper {
  width: 12px;
  /* Adjust as needed */
  height: 40px;
  /* Adjust as needed */
  /* Light gray for the root */
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  /* Creates a rounded top and flat bottom */
  position: relative;
  /* For positioning pseudo-elements if used */
  border: 1px solid, lightgrey;
}

.tooth-root-lower {
  width: 12px;
  /* Adjust as needed */
  height: 40px;
  /* Light gray for the root */
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  /* Creates a rounded top and flat bottom */
  position: relative;
  /* For positioning pseudo-elements if used */
  border: 1px solid, lightgrey;
  transform: rotate(180deg);
}

.root-color-red {
  background-color: red;
}

.root-color-yellow {
  background-color: rgb(255, 251, 0);
}

.root-color-paleblue {
  background-color: rgb(63, 140, 241);
}

/**Dental Notes Style*/

.dental-notes-row {
  font-size: var(--fs-100);
  display: grid;
  grid-template-columns: 150px 600px 20px;
  align-items: center;
  gap: 1em;
  min-height: 35px;
  padding-left: 10px;
  padding-right: 10px;
}

.dental-notes-row div:nth-child(2) {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.note-container-style {
  display: none;
  position: absolute;
  top: 1vh;
  left: 90px;
  /* staticish dimensions with responsive caps */
  width: 85vw;
  max-width: 1100px;
  height: 600px;
  max-height: 90vh;
  padding: 12px;
  border-radius: 10px;
  background-color: var(--bg-alt);
  border: 1px solid #e9d5ff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.08);
  z-index: 3001;
  color: var(--fc-main);
  transition: var(--tran-03);
}

.note-container-style.active {
  left: 260px;
}

.dentalnoteview {
  font-family: Arial, Helvetica, sans-serif;
  /* fill parent but account for margins */
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  box-sizing: border-box;
  /* include padding in height/width calculations */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  margin: 20px;
  /* spacing from parent */
  padding: 20px;
  /* inner padding */
  overflow: auto;
  border-radius: 12px;
  /* rounded corners */
  background: #ffffff;
  /* card background */
  border: 1px solid rgba(124, 58, 237, 0.08);
  /* subtle purple-tinted border */
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  /* soft shadow */
}

/* Custom scrollbar for note container to match dental rows */
.note-container-style .dentalnoteview::-webkit-scrollbar {
  width: 10px;
}

.note-container-style .dentalnoteview::-webkit-scrollbar-track {
  background: #f3e8ff;
  border-radius: 6px;
}

.note-container-style .dentalnoteview::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c3aed, #a855f7);
  border-radius: 6px;
  border: 2px solid #f3e8ff;
}

.note-container-style .dentalnoteview::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6d28d9, #9b4be6);
}

.note-container-style .dentalnoteview {
  scrollbar-width: auto;
  scrollbar-color: #7c3aed #f3e8ff;
}

/* Firefox hover approximation (Firefox can't style thumb hover directly) */
.note-container-style .dentalnoteview:hover {
  scrollbar-color: #6d28d9 #f3e8ff;
}

/* Modal-specific adjustments: ensure the dental table fills the modal and rows scroll properly */
.note-container-style .dentalnoteview {
  margin: 12px;
  /* slightly reduce margin for tighter fit */
  padding: 12px;
  /* reduce padding to give more room */
  box-sizing: border-box;
}

.note-container-style .dentalnoteview .dental-table-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.note-container-style .dentalnoteview .layout_container {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.note-container-style .dentalnoteview .layout_dental_rows_container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.dental-container-style {
  display: none;
  position: absolute;
  top: 1vh;
  left: 90px;
  width: 85vw;
  height: 95vh;
  padding: 5px;
  border-radius: 6px;
  background-color: var(--bg-alt);
  z-index: 3001;
  color: var(--fc-main);
  transition: var(--tran-03);
}

.dental-container-style.active {
  left: 260px;
}


.dentalalertview {
  font-family: Arial, Helvetica, sans-serif;
  width: 80%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  padding: 50px;
  margin: 0;
  overflow: auto
}

.dental-alert-container-style {
  display: none;
  position: absolute;
  top: 1vh;
  left: 90px;
  width: 85vw;
  height: 95vh;
  padding: 5px;
  border-radius: 6px;
  background-color: var(--bg-alt);
  z-index: 3001;
  color: var(--fc-main);
  transition: var(--tran-03);
}

.dental-alert-container-style.active {
  left: 260px;
}

/** Right click menu styling for
  * teeth labels to show Arhive records */

/* Modal for single dental value display (alerts/notes) */
.dental-value-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dental-value-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.dental-value-modal-content {
  position: relative;
  background: #fff;
  padding: 0;
  /* handle spacing in header/content */
  border-radius: 8px;
  max-width: 800px;
  width: 100%;
  max-height: 80vh;
  z-index: 4001;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dental-value-modal-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  /* small gap between label and date */
  padding: 16px 18px;
  /* left padding matches content padding for alignment */
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #fafafa;
}

.dental-value-title {
  font-weight: 700;
  font-size: 1.125rem;
  /* slightly larger header */
  color: var(--fc-main);
  margin-right: 6px;
}

.dental-value-date {
  font-size: 1rem;
  /* larger but slightly smaller than title */
  color: #666;
  margin-left: 4px;
  white-space: nowrap;
}

.dental-value-content {
  padding: 16px;
  overflow: auto;
  /* make content area take available space and be scrollable */
  flex: 1 1 auto;
}

/* Scrollbar style matching layout_dental_rows_container */
.dental-value-content::-webkit-scrollbar {
  width: 10px;
}

.dental-value-content::-webkit-scrollbar-track {
  background: #f3e8ff;
  border-radius: 6px;
}

.dental-value-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c3aed, #a855f7);
  border-radius: 6px;
  border: 2px solid #f3e8ff;
}

.dental-value-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6d28d9, #9b4be6);
}

.dental-value-content {
  scrollbar-width: auto;
  scrollbar-color: #7c3aed #f3e8ff;
}

/* Firefox hover approximation (Firefox can't style thumb hover directly) */
.dental-value-content:hover {
  scrollbar-color: #6d28d9 #f3e8ff;
}

.dental-value-data {
  white-space: pre-wrap;
}

.dental-value-modal-footer {
  padding: 12px 18px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.dental-value-modal-footer .btn {
  min-width: auto;
}

@media (max-width: 800px) {
  .dental-value-modal-content {
    width: 94%;
  }
}

#contextMenu {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 120px;
  width: 200px;
  border-radius: 5px;
}

#contextMenu.active {
  display: block;
  top: 25px;
  /* Adjust as needed */
  left: 5px;
  /* Adjust as needed */
  transition: all 0.3s ease;
}

#contextMenu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#contextMenu li {
  padding: 8px 16px;
  cursor: pointer;
}

#contextMenu li:hover {
  background: #eee;
}

.DentalCheckboxContainer {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 1em;
  color: var(--fc-main);
  width: 250px;
}

/**Periodontal Chart Styling*/
.perio-chart {
  background-color: var(--perio-card-bg);
  padding: 10px;
  border-radius: 8px;
  box-shadow: var(--perio-card-shadow);
  max-width: 1200px;
  margin: 0 auto;
}

.perio-chart h2 {
  margin-bottom: 12px;
  font-size: 16px;
}

h2 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
}

.arch {
  margin-bottom: 18px;
}

.perio-table-divider {
  width: 100%;
  height: 1px;
  background: var(--perio-divider-bg);
  margin: 10px 0;
}

.arch-label {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--perio-arch-label-fc);
  text-align: center;
}

.chart-table {
  width: auto;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

.chart-table th,
.chart-table td {
  border: 1px solid var(--perio-border-color);
  padding: 0;
  padding-top: 1px;
  text-align: center;
  min-width: 10px;
  max-width: 14px;
  overflow: hidden;
  line-height: 1;
}

.chart-table th {
  background-color: var(--perio-header-bg);
  font-weight: bold;
}

/* Value/measurement cells: remove padding, keep labels/spacers intact */
.chart-table td:not(.row-label):not(.section-label):not(.section-col):not(.tooth-spacer) {
  padding: 0 !important;
  padding-top: 1px !important;
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 13px !important;
  line-height: 1;
}

.chart-table .section-col {
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
}

.chart-table .section-label {
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  box-sizing: border-box !important;
}

.chart-table .row-label {
  width: 75px !important;
  min-width: 75px !important;
  max-width: 75px !important;
  box-sizing: border-box !important;
}

.row-label {
  background-color: var(--perio-row-label-bg);
  font-weight: bold;
  text-align: right !important;
  padding-left: 4px;
  padding-right: 1px !important;
  padding-top: 1px;
  padding-bottom: 0;
  font-size: 12px;
  color: var(--perio-row-label-fc);
  white-space: nowrap;
}

.title-label {
  background-color: var(--perio-row-label-bg);
  font-weight: bold;
  text-align: right !important;
  padding-left: 5px;
  min-width: 35px !important;
  max-width: 35px !important;
  font-size: 10px;
  color: var(--perio-row-label-fc);
  white-space: nowrap;
}

.tooth-number-row th {
  background-color: var(--perio-tooth-number-bg);
  font-weight: bold;
  font-size: 12px;
  padding: 0;
  padding-top: 1px;
  height: 10px;
  line-height: 1;
}

.perio-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  min-width: 10px;
  height: 15px;
  line-height: 1;
  font-size: 12px;
}

.perio-value.red {
  color: var(--perio-value-alert-fc);
  font-weight: bold;
}

.bleed {
  color: var(--perio-bleed-fc);
  font-weight: bold;
}

.supp {
  color: var(--perio-supp-fc);
  font-weight: bold;
}

#loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.error {
  color: red;
  text-align: center;
  padding: 20px;
}

.section-label {
  font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background-color: var(--perio-section-label-bg);
  font-weight: bold;
  font-size: 12px;
  padding: 1px !important;
  text-align: center;
  vertical-align: middle;
  color: var(--perio-section-label-fc);
  border: 1px solid var(--perio-border-color);
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

.position-label,
.position-value {
  color: var(--perio-position-fc);
}

/* Spacer cells normally have no top border; add it back only for the Position row */
.chart-table tr.perio-position-row td.tooth-spacer {
  border-top: 1px solid var(--perio-border-color) !important;
}

.tooth-spacer {
  width: 6px;
  min-width: 6px;
  max-width: 6px;
  border-left: 1px solid var(--perio-border-color);
  border-right: 1px solid var(--perio-border-color);
  border-top: 0 !important;
  border-bottom: 0 !important;
  background-color: transparent !important;
}

.chart-table th.tooth-spacer,
.chart-table td.tooth-spacer {
  background-color: transparent !important;
}

.tooth-number-row th.tooth-spacer {
  background-color: transparent !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

.tooth-number-row .tooth-spacer {
  border-top: 1px solid var(--perio-border-color) !important;
}

.tooth-number-row.no-spacer-top .tooth-spacer {
  border-top: 0 !important;
}

tr:last-child .tooth-spacer {
  border-bottom: 1px solid var(--perio-border-color) !important;
}

/* Alternating background colors for value rows (class-based; no :has dependency) */
.chart-table tr.perio-value-row--alt td:not(.section-label):not(.row-label):not(.section-col):not(.tooth-spacer) {
  background-color: var(--perio-row-alt-bg);
}

.chart-table tr.perio-value-row--alt td.row-label {
  background-color: var(--perio-row-label-bg-alt);
}

/* End Periodontal Chart Styling */

/**Dental Action table styling*/
.dental-action-row {
  display: grid;
  grid-template-columns: 150px 250px 400px;
  align-items: center;
  gap: 1em;
  min-height: 35px;
  padding-left: 10px;
  padding-right: 10px;
}

.dental-notes-textarea {
  width: 100%;
  height: 100%;
  resize: none;
  background-color: white;
  color: black;
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--fs-100);
  padding: 10px;
  margin: 50px 100px;
}