/**
 * DENTALISYS — Puente visual BS3/AdminLTE → Theme Oral Admin
 * Solo estilos. No altera comportamiento JS.
 * Carga DESPUÉS de AdminLTE y ANTES de estilos de dominio (odontograma, etc.)
 */

/* Tokens: dentalisys-theme.css (cargar después de este archivo en layout) */

/* Utilidades mínimas del template nuevo (sin cargar Bootstrap 5 completo) */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.flex-column { flex-direction: column !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-primary { color: var(--ds-primary) !important; }
.text-fade { color: var(--ds-muted) !important; }
.text-white { color: #fff !important; }

/* Sin recorte circular (anula Bootstrap .img-circle) */
.img-circle {
  border-radius: 0;
}

.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-20 { margin-bottom: 20px !important; }
.mt-10 { margin-top: 10px !important; }
.mt-15 { margin-top: 15px !important; }
.mt-20 { margin-top: 20px !important; }
.me-2 { margin-right: .5rem !important; }
.me-3 { margin-right: 1rem !important; }
.me-10 { margin-right: 10px !important; }
.me-15 { margin-right: 15px !important; }
.ms-5 { margin-left: 3rem !important; }
.p-0 { padding: 0 !important; }
.p-15 { padding: 15px !important; }
.p-20 { padding: 20px !important; }
.p-40 { padding: 40px !important; }
.pb-0 { padding-bottom: 0 !important; }
.py-10 { padding-top: 10px !important; padding-bottom: 10px !important; }
.g-0 { margin-left: 0; margin-right: 0; }
.rounded { border-radius: var(--ds-radius) !important; }
.rounded10 { border-radius: 10px !important; }
.shadow-lg { box-shadow: var(--ds-shadow) !important; }
.bg-white { background-color: #fff !important; }
.bg-transparent { background-color: transparent !important; }
.bg-primary-light { background-color: rgba(2, 132, 199, 0.12) !important; color: #0284c7 !important; }
.bg-success-light { background-color: rgba(34, 197, 94, 0.12) !important; color: #16a34a !important; }
.bg-warning-light { background-color: rgba(245, 158, 11, 0.14) !important; color: #d97706 !important; }
.bg-danger-light { background-color: rgba(239, 68, 68, 0.12) !important; color: #dc2626 !important; }
.bg-info-light { background-color: rgba(6, 182, 212, 0.14) !important; color: #0891b2 !important; }
.bg-purple-light { background-color: rgba(139, 92, 246, 0.14) !important; color: #7c3aed !important; }
.bg-maroon-light { background-color: rgba(190, 24, 93, 0.12) !important; color: #be185d !important; }
.bg-navy-light { background-color: rgba(30, 64, 175, 0.12) !important; color: #1e40af !important; }
.bg-orange-light { background-color: rgba(249, 115, 22, 0.14) !important; color: #ea580c !important; }
.bg-teal-light { background-color: rgba(20, 184, 166, 0.14) !important; color: #0d9488 !important; }
.w-50 { width: 50px !important; }
.h-50 { height: 50px !important; }
.h-p100 { min-height: 100vh !important; }
.fs-20 { font-size: 20px !important; }
.fw-600 { font-weight: 600 !important; }
.fw-500 { font-weight: 500 !important; }
.mt-5 { margin-top: 5px !important; }
.mt-10 { margin-top: 10px !important; }
.gap-3 { gap: 1rem; }

/* KPI Oral Admin (index-5) — site-wide */
.ds-kpi-icon-wrap {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.ds-kpi-icon-wrap > i { line-height: 1; }
.ds-kpi-card .ds-kpi-value,
.ds-kpi-card h2.ds-kpi-value {
  font-family: "Poppins", sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ds-text);
  line-height: 1.2;
}
.ds-kpi-card .ds-kpi-hint {
  font-size: 12px;
  color: var(--ds-muted);
  margin: 4px 0 0;
}

/* Legacy AdminLTE indicators → Oral Admin look */
.theme-primary .info-box {
  background: var(--ds-surface) !important;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  box-shadow: var(--ds-shadow);
  min-height: 0;
  margin-bottom: 20px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.theme-primary .info-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(23, 43, 77, 0.12);
}
.theme-primary .info-box.bg-green,
.theme-primary .info-box.bg-aqua,
.theme-primary .info-box.bg-yellow,
.theme-primary .info-box.bg-red,
.theme-primary .info-box.bg-blue,
.theme-primary .info-box.bg-navy,
.theme-primary .info-box.bg-maroon,
.theme-primary .info-box.bg-orange,
.theme-primary .info-box.bg-teal,
.theme-primary .info-box.bg-purple {
  color: var(--ds-text) !important;
}
.theme-primary .info-box .info-box-icon {
  float: none;
  width: 50px;
  height: 50px;
  line-height: 50px;
  border-radius: 12px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 132, 199, 0.12) !important;
  color: #0284c7 !important;
  flex-shrink: 0;
}
.theme-primary .info-box .info-box-icon.bg-green,
.theme-primary .info-box.bg-green .info-box-icon { background: rgba(34, 197, 94, 0.12) !important; color: #16a34a !important; }
.theme-primary .info-box .info-box-icon.bg-aqua,
.theme-primary .info-box.bg-aqua .info-box-icon { background: rgba(6, 182, 212, 0.14) !important; color: #0891b2 !important; }
.theme-primary .info-box .info-box-icon.bg-yellow,
.theme-primary .info-box.bg-yellow .info-box-icon { background: rgba(245, 158, 11, 0.14) !important; color: #d97706 !important; }
.theme-primary .info-box .info-box-icon.bg-red,
.theme-primary .info-box.bg-red .info-box-icon { background: rgba(239, 68, 68, 0.12) !important; color: #dc2626 !important; }
.theme-primary .info-box .info-box-icon.bg-blue,
.theme-primary .info-box.bg-blue .info-box-icon { background: rgba(2, 132, 199, 0.12) !important; color: #0284c7 !important; }
.theme-primary .info-box .info-box-icon.bg-navy,
.theme-primary .info-box.bg-navy .info-box-icon { background: rgba(30, 64, 175, 0.12) !important; color: #1e40af !important; }
.theme-primary .info-box .info-box-icon.bg-maroon,
.theme-primary .info-box.bg-maroon .info-box-icon { background: rgba(190, 24, 93, 0.12) !important; color: #be185d !important; }
.theme-primary .info-box .info-box-icon.bg-orange,
.theme-primary .info-box.bg-orange .info-box-icon { background: rgba(249, 115, 22, 0.14) !important; color: #ea580c !important; }
.theme-primary .info-box .info-box-icon.bg-teal,
.theme-primary .info-box.bg-teal .info-box-icon { background: rgba(20, 184, 166, 0.14) !important; color: #0d9488 !important; }
.theme-primary .info-box .info-box-icon.bg-purple,
.theme-primary .info-box.bg-purple .info-box-icon { background: rgba(139, 92, 246, 0.14) !important; color: #7c3aed !important; }
.theme-primary .info-box .info-box-content {
  margin-left: 14px;
  padding: 0;
  display: block;
  flex: 1;
  min-width: 0;
}
.theme-primary .info-box .info-box-text {
  display: block;
  text-transform: none;
  font-weight: 400;
  font-size: 13px;
  color: var(--ds-muted);
  white-space: normal;
}
.theme-primary .info-box .info-box-number {
  display: block;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--ds-text);
  line-height: 1.25;
}
.theme-primary .info-box .progress-description {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ds-muted);
  opacity: 1;
}

.theme-primary .small-box {
  background: var(--ds-surface) !important;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  box-shadow: var(--ds-shadow);
  color: var(--ds-text) !important;
  margin-bottom: 20px;
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
  overflow: hidden;
}
.theme-primary .small-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(23, 43, 77, 0.12);
}
.theme-primary .small-box > .inner {
  padding: 18px 16px 18px 78px !important;
  position: relative;
  min-height: 86px;
}
.theme-primary .small-box > .inner::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(2, 132, 199, 0.12);
}
.theme-primary .small-box.bg-blue > .inner::before { background: rgba(2, 132, 199, 0.12); }
.theme-primary .small-box.bg-green > .inner::before { background: rgba(34, 197, 94, 0.12); }
.theme-primary .small-box.bg-red > .inner::before { background: rgba(239, 68, 68, 0.12); }
.theme-primary .small-box.bg-yellow > .inner::before { background: rgba(245, 158, 11, 0.14); }
.theme-primary .small-box.bg-aqua > .inner::before { background: rgba(6, 182, 212, 0.14); }
.theme-primary .small-box.bg-purple > .inner::before { background: rgba(139, 92, 246, 0.14); }
.theme-primary .small-box > .inner h3 {
  font-family: "Poppins", sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ds-text);
  z-index: 1;
  position: relative;
}
.theme-primary .small-box > .inner p {
  font-size: 13px;
  color: var(--ds-muted);
  margin: 0;
  z-index: 1;
  position: relative;
}
.theme-primary .small-box .icon,
.theme-primary .small-box > .small-box-footer {
  display: none !important;
}

@media (min-width: 992px) {
  .d-lg-inline-flex { display: inline-flex !important; }
  .d-lg-none { display: none !important; }
}

@media (max-width: 991px) {
  .d-lg-inline-flex { display: none !important; }
}

/* Body & layout base — tipografía en ds-typography.css */
body.hold-transition.light-skin.theme-primary {
  background: var(--ds-bg);
  color: var(--ds-text);
}

/* Bootstrap 3 añade padding-right inline al abrir modales (compensar scrollbar) */
body.light-skin.sidebar-mini,
body.modal-open {
  padding-right: 0 !important;
}

.wrapper {
  background: var(--ds-bg);
  overflow-x: hidden;
}

.content-wrapper {
  background: transparent;
  min-height: calc(100vh - 60px);
  padding-top: 60px;
  -webkit-transition: margin-left 0.3s ease-in-out, transform 0.3s ease-in-out;
  transition: margin-left 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.main-footer {
  -webkit-transition: margin-left 0.3s ease-in-out, transform 0.3s ease-in-out;
  transition: margin-left 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* AdminLTE .fixed usa 50px/100px; header DENTALISYS mide 60px */
body.fixed .content-wrapper,
body.fixed .right-side {
  padding-top: 60px !important;
}

.content {
  padding: 24px;
}

@media (max-width: 767px) {
  .content-wrapper,
  .main-footer {
    margin-left: 0 !important;
    -webkit-transform: none !important;
    transform: none !important;
  }

  body.fixed .content-wrapper,
  body.fixed .right-side {
    padding-top: 60px !important;
  }

  .content {
    padding: 16px 12px;
  }

  .content-header h1 {
    font-size: 22px;
  }

  .ds-dashboard .row > [class*="col-"] {
    margin-bottom: 16px;
  }

  .main-header.ds-main-header .header-megamenu .search-bx {
    max-width: 160px;
  }

  .main-header.ds-main-header .app-menu .search-bx input[type="search"] {
    font-size: 13px;
    padding-left: 10px;
  }
}

/* Header moderno — AdminLTE 2 + sidebar ds-sidebar */
.main-header.ds-main-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
  max-height: none;
  box-shadow: 0 2px 16px rgba(23, 43, 77, 0.06);
  border-bottom: 1px solid var(--ds-border);
  background: var(--ds-header-bg, #ffffff);
}

.main-header.ds-main-header .navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  width: 100%;
  min-height: 60px;
  margin-bottom: 0;
  margin-left: 0 !important;
  border: none;
  background: var(--ds-header-bg, #ffffff);
  padding: 0 8px;
}

.main-header.ds-main-header .app-menu {
  flex: 1 1 auto;
  min-width: 0;
  float: none;
}

.main-header.ds-main-header .header-megamenu {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-header.ds-main-header .header-megamenu > li {
  float: none;
}

.main-header.ds-main-header .push-btn,
.main-header.ds-main-header .full-screen,
.main-header.ds-main-header .svg-bt-icon,
.main-header.ds-main-header .navbar-custom-menu .btn-info-light.dropdown-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 6px 4px;
  padding: 10px !important;
  border-radius: 8px;
  line-height: 1;
  text-decoration: none;
  color: var(--ds-header-text, #334155) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.main-header.ds-main-header .push-btn:hover,
.main-header.ds-main-header .push-btn:focus,
.main-header.ds-main-header .full-screen:hover,
.main-header.ds-main-header .full-screen:focus,
.main-header.ds-main-header .svg-bt-icon:hover,
.main-header.ds-main-header .svg-bt-icon:focus,
.main-header.ds-main-header .ds-theme-toggle:hover,
.main-header.ds-main-header .ds-theme-toggle:focus {
  background: rgba(2, 132, 199, 0.1) !important;
  color: var(--ds-primary) !important;
  text-decoration: none;
}

.main-header.ds-main-header .push-btn svg,
.main-header.ds-main-header .full-screen svg,
.main-header.ds-main-header .svg-bt-icon svg,
.main-header.ds-main-header .ds-theme-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.main-header.ds-main-header .app-menu .search-bx {
  max-width: 340px;
  border-radius: 8px;
  overflow: visible;
  box-shadow: 0 0 0 1px var(--ds-border, #e2e8f0);
}

.main-header.ds-main-header .app-menu .search-bx input[type="search"] {
  height: 40px;
  border: none;
  background: var(--ds-surface-alt, #f8fafc);
  color: var(--ds-header-text, #334155);
  font-size: 14px;
  padding-left: 14px;
}

.main-header.ds-main-header .app-menu .search-bx .btn {
  height: 40px;
  border: none;
  background: var(--ds-surface-alt, #f8fafc);
  color: var(--ds-header-text, #334155);
  padding: 6px 12px;
}

.main-header.ds-main-header .ds-theme-switch {
  margin: 0;
  padding: 0;
}

.main-header.ds-main-header .ds-theme-switch .switch-on,
.main-header.ds-main-header .ds-theme-switch .switch-off {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.main-header.ds-main-header .navbar-custom-menu.r-side {
  float: none;
  flex: 0 0 auto;
  margin-left: auto;
}

.main-header.ds-main-header .navbar-custom-menu {
  float: none;
  flex-shrink: 0;
}

.main-header.ds-main-header .navbar-custom-menu .nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

.main-header.ds-main-header .navbar-custom-menu .user-menu > a,
.main-header.ds-main-header .navbar-custom-menu .user-menu > .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px !important;
  color: var(--ds-header-text, #334155);
}

.main-header.ds-main-header .user-image,
.main-header.ds-main-header .avatar.avatar-pill {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.main-header.ds-main-header .notifications-menu .dropdown-menu {
  min-width: 280px;
  border-radius: 8px;
  border: 1px solid var(--ds-border);
  box-shadow: var(--ds-shadow, 0 8px 24px rgba(15, 23, 42, 0.12));
}

.main-header.ds-main-header .notifications-menu .header h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ds-header-text);
}

.main-header .logo-box {
  display: none !important;
}

/* Sidebar (legacy — no aplica si .ds-sidebar está activo) */
.main-sidebar:not(.ds-sidebar) {
  box-shadow: 2px 0 16px rgba(23, 43, 77, 0.05);
}

.main-sidebar:not(.ds-sidebar) .sidebar-menu > li > a {
  border-radius: 8px;
  margin: 2px 10px;
  width: calc(100% - 20px);
}

.main-sidebar:not(.ds-sidebar) .sidebar-menu .treeview-menu > li > a {
  padding-left: 36px;
}

/* Cards / boxes — mantiene clases .box usadas en todo el sistema */
.box {
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-border);
  box-shadow: var(--ds-shadow);
  background: var(--ds-surface);
}

.box.box-primary {
  border-top: 3px solid var(--ds-primary);
}

.box-header {
  border-bottom: 1px solid var(--ds-border);
  padding: 16px 20px;
}

.box-header .box-title {
  font-weight: 600;
  font-size: 16px;
}

.box-body {
  padding: 20px;
}

.box.pull-up {
  transition: transform .2s ease, box-shadow .2s ease;
}

.box.pull-up:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(23, 43, 77, 0.12);
}

/* Formularios */
.form-control,
select.form-control,
.input-group .form-control {
  border-radius: 8px;
  border: 1px solid var(--ds-border);
  box-shadow: none;
  min-height: 38px;
}

.form-control:focus {
  border-color: var(--ds-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-group label {
  font-weight: 500;
  color: var(--ds-text);
}

.input-group-addon,
.input-group-text {
  border-radius: 8px 0 0 8px;
  border-color: var(--ds-border);
  background: #f8fafc;
}

.dental-auth-page .input-group .form-control {
  border-left: 0;
}

.dental-auth-page .input-group-addon {
  border-right: 0;
}

/* Botones: ver assets/css/ds-buttons.css (Oral Admin General Buttons) */

/* Tablas / DataTables */
.table {
  border-collapse: separate;
  border-spacing: 0;
}

.table > thead > tr > th {
  background: #f8fafc;
  border-bottom: 1px solid var(--ds-border);
  font-weight: 600;
  color: var(--ds-text);
}

.table > tbody > tr > td {
  vertical-align: middle;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border-radius: 8px;
  border: 1px solid var(--ds-border);
  padding: 6px 10px;
}

/* Paginación DataTables: ver assets/css/ds-datatables.css */

/* Modales BS3 — conservar comportamiento */
.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 20px 50px rgba(23, 43, 77, 0.18);
}

.modal-header {
  border-bottom: 1px solid var(--ds-border);
  padding: 16px 20px;
}

.modal-footer {
  border-top: 1px solid var(--ds-border);
  padding: 14px 20px;
}

/* Footer */
.main-footer {
  background: var(--ds-footer-bg, var(--ds-surface));
  border-top: 1px solid var(--ds-border);
  color: var(--ds-text-muted);
  padding: 12px 20px;
}

/* Login */
.dental-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ds-dark);
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(0, 212, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 90% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  padding: 24px;
}

.dental-auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(11, 45, 79, 0.25);
  overflow: hidden;
}

.dental-auth-card .auth-header {
  padding: 28px 32px 0;
}

.dental-auth-card .auth-body {
  padding: 24px 32px 32px;
}

.dental-auth-card .auth-logo {
  max-width: 220px;
  width: 100%;
  height: auto;
  margin: 0 auto 12px;
  display: block;
}

.dental-auth-card.ds-auth-card--register {
  max-width: 520px;
}

/* Dashboard widgets */
.dental-stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 132, 199, 0.12);
  color: var(--ds-primary);
  font-size: 20px;
}

/* Lista de datos de cuenta (dashboard) */
.dental-profile-card .ds-profile-list {
  margin: 0 0 4px;
  padding: 0;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  background: var(--ds-surface-elevated, #F0F9FF);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.dental-profile-card .ds-profile-list .list-group-item {
  border: none;
  border-bottom: 1px solid var(--ds-border);
  padding: 14px 16px;
  margin: 0;
  background: transparent;
  gap: 12px;
}

.dental-profile-card .ds-profile-list .list-group-item:last-child {
  border-bottom: none;
}

.dental-profile-card .ds-profile-list .list-group-item > span:first-child {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
  line-height: 1.45;
  font-size: 13px;
  color: var(--ds-text);
}

.dental-profile-card .ds-profile-list .list-group-item > span:first-child strong {
  color: var(--ds-text);
  font-weight: 600;
}

.dental-profile-card .ds-profile-list .badge {
  flex-shrink: 0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1;
  border: none;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.12);
}

.dental-profile-card .ds-profile-list .badge.bg-aqua {
  background: rgba(2, 132, 199, 0.15) !important;
  color: var(--ds-primary) !important;
}

.dental-profile-card .ds-profile-list .badge.bg-yellow {
  background: rgba(245, 158, 11, 0.15) !important;
  color: var(--ds-warning) !important;
}

.dental-profile-card .ds-profile-list .badge.bg-blue {
  background: rgba(14, 165, 233, 0.15) !important;
  color: var(--ds-cyan, #0EA5E9) !important;
}

.dental-profile-card .ds-profile-list .badge.bg-green {
  background: rgba(34, 197, 94, 0.15) !important;
  color: var(--ds-success) !important;
}

html[data-theme="dark"] .dental-profile-card .ds-profile-list {
  background: var(--ds-surface-elevated);
  box-shadow: none;
}

html[data-theme="dark"] .dental-profile-card .ds-profile-list .list-group-item > span:first-child {
  color: var(--ds-text);
}

.dental-announcement {
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius);
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
}

/* Select2 mantiene funcionalidad */
.select2-container--default .select2-selection--single {
  border-radius: 8px !important;
  border-color: var(--ds-border) !important;
  min-height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px !important;
}

/* Odontograma y módulos clínicos — no interferir con motor JS */
#odontograma,
#odontograma-contenido,
#cursoresRecuadros,
#OdontogramaImprimir {
  /* posicionamiento lo controla odontograma.css */
}

/* ============================================================
   FASE 2 — Módulos CORE
   ============================================================ */

/* Page header unificado */
.ds-page-header h1,
.ds-page-header h4,
.ds-page-header .page-title {
  font-weight: 600;
  color: var(--ds-text);
  margin: 0 0 4px;
}

.content-header .page-title {
  margin: 0 0 4px;
  display: block;
  padding: 0;
  color: var(--ds-text);
  font-size: 1.2857142857rem;
  font-weight: 400;
}

.ds-page-header .ds-page-subtitle {
  color: var(--ds-muted);
  font-weight: 400;
  font-size: 1rem;
}

.content-header.ds-page-header,
.content-header {
  padding: 20px 24px 12px;
  background: transparent;
}

.content-header .breadcrumb {
  padding: 0;
  margin: 8px 0 0;
  background-color: transparent;
}

.content-header .breadcrumb .breadcrumb-item a {
  color: var(--ds-primary, #2f579a);
  text-decoration: none;
}

.content-header .breadcrumb-item + .breadcrumb-item::before {
  content: "-";
  color: var(--ds-primary, #3b6dc1);
}

.content-header .breadcrumb-item.active {
  color: var(--ds-text, #172b4c);
}

.content-header .breadcrumb .mdi {
  font-size: 16px;
  line-height: 1;
  vertical-align: middle;
}

/* Toolbar de acciones */
.ds-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ds-toolbar .btn-group .btn {
  border-radius: 8px;
}

.ds-toolbar-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Cards de filtros */
.ds-filter-card.box {
  margin-bottom: 20px;
}

.ds-filter-card .box-header,
.ds-filter-card .box-body.pad {
  padding: 20px;
}

.ds-filter-card .control-label,
.ds-filter-card label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ds-muted);
  margin-bottom: 6px;
}

/* Tabla premium */
.ds-table-card.box {
  overflow: hidden;
}

.ds-table-card .box-header {
  background: var(--ds-primary);
  color: #ffffff;
  border-bottom: none;
  padding: 16px 20px;
}

.ds-table-card .box-header .box-title {
  color: #ffffff !important;
}

.ds-table-card .table-responsive {
  padding: 0 12px 12px;
}

.ds-table-card table.dataTable thead th,
.ds-table-card table.dataTable thead .sorting,
.ds-table-card table.dataTable thead .sorting_asc,
.ds-table-card table.dataTable thead .sorting_desc,
.ds-table-card table.dataTable thead .sorting_disabled,
.ds-table-card .ds-table-head th {
  background-color: var(--ds-primary) !important;
  background-image: none !important;
  background: var(--ds-primary) !important;
  color: #ffffff !important;
  text-align: center !important;
  border: none !important;
  border-color: var(--ds-primary) !important;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 12px 10px !important;
  vertical-align: middle !important;
}

.ds-table-card table.dataTable thead th.sorting:before,
.ds-table-card table.dataTable thead th.sorting:after,
.ds-table-card table.dataTable thead th.sorting_asc:before,
.ds-table-card table.dataTable thead th.sorting_asc:after,
.ds-table-card table.dataTable thead th.sorting_desc:before,
.ds-table-card table.dataTable thead th.sorting_desc:after {
  color: rgba(255, 255, 255, 0.85) !important;
  opacity: 1 !important;
}

.ds-table-card table.dataTable tbody td {
  vertical-align: middle;
  padding: 10px 12px !important;
}

.ds-table-card table.dataTable tbody .badge,
table.dataTable .badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1.3;
  white-space: nowrap;
  vertical-align: middle;
}

.ds-table-card table.dataTable tbody tr:hover {
  background-color: rgba(2, 132, 199, 0.04);
}

.ds-table-card .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.ds-table-card .dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
  background: var(--ds-primary) !important;
  border-color: var(--ds-primary) !important;
  color: #fff !important;
  border-radius: 6px;
}

.ds-table-card .dataTables_wrapper .dataTables_info {
  color: var(--ds-muted);
  padding-top: 14px;
}

/* Botones de acción en tablas */
.ds-table-card .btn-xs,
.ds-table-card .btn-sm {
  border-radius: 6px;
  margin: 1px;
}

/* Formularios paciente */
.ds-module-paciente .ds-form-sidebar.box {
  position: sticky;
  top: 74px;
}

.ds-module-paciente .profile-user-img {
  border: 3px solid rgba(2, 132, 199, 0.2);
  padding: 4px;
}

.ds-module-paciente .nav-tabs-custom {
  background: #fff;
  border-radius: var(--ds-radius);
  box-shadow: var(--ds-shadow);
  border: 1px solid var(--ds-border);
}

.ds-module-paciente .nav-tabs-custom > .nav-tabs {
  border-bottom: 1px solid var(--ds-border);
  padding: 8px 12px 0;
}

.ds-module-paciente .nav-tabs-custom > .nav-tabs > li > a {
  border-radius: 8px 8px 0 0;
  font-weight: 500;
  color: var(--ds-muted);
}

.ds-module-paciente .nav-tabs-custom > .nav-tabs > li.active > a {
  color: var(--ds-primary);
  border-top: 2px solid var(--ds-primary);
}

.ds-module-paciente .tab-content {
  padding: 20px;
}

.ds-module-paciente .box-footer {
  background: #f8fafc;
  border-top: 1px solid var(--ds-border);
  padding: 16px 20px;
  border-radius: 0 0 var(--ds-radius) var(--ds-radius);
}

.ds-form-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ds-primary);
  margin: 20px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ds-border);
}

/* Agenda / calendario */
.ds-module-agenda .ds-agenda-sidebar.box {
  position: sticky;
  top: 74px;
}

.ds-module-agenda .ds-agenda-sidebar .box-body {
  padding: 20px;
}

.ds-module-agenda .ds-agenda-calendar.box {
  min-height: 520px;
}

.ds-module-agenda .botones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-border);
}

.ds-module-agenda .botones h4 {
  margin: 0;
  flex: 1;
  font-weight: 600;
  color: var(--ds-text);
  min-width: 120px;
}

.ds-module-agenda .botones .btn-group .btn {
  border-radius: 8px;
}

.ds-module-agenda .botones .radio-inline {
  margin-right: 12px;
}

.ds-module-agenda #calendar {
  border-radius: var(--ds-radius);
  overflow: hidden;
  border: 1px solid var(--ds-border);
  background: #fff;
  padding: 8px;
}

.ds-module-agenda .cal-cell1 {
  min-height: 80px;
}

/* Historia clínica */
.ds-module-historia .ds-historia-filter.box {
  margin-bottom: 16px;
}

.ds-module-historia #HistoriaMenu.ds-historia-nav {
  border-radius: var(--ds-radius);
  overflow: hidden;
  box-shadow: var(--ds-shadow);
  border: 1px solid var(--ds-border);
}

.ds-module-historia #HistoriaMenu.ds-historia-nav .list-group-item {
  border: none;
  border-bottom: 1px solid var(--ds-border);
  padding: 12px 16px;
  font-weight: 500;
  color: var(--ds-text);
  transition: background .15s ease, color .15s ease;
}

.ds-module-historia #HistoriaMenu.ds-historia-nav .list-group-item:last-child {
  border-bottom: none;
}

.ds-module-historia #HistoriaMenu.ds-historia-nav .list-group-item.active,
.ds-module-historia #HistoriaMenu.ds-historia-nav .list-group-item.active:focus,
.ds-module-historia #HistoriaMenu.ds-historia-nav .list-group-item.active:hover {
  background: linear-gradient(90deg, rgba(2, 132, 199, 0.12) 0%, transparent 100%);
  color: var(--ds-primary);
  border-left: 3px solid var(--ds-primary);
}

.ds-module-historia #HistoriaMenu.ds-historia-nav .list-group-item i {
  width: 20px;
  margin-right: 8px;
  color: var(--ds-primary);
}

.ds-module-historia .ds-historia-patient-card {
  background: #fff;
  border-radius: var(--ds-radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--ds-border);
  box-shadow: var(--ds-shadow);
}

.ds-module-historia .ds-historia-patient-card h4 {
  font-weight: 600;
  color: var(--ds-primary);
  margin-top: 12px;
}

.ds-module-historia #HistoriaContenido .panel-primary:not(.ds-odontograma-shell) {
  border-radius: var(--ds-radius);
  overflow: hidden;
  border: 1px solid var(--ds-border);
  box-shadow: var(--ds-shadow);
}

/* Paneles historia: ocultos salvo el activo */
.ds-module-historia [id^="HistoriaContenido"].panel {
  display: none;
}

.ds-module-historia [id^="HistoriaContenido"].panel.ds-historia-panel-visible {
  display: block !important;
}

/* Layout historia: perfil + menú izquierda, contenido derecha */
.ds-module-historia #HistoriaSidebarCol {
  position: sticky;
  top: 15px;
}

/* Odontograma: en modo chart el canvas se escala; no forzar scroll */
.ds-module-historia #HistoriaContenidoCol.ds-historia-odontograma-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ds-module-historia.ds-historia-chart-mode #HistoriaContenidoCol.ds-historia-odontograma-scroll {
  overflow: visible;
}

.ds-module-historia #HistoriaContenido .panel-heading {
  background: var(--ds-gradient-accent);
  border: none;
  padding: 14px 18px;
  font-weight: 600;
}

/* Odontograma — layout fijo 800px (cursores % dependen de esto) */
.ds-odontograma-shell.panel-primary {
  border-radius: var(--ds-radius);
  overflow: visible;
  border: 1px solid var(--ds-border);
  box-shadow: var(--ds-shadow);
}

.ds-odontograma-shell > .panel-heading {
  background: var(--ds-gradient-accent);
  border: none;
  padding: 14px 18px;
  font-weight: 600;
  border-radius: var(--ds-radius) var(--ds-radius) 0 0;
}

.ds-odontograma-shell > .panel-body {
  background: #fafbfd;
  padding: 16px;
  overflow: visible;
}

.ds-odontograma-shell #OdontogramaImprimir {
  overflow-x: hidden;
  padding-bottom: 8px;
}

.ds-odontograma-shell #odontograma {
  justify-content: flex-start;
}

.ds-odontograma-shell #odontograma-contenido.ds-odontograma-canvas,
.ds-odontograma-shell #odontograma-contenido {
  width: 800px;
  min-width: 800px;
  max-width: 800px;
  margin: 0 auto;
}

.ds-odontograma-shell #odontograma-contenido img {
  width: 800px !important;
  max-width: none !important;
  height: auto;
  display: block;
}

.ds-odontograma-shell #imprimir {
  display: none;
}

.ds-odontograma-shell .ds-odontograma-nav-wrap {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  overflow-x: hidden;
}

.ds-odontograma-shell .odontograma-navegacion {
  background: #fff;
  border-radius: var(--ds-radius);
  border: 1px solid var(--ds-border);
  padding: 12px !important;
  box-shadow: var(--ds-shadow);
}

.ds-odontograma-shell .odontograma-navegacion > li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
}

.ds-odontograma-shell .odontograma-navegacion > li:last-child {
  border-bottom: none;
}

.ds-hal-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ds-hal-icon {
  --hal-azul: #2563eb;
  --hal-rojo: #dc2626;
  --hal-ink: #475569;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
  overflow: visible;
}

.odontograma-navegacion .dropdown-menu .ds-hal-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

.ds-odontograma-shell .odontograma-navegacion img,
.ds-odontograma-shell .odontograma-navegacion .ds-hal-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.ds-odontograma-shell .nav-tabs {
  margin-bottom: 8px;
}

.ds-odontograma-shell #odontograma-navegacion .btn-flat {
  border-radius: 8px;
}

.ds-odontograma-nav-wrap .odontograma-navegacion {
  margin-top: 0;
}

@media (max-width: 991px) {
  .ds-module-paciente .ds-form-sidebar.box,
  .ds-module-agenda .ds-agenda-sidebar.box {
    position: static;
    margin-bottom: 20px;
  }

  .ds-toolbar-actions {
    margin-left: 0;
    width: 100%;
  }

  .ds-module-agenda .botones {
    flex-direction: column;
    align-items: stretch;
  }
}
