/* ==========================================================================
   ORTHOMETRY - LUXURY OBSIDIAN SLATE ODONTOGRAM & TOOTH CHART
   High-Contrast Executive Orthodontic Arch Visualizer (60fps, 0ms Latency)
   ========================================================================== */

/* Main Odontogram Canvas Container */
.odontogram-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 10px 4px 40px;
  user-select: none;
  box-sizing: border-box;
}

/* Header & Executive Controls Toolbar */
.odontogram-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card, #131B28);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-lg, 12px);
  padding: 14px 20px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.2));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.odontogram-toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.odontogram-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.odontogram-main-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary, #F8FAFC);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.odontogram-main-title .arch-icon {
  font-size: 18px;
}

/* Stage Selector Inset Well */
.odontogram-stage-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input, #0E141F);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: var(--border-radius-sm, 6px);
  padding: 4px 10px;
}

.odontogram-stage-selector label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #94A3B8);
}

.odontogram-stage-select {
  background: transparent;
  border: none;
  color: var(--accent, #2DD4BF);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding-right: 4px;
}

.odontogram-stage-select option {
  background: #131B28;
  color: #F8FAFC;
}

/* Notation Pill Toggle (FDI <-> Universal) */
.odontogram-notation-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-input, #0E141F);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: 20px;
  padding: 2px;
}

.notation-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94A3B8);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.notation-pill-btn:hover {
  color: var(--text-primary, #F8FAFC);
}

.notation-pill-btn.active {
  background: var(--accent, #0D9488);
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.4);
}

/* Presets Bar */
.odontogram-presets-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.odontogram-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary, #1A2436);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  color: var(--text-primary, #F8FAFC);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--border-radius-sm, 6px);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  will-change: transform;
}

.odontogram-preset-btn:hover {
  transform: translateY(-1px);
  background: var(--bg-card-hover, #222F46);
  border-color: var(--accent, #2DD4BF);
}

.odontogram-preset-btn:active {
  transform: translateY(0);
}

.odontogram-preset-btn.btn-bond-all:hover {
  border-color: #2DD4BF;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.25);
}

.odontogram-preset-btn.btn-extract-premolars:hover {
  border-color: #EF4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

/* Save Status Indicator */
.odontogram-save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.odontogram-save-status.status-saved {
  color: #10B981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.odontogram-save-status.status-saving {
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.odontogram-save-status.status-unsaved {
  color: #94A3B8;
  background: rgba(148, 163, 184, 0.08);
}

.odontogram-save-status.status-error {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* KPI Metrics Micro-Card Bar */
.odontogram-kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.odontogram-kpi-card {
  background: var(--bg-card, #131B28);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
  border-radius: var(--border-radius-md, 10px);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.odontogram-kpi-info {
  display: flex;
  flex-direction: column;
}

.odontogram-kpi-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #94A3B8);
}

.odontogram-kpi-value {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary, #F8FAFC);
  line-height: 1.2;
}

.odontogram-kpi-value.kpi-bonded {
  color: #2DD4BF;
}

.odontogram-kpi-value.kpi-debonded {
  color: #F59E0B;
}

.odontogram-kpi-value.kpi-extracted {
  color: #EF4444;
}

.odontogram-kpi-value.kpi-tad {
  color: #C084FC;
}

.odontogram-kpi-badge {
  font-size: 18px;
  opacity: 0.85;
}

/* ==========================================================================
   ARCH CHART DISPLAY (Maxillary Upper & Mandibular Lower Arches)
   ========================================================================== */
.odontogram-arch-card {
  background: var(--bg-card, #131B28);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-lg, 14px);
  padding: 20px 24px;
  position: relative;
  overflow: visible;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.arch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.arch-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary, #F8FAFC);
}

.arch-title-badge .arch-subtext {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #94A3B8);
  text-transform: none;
}

.arch-orientation-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94A3B8);
}

.arch-orientation-legend .side-indicator {
  padding: 2px 8px;
  background: var(--bg-input, #0E141F);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Arch Teeth Container with Midline Divider */
.arch-teeth-row-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  padding: 8px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.arch-quadrant {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Midline Divider Guideline */
.arch-midline-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 28px;
  margin: 0 4px;
  position: relative;
}

.arch-midline-line {
  width: 2px;
  height: 95px;
  background: linear-gradient(to bottom, rgba(45, 212, 191, 0.1), rgba(45, 212, 191, 0.8), rgba(45, 212, 191, 0.1));
  border-radius: 1px;
}

.arch-midline-tag {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #0E141F;
  border: 1px solid rgba(45, 212, 191, 0.5);
  color: #2DD4BF;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}

/* ==========================================================================
   INDIVIDUAL TOOTH UNIT CARD
   0ms Click Target with GPU Accelerated Hover
   ========================================================================== */
.tooth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 66px;
  min-width: 64px;
  padding: 8px 3px 6px;
  background: var(--bg-secondary, #1A2436);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-md, 10px);
  cursor: pointer;
  position: relative;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  will-change: transform;
}

.tooth-card:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--accent, #2DD4BF);
  background: var(--bg-card-hover, #202D44);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35), 0 0 10px rgba(45, 212, 191, 0.2);
  z-index: 5;
}

.tooth-card.selected {
  border-color: #2DD4BF;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.4), 0 6px 16px rgba(0, 0, 0, 0.4);
  background: #202E46;
  z-index: 6;
}

/* Tooth Identifiers (Number & Quadrant) */
.tooth-label-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px 4px;
}

.tooth-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #F8FAFC);
  letter-spacing: -0.01em;
}

.tooth-sub-num {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted, #94A3B8);
}

/* TAD Anchors (Buccal & Palatal/Lingual) */
.tooth-tad-slot {
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.tad-pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1;
}

.tad-pin-badge.buccal {
  background: rgba(192, 132, 252, 0.18);
  border: 1px solid #C084FC;
  color: #E9D5FF;
}

.tad-pin-badge.palatal {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid #38BDF8;
  color: #BAE6FD;
}

/* SVG Tooth Crown Graphics */
.tooth-svg-wrap {
  width: 58px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tooth-svg-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* SVG Anatomical Tooth Styling */
.tooth-crown-base {
  fill: #1E293B;
  stroke: #475569;
  stroke-width: 1.5;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

.tooth-fissure {
  stroke: #334155;
  stroke-width: 1.2;
  fill: none;
}

/* Tooth Note Indicator Dot */
.tooth-note-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #F59E0B;
  box-shadow: 0 0 6px #F59E0B;
  display: none;
}

.tooth-card.has-note .tooth-note-dot {
  display: block;
}

/* ==========================================================================
   BRACKET STYLES & VISUAL STATES
   ========================================================================== */
.bracket-base {
  fill: #0F172A;
  stroke: #64748B;
  stroke-width: 1.2;
  transition: all 0.15s ease;
}

.bracket-wing {
  fill: #1E293B;
  stroke: #64748B;
  stroke-width: 1;
  transition: all 0.15s ease;
}

.bracket-slot-channel {
  fill: #0A0E17;
}

.bracket-slot {
  stroke: #475569;
  stroke-width: 1.5;
}

/* Bonded State: Clinical Teal Glow */
.tooth-card.bracket-bonded .bracket-base {
  fill: #0D9488;
  stroke: #2DD4BF;
  stroke-width: 1.8;
  filter: drop-shadow(0 0 5px rgba(45, 212, 191, 0.7));
}

.tooth-card.bracket-bonded .bracket-wing {
  fill: #14B8A6;
  stroke: #5EEAD4;
  filter: drop-shadow(0 0 3px rgba(45, 212, 191, 0.5));
}

.tooth-card.bracket-bonded .bracket-slot {
  stroke: #F8FAFC;
  stroke-width: 2;
  filter: drop-shadow(0 0 4px #5EEAD4);
}

/* Debonded State: Warning Amber Pulse */
@keyframes debondPulse {
  0% {
    stroke-color: #F59E0B;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6));
    transform: scale(1);
  }
  50% {
    stroke-color: #FBBF24;
    filter: drop-shadow(0 0 9px rgba(251, 191, 36, 0.9));
    transform: scale(1.04);
  }
  100% {
    stroke-color: #F59E0B;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6));
    transform: scale(1);
  }
}

.tooth-card.bracket-debonded .bracket-base {
  fill: rgba(245, 158, 11, 0.35);
  stroke: #F59E0B;
  stroke-width: 2;
  animation: debondPulse 1.8s infinite ease-in-out;
}

.tooth-card.bracket-debonded .bracket-wing {
  fill: #D97706;
  stroke: #FBBF24;
  animation: debondPulse 1.8s infinite ease-in-out;
}

.tooth-card.bracket-debonded .bracket-slot {
  stroke: #FDE68A;
  stroke-width: 2;
}

/* Unbonded State: Subtle Translucent Ring */
.tooth-card.bracket-unbonded .bracket-base {
  fill: transparent;
  stroke: rgba(148, 163, 184, 0.35);
  stroke-dasharray: 2 2;
}

.tooth-card.bracket-unbonded .bracket-wing {
  fill: transparent;
  stroke: rgba(148, 163, 184, 0.25);
}

.tooth-card.bracket-unbonded .bracket-slot {
  stroke: rgba(148, 163, 184, 0.25);
}

/* ==========================================================================
   TOOTH CLINICAL STATUSES (Present, Missing, Extracted, Impacted)
   ========================================================================== */
/* Missing: Faded & Dashed */
.tooth-card.status-missing {
  opacity: 0.38;
}

.tooth-card.status-missing .tooth-crown-base {
  stroke-dasharray: 4 3;
  fill: transparent;
}

.tooth-card.status-missing .bracket-base,
.tooth-card.status-missing .bracket-wing,
.tooth-card.status-missing .bracket-slot {
  display: none;
}

/* Extracted: Red Cross Strike-Through */
.tooth-card.status-extracted {
  opacity: 0.55;
  border-color: rgba(239, 68, 68, 0.3);
}

.tooth-card.status-extracted .tooth-crown-base {
  fill: rgba(239, 68, 68, 0.1);
  stroke: #EF4444;
}

.extracted-marker {
  display: none;
}

.tooth-card.status-extracted .extracted-marker {
  display: block;
}

.tooth-card.status-extracted .bracket-base,
.tooth-card.status-extracted .bracket-wing,
.tooth-card.status-extracted .bracket-slot {
  display: none;
}

/* Impacted: Purple Luminous Badge */
.impacted-marker {
  display: none;
}

.tooth-card.status-impacted {
  border-color: rgba(168, 85, 247, 0.4);
}

.tooth-card.status-impacted .tooth-crown-base {
  stroke: #A855F7;
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.5));
}

.tooth-card.status-impacted .impacted-marker {
  display: block;
}

/* ==========================================================================
   PRE-TREATMENT DENTAL CONDITIONS (Decay, Restored, Crown, RCT, Implant)
   ========================================================================== */
.decay-marker,
.restored-marker,
.crown-marker,
.rct-marker,
.implant-marker {
  display: none;
}

/* Active Decay / Caries */
.tooth-card.condition-decay .decay-marker {
  display: block;
}

.tooth-card.condition-decay .tooth-crown-base {
  fill: #0F172A;
  stroke: #F59E0B;
}

/* Restored Tooth (Composite/Amalgam) */
.tooth-card.condition-restored .restored-marker {
  display: block;
}

.tooth-card.condition-restored .tooth-crown-base {
  stroke: #38BDF8;
}

/* Crown / Prosthetic Cap */
.tooth-card.condition-crown .crown-marker {
  display: block;
}

.tooth-card.condition-crown .tooth-crown-base {
  fill: rgba(234, 179, 8, 0.12);
  stroke: #EAB308;
}

/* Endodontically Treated / RCT */
.tooth-card.condition-rct .rct-marker {
  display: block;
}

.tooth-card.condition-rct .tooth-crown-base {
  stroke: #C084FC;
}

/* Dental Implant */
.tooth-card.condition-implant .implant-marker {
  display: block;
}

.tooth-card.condition-implant .tooth-crown-base {
  fill: rgba(148, 163, 184, 0.1);
  stroke: #94A3B8;
}

.tooth-card.condition-implant .bracket-assembly {
  opacity: 0.6;
}

/* Legend Swatches for Dental Conditions */
.legend-swatch.swatch-decay {
  background: #18181B;
  border: 1.5px solid #F59E0B;
}

.legend-swatch.swatch-restored {
  background: rgba(56, 189, 248, 0.4);
  border: 1.5px solid #38BDF8;
}

.legend-swatch.swatch-crown {
  background: rgba(234, 179, 8, 0.4);
  border: 1.5px solid #EAB308;
}

/* KPI Values for Dental Conditions */
.odontogram-kpi-value.kpi-decay {
  color: #F59E0B;
}

.odontogram-kpi-value.kpi-restored {
  color: #38BDF8;
}

/* HUD Condition Buttons */
.hud-condition-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.hud-pill-option.opt-cond-sound.active {
  background: rgba(13, 148, 136, 0.25);
  border-color: #2DD4BF;
  color: #5EEAD4;
}

.hud-pill-option.opt-cond-decay.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #F59E0B;
  color: #FBBF24;
}

.hud-pill-option.opt-cond-restored.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38BDF8;
  color: #7DD3FC;
}

.hud-pill-option.opt-cond-crown.active {
  background: rgba(234, 179, 8, 0.2);
  border-color: #EAB308;
  color: #FDE047;
}

.hud-pill-option.opt-cond-rct.active {
  background: rgba(168, 85, 247, 0.2);
  border-color: #C084FC;
  color: #E9D5FF;
}

.hud-pill-option.opt-cond-implant.active {
  background: rgba(148, 163, 184, 0.2);
  border-color: #94A3B8;
  color: #F1F5F9;
}

/* ==========================================================================
   CHAIRSIDE QUICK-SELECTION HUD (0ms Click Instant HUD)
   ========================================================================== */
.odontogram-hud-popover {
  position: absolute;
  width: 320px;
  background: var(--bg-card, #131B28);
  border: 1px solid var(--accent, #2DD4BF);
  border-radius: var(--border-radius-lg, 12px);
  padding: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(45, 212, 191, 0.25);
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: hudFadeIn 0.12s ease-out;
}

@keyframes hudFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.odontogram-hud-popover.active {
  display: flex;
}

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.hud-title-lockup {
  display: flex;
  flex-direction: column;
}

.hud-tooth-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary, #F8FAFC);
}

.hud-tooth-sub {
  font-size: 11px;
  color: var(--text-muted, #94A3B8);
}

.hud-btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #94A3B8);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.hud-btn-close:hover {
  color: var(--text-primary, #F8FAFC);
  background: rgba(255, 255, 255, 0.08);
}

.hud-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #94A3B8);
}

.hud-btn-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 6px;
}

.hud-pill-option {
  background: var(--bg-input, #0E141F);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  color: var(--text-primary, #F8FAFC);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: var(--border-radius-sm, 6px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.hud-pill-option:hover {
  background: #1A2436;
  border-color: rgba(255, 255, 255, 0.25);
}

.hud-pill-option.active {
  background: #0D9488;
  border-color: #2DD4BF;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.4);
}

.hud-pill-option.opt-debonded.active {
  background: #D97706;
  border-color: #FBBF24;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.hud-pill-option.opt-extracted.active {
  background: #DC2626;
  border-color: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.hud-pill-option.opt-impacted.active {
  background: #7E22CE;
  border-color: #C084FC;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.hud-note-input {
  background: var(--bg-input, #0E141F);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: var(--border-radius-sm, 6px);
  padding: 7px 10px;
  color: var(--text-primary, #F8FAFC);
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease;
}

.hud-note-input:focus {
  border-color: var(--accent, #2DD4BF);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.25);
}

/* ==========================================================================
   ARCH NOTES & CLINICAL LEGEND FOOTER
   ========================================================================== */
.odontogram-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .odontogram-footer-grid {
    grid-template-columns: 1fr;
  }
}

.odontogram-notes-card,
.odontogram-legend-card {
  background: var(--bg-card, #131B28);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: var(--border-radius-lg, 12px);
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.odontogram-notes-card h4,
.odontogram-legend-card h4 {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary, #F8FAFC);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.odontogram-general-notes {
  width: 100%;
  min-height: 85px;
  background: var(--bg-input, #0E141F);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: var(--border-radius-sm, 6px);
  padding: 10px 12px;
  color: var(--text-primary, #F8FAFC);
  font-size: 12.5px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease;
}

.odontogram-general-notes:focus {
  border-color: var(--accent, #2DD4BF);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.25);
}

.odontogram-legend-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary, #CBD5E1);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.legend-swatch.swatch-bonded {
  background: #0D9488;
  border: 1px solid #2DD4BF;
  box-shadow: 0 0 6px #2DD4BF;
}

.legend-swatch.swatch-debonded {
  background: #D97706;
  border: 1px solid #FBBF24;
  box-shadow: 0 0 6px #FBBF24;
}

.legend-swatch.swatch-unbonded {
  background: transparent;
  border: 1px dashed #64748B;
}

.legend-swatch.swatch-extracted {
  background: #EF4444;
  position: relative;
}

.legend-swatch.swatch-impacted {
  background: #7E22CE;
  border: 1px solid #C084FC;
}

.legend-swatch.swatch-tad {
  background: #38BDF8;
  border-radius: 50%;
}

/* ==========================================================================
   LIGHT MODE ADAPTATIONS
   Maintains High Contrast WCAG Compliance
   ========================================================================== */
[data-theme="light"] .tooth-crown-base {
  fill: #FFFFFF;
  stroke: #94A3B8;
}

[data-theme="light"] .tooth-fissure {
  stroke: #CBD5E1;
}

[data-theme="light"] .bracket-base {
  fill: #F1F5F9;
  stroke: #64748B;
}

[data-theme="light"] .bracket-wing {
  fill: #E2E8F0;
  stroke: #64748B;
}

[data-theme="light"] .arch-midline-line {
  background: linear-gradient(to bottom, rgba(13, 148, 136, 0.1), rgba(13, 148, 136, 0.8), rgba(13, 148, 136, 0.1));
}

[data-theme="light"] .arch-midline-tag {
  background: #FFFFFF;
  border-color: #0D9488;
  color: #0D9488;
}
