/**
 * AdminEduDaat — mejoras responsive (login + panel)
 * Cargar después de style.css del tema iPortfolio.
 */

/* ---------- Invitados (login / recuperar) ---------- */
body.guest-layout #header,
body.guest-layout .mobile-nav-toggle,
body.guest-layout #footer,
body.guest-layout .back-to-top {
  display: none !important;
}

/* El copyright fijo (#footer) tapaba el final del menú lateral */
body.auth-panel #footer {
  display: none !important;
}

/* Barra superior: saludo izquierda, Salir derecha, centrado vertical */
.breadcrumbs {
  padding: 12px 0;
}

.breadcrumbs__bar {
  min-height: 2.5rem;
  gap: 0.75rem;
}

.breadcrumbs__left {
  min-width: 0;
  gap: 0.75rem 1.25rem;
}

.breadcrumbs h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #0e2442;
  padding-left: 0.75rem;
  border-left: 4px solid #149ddd;
}

.sidebar-hello {
  margin-top: 0.35rem;
  padding: 0 10px;
  font-size: 0.9rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.sidebar-hello b {
  color: #fff;
  font-weight: 600;
}

.breadcrumbs__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.breadcrumbs__logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #149ddd;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.breadcrumbs__logout i {
  font-size: 1.25rem;
  line-height: 1;
}

.breadcrumbs__logout:hover {
  color: #0e2442;
}

@media (max-width: 768px) {
  .breadcrumbs .breadcrumbs__bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .breadcrumbs__left h2 {
    font-size: 1.35rem;
    padding-left: 0.6rem;
    border-left-width: 3px;
  }
}

body.guest-layout #main {
  margin-left: 0 !important;
  min-height: 100vh;
}

body.guest-layout {
  margin: 0;
  background: #0b1326;
}

/* Split 50/50 — estilo landing-main */
.login-split {
  display: flex;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0 !important;
  overflow: hidden;
}

.login-split__brand {
  position: relative;
  flex: 0 0 50%;
  width: 50%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("../img/hero-bg.jpg") center center / cover no-repeat;
  color: #dae2fd;
}

.login-split__brand-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(11, 19, 38, 0.78) 0%, rgba(19, 27, 46, 0.65) 45%, rgba(0, 43, 117, 0.55) 100%);
  z-index: 1;
}

.login-split__brand-halos {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.login-split__halo {
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.45;
}

.login-split__halo--a {
  width: 22rem;
  height: 22rem;
  top: -4rem;
  left: -3rem;
  background: rgba(179, 197, 255, 0.55);
}

.login-split__halo--b {
  width: 18rem;
  height: 18rem;
  bottom: 10%;
  right: -2rem;
  background: rgba(208, 188, 255, 0.4);
}

.login-split__brand-content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 2rem;
  max-width: 32rem;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

/* Marca TochnaNet — docs/BRANDING.md (landing-main). Nombre: una sola palabra. */
.tn-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  font-family: 'Plus Jakarta Sans', Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1;
  color: #dae2fd;
  margin: 0 auto 1.35rem;
}

.tn-brand--lg {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.tn-brand__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem; /* 36 px */
  height: 2.25rem;
  border-radius: 0.75rem; /* 12 px — branding */
  background: linear-gradient(to bottom right, #b3c5ff, #d0bcff);
  color: #002b75;
  flex-shrink: 0;
}

.tn-brand--lg .tn-brand__icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1.167rem; /* 56 × 12/36 */
}

.tn-brand__hub {
  font-size: 20px !important;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}

.tn-brand--lg .tn-brand__hub {
  font-size: 32px !important;
}

.tn-brand__word {
  letter-spacing: -0.02em;
}

.tn-brand__net {
  background-image: linear-gradient(to right, #b3c5ff, #d0bcff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

.login-split__logo {
  display: none;
}

.login-split__tagline {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  line-height: 1.45;
  color: rgba(218, 226, 253, 0.88);
  font-weight: 500;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.login-split__product {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(218, 226, 253, 0.7);
  font-family: 'Plus Jakarta Sans', Inter, sans-serif;
}

.login-split__product span {
  background-image: linear-gradient(to right, #b3c5ff, #d0bcff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-split__form-pane {
  flex: 0 0 50%;
  width: 50%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: #f8fafc;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.login-split__form-card {
  width: 100%;
  max-width: 24rem;
}

.login-split__title {
  margin: 0 0 0.35rem;
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  font-family: 'Plus Jakarta Sans', Inter, sans-serif;
}

.login-split__subtitle {
  margin: 0 0 1.5rem;
  color: #64748b;
  font-size: 0.95rem;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.login-split__form .form-label {
  color: #334155;
  font-weight: 600;
  font-size: 0.9rem;
}

.login-split__form .form-control {
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.7rem 0.85rem;
  background: #fff;
  color: #0f172a;
}

.login-split__form .form-control:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-split__btn {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  font-weight: 700;
  border-radius: 0.65rem;
  padding: 0.7rem 1rem;
}

.login-split__btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.login-split__link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}

.login-split__link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

@media (max-width: 991.98px) {
  .login-split {
    flex-direction: column;
  }

  .login-split__brand,
  .login-split__form-pane {
    flex: none;
    width: 100%;
    min-height: auto;
  }

  .login-split__brand {
    min-height: 42vh;
    padding: 2.5rem 1rem;
  }

  .login-split__form-pane {
    min-height: 58vh;
    padding: 2rem 1.25rem 2.5rem;
  }
}

/* ---------- Panel autenticado ---------- */
section.inner-page {
  overflow: visible;
  padding-left: 12px;
  padding-right: 12px;
}

#main {
  max-width: 100%;
  /* visible: el menú Ayuda de breadcrumbs no debe quedar recortado bajo el contenido */
  overflow: visible;
}

#main > .inner-page {
  max-width: 100%;
  overflow-x: auto;
}

#main .container-fluid {
  padding-left: 12px;
  padding-right: 12px;
}

#main .card {
  max-width: 100%;
}

#main .card-body {
  padding: 1rem;
  overflow-x: auto;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
  div.dataTables_wrapper div.dataTables_length,
  div.dataTables_wrapper div.dataTables_filter,
  div.dataTables_wrapper div.dataTables_info,
  div.dataTables_wrapper div.dataTables_paginate {
    float: none !important;
    text-align: left !important;
    width: 100%;
    margin-bottom: 0.75rem;
  }

  div.dataTables_wrapper div.dataTables_filter input {
    width: 100% !important;
    margin-left: 0 !important;
    display: block;
    margin-top: 0.35rem;
  }

  div.dataTables_wrapper div.dataTables_length select {
    display: inline-block;
  }

  .breadcrumbs {
    padding-top: 70px;
  }

  #header .profile img {
    width: 96px !important;
    height: 96px !important;
  }

  #header .profile h1 {
    font-size: 1rem !important;
    line-height: 1.3;
    padding: 0 10px;
  }

  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .d-grid .btn,
  .btn-xl {
    width: 100%;
  }

  .col-lg-8 {
    max-width: 100%;
  }
}

@media (max-width: 1199.98px) {
  body.auth-panel #main {
    padding-top: 0;
  }

  .mobile-nav-toggle {
    z-index: 9999;
  }

  body.mobile-nav-active::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9989;
  }

  body.mobile-nav-active #header {
    z-index: 9990;
  }
}

/* El select inline conserva el ancho que tenía en la tabla de escritorio */
.orden-boleta-inline {
  min-width: 8.5rem;
}

/* ---------- Panel en teléfono y tableta (sidebar superpuesto, < 1200px) ---------- */
@media (max-width: 1199.98px) {
  html,
  body.auth-panel {
    overflow-x: hidden;
    max-width: 100%;
  }

  #main,
  #main > .inner-page,
  #main .card,
  #main .card-body,
  #main .col,
  #main .container-fluid {
    min-width: 0;
    max-width: 100%;
  }

  #main,
  #main > .inner-page,
  #main .card,
  #main .card-body {
    overflow-x: hidden;
  }

  .breadcrumbs {
    padding: 10px 0 !important;
    margin-bottom: 0.75rem;
  }

  body.auth-panel .breadcrumbs .container {
    /* Hueco del botón de menú, fijo a la derecha */
    padding-right: calc(12px + 44px + 10px);
  }

  .mobile-nav-toggle {
    top: 10px;
    right: 12px;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }

  .breadcrumbs .breadcrumbs__bar {
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 44px;
    gap: 0.5rem;
  }

  .breadcrumbs__left {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    overflow: hidden;
  }

  .breadcrumbs__left h2 {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.15rem;
  }

  .breadcrumbs__actions {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 0.25rem;
  }

  #header {
    width: min(300px, calc(100vw - 3.5rem));
    overflow-x: hidden;
    padding-bottom: 1.5rem;
  }

  #header .profile .social-links a {
    width: 40px;
    height: 40px;
  }

  #header .profile h1 a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
  }

  .nav-menu > ul > li {
    white-space: normal;
  }

  .nav-menu a,
  .nav-menu button.nav-link {
    min-height: 44px;
    height: auto;
  }

  .nav-menu a span,
  .nav-menu button.nav-link span {
    white-space: normal;
  }

  .breadcrumbs .breadcrumbs__actions.d-flex,
  .breadcrumbs .breadcrumbs__left.d-flex {
    display: flex !important;
  }

  body.auth-panel .breadcrumbs__help,
  body.auth-panel .breadcrumbs__user {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    box-sizing: border-box;
    justify-content: center;
    flex-shrink: 0;
  }

  body.auth-panel .breadcrumbs__help-icon,
  body.auth-panel .breadcrumbs__user-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .session-dropdown {
    min-width: 12rem;
  }

  .session-dropdown__logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }

  .breadcrumbs__user {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 0;
    background: transparent;
    color: #0e2442;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
  }

  .breadcrumbs__user::after {
    display: none;
  }

  .breadcrumbs__user-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #0e2442;
    color: #fff;
    flex-shrink: 0;
  }

  .breadcrumbs__user-icon i {
    font-size: 1.35rem;
    line-height: 1;
  }

  .breadcrumbs__user-name {
    display: none;
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ayuda-dropdown,
  .session-dropdown {
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 5.5rem);
    overflow-y: auto;
  }

  .ayuda-dropdown .dropdown-item,
  .session-dropdown .dropdown-item,
  .session-dropdown__logout {
    min-height: 44px;
  }

  .session-dropdown__name {
    white-space: normal;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0e2442;
  }

  .ayuda-dropdown__row .btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .table-responsive,
  div.dataTables_wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #main table.dataTable {
    width: max-content !important;
    min-width: 100%;
  }

  #main table.dataTable th,
  #main table.dataTable td {
    white-space: nowrap;
  }

  #main table td a,
  #main table td button.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    vertical-align: middle;
  }

  #main table td a i,
  #main table td button.btn-link i {
    font-size: 1.25rem;
    line-height: 1;
  }

  .btn,
  .form-control,
  .form-select,
  .page-link,
  .nav-tabs .nav-link,
  .accordion-button {
    min-height: 40px;
  }

  .btn-group {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .btn-group > .btn {
    flex: 1 1 auto;
  }

  div.dataTables_wrapper div.dataTables_filter input,
  div.dataTables_wrapper div.dataTables_length select,
  div.dataTables_wrapper .page-link {
    min-height: 40px;
  }

  div.dataTables_wrapper .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
  }

  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tabs .nav-item {
    flex: 0 0 auto;
  }

  .nav-tabs .nav-link {
    white-space: nowrap;
  }

  .d-flex.gap-1,
  .d-flex.gap-2,
  .d-flex.gap-3 {
    flex-wrap: wrap;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
  select,
  textarea {
    max-width: 100%;
  }

  form.row.align-items-end > .col-md-1,
  form.row.align-items-end > .col-md-2 {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }

  form.row.align-items-end > .col-md-1 .btn,
  form.row.align-items-end > .col-md-2 .btn {
    width: 100%;
  }

  .modal-dialog,
  .modal-dialog.modal-lg {
    width: auto;
    max-width: calc(100vw - 1rem);
    margin: 0.5rem auto;
  }

  .modal-content {
    max-height: calc(100dvh - 1rem);
  }

  .modal-body {
    overflow-y: auto;
    max-height: calc(100dvh - 9.5rem);
  }

  .modal-header .btn-close {
    min-width: 40px;
    min-height: 40px;
    padding: 0.75rem;
  }

  .modal-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    flex: 1 1 8rem;
  }

  .form-check {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .form-check-inline {
    display: flex;
    align-items: center;
    width: 100%;
    margin-right: 0;
    min-height: 44px;
  }

  .form-check .form-check-input {
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0;
    flex-shrink: 0;
  }

  .form-switch {
    padding-left: 4.25rem;
  }

  .form-switch .form-check-input {
    width: 3.25rem;
    height: 2.5rem;
    margin-left: -4.25rem;
    margin-top: 0;
    float: none;
  }

  .login-split__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.35rem 0.5rem;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .breadcrumbs__user-name {
    display: inline;
  }
}

@media (max-width: 575.98px) {
  form.row .col-auto {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }

  form.row .col-auto .form-select,
  form.row .col-auto .form-control,
  form.row .col-auto .btn {
    width: 100%;
  }
}

/* Asignaturas: ficha apilada para que orden y boleta no queden fuera de pantalla */
@media (max-width: 991.98px) {
  div.dataTables_wrapper:has(table.table-cards) {
    overflow-x: visible;
  }

  #main table.dataTable.table-cards {
    width: 100% !important;
    min-width: 0 !important;
  }

  #main table.table-cards thead {
    display: none;
  }

  #main table.table-cards,
  #main table.table-cards tbody,
  #main table.table-cards tr,
  #main table.table-cards td,
  #main table.table-cards th {
    display: block;
    width: 100% !important;
    max-width: 100%;
    white-space: normal;
    box-sizing: border-box;
  }

  #main table.table-cards tr {
    margin: 0 0 0.85rem;
    padding: 0.35rem 0.85rem 0.65rem;
    border: 1px solid #e4eaf1;
    border-radius: 12px;
    background: #fff;
  }

  #main table.table-cards td,
  #main table.table-cards th[scope="row"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 0;
    padding: 0.45rem 0;
    text-align: right;
  }

  #main table.table-cards td::before,
  #main table.table-cards th[scope="row"]::before {
    content: attr(data-label);
    flex: 0 0 42%;
    font-weight: 600;
    text-align: left;
    color: #0e2442;
  }

  #main table.table-cards td form {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
  }

  #main table.table-cards .orden-boleta-inline {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 44px;
  }

  #main table.table-cards td.table-cards__actions {
    justify-content: flex-end;
    gap: 0.35rem;
  }

  #main table.table-cards td.table-cards__actions::before {
    margin-right: auto;
  }
}
