/**
 * HKDental - Estilos visuales generales y adaptación responsiva.
 *
 * Define identidad visual, login, tarjetas KPI, tablas, carga de archivos
 * y comportamiento móvil del menú lateral de AdminLTE.
 * Copyright GrupoMBIT
 * Copyright © DOMB
 */

:root {
  --brand: #ff5fa2;
  --brand-2: #e91e63;
  --soft-shadow: 0 16px 40px rgba(15, 23, 42, .08);
  --sidebar-width: 250px;
}

html { font-size: 16px; }
body { overflow-x: hidden; }

.gradient-text {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-bg {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 105, 180, .38), transparent 30%),
    radial-gradient(circle at 82% 22%, rgba(255, 182, 193, .45), transparent 32%),
    radial-gradient(circle at 50% 90%, rgba(255, 240, 246, .9), transparent 36%),
    linear-gradient(135deg, #fff1f7, #ffd6e8 55%, #fff7fb);
}

.login-card {
  width: min(430px, 94vw);
  padding: clamp(22px, 5vw, 34px);
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 28px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
}

.login-logo-img {
  width: clamp(62px, 13vw, 88px);
  height: clamp(62px, 13vw, 88px);
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: clamp(18px, 4vw, 24px);
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,235,246,.92));
  border: 1px solid rgba(255, 143, 196, .45);
  box-shadow: 0 14px 30px rgba(233, 30, 99, .18);
  overflow: hidden;
  flex: 0 0 auto;
}
.login-logo-img img {
  width: clamp(52px, 11vw, 78px);
  height: clamp(52px, 11vw, 78px);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
@media (max-width: 480px) {
  .login-logo-img {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    margin-bottom: 10px;
  }
  .login-logo-img img {
    width: 50px;
    height: 50px;
  }
}
.login-card .btn-primary { background: linear-gradient(135deg, #ff5fa2, #e91e63); border-color: #e91e63; }

.metric-card {
  min-height: 126px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 18px 35px rgba(47, 128, 237, .22);
  color: #fff;
}

.metric-card span { display: block; opacity: .86; }
.metric-card strong { font-size: clamp(1.7rem, 8vw, 2.1rem); }

.glass-card { border: 0; border-radius: 22px; box-shadow: var(--soft-shadow); }

.table td,
.table th { vertical-align: middle; font-size: .86rem; }

.app-sidebar .nav-link.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.badge { font-size: .75rem; }

.file-chip {
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #fff;
  height: 100%;
}

.batch-title { color: #475569; font-weight: 700; }
.progress { height: 28px; border-radius: 999px; overflow: hidden; }

/* Evita que DataTables y matrices anchas rompan el viewport en celular. */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dataTables_wrapper, .dt-container { width: 100%; overflow-x: auto; }
.dt-buttons { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }

.mobile-sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .app-header .navbar-brand { font-size: 1.05rem; }
  .app-content-header h1 { font-size: 1.35rem; }
  .app-content { padding: .75rem; }

  .app-sidebar {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1045;
    width: var(--sidebar-width);
    transform: translateX(-105%);
    transition: transform .22s ease-in-out;
  }

  body.sidebar-open { overflow: hidden; }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  body.sidebar-open .mobile-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(2px);
  }

  .app-main { margin-left: 0 !important; }
  .metric-card { min-height: auto; padding: 18px; }
  .card-body { padding: 1rem; }
  .btn-lg { width: 100%; margin-bottom: .35rem; }
  .mobile-stack { flex-direction: column !important; align-items: stretch !important; }
  .mobile-stack > * { width: 100%; }
}

@media (max-width: 575.98px) {
  .login-card { border-radius: 22px; }
  .form-control, .form-select, .btn { min-height: 44px; }
  .table td, .table th { font-size: .8rem; white-space: nowrap; }
}

/* HKDental v34 - Hoja 2/4 Historia Clínica: odontograma capturable.
   No modifica ETL; únicamente da formato responsive a la pestaña de captura. */
.clinical-tabs .nav-link { border-radius: 999px; font-weight: 700; }
.odonto-wrapper { padding: .5rem 0; }
.odonto-table { width: max-content; min-width: 720px; }
.odonto-table td { width: 44px; min-width: 44px; padding: 2px !important; text-align: center; vertical-align: middle; }
.odonto-tooth { font-weight: 700; font-size: .8rem; line-height: 1; margin-bottom: 2px; }
.odonto-cell { text-align: center; padding: 2px !important; height: 28px; font-weight: 700; text-transform: uppercase; }
.compact-table th, .compact-table td { padding: .25rem .35rem !important; text-align: center; vertical-align: middle; }
.compact-table input { min-width: 46px; }
