/**
 * Atlas dental y odontograma interactivo - Estilos corporativos y responsive
 * Fijate Tools
 */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta base clara */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-surface: #f1f5f9;
  --bg-hover: #e2e8f0;
  --border-color: #cbd5e1;
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Acentos médicos y clínicos */
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-glow: rgba(2, 132, 199, 0.25);

  --accent-teal: #0d9488;
  --accent-teal-light: #ccfbf1;

  /* Estados clínicos */
  --color-sano: #f8fafc;
  --color-sano-border: #94a3b8;
  --color-empaste: #2563eb;
  --color-caries: #dc2626;
  --color-endodoncia: #9333ea;
  --color-corona: #0284c7;
  --color-implante: #475569;
  --color-ausente: #64748b;
  --color-sellador: #16a34a;

  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

[data-theme="dark"] {
  --bg-app: #0b0f17;
  --bg-card: #131b26;
  --bg-surface: #1a2433;
  --bg-hover: #243245;
  --border-color: #2b3a4f;
  --border-focus: #38bdf8;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --primary: #38bdf8;
  --primary-hover: #0284c7;
  --primary-light: rgba(56, 189, 248, 0.15);
  --primary-glow: rgba(56, 189, 248, 0.3);

  --accent-teal: #2dd4bf;
  --accent-teal-light: rgba(45, 212, 191, 0.15);

  --color-sano: #1e293b;
  --color-sano-border: #475569;
  --color-empaste: #3b82f6;
  --color-caries: #ef4444;
  --color-endodoncia: #a855f7;
  --color-corona: #38bdf8;
  --color-implante: #94a3b8;
  --color-ausente: #475569;
  --color-sellador: #22c55e;

  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Reset y estructura global canónica */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.hero-title,
.section-title,
.faq-section-title {
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--text-main);
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Layout canónico Fijate Tools */
.main-wrapper.tool-layout {
  max-width: 1240px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Hero e introducción */
.hero-section {
  margin-bottom: 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
  border: 1px solid var(--primary-glow);
}

.hero-title {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 900px;
  margin-bottom: 1.5rem;
}

/* Pestañas de navegación de la herramienta */
.dental-nav-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.75rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 44px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface);
}

.tab-btn.active {
  color: var(--primary);
  background: var(--bg-card);
  border-color: var(--border-color);
  border-bottom: 2px solid var(--bg-card);
  margin-bottom: -1px;
}

/* Paneles de pestañas */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tarjeta modular estándar */
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.section-intro {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.45rem;
  margin: 0 0 0.4rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ==========================================================
   MÓDULO 1: ODONTOGRAMA ANATÓMICO
   ========================================================== */
.odontogram-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.control-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
}

.segmented-control {
  display: inline-flex;
  background: var(--bg-surface);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.segment-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
}

.segment-btn:hover {
  color: var(--text-main);
}

.segment-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.pill-filters {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.pill-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
}

.pill-btn:hover {
  color: var(--text-main);
  border-color: var(--text-light);
}

.pill-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Espacio de trabajo dual del odontograma */
.odontogram-workspace {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.75rem;
  align-items: start;
}

.arch-visualizer-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.arch-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.arch-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border-color);
}

.arch-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.arch-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.arch-teeth-track {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem;
  scrollbar-width: thin;
}

.arch-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.2rem 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.divider-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: lowercase;
}

/* Tarjeta individual de diente en la arcada */
.tooth-card-unit {
  flex: 0 0 auto;
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.tooth-card-unit:hover {
  background: var(--bg-surface);
  border-color: var(--border-color);
  transform: translateY(-2px);
}

.tooth-card-unit.active {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.tooth-card-unit.dimmed {
  opacity: 0.25;
}

.tooth-num-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.tooth-card-unit.active .tooth-num-badge {
  color: var(--primary);
}

.tooth-svg-icon {
  width: 32px;
  height: 48px;
  transition: transform 0.15s ease;
}

.tooth-card-unit:hover .tooth-svg-icon {
  transform: scale(1.08);
}

.tooth-shape-path {
  fill: #f8fafc;
  stroke: #64748b;
  stroke-width: 1.5;
  transition: all 0.2s ease;
}

[data-theme="dark"] .tooth-shape-path {
  fill: #1e293b;
  stroke: #94a3b8;
}

.tooth-card-unit.active .tooth-shape-path {
  fill: #e0f2fe;
  stroke: var(--primary);
}

[data-theme="dark"] .tooth-card-unit.active .tooth-shape-path {
  fill: #0c4a6e;
  stroke: var(--primary);
}

/* Ficha lateral de anatomía */
.tooth-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: sticky;
  top: 1rem;
}

.tooth-detail-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.tooth-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
}

.tooth-detail-title {
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0 0 0.25rem;
}

.tooth-detail-common {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tooth-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  background: var(--bg-surface);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}

.tooth-stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.stat-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.tooth-detail-section {
  margin-bottom: 1rem;
}

.detail-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.35rem;
}

.detail-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.tooth-faces-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.8rem;
}

.tooth-faces-list li {
  margin-bottom: 0.35rem;
  padding-left: 0.75rem;
  position: relative;
  color: var(--text-muted);
  line-height: 1.4;
}

.tooth-faces-list li::before {
  content: "•";
  color: var(--primary);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.alert-box-subtle {
  background: var(--danger-bg);
  border-left: 3px solid var(--danger);
  padding: 0.65rem 0.85rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.alert-box-subtle .detail-subtitle {
  color: var(--danger);
}

/* ==========================================================
   MÓDULO 2: CAPAS DEL DIENTE (CORTE TRANSVERSAL)
   ========================================================== */
.layer-explorer-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
  align-items: center;
}

.tooth-cross-section-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tooth-svg-corte {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
}

.layer-path {
  cursor: pointer;
  transition: all 0.2s ease;
}

.layer-path:hover,
.layer-path.active {
  filter: drop-shadow(0 0 6px var(--primary-glow));
  stroke-width: 3.5px !important;
}

.hotspot-circle {
  fill: var(--primary);
  stroke: #ffffff;
  stroke-width: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hotspot-circle:hover,
.hotspot-circle.active {
  fill: #0369a1;
  transform: scale(1.2);
  transform-origin: center;
}

.hotspot-text {
  fill: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.svg-legend-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
}

.layer-info-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.layer-selector-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.layer-chip-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
}

.layer-chip-btn:hover {
  color: var(--text-main);
  border-color: var(--text-light);
}

.layer-chip-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.layer-card-detail {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.layer-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
}

.layer-name {
  font-size: 1.35rem;
  margin: 0 0 0.6rem;
}

.layer-summary {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.layer-spec-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.spec-label {
  color: var(--text-muted);
  font-weight: 500;
}

.spec-val {
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
  max-width: 65%;
}

.layer-clinical-box {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.clinical-box-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.layer-clinical-box p {
  font-size: 0.85rem;
  color: var(--text-main);
  margin: 0;
}

/* ==========================================================
   MÓDULO 3: SIMULADOR DE PATOLOGÍAS
   ========================================================== */
.pathology-selector-nav {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.patho-tab-btn {
  flex: 1;
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
}

.patho-tab-btn:hover {
  color: var(--text-main);
  border-color: var(--text-light);
}

.patho-tab-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.patho-stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.step-node-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 52px;
}

.step-node-btn:hover {
  background: var(--bg-hover);
}

.step-node-btn.active {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

.step-name {
  font-size: 0.78rem;
  color: var(--text-main);
  text-align: center;
  font-weight: 600;
}

.patho-stage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
}

.stage-card-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.stage-tag {
  display: inline-block;
  background: var(--success-bg);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.stage-title {
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
}

.stage-severity {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stage-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.desc-heading {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  color: var(--text-main);
}

.desc-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.stage-treatment-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
}

.treatment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.stage-treatment-box p {
  font-size: 0.9rem;
  color: var(--text-main);
  margin: 0;
}

/* ==========================================================
   MÓDULO 4: FICHA ODONTOLÓGICA CLÍNICA
   ========================================================== */
.clinical-tools-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.tool-brush-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.tool-brush-btn:hover {
  color: var(--text-main);
  border-color: var(--text-light);
}

.tool-brush-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.brush-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.cond-sano { background: var(--color-sano); border: 1px solid var(--color-sano-border); }
.cond-empaste { background: var(--color-empaste); }
.cond-caries { background: var(--color-caries); }
.cond-endodoncia { background: var(--color-endodoncia); }
.cond-corona { background: var(--color-corona); }
.cond-implante { background: var(--color-implante); }
.cond-ausente { background: var(--color-ausente); position: relative; }
.cond-sellador { background: var(--color-sellador); }

.clinical-chart-board {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chart-quadrant-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.chart-block-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed var(--border-color);
}

.chart-teeth-row {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem;
  scrollbar-width: thin;
}

.chart-tooth-cell {
  flex: 0 0 auto;
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  padding: 0.4rem 0.2rem;
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease;
  user-select: none;
}

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

.chart-tooth-svg {
  width: 34px;
  height: 48px;
}

.clinical-summary-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.summary-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.counter-box {
  display: flex;
  flex-direction: column;
}

.counter-num {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.counter-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.clinical-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-action-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
  min-height: 42px;
}

.btn-action-primary:hover {
  background: var(--primary-hover);
}

.btn-action-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 42px;
}

.btn-action-secondary:hover {
  background: var(--bg-hover);
}

/* ==========================================================
   MÓDULO 5: TEMPORIZADOR DE CEPILLADO
   ========================================================== */
.brushing-timer-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: center;
  background: var(--bg-surface);
  padding: 1.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.timer-display-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.timer-radial-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-track {
  fill: none;
  stroke: var(--bg-hover);
  stroke-width: 12px;
}

.timer-bar {
  fill: none;
  stroke: var(--primary);
  stroke-width: 12px;
  stroke-linecap: round;
  stroke-dasharray: 553;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s linear;
}

.timer-inside-info {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-digits {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.timer-sector-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.timer-buttons-row {
  display: flex;
  gap: 0.6rem;
  width: 100%;
}

.btn-timer-ctrl {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.15s ease;
}

.btn-timer-ctrl.primary {
  background: var(--primary);
  color: #ffffff;
  border: none;
}

.btn-timer-ctrl.primary:hover {
  background: var(--primary-hover);
}

.btn-timer-ctrl.secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-timer-ctrl.secondary:hover {
  background: var(--bg-hover);
}

.brushing-instructions-box {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.quadrant-indicator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border-left: 4px solid var(--primary);
}

.quadrant-step-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.instruction-title {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.instruction-body {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.bass-technique-guide {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.guide-title {
  font-size: 0.9rem;
  margin: 0 0 0.6rem;
  color: var(--text-main);
}

.guide-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.guide-list li {
  margin-bottom: 0.4rem;
  padding-left: 1rem;
  position: relative;
  color: var(--text-muted);
}

.guide-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
}

.oral-hygiene-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.hygiene-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.hygiene-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.hygiene-card-header h4 {
  font-size: 1rem;
  margin: 0;
  color: var(--text-main);
}

.hygiene-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ==========================================================
   MÓDULO 6: TEST DE RIESGO Y MITOS
   ========================================================== */
.risk-form-container {
  margin-bottom: 2rem;
}

.questions-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.question-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.options-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-choice-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-main);
  transition: all 0.15s ease;
  min-height: 42px;
}

.option-choice-label:hover {
  border-color: var(--primary);
}

.option-choice-label input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  margin: 0;
}

.btn-calculate-risk {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
  min-height: 48px;
}

.btn-calculate-risk:hover {
  background: var(--primary-hover);
}

.risk-result-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.3s ease-out;
}

.risk-score-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.risk-traffic-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.badge-risk-low { background: var(--success-bg); color: var(--success); }
.badge-risk-med { background: var(--warning-bg); color: var(--warning); }
.badge-risk-high { background: var(--danger-bg); color: var(--danger); }

.risk-score-title {
  font-size: 1.25rem;
  margin: 0;
}

.risk-score-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.risk-recommendations {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rec-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-main);
  background: var(--bg-card);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2.5rem 0;
}

/* Mitos y realidades */
.myths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.myth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.myth-header {
  margin-bottom: 0.75rem;
}

.myth-verdict-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.myth-question {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.35;
}

.myth-explanation {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================
   ACORDEÓN FAQ
   ========================================================== */
.faq-section {
  margin: 3rem 0;
}

.faq-section-title {
  font-size: 1.45rem;
  margin-bottom: 1.25rem;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item[open] {
  border-color: var(--primary);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: bold;
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
  content: "−";
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.faq-answer p {
  margin: 0;
}

/* ==========================================================
   MODAL ACCESIBLE (SIN JAVASCRIPT ALERT)
   ========================================================== */
.accessible-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.accessible-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.accessible-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-card-title {
  margin: 0;
  font-size: 1.15rem;
}

.btn-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.5rem;
}

.modal-card-body {
  padding: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.55;
}

.modal-card-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

.btn-modal-confirm {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
}

/* ==========================================================
   RESPONSIVE DESIGN (TABLET Y MÓVIL)
   ========================================================== */
@media (max-width: 1024px) {
  .odontogram-workspace {
    grid-template-columns: 1fr;
  }

  .tooth-detail-card {
    position: static;
  }

  .layer-explorer-layout {
    grid-template-columns: 1fr;
  }

  .brushing-timer-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.5rem;
  }

  .stage-body-grid {
    grid-template-columns: 1fr;
  }

  .clinical-summary-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-counters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .clinical-actions {
    width: 100%;
  }

  .btn-action-primary,
  .btn-action-secondary {
    width: 100%;
    justify-content: center;
  }

  .timer-buttons-row {
    flex-direction: column;
  }

  .btn-timer-ctrl {
    width: 100%;
  }
}

/* Estilos de impresión para la ficha odontológica */
@media print {
  header.app-header,
  footer.fijate-footer,
  aside.tool-ad-sidebar,
  .tools-ad-banner-section,
  .dental-nav-tabs,
  .clinical-tools-palette,
  .clinical-actions,
  .hero-section,
  .faq-section {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .main-wrapper.tool-layout {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .module-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .chart-quadrant-block {
    break-inside: avoid;
  }
}
