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;
}

.border-thick {
    border-bottom: 3px solid #dee2e6 !important;
    border-top: 3px solid #dee2e6 !important;
}
#menuScopeButtons .menu-scope-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#menuScopeButtons .menu-scope-toggle .btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
}

#menuScopeButtons .menu-scope-toggle .menu-scope-icon {
  display: inline-flex;
  justify-content: center;
  min-width: 1rem;
}

body.sidebar-toggled #menuScopeButtons {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

body.sidebar-toggled #menuScopeButtons .menu-scope-toggle .btn {
  justify-content: center;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

body.sidebar-toggled #menuScopeButtons .menu-scope-toggle .menu-scope-text {
  display: none;
}

.theme-toggle-btn {
  min-width: 2.25rem;
  border-radius: 999px;
}

.scc-topbar {
  height: auto !important;
  min-height: 76px;
  margin: 0 1.5rem 1.5rem;
  padding: 0;
  border: 1px solid rgba(17, 24, 39, .08);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 14px 32px rgba(17, 24, 39, .08) !important;
}

.scc-topbar .scc-topbar-inner {
  position: relative !important;
  gap: 1rem;
  min-width: 0;
  padding: .65rem 1.5rem;
}

.scc-topbar .header-content-left {
  flex: 0 0 auto;
  min-width: 0;
}

.scc-topbar .header-content-left img,
.scc-topbar .mineduc-logo-container {
  height: 52px !important;
  max-width: 240px;
  object-fit: contain;
}

.scc-topbar .mineduc-logo-dark {
  padding: 0 !important;
}

.scc-topbar .scc-topbar-title {
  position: static !important;
  left: auto !important;
  transform: none !important;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 1rem;
}

.scc-topbar .scc-topbar-title h3,
.scc-topbar .scc-topbar-title h5 {
  color: #374151;
  font-weight: 500;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scc-topbar .scc-topbar-title h3 {
  font-size: clamp(1.35rem, 2vw, 2.15rem);
}

.scc-topbar .scc-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex: 0 0 auto;
  min-width: 0;
}

.scc-network-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.scc-network-status__button {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background-color: #f9fafb;
  color: #2563eb;
  cursor: pointer;
  transition: transform .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.scc-network-status__button::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  border: 1px solid currentColor;
  opacity: 0;
  pointer-events: none;
}

.scc-network-status__button::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background-color: currentColor;
  opacity: 0;
  transform: rotate(-45deg) scaleX(.65);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

.scc-network-status__button i {
  position: relative;
  z-index: 1;
  transition: color .2s ease, opacity .2s ease;
}

.scc-network-status__button:hover,
.scc-network-status__button:focus,
.scc-network-status.is-open .scc-network-status__button {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  background-color: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
  outline: none;
}

.scc-network-status.is-online .scc-network-status__button {
  color: #16a34a;
}

.scc-network-status.is-online .scc-network-status__button::before {
  animation: scc-network-pulse 2.5s ease-out infinite;
}

.scc-network-status.is-slow .scc-network-status__button {
  color: #d97706;
  border-color: #fde68a;
  background-color: #fffbeb;
}

.scc-network-status.is-slow .scc-network-status__button::before {
  animation: scc-network-pulse-strong 2.5s ease-out infinite;
}

.scc-network-status.is-offline .scc-network-status__button {
  color: #dc2626;
  border-color: #fecaca;
  background-color: #fff5f5;
}

.scc-network-status.is-offline .scc-network-status__button::after {
  opacity: .9;
  transform: rotate(-45deg) scaleX(1);
}

.scc-network-status.is-checking .scc-network-status__button {
  color: #2563eb;
}

.scc-network-status.is-checking .scc-network-status__button::before {
  animation: scc-network-checking 1.4s ease-in-out infinite;
}

.scc-network-status__popover {
  position: absolute;
  top: calc(100% + .75rem);
  right: 0;
  z-index: 1070;
  width: min(280px, calc(100vw - 2rem));
  padding: .95rem 1rem;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  color: #111827;
  box-shadow: 0 22px 50px rgba(15, 23, 42, .16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  pointer-events: none;
}

.scc-network-status__popover::before {
  content: "";
  position: absolute;
  top: -.42rem;
  right: 1rem;
  width: .8rem;
  height: .8rem;
  border-left: 1px solid rgba(15, 23, 42, .08);
  border-top: 1px solid rgba(15, 23, 42, .08);
  background: inherit;
  transform: rotate(45deg);
}

.scc-network-status:hover .scc-network-status__popover,
.scc-network-status:focus-within .scc-network-status__popover,
.scc-network-status.is-open .scc-network-status__popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

@keyframes scc-network-pulse {
  0% {
    opacity: .28;
    transform: scale(.86);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

@keyframes scc-network-pulse-strong {
  0% {
    opacity: .38;
    transform: scale(.84);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.3);
  }
}

@keyframes scc-network-checking {
  0%,
  100% {
    opacity: .12;
    transform: scale(.9);
  }
  50% {
    opacity: .34;
    transform: scale(1.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scc-network-status__button,
  .scc-network-status__button::after,
  .scc-network-status__button i,
  .scc-network-status__popover {
    transition: none;
  }

  .scc-network-status__button::before {
    animation: none !important;
  }
}

.scc-network-status__eyebrow {
  margin-bottom: .25rem;
  color: #6b7280;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scc-network-status__title {
  color: #111827;
  font-size: .98rem;
  font-weight: 800;
  line-height: 1.25;
}

.scc-network-status__text {
  margin-top: .35rem;
  color: #4b5563;
  font-size: .84rem;
  line-height: 1.4;
}

.scc-network-status__meta {
  margin-top: .65rem;
  color: #6b7280;
  font-size: .75rem;
}

.scc-profile-toggle {
  min-height: 44px;
  max-width: 240px;
  padding: .25rem .55rem .25rem .25rem;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #374151;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.scc-profile-toggle:hover,
.scc-profile-toggle:focus {
  background-color: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 8px 22px rgba(17, 24, 39, .08);
  outline: none;
}

.scc-profile-toggle::after {
  margin-left: .1rem;
  color: #9ca3af;
}

.scc-profile-avatar,
.scc-profile-avatar-img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.scc-profile-avatar {
  background: linear-gradient(135deg, #4e73df, #22c55e);
  color: #ffffff;
  font-size: .75rem;
  font-weight: 800;
}

.scc-profile-avatar-img {
  object-fit: cover;
}

.scc-profile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .9rem;
  font-weight: 700;
}

.scc-profile-menu {
  min-width: 15rem;
  margin-top: .65rem;
  padding: .45rem;
  border: 1px solid rgba(17, 24, 39, .08);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(17, 24, 39, .14);
}

.scc-profile-menu-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .7rem;
}

.scc-profile-avatar-lg {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.scc-profile-menu-name {
  max-width: 10rem;
  color: #374151;
  font-size: .92rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scc-profile-menu-caption {
  color: #6b7280;
  font-size: .75rem;
}

.scc-profile-menu-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 38px;
  border-radius: 10px;
  color: #4b5563;
  font-weight: 700;
}

.scc-profile-menu-item i {
  width: 1rem;
  color: #6b7280;
  text-align: center;
}

.scc-profile-menu-item:hover,
.scc-profile-menu-item:focus {
  background-color: #f3f4f6;
  color: #1f2937;
}

.scc-profile-menu-item:hover i,
.scc-profile-menu-item:focus i {
  color: #1f2937;
}

@media (max-width: 991.98px) {
  .scc-topbar {
    margin: 0 1rem 1.25rem;
  }

  .scc-topbar .scc-topbar-inner {
    padding: .6rem 1rem;
  }

  .scc-topbar .header-content-left img,
  .scc-topbar .mineduc-logo-container {
    height: 44px !important;
    max-width: 170px;
  }
}

@media (max-width: 575.98px) {
  .scc-topbar {
    min-height: 64px;
    margin: 0 .75rem 1rem;
  }

  .scc-topbar .scc-topbar-inner {
    gap: .5rem;
    padding: .55rem .75rem;
  }

  .scc-topbar .scc-topbar-title {
    padding: 0 .35rem;
  }

  .scc-topbar .scc-topbar-actions {
    gap: .35rem;
    max-width: 92px;
  }

  .scc-network-status__button {
    width: 40px;
    height: 40px;
  }

  .scc-network-status__popover {
    right: -.2rem;
  }

  .scc-network-status__popover::before {
    right: .95rem;
  }

  .scc-profile-toggle {
    width: 40px;
    height: 40px;
    padding: .2rem;
  }

  .scc-profile-toggle::after,
  .scc-profile-name {
    display: none;
  }
}

html.dark-mode body {
  background-color: #111827;
  color: #d1d5db;
}

html.dark-mode body #content,
html.dark-mode body .container-fluid,
html.dark-mode body .card,
html.dark-mode body .modal-content,
html.dark-mode body .dropdown-menu,
html.dark-mode body .sticky-footer {
  background-color: #1f2937 !important;
  color: #d1d5db;
}

html.dark-mode body .topbar {
  /* background-color: #111827 !important; */
  background-color: #1f2937 !important;
  border-bottom: 1px solid #374151;
  box-shadow: none !important;
}

html.dark-mode body .scc-topbar {
  border-color: #374151;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .24) !important;
}

html.dark-mode body .scc-topbar .scc-topbar-title h3,
html.dark-mode body .scc-topbar .scc-topbar-title h5 {
  color: #f3f4f6 !important;
}

html.dark-mode body .scc-profile-toggle {
  background-color: #111827;
  border-color: #374151;
  color: #e5e7eb !important;
}

html.dark-mode body .scc-network-status__button {
  background-color: #111827;
  border-color: #374151;
  color: #93c5fd;
}

html.dark-mode body .scc-network-status__button:hover,
html.dark-mode body .scc-network-status__button:focus,
html.dark-mode body .scc-network-status.is-open .scc-network-status__button {
  background-color: #1f2937;
  border-color: #4b5563;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .26);
}

html.dark-mode body .scc-network-status.is-online .scc-network-status__button {
  color: #86efac;
}

html.dark-mode body .scc-network-status.is-slow .scc-network-status__button {
  color: #fbbf24;
  border-color: #854d0e;
  background-color: #261a08;
}

html.dark-mode body .scc-network-status.is-offline .scc-network-status__button {
  color: #fca5a5;
  border-color: #7f1d1d;
  background-color: #2a1114;
}

html.dark-mode body .scc-network-status__popover {
  border-color: #374151;
  background: rgba(31, 41, 55, .98);
  color: #f9fafb;
  box-shadow: 0 22px 50px rgba(0, 0, 0, .35);
}

html.dark-mode body .scc-network-status__popover::before {
  border-color: #374151;
}

html.dark-mode body .scc-network-status__eyebrow,
html.dark-mode body .scc-network-status__meta {
  color: #cbd5e1;
}

html.dark-mode body .scc-network-status__title {
  color: #f9fafb;
}

html.dark-mode body .scc-network-status__text {
  color: #d1d5db;
}

html.dark-mode body .scc-profile-toggle:hover,
html.dark-mode body .scc-profile-toggle:focus,
html.dark-mode body .scc-profile-menu {
  background-color: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

html.dark-mode body .scc-profile-menu-name,
html.dark-mode body .scc-profile-menu-item {
  color: #f3f4f6;
}

html.dark-mode body .scc-profile-menu-caption,
html.dark-mode body .scc-profile-menu-item i {
  color: #cbd5e1;
}

html.dark-mode body .scc-profile-menu-item:hover,
html.dark-mode body .scc-profile-menu-item:focus {
  background-color: #1f2937;
  color: #ffffff;
}

html.dark-mode body h1,
html.dark-mode body h2,
html.dark-mode body h3,
html.dark-mode body h4,
html.dark-mode body h5,
html.dark-mode body h6,
html.dark-mode body .text-gray-600,
html.dark-mode body .text-gray-800,
html.dark-mode body [class*="text-gray-"],
html.dark-mode body .text-muted,
html.dark-mode body .text-secondary,
html.dark-mode body .text-dark,
html.dark-mode body .small,
html.dark-mode body label,
html.dark-mode body .form-text,
html.dark-mode body .dropdown-item,
html.dark-mode body .card-header,
html.dark-mode body .card-body {
  color: #e5e7eb !important;
}

/* Bootstrap uses light backgrounds in filter headers throughout the system.
   They must change together with their text instead of remaining almost white. */
html.dark-mode body .bg-light,
html.dark-mode body .bg-white,
html.dark-mode body .card-header.bg-light {
  background-color: #273449 !important;
  color: #f3f4f6 !important;
}

html.dark-mode body input::placeholder,
html.dark-mode body textarea::placeholder,
html.dark-mode body .dataTables_empty,
html.dark-mode body caption,
html.dark-mode body legend {
  color: #cbd5e1 !important;
  opacity: 1;
}

html.dark-mode body .table,
html.dark-mode body .table td,
html.dark-mode body .table th {
  color: #e5e7eb;
  border-color: #4b5563;
}

html.dark-mode body .form-control,
html.dark-mode body .custom-select,
html.dark-mode body .form-select {
  background-color: #111827;
  color: #e5e7eb;
  border-color: #4b5563;
}

html.dark-mode body .form-control:focus,
html.dark-mode body .custom-select:focus,
html.dark-mode body .form-select:focus {
  background-color: #111827;
  color: #f9fafb;
}

html.dark-mode body .btn-outline-secondary {
  color: #e5e7eb;
  border-color: #6b7280;
}

html.dark-mode body .btn-outline-secondary:hover {
  background-color: #374151;
  color: #f9fafb;
}
/* Ajustes de contraste en tema oscuro */
.mineduc-logo-container {
  position: relative;
}

.mineduc-logo-container .mineduc-logo-dark {
  display: none;
}

html.dark-mode body .mineduc-logo-container .mineduc-logo-light {
  display: none;
}

html.dark-mode body .mineduc-logo-container .mineduc-logo-dark {
  display: block;
}

html:not(.dark-mode) body .sidebar {
  background: linear-gradient(180deg, #4e73df 10%, #224abe 100%) !important;
}

html.dark-mode body .sidebar {
  background: #4d505a !important;
}

/* Navegación lateral: los submenús de SB Admin conservan texto oscuro por
   defecto, lo que los vuelve ilegibles sobre la superficie oscura. */
html.dark-mode body .sidebar .collapse-inner,
html.dark-mode body .sidebar .collapsing .collapse-inner {
  background-color: #273449 !important;
  border: 1px solid #64748b;
}

html.dark-mode body .sidebar .collapse-inner .collapse-header,
html.dark-mode body .sidebar .collapse-inner .collapse-item,
html.dark-mode body .sidebar .collapsing .collapse-inner .collapse-header,
html.dark-mode body .sidebar .collapsing .collapse-inner .collapse-item {
  color: #e5e7eb !important;
}

html.dark-mode body .sidebar .collapse-inner .collapse-item:hover,
html.dark-mode body .sidebar .collapse-inner .collapse-item:focus,
html.dark-mode body .sidebar .collapse-inner .collapse-item.active,
html.dark-mode body .sidebar .collapsing .collapse-inner .collapse-item:hover,
html.dark-mode body .sidebar .collapsing .collapse-inner .collapse-item:focus,
html.dark-mode body .sidebar .collapsing .collapse-inner .collapse-item.active {
  background-color: #3b4a61 !important;
  color: #ffffff !important;
}

html.dark-mode body .sidebar #menuScopeButtons .btn-light {
  background-color: #273449;
  border-color: #64748b;
  color: #e5e7eb;
}

html.dark-mode body .sidebar #menuScopeButtons .btn-light:hover,
html.dark-mode body .sidebar #menuScopeButtons .btn-light:focus,
html.dark-mode body .sidebar #menuScopeButtons .btn-light.active {
  background-color: #3b4a61;
  border-color: #93c5fd;
  color: #ffffff;
}

html.dark-mode body .sticky-footer {
  border-top: 1px solid #374151 !important;
}

html.dark-mode body .table thead th,
html.dark-mode body .table-light,
html.dark-mode body .table-light > th,
html.dark-mode body .table-light > td,
html.dark-mode body .thead-light th,
html.dark-mode body table.dataTable thead th,
html.dark-mode body .dataTables_wrapper .dataTables_scrollHead,
html.dark-mode body .dataTables_wrapper .dataTables_scrollHeadInner,
html.dark-mode body .dataTables_wrapper .dataTables_scrollHead table {
  background-color: #1f2937 !important;
  color: #f9fafb !important;
}

html.dark-mode body .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

html.dark-mode body .dataTables_wrapper .dataTables_length,
html.dark-mode body .dataTables_wrapper .dataTables_filter,
html.dark-mode body .dataTables_wrapper .dataTables_info,
html.dark-mode body .dataTables_wrapper .dataTables_paginate {
  color: #e5e7eb !important;
}

html.dark-mode body #wrapper,
html.dark-mode body #content-wrapper {
  background-color: #1f2937 !important;
}

.swal2-popup.scc-toast {
  border-radius: .5rem;
  font-family: Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.swal2-popup.scc-toast-light {
  background-color: #ffffff;
  color: #374151;
  border: 1px solid rgba(17, 24, 39, .08);
}

.swal2-popup.scc-toast-dark {
  background-color: #1f2937;
  color: #e5e7eb;
  border: 1px solid #374151;
}

.swal2-popup.scc-toast-dark .swal2-title,
.swal2-popup.scc-toast-dark .swal2-html-container,
.swal2-popup.scc-toast-dark .swal2-close {
  color: #e5e7eb !important;
}

.swal2-popup.scc-toast-dark .swal2-timer-progress-bar {
  background-color: rgba(229, 231, 235, .35);
}

.swal2-popup.scc-toast-light .swal2-title,
.swal2-popup.scc-toast-light .swal2-html-container {
  color: #374151 !important;
}
