html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ── Tema oscuro: overrides para utilidades Bootstrap con color fijo ───── */

/* bg-white y bg-light no responden automáticamente a data-bs-theme */
[data-bs-theme="dark"] .bg-white {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color) !important;
}
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--bs-body-color) !important;
}

/* Filas inactivas table-secondary (Bootstrap hardcodea colores claros) */
[data-bs-theme="dark"] .table-secondary,
[data-bs-theme="dark"] .table > :not(caption) > * > .table-secondary {
    --bs-table-color:         var(--bs-secondary-color);
    --bs-table-bg:            rgba(255, 255, 255, 0.05);
    --bs-table-striped-bg:    rgba(255, 255, 255, 0.05);
    --bs-table-striped-color: var(--bs-secondary-color);
    --bs-table-active-bg:     rgba(255, 255, 255, 0.08);
    --bs-table-hover-bg:      rgba(255, 255, 255, 0.08);
    --bs-table-border-color:  var(--bs-border-color);
    color: var(--bs-secondary-color) !important;
    border-color: var(--bs-border-color) !important;
}

/* Encabezados de tabla table-light */
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table > :not(caption) > * > .table-light {
    --bs-table-color:         var(--bs-body-color);
    --bs-table-bg:            var(--bs-secondary-bg);
    --bs-table-striped-bg:    var(--bs-tertiary-bg);
    --bs-table-striped-color: var(--bs-body-color);
    --bs-table-active-bg:     var(--bs-tertiary-bg);
    --bs-table-hover-bg:      var(--bs-tertiary-bg);
    --bs-table-border-color:  var(--bs-border-color);
    color: var(--bs-body-color) !important;
    border-color: var(--bs-border-color) !important;
}

/* text-dark fuera de badges conserva legibilidad */
[data-bs-theme="dark"] :not(.badge).text-dark {
    color: var(--bs-body-color) !important;
}

/* Badge advertencia: texto oscuro para contraste sobre fondo amarillo */
[data-bs-theme="dark"] .badge.bg-warning {
    color: #212529 !important;
}

/* Details/summary */
[data-bs-theme="dark"] details > summary {
    color: var(--bs-body-color);
}

/* Etiquetas small text-muted en card-headers ya adaptan vía --bs-secondary-color */

/* Popover */
[data-bs-theme="dark"] .popover {
    --bs-popover-bg:           var(--bs-secondary-bg);
    --bs-popover-border-color: var(--bs-border-color);
    --bs-popover-header-bg:    var(--bs-tertiary-bg);
    --bs-popover-body-color:   var(--bs-body-color);
    --bs-popover-header-color: var(--bs-body-color);
}

/* Focus ring sobre fondo oscuro */
[data-bs-theme="dark"] .btn:focus,
[data-bs-theme="dark"] .btn:active:focus,
[data-bs-theme="dark"] .btn-link.nav-link:focus,
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--bs-body-bg), 0 0 0 0.25rem var(--azell-blue);
}

/* Scrollbar WebKit */
[data-bs-theme="dark"] ::-webkit-scrollbar { width: 8px; height: 8px; }
[data-bs-theme="dark"] ::-webkit-scrollbar-track { background: var(--bs-body-bg); }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--bs-border-color); border-radius: 4px; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: var(--bs-secondary-color); }
