/* ==========================================================================
   QVORA Specialty Clinical Modules Styles
   Dental Odontogram & Physiotherapy Body Map (Strictly 100% English)
   ========================================================================== */

/* Dental Odontogram Workspace */
.dental-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 14px;
}

/* Minimalist single-line status bar - NOT a menu */
.dental-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-alt, #f8fafc);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
}

.dental-legend-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-dim, #64748b);
}

.dental-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dental-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dental-dmft-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #334155);
}

/* Odontogram Arch & Teeth Grid - Fully responsive to fit without horizontal scrolling */
.odontogram-container {
  overflow-x: hidden;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: #fbfcfe;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  width: 100%;
}

.odontogram-arch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 620px;
}

.odontogram-arch-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim, #64748b);
}

.odontogram-quadrants {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 620px;
}

.odontogram-quadrant {
  display: flex;
  gap: 2px;
  flex: 1 1 0;
  justify-content: space-between;
}

/* Individual Tooth Cell - fluid scaling between 22px and 34px */
.tooth-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1 1 0;
  max-width: 34px;
  min-width: 22px;
  width: 100%;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease;
}

.tooth-cell:hover {
  transform: translateY(-2px);
}

.tooth-cell.selected .tooth-svg {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.tooth-number {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text, #334155);
  line-height: 1;
}

.tooth-svg {
  width: 100%;
  max-width: 32px;
  height: auto;
  aspect-ratio: 1 / 1;
  background: white;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  transition: all 0.12s ease;
  display: block;
}

.tooth-surface {
  fill: #ffffff;
  stroke: #94a3b8;
  stroke-width: 1;
  transition: fill 0.12s ease;
  cursor: pointer;
}

.tooth-surface:hover {
  fill: #e2e8f0;
}

/* Tooth Modal Tabs */
.tooth-modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 14px;
}

.tooth-modal-tab-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.tooth-modal-tab-btn:hover {
  color: #1e293b;
}

.tooth-modal-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

/* Tooth Timeline & History Styling */
.tooth-history-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.tooth-history-item {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border-left: 3px solid #2563eb;
  border-radius: 4px;
  font-size: 12px;
}

.tooth-history-date {
  font-weight: 600;
  color: #475569;
  min-width: 80px;
  font-size: 11px;
}

.tooth-history-content {
  flex: 1;
}

.tooth-history-action {
  font-weight: 700;
  color: #0f172a;
}

.tooth-history-meta {
  color: #64748b;
  font-size: 11px;
  margin-top: 2px;
}

/* Tooth Attachment Cards */
.tooth-xray-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.tooth-xray-card {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  background: #0f172a;
  cursor: pointer;
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tooth-xray-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tooth-xray-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  font-size: 10px;
  padding: 2px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tooth Condition Colors */
.surface-healthy { fill: #ffffff !important; }
.surface-caries { fill: #ef4444 !important; }
.surface-filled { fill: #3b82f6 !important; }
.surface-root-canal { fill: #8b5cf6 !important; }
.surface-crown { fill: #eab308 !important; }
.surface-extraction { fill: #f97316 !important; }

.tooth-cell.is-missing .tooth-svg {
  opacity: 0.35;
  background: #f1f5f9;
}

/* Physiotherapy Workspace Styles */
.physio-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 16px;
}

.physio-top-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 960px) {
  .physio-top-grid {
    grid-template-columns: 1fr;
  }
}

.physio-body-chart-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--bg-alt, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 12px;
  box-sizing: border-box;
}

.physio-workspace .table-wrap,
.physio-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

.physio-workspace .data-table,
.physio-data-table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 0 !important;
}

.physio-workspace .data-table th,
.physio-workspace .data-table td {
  padding: 6px 8px !important;
  font-size: 12px !important;
  vertical-align: middle;
  box-sizing: border-box;
}

.physio-workspace .rom-field,
.physio-workspace .muscle-field {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  font-size: 12px !important;
  padding: 4px 6px !important;
  height: 28px !important;
}

.body-views-toggle {
  display: flex;
  gap: 4px;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 6px;
}

.body-view-btn {
  padding: 5px 12px;
  border: none;
  background: transparent;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.body-view-btn.active {
  background: white;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.body-svg-container {
  position: relative;
  width: 220px;
  height: 380px;
}

.body-zone {
  fill: #e2e8f0;
  stroke: #94a3b8;
  stroke-width: 1.5;
  cursor: pointer;
  transition: all 0.15s ease;
}

.body-zone:hover {
  fill: #cbd5e1;
  stroke: #475569;
}

.body-zone.has-pain {
  fill: #fca5a5;
  stroke: #ef4444;
}

.body-pain-pin {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

/* VAS Pain Scale Slider */
.vas-scale-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: white;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
}

.vas-scale-bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #22c55e 0%, #eab308 50%, #ef4444 100%);
}

/* Session Package Cards */
.rehab-package-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 12px 14px;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rehab-progress-bar {
  height: 8px;
  border-radius: 4px;
  background: #f1f5f9;
  overflow: hidden;
}

.rehab-progress-fill {
  height: 100%;
  background: #2563eb;
  transition: width 0.3s ease;
}

/* Specialty Modal Overlays - ensure they layer directly above the encounter workspace modal */
#dentalToothInspectionModal,
#dentalTreatmentModal,
#dentalCompleteProcedureModal,
#physioPainModal,
#physioPackageModal {
  z-index: 1200;
}

/* Dental Bottom Section: Full Fluid Width without horizontal scrollbar */
.dental-bottom-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  width: 100%;
}

.dental-plans-box {
  width: 100%;
}

.dental-plans-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
  flex-wrap: wrap;
}

.dental-section-heading {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.dental-plans-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

.dental-plans-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
  border-collapse: collapse;
}

.dental-plans-table th {
  padding: 6px 8px !important;
  font-size: 11px !important;
  font-weight: 700;
  text-transform: uppercase;
  background: #f1f5f9;
  color: #475569;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
}

.dental-plans-table td {
  padding: 6px 8px !important;
  font-size: 12px !important;
  vertical-align: middle;
  border-bottom: 1px solid #e2e8f0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.dental-notes-box {
  width: 100%;
}

.dental-notes-box textarea {
  width: 100%;
  resize: vertical;
  min-height: 48px;
}

/* Patient Financial Ledger Statement Responsive Fluid Styling with Smooth Scroll */
#patientStatementTableWrap,
div[data-panel="financial"] .table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
  -webkit-overflow-scrolling: touch;
}

#patientStatementTable {
  width: 100% !important;
  min-width: 680px !important;
  table-layout: auto !important;
  border-collapse: collapse;
  font-size: 12px;
}

#patientStatementTable th {
  padding: 8px 10px !important;
  font-size: 11px !important;
  font-weight: 700;
  text-transform: uppercase;
  background: #f8fafc;
  color: #475569;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap !important;
}

#patientStatementTable td {
  padding: 8px 10px !important;
  font-size: 12px !important;
  vertical-align: middle;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

#patientStatementTable .badge {
  font-size: 10px;
  padding: 2px 6px;
  line-height: 1.2;
  white-space: nowrap !important;
}

/* Universal Smooth Scroll & High-Legibility Data Tables */
.invoices-table-wrap,
#invoicesTableWrap,
.claims-table-wrap,
#claimsTableWrap,
.expenses-table-wrap,
#clinicExpensesPanel .table-wrap,
.physio-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
  border-radius: 8px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
  -webkit-overflow-scrolling: touch;
}

/* Custom sleek, modern scrollbars for webkit */
.invoices-table-wrap::-webkit-scrollbar,
#invoicesTableWrap::-webkit-scrollbar,
.claims-table-wrap::-webkit-scrollbar,
#claimsTableWrap::-webkit-scrollbar,
.expenses-table-wrap::-webkit-scrollbar,
#clinicExpensesPanel .table-wrap::-webkit-scrollbar,
#patientStatementTableWrap::-webkit-scrollbar,
.physio-table-wrap::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.invoices-table-wrap::-webkit-scrollbar-track,
#invoicesTableWrap::-webkit-scrollbar-track,
.claims-table-wrap::-webkit-scrollbar-track,
#claimsTableWrap::-webkit-scrollbar-track,
.expenses-table-wrap::-webkit-scrollbar-track,
#clinicExpensesPanel .table-wrap::-webkit-scrollbar-track,
#patientStatementTableWrap::-webkit-scrollbar-track,
.physio-table-wrap::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 4px;
}

.invoices-table-wrap::-webkit-scrollbar-thumb,
#invoicesTableWrap::-webkit-scrollbar-thumb,
.claims-table-wrap::-webkit-scrollbar-thumb,
#claimsTableWrap::-webkit-scrollbar-thumb,
.expenses-table-wrap::-webkit-scrollbar-thumb,
#clinicExpensesPanel .table-wrap::-webkit-scrollbar-thumb,
#patientStatementTableWrap::-webkit-scrollbar-thumb,
.physio-table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.invoices-table-wrap::-webkit-scrollbar-thumb:hover,
#invoicesTableWrap::-webkit-scrollbar-thumb:hover,
.claims-table-wrap::-webkit-scrollbar-thumb:hover,
#claimsTableWrap::-webkit-scrollbar-thumb:hover,
.expenses-table-wrap::-webkit-scrollbar-thumb:hover,
#clinicExpensesPanel .table-wrap::-webkit-scrollbar-thumb:hover,
#patientStatementTableWrap::-webkit-scrollbar-thumb:hover,
.physio-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Tables: auto-layout with comfortable min-widths so headers & cell content never truncate */
#invoicesTable {
  width: 100% !important;
  min-width: 980px !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
}

#claimsToSendTable {
  width: 100% !important;
  min-width: 1260px !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
}

#expensesTable {
  width: 100% !important;
  min-width: 1120px !important;
  table-layout: auto !important;
  border-collapse: collapse !important;
}

#invoicesTable th,
#claimsToSendTable th,
#expensesTable th {
  white-space: nowrap !important;
  padding: 10px 14px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #475569;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow: visible !important;
  text-overflow: clip !important;
}

#invoicesTable td,
#claimsToSendTable td,
#expensesTable td {
  padding: 9px 12px !important;
  font-size: 12.5px !important;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

/* Action buttons in tables must never collide, squish, or truncate */
#invoicesTable .row-actions,
#claimsToSendTable .row-actions,
#expensesTable .row-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
}

#invoicesTable .row-actions button,
#claimsToSendTable .row-actions button,
#expensesTable .row-actions button {
  white-space: nowrap !important;
  font-size: 11.5px !important;
  padding: 4px 8px !important;
  height: 28px !important;
  line-height: 1 !important;
  border-radius: 5px !important;
  cursor: pointer;
}

/* Badges in tables */
#invoicesTable .badge,
#claimsToSendTable .badge,
#expensesTable .badge {
  white-space: nowrap !important;
  display: inline-block !important;
  font-size: 11px !important;
  padding: 3px 8px !important;
  line-height: 1.2 !important;
  border-radius: 4px !important;
}


