/*
  Thydom admin visual layer.
  Rojo Industrial aplicado a admin.thydom.com.
*/

body.thydom-admin {
  background: var(--color-off-white) !important;
}

.thydom-admin .admin-shell,
.thydom-admin .thy-admin-shell {
  min-height: 100vh;
}

.thydom-admin .admin-nav,
.thydom-admin .thy-admin-nav {
  background: var(--color-black);
  border-bottom: 4px solid var(--color-primary);
  color: var(--color-white);
}

.thydom-admin .admin-sidebar,
.thydom-admin .thy-sidebar {
  background: var(--color-black);
  border-right: 4px solid var(--color-primary);
  color: var(--color-white);
}

.thydom-admin .admin-sidebar a,
.thydom-admin .thy-sidebar a,
.thydom-admin .admin-nav a,
.thydom-admin .thy-admin-nav a {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-white);
}

.thydom-admin .admin-sidebar a:hover,
.thydom-admin .thy-sidebar a:hover,
.thydom-admin .admin-nav a:hover,
.thydom-admin .thy-admin-nav a:hover {
  color: var(--color-primary-light);
}

.thydom-admin .admin-table,
.thydom-admin table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
}

.thydom-admin th,
.thydom-admin td {
  border-bottom: 1px solid var(--color-gray-300);
  padding: .75rem .85rem;
  vertical-align: middle;
}

.thydom-admin th {
  background: var(--color-black);
  color: var(--color-white);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.thydom-admin .action-group,
.thydom-admin .table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.thydom-admin .danger-zone {
  border: 1px solid var(--color-primary);
  border-left: 5px solid var(--color-primary);
  background: var(--color-white);
  border-radius: 4px;
}

/* Admin login usa el auth layout común. Evita herencias antiguas sin estructura. */
body.thydom-admin .thy-auth-page {
  background: var(--color-off-white) !important;
}

body.thydom-admin .thy-auth-title,
body.thydom-admin .thy-auth-card-title {
  color: var(--color-black) !important;
}

body.thydom-admin .thy-auth-brand,
body.thydom-admin .thy-auth-brand * {
  color: var(--color-white) !important;
}

/* Admin global UI pass: contraste, iconos, cuenta derecha y scroll helpers. */
body.thydom-admin {
  background: var(--color-off-white) !important;
  color: var(--color-black) !important;
}

.thydom-admin main,
.thydom-admin .admin-main,
.thydom-admin .thy-admin-main,
.thydom-admin .content,
.thydom-admin .page-content {
  color: var(--color-black) !important;
}

/* Sidebar negro legible. */
.thydom-admin .admin-sidebar,
.thydom-admin .thy-sidebar,
.thydom-admin aside {
  background: #050505 !important;
  color: var(--color-white) !important;
}

.thydom-admin .admin-sidebar *,
.thydom-admin .thy-sidebar *,
.thydom-admin aside * {
  color: var(--color-white);
}

.thydom-admin .admin-sidebar .active,
.thydom-admin .thy-sidebar .active,
.thydom-admin .admin-sidebar a:hover,
.thydom-admin .thy-sidebar a:hover {
  color: var(--color-white) !important;
  border-color: var(--color-primary) !important;
}

/* Bloques de contenido legibles: evita negro sobre negro. */
.thydom-admin .thydom-admin-readable-block,
.thydom-admin main .card,
.thydom-admin main .thy-card,
.thydom-admin main .thydom-card,
.thydom-admin main .stat-card,
.thydom-admin main .metric-card,
.thydom-admin main .summary-card,
.thydom-admin main .dashboard-card,
.thydom-admin main .kpi-card {
  background: var(--color-white) !important;
  color: var(--color-black) !important;
  border: 1px solid var(--color-gray-300) !important;
  border-top: 5px solid var(--color-primary) !important;
  box-shadow: 0 2px 12px rgba(26, 26, 26, .08) !important;
}

.thydom-admin .thydom-admin-readable-block *,
.thydom-admin main .card *,
.thydom-admin main .thy-card *,
.thydom-admin main .thydom-card *,
.thydom-admin main .stat-card *,
.thydom-admin main .metric-card *,
.thydom-admin main .summary-card *,
.thydom-admin main .dashboard-card *,
.thydom-admin main .kpi-card * {
  color: var(--color-black) !important;
}

/* Paneles de tabla y auditoría. */
.thydom-admin table {
  background: var(--color-white) !important;
  color: var(--color-black) !important;
}

.thydom-admin table td,
.thydom-admin table td *,
.thydom-admin tbody,
.thydom-admin tbody * {
  color: var(--color-black) !important;
}

.thydom-admin table th,
.thydom-admin table th * {
  color: var(--color-white) !important;
}

/* Títulos siempre visibles. */
.thydom-admin h1,
.thydom-admin h2,
.thydom-admin h3,
.thydom-admin .display,
.thydom-admin .thy-page-title {
  color: var(--color-black) !important;
}

/* Zona superior de cuenta/roles alineada a la derecha. */
.thydom-admin .thydom-admin-account-strip {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .5rem;
  margin: 0 0 1.25rem auto;
  width: 100%;
}

.thydom-admin .thydom-admin-account-strip > * {
  display: inline-flex !important;
  align-items: center;
  min-height: 32px;
  padding: .35rem .65rem !important;
  background: var(--color-black) !important;
  border: 1px solid var(--color-black) !important;
  color: var(--color-white) !important;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.thydom-admin .thydom-admin-account-strip > * * {
  color: var(--color-white) !important;
}

/* Logout minimalista con Font Awesome. */
.thydom-admin .thydom-admin-logout-icon {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--color-primary) !important;
  border: 2px solid var(--color-primary) !important;
  color: var(--color-white) !important;
  border-radius: 2px !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  text-indent: 0 !important;
}

.thydom-admin .thydom-admin-logout-icon:hover {
  background: var(--color-primary-dark) !important;
  border-color: var(--color-primary-dark) !important;
}

.thydom-admin .thydom-admin-logout-icon i {
  color: var(--color-white) !important;
}

/* Accesibilidad: texto solo para lectores. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Botón subir. */
.thydom-admin-back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9999;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-black);
  color: var(--color-white);
  border: 2px solid var(--color-primary);
  border-radius: 2px;
  box-shadow: 0 2px 12px rgba(26, 26, 26, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, background-color .18s ease;
}

.thydom-admin-back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.thydom-admin-back-to-top:hover {
  background: var(--color-primary);
}

.thydom-admin-back-to-top i {
  color: var(--color-white);
}

@media (max-width: 900px) {
  .thydom-admin .thydom-admin-account-strip {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .thydom-admin-back-to-top {
    right: .85rem;
    bottom: .85rem;
  }
}

/* Admin Settings y Tipos de cuenta. */
.thy-admin-page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 1.5rem;
}

.thy-admin-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.thy-admin-page-head h1 {
  margin: .25rem 0 .35rem;
}

.thy-admin-kicker {
  margin: 0;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.thy-admin-lead {
  margin: 0;
  color: var(--color-gray-600);
  max-width: 760px;
}

.thy-admin-alert {
  border-radius: 2px;
  border: 1px solid var(--color-gray-300);
  border-left: 5px solid var(--color-primary);
  background: var(--color-white);
  color: var(--color-black);
  padding: .85rem 1rem;
  margin-bottom: 1rem;
}

.thy-admin-alert--ok {
  border-left-color: #1F8A4C;
}

.thy-admin-alert--error {
  border-left-color: var(--color-primary);
}

.thy-admin-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.thy-admin-setting-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-top: 5px solid var(--color-primary);
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(26, 26, 26, .08);
  padding: 1.1rem;
}

.thy-admin-setting-card__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: .75rem;
}

.thy-admin-setting-card h2 {
  margin: 0 0 .25rem;
  font-size: var(--fs-xl);
}

.thy-admin-setting-card code {
  display: inline-flex;
  background: var(--color-off-white);
  color: var(--color-gray-600);
  border: 1px solid var(--color-gray-300);
  padding: .15rem .35rem;
  font-size: var(--fs-xs);
}

.thy-admin-setting-card p {
  color: var(--color-gray-600);
  margin: 0 0 .85rem;
}

.thy-admin-setting-card input[type="text"],
.thy-admin-setting-card textarea,
.thy-admin-field input,
.thy-admin-field textarea {
  width: 100%;
  box-sizing: border-box;
}

.thy-admin-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding: 1rem 0;
  background: linear-gradient(to top, var(--color-off-white), rgba(245, 242, 237, .85));
}

.thy-admin-btn,
.thy-admin-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-radius: 2px;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  cursor: pointer;
}

.thy-admin-btn {
  min-height: 42px;
  padding: .75rem 1.25rem;
  border: 2px solid var(--color-black);
}

.thy-admin-btn--primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.thy-admin-btn--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.thy-admin-btn--secondary {
  background: transparent;
  color: var(--color-black);
}

.thy-admin-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-black);
  background: var(--color-white);
  color: var(--color-black);
}

.thy-admin-icon-btn:hover {
  background: var(--color-black);
  color: var(--color-white);
}

.thy-admin-icon-btn.is-danger {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.thy-admin-icon-btn.is-ok {
  border-color: #1F8A4C;
  color: #1F8A4C;
}

.thy-admin-actions {
  display: flex;
  gap: .45rem;
  align-items: center;
}

.thy-admin-actions form {
  margin: 0;
}

.thy-admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: .15rem .55rem;
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border: 1px solid var(--color-gray-300);
}

.thy-admin-badge.is-on {
  background: #1F8A4C;
  border-color: #1F8A4C;
  color: var(--color-white);
}

.thy-admin-badge.is-off {
  background: var(--color-gray-300);
  color: var(--color-black);
}

.thy-admin-switch {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  cursor: pointer;
  user-select: none;
}

.thy-admin-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.thy-admin-switch span {
  width: 46px;
  height: 24px;
  border: 2px solid var(--color-black);
  background: var(--color-gray-300);
  position: relative;
  border-radius: 2px;
}

.thy-admin-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: var(--color-black);
  transition: transform .15s ease, background-color .15s ease;
}

.thy-admin-switch input:checked + span {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.thy-admin-switch input:checked + span::after {
  transform: translateX(22px);
  background: var(--color-white);
}

.thy-admin-table-wrap {
  overflow-x: auto;
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-top: 5px solid var(--color-primary);
  box-shadow: 0 2px 12px rgba(26, 26, 26, .08);
}

.thy-admin-table {
  width: 100%;
  border-collapse: collapse;
}

.thy-admin-table th,
.thy-admin-table td {
  padding: .8rem .9rem;
  border-bottom: 1px solid var(--color-gray-300);
  vertical-align: top;
}

.thy-admin-table th {
  background: var(--color-black);
  color: var(--color-white);
}

/* Modales */
.thy-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(26, 26, 26, .72);
}

.thy-modal.is-open {
  display: flex;
}

.thy-modal__panel {
  width: min(680px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-top: 6px solid var(--color-primary);
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(26, 26, 26, .26);
}

.thy-modal__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 1.25rem .75rem;
  border-bottom: 1px solid var(--color-gray-300);
}

.thy-modal__head h2 {
  margin: 0;
}

.thy-modal__close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-black);
  background: var(--color-white);
  color: var(--color-black);
  border-radius: 2px;
}

.thy-modal__close:hover {
  background: var(--color-black);
  color: var(--color-white);
}

.thy-admin-modal-form {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.thy-admin-field {
  display: grid;
  gap: .35rem;
}

.thy-admin-field span {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.thy-admin-field small {
  color: var(--color-gray-600);
}

.thy-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: .5rem;
}

body.thy-modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .thy-admin-page-head {
    flex-direction: column;
  }

  .thy-admin-settings-grid {
    grid-template-columns: 1fr;
  }

  .thy-modal {
    align-items: stretch;
    padding: .75rem;
  }
}

/* Dashboard limpio estilo panel administrativo. */
.thy-admin-dashboard,
.thy-admin-page--wide {
  max-width: 1480px;
  margin: 0 auto;
  padding: 1.5rem;
}

.thy-admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.thy-admin-kpi-card {
  display: grid;
  gap: .35rem;
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-top: 5px solid var(--color-primary);
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(26, 26, 26, .08);
  padding: 1rem;
  color: var(--color-black);
}

.thy-admin-kpi-card:hover {
  border-color: var(--color-black);
  color: var(--color-black);
}

.thy-admin-kpi-card__label {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-gray-600);
  font-size: var(--fs-xs);
}

.thy-admin-kpi-card strong {
  color: var(--color-black);
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  line-height: 1;
}

.thy-admin-kpi-card small {
  color: var(--color-gray-600);
}

.thy-admin-dashboard-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .55fr);
  gap: 1rem;
}

.thy-admin-panel-card,
.thy-admin-filter-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-top: 5px solid var(--color-primary);
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(26, 26, 26, .08);
  padding: 1.25rem;
}

.thy-admin-panel-card h2 {
  margin: 0 0 .5rem;
}

.thy-admin-panel-card p {
  color: var(--color-gray-600);
}

.thy-admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .65rem;
  margin-top: 1rem;
}

.thy-admin-quick-grid a {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 42px;
  padding: .65rem .8rem;
  background: var(--color-off-white);
  border: 1px solid var(--color-gray-300);
  color: var(--color-black);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.thy-admin-quick-grid a:hover {
  background: var(--color-black);
  color: var(--color-white);
}

.thy-admin-note {
  border-left: 5px solid var(--color-primary);
  background: var(--color-off-white);
  padding: .85rem 1rem;
  color: var(--color-black);
}

.thy-admin-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .75rem;
}

.thy-admin-btn--danger {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.thy-admin-btn--danger:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: var(--color-white);
}

.thy-admin-search-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  gap: .75rem;
}

.thy-admin-filter-meta {
  display: flex;
  gap: 1rem;
  margin-top: .85rem;
  color: var(--color-gray-600);
}

.thy-admin-table--compact th,
.thy-admin-table--compact td {
  font-size: .92rem;
  white-space: nowrap;
}

.thy-admin-pagination {
  margin-top: 1rem;
}

@media (max-width: 1200px) {
  .thy-admin-kpi-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .thy-admin-dashboard-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .thy-admin-kpi-grid {
    grid-template-columns: 1fr;
  }

  .thy-admin-search-form {
    grid-template-columns: 1fr;
  }

  .thy-admin-head-actions {
    justify-content: flex-start;
  }
}

/* Barra superior de sesión definitiva: legible, minimalista y derecha. */
.thydom-admin-session-bar {
  position: fixed;
  top: .85rem;
  right: 1rem;
  z-index: 11000;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  max-width: calc(100vw - 2rem);
}

.thydom-admin-session-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 34px;
  padding: .35rem .65rem;
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-left: 4px solid var(--color-primary);
  color: var(--color-black);
  box-shadow: 0 2px 10px rgba(26, 26, 26, .08);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.thydom-admin-session-pill i {
  color: var(--color-primary);
}

.thydom-admin-session-pill span {
  color: var(--color-black) !important;
}

.thydom-admin-session-logout {
  margin: 0;
}

.thydom-admin-session-bar .thydom-admin-logout-icon {
  position: static !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  box-shadow: 0 2px 10px rgba(26, 26, 26, .12);
}

/* Oculta tiras antiguas oscuras que el JS anterior intentaba reubicar. */
.thydom-admin .thydom-admin-account-strip {
  display: none !important;
}

/* Da aire superior para la barra fija. */
body.thydom-admin main,
body.thydom-admin .admin-main,
body.thydom-admin .thy-admin-main,
body.thydom-admin .content,
body.thydom-admin .page-content {
  padding-top: 2.75rem;
}

/* Panel de avance. */
.thy-admin-progress-panel {
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-top: 5px solid var(--color-primary);
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(26, 26, 26, .08);
  padding: 1.25rem;
  margin: 0 0 1.25rem;
}

.thy-admin-progress-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.thy-admin-progress-panel__head h2 {
  margin: .25rem 0 0;
}

.thy-admin-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: .75rem;
}

.thy-admin-progress-item {
  display: grid;
  gap: .25rem;
  min-height: 82px;
  padding: .85rem;
  background: var(--color-off-white);
  border: 1px solid var(--color-gray-300);
  color: var(--color-black);
}

.thy-admin-progress-item span {
  color: var(--color-gray-600);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.thy-admin-progress-item strong {
  color: var(--color-black);
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  line-height: 1;
}

.thy-admin-progress-item.is-link:hover {
  background: var(--color-black);
  color: var(--color-white);
}

.thy-admin-progress-item.is-link:hover span,
.thy-admin-progress-item.is-link:hover strong {
  color: var(--color-white) !important;
}

/* Estado operativo dinámico. */
.thy-admin-status-line {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  border: 1px solid var(--color-gray-300);
  border-left: 5px solid var(--color-primary);
  background: var(--color-off-white);
  padding: .85rem 1rem;
  margin: .75rem 0 1rem;
}

.thy-admin-status-line i {
  margin-top: .15rem;
  font-size: 1.15rem;
}

.thy-admin-status-line strong {
  display: block;
  color: var(--color-black);
}

.thy-admin-status-line span {
  display: block;
  color: var(--color-gray-600);
}

.thy-admin-status-line.is-on {
  border-left-color: #1F8A4C;
}

.thy-admin-status-line.is-on i {
  color: #1F8A4C;
}

.thy-admin-status-line.is-off {
  border-left-color: var(--color-primary);
}

.thy-admin-status-line.is-off i {
  color: var(--color-primary);
}

/* Dashboard algo más compacto y elegante. */
.thy-admin-dashboard {
  max-width: 1440px;
}

.thy-admin-kpi-grid {
  margin-bottom: 1.25rem;
}

@media (max-width: 1200px) {
  .thy-admin-progress-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .thydom-admin-session-bar {
    position: static;
    margin: .75rem;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  body.thydom-admin main,
  body.thydom-admin .admin-main,
  body.thydom-admin .thy-admin-main,
  body.thydom-admin .content,
  body.thydom-admin .page-content {
    padding-top: 0;
  }

  .thy-admin-progress-grid {
    grid-template-columns: 1fr;
  }
}

/* Barra superior de sesión definitiva: legible, minimalista y derecha. */
.thydom-admin-session-bar {
  position: fixed;
  top: .85rem;
  right: 1rem;
  z-index: 11000;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  max-width: calc(100vw - 2rem);
}

.thydom-admin-session-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 34px;
  padding: .35rem .65rem;
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-left: 4px solid var(--color-primary);
  color: var(--color-black);
  box-shadow: 0 2px 10px rgba(26, 26, 26, .08);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.thydom-admin-session-pill i {
  color: var(--color-primary);
}

.thydom-admin-session-pill span {
  color: var(--color-black) !important;
}

.thydom-admin-session-logout {
  margin: 0;
}

.thydom-admin-session-bar .thydom-admin-logout-icon {
  position: static !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  box-shadow: 0 2px 10px rgba(26, 26, 26, .12);
}

/* Oculta tiras antiguas oscuras que el JS anterior intentaba reubicar. */
.thydom-admin .thydom-admin-account-strip {
  display: none !important;
}

/* Da aire superior para la barra fija. */
body.thydom-admin main,
body.thydom-admin .admin-main,
body.thydom-admin .thy-admin-main,
body.thydom-admin .content,
body.thydom-admin .page-content {
  padding-top: 2.75rem;
}

/* Panel de avance. */
.thy-admin-progress-panel {
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-top: 5px solid var(--color-primary);
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(26, 26, 26, .08);
  padding: 1.25rem;
  margin: 0 0 1.25rem;
}

.thy-admin-progress-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.thy-admin-progress-panel__head h2 {
  margin: .25rem 0 0;
}

.thy-admin-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: .75rem;
}

.thy-admin-progress-item {
  display: grid;
  gap: .25rem;
  min-height: 82px;
  padding: .85rem;
  background: var(--color-off-white);
  border: 1px solid var(--color-gray-300);
  color: var(--color-black);
}

.thy-admin-progress-item span {
  color: var(--color-gray-600);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.thy-admin-progress-item strong {
  color: var(--color-black);
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  line-height: 1;
}

.thy-admin-progress-item.is-link:hover {
  background: var(--color-black);
  color: var(--color-white);
}

.thy-admin-progress-item.is-link:hover span,
.thy-admin-progress-item.is-link:hover strong {
  color: var(--color-white) !important;
}

/* Estado operativo dinámico. */
.thy-admin-status-line {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  border: 1px solid var(--color-gray-300);
  border-left: 5px solid var(--color-primary);
  background: var(--color-off-white);
  padding: .85rem 1rem;
  margin: .75rem 0 1rem;
}

.thy-admin-status-line i {
  margin-top: .15rem;
  font-size: 1.15rem;
}

.thy-admin-status-line strong {
  display: block;
  color: var(--color-black);
}

.thy-admin-status-line span {
  display: block;
  color: var(--color-gray-600);
}

.thy-admin-status-line.is-on {
  border-left-color: #1F8A4C;
}

.thy-admin-status-line.is-on i {
  color: #1F8A4C;
}

.thy-admin-status-line.is-off {
  border-left-color: var(--color-primary);
}

.thy-admin-status-line.is-off i {
  color: var(--color-primary);
}

/* Dashboard algo más compacto y elegante. */
.thy-admin-dashboard {
  max-width: 1440px;
}

.thy-admin-kpi-grid {
  margin-bottom: 1.25rem;
}

@media (max-width: 1200px) {
  .thy-admin-progress-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .thydom-admin-session-bar {
    position: static;
    margin: .75rem;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  body.thydom-admin main,
  body.thydom-admin .admin-main,
  body.thydom-admin .thy-admin-main,
  body.thydom-admin .content,
  body.thydom-admin .page-content {
    padding-top: 0;
  }

  .thy-admin-progress-grid {
    grid-template-columns: 1fr;
  }
}

/* Hotfix dashboard 500: barra de sesión segura y no invasiva. */
.thydom-admin-session-bar {
  position: fixed;
  top: .85rem;
  right: 1rem;
  z-index: 11000;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
}

.thydom-admin-session-pill {
  background: var(--color-white) !important;
  color: var(--color-black) !important;
  border: 1px solid var(--color-gray-300);
  border-left: 4px solid var(--color-primary);
}

.thydom-admin-session-pill,
.thydom-admin-session-pill * {
  color: var(--color-black) !important;
}

.thydom-admin-session-pill i {
  color: var(--color-primary) !important;
}

.thydom-admin .thydom-admin-account-strip {
  display: none !important;
}

/* Dashboard por dominios: cuentas, editorial, social. */
.thy-admin-domain-panel {
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-top: 5px solid var(--color-primary);
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(26, 26, 26, .08);
  padding: 1.25rem;
  margin: 0 0 1.25rem;
}

.thy-admin-domain-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.thy-admin-domain-panel__head h2 {
  margin: .25rem 0 0;
}

.thy-admin-domain-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: .75rem;
}

.thy-admin-domain-card {
  display: grid;
  gap: .25rem;
  min-height: 82px;
  padding: .85rem;
  background: var(--color-off-white);
  border: 1px solid var(--color-gray-300);
  color: var(--color-black);
}

.thy-admin-domain-card span {
  color: var(--color-gray-600);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.thy-admin-domain-card strong {
  color: var(--color-black);
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  line-height: 1;
}

a.thy-admin-domain-card:hover {
  background: var(--color-black);
  color: var(--color-white);
}

a.thy-admin-domain-card:hover span,
a.thy-admin-domain-card:hover strong {
  color: var(--color-white) !important;
}

/* Ocultar paneles anteriores si quedaron cacheados o duplicados en HTML antiguo. */
.thy-admin-kpi-grid,
.thy-admin-progress-panel {
  display: none !important;
}

/* Barra sesión única: anula cajas negras antiguas y elimina duplicados visuales. */
.thydom-admin .thydom-admin-account-strip {
  display: none !important;
}

.thydom-admin-session-bar {
  position: fixed;
  top: .75rem;
  right: 1rem;
  z-index: 11000;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
}

.thydom-admin-session-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 34px;
  padding: .35rem .65rem;
  background: var(--color-white) !important;
  border: 1px solid var(--color-gray-300) !important;
  border-left: 4px solid var(--color-primary) !important;
  color: var(--color-black) !important;
  box-shadow: 0 2px 10px rgba(26, 26, 26, .08);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.thydom-admin-session-pill,
.thydom-admin-session-pill * {
  color: var(--color-black) !important;
}

.thydom-admin-session-pill i {
  color: var(--color-primary) !important;
}

.thydom-admin-session-logout {
  margin: 0;
}

.thydom-admin-session-bar .thydom-admin-logout-icon {
  position: static !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
}

/* Evitar que scripts antiguos pinten tiras negras. */
body.thydom-admin .thydom-admin-account-strip,
body.thydom-admin .thydom-admin-account-strip *,
body.thydom-admin .thydom-admin-readable-block.thydom-admin-account-strip {
  display: none !important;
  visibility: hidden !important;
}

@media (max-width: 1200px) {
  .thy-admin-domain-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .thy-admin-domain-grid {
    grid-template-columns: 1fr;
  }

  .thydom-admin-session-bar {
    position: static;
    margin: .75rem;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* Limpieza definitiva de sesión admin: una sola barra, sin cajas negras ni logout duplicado. */
.thydom-admin-session-bar {
  position: fixed !important;
  top: .75rem !important;
  right: 1rem !important;
  z-index: 12000 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: .5rem !important;
  max-width: calc(100vw - 2rem) !important;
}

.thydom-admin-session-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: .45rem !important;
  min-height: 34px !important;
  padding: .35rem .65rem !important;
  background: var(--color-white) !important;
  border: 1px solid var(--color-gray-300) !important;
  border-left: 4px solid var(--color-primary) !important;
  color: var(--color-black) !important;
  box-shadow: 0 2px 10px rgba(26, 26, 26, .08) !important;
  font-family: var(--font-display) !important;
  font-size: var(--fs-xs) !important;
  font-weight: var(--fw-bold) !important;
  text-transform: uppercase !important;
  letter-spacing: var(--tracking-wide) !important;
  white-space: nowrap !important;
}

.thydom-admin-session-pill,
.thydom-admin-session-pill * {
  color: var(--color-black) !important;
  opacity: 1 !important;
}

.thydom-admin-session-pill i {
  color: var(--color-primary) !important;
}

.thydom-admin-session-logout {
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
}

.thydom-admin-session-bar .thydom-admin-logout-icon {
  position: static !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Ocultar cualquier logout antiguo fuera de la barra de sesión. */
body.thydom-admin [data-thydom-legacy-logout="1"],
body.thydom-admin a:not(.thydom-admin-logout-icon)[href*="logout"],
body.thydom-admin button:not(.thydom-admin-logout-icon)[title="Salir"],
body.thydom-admin button:not(.thydom-admin-logout-icon)[aria-label="Salir"] {
  display: none !important;
  visibility: hidden !important;
}

/* Ocultar cajas negras antiguas de usuario/roles que no pertenezcan a la barra final. */
body.thydom-admin .thydom-admin-account-strip,
body.thydom-admin .thydom-admin-account-strip *,
body.thydom-admin .thydom-admin-readable-block.thydom-admin-account-strip {
  display: none !important;
  visibility: hidden !important;
}

/* Si alguna caja negra antigua queda antes del h1, el JS la retira; este CSS evita parpadeos. */
body.thydom-admin .thy-admin-legacy-top-badge {
  display: none !important;
  visibility: hidden !important;
}

@media (max-width: 900px) {
  .thydom-admin-session-bar {
    position: static !important;
    margin: .75rem !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

/* Hotfix enum/session: barra única final y ocultación de restos. */
.thydom-admin-session-bar {
  position: fixed !important;
  top: .75rem !important;
  right: 1rem !important;
  z-index: 12000 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: .5rem !important;
  max-width: calc(100vw - 2rem) !important;
}

.thydom-admin-session-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: .45rem !important;
  min-height: 34px !important;
  padding: .35rem .65rem !important;
  background: var(--color-white) !important;
  border: 1px solid var(--color-gray-300) !important;
  border-left: 4px solid var(--color-primary) !important;
  color: var(--color-black) !important;
  box-shadow: 0 2px 10px rgba(26, 26, 26, .08) !important;
  font-family: var(--font-display) !important;
  font-size: var(--fs-xs) !important;
  font-weight: var(--fw-bold) !important;
  text-transform: uppercase !important;
  letter-spacing: var(--tracking-wide) !important;
  white-space: nowrap !important;
}

.thydom-admin-session-pill,
.thydom-admin-session-pill * {
  color: var(--color-black) !important;
  opacity: 1 !important;
}

.thydom-admin-session-pill i {
  color: var(--color-primary) !important;
}

.thydom-admin-session-logout {
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
}

.thydom-admin-session-bar .thydom-admin-logout-icon {
  position: static !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.thydom-admin .thydom-admin-account-strip,
body.thydom-admin .thy-admin-legacy-top-badge,
body.thydom-admin [data-thydom-legacy-logout="1"],
body.thydom-admin button:not(.thydom-admin-logout-icon)[title="Salir"],
body.thydom-admin button:not(.thydom-admin-logout-icon)[aria-label="Salir"] {
  display: none !important;
  visibility: hidden !important;
}

.thy-admin-domain-panel {
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-top: 5px solid var(--color-primary);
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(26, 26, 26, .08);
  padding: 1.25rem;
  margin: 0 0 1.25rem;
}

.thy-admin-domain-panel__head {
  margin-bottom: 1rem;
}

.thy-admin-domain-panel__head h2 {
  margin: .25rem 0 0;
}

.thy-admin-domain-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: .75rem;
}

.thy-admin-domain-card {
  display: grid;
  gap: .25rem;
  min-height: 82px;
  padding: .85rem;
  background: var(--color-off-white);
  border: 1px solid var(--color-gray-300);
  color: var(--color-black);
}

.thy-admin-domain-card span {
  color: var(--color-gray-600);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.thy-admin-domain-card strong {
  color: var(--color-black);
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  line-height: 1;
}

a.thy-admin-domain-card:hover {
  background: var(--color-black);
  color: var(--color-white);
}

a.thy-admin-domain-card:hover span,
a.thy-admin-domain-card:hover strong {
  color: var(--color-white) !important;
}

.thy-admin-kpi-grid,
.thy-admin-progress-panel {
  display: none !important;
}

@media (max-width: 1200px) {
  .thy-admin-domain-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .thy-admin-domain-grid {
    grid-template-columns: 1fr;
  }

  .thydom-admin-session-bar {
    position: static !important;
    margin: .75rem !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

/* Sesión admin final: una sola barra válida. */
body.thydom-admin > .thydom-admin-session-bar {
  position: fixed !important;
  top: .75rem !important;
  right: 1rem !important;
  z-index: 12000 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: .5rem !important;
  max-width: calc(100vw - 2rem) !important;
}

body.thydom-admin > .thydom-admin-session-bar .thydom-admin-session-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: .45rem !important;
  min-height: 34px !important;
  padding: .35rem .65rem !important;
  background: var(--color-white) !important;
  border: 1px solid var(--color-gray-300) !important;
  border-left: 4px solid var(--color-primary) !important;
  color: var(--color-black) !important;
  box-shadow: 0 2px 10px rgba(26, 26, 26, .08) !important;
  font-family: var(--font-display) !important;
  font-size: var(--fs-xs) !important;
  font-weight: var(--fw-bold) !important;
  text-transform: uppercase !important;
  letter-spacing: var(--tracking-wide) !important;
  white-space: nowrap !important;
}

body.thydom-admin > .thydom-admin-session-bar .thydom-admin-session-pill,
body.thydom-admin > .thydom-admin-session-bar .thydom-admin-session-pill * {
  color: var(--color-black) !important;
  opacity: 1 !important;
}

body.thydom-admin > .thydom-admin-session-bar .thydom-admin-session-pill i {
  color: var(--color-primary) !important;
}

body.thydom-admin > .thydom-admin-session-bar .thydom-admin-session-logout {
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
}

body.thydom-admin > .thydom-admin-session-bar .thydom-admin-logout-icon {
  position: static !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Ocultar restos antiguos directos del body: iconos, botones y formularios fuera de la barra final. */
body.thydom-admin > a[href*="logout"],
body.thydom-admin > form[action*="logout"],
body.thydom-admin > button,
body.thydom-admin > .thydom-admin-account-strip,
body.thydom-admin > .thy-admin-legacy-top-badge {
  display: none !important;
  visibility: hidden !important;
}

/* Ocultar tiras negras antiguas dentro del contenido, si quedaron como nodos huérfanos. */
body.thydom-admin .thydom-admin-account-strip,
body.thydom-admin .thy-admin-legacy-top-badge {
  display: none !important;
  visibility: hidden !important;
}

@media (max-width: 900px) {
  body.thydom-admin > .thydom-admin-session-bar {
    position: static !important;
    margin: .75rem !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

/* Final admin layout guard: se impone sobre restos de iteraciones anteriores. */
body.thydom-admin > .thydom-admin-session-bar {
  position: fixed !important;
  top: .75rem !important;
  right: 1rem !important;
  z-index: 12000 !important;
}

body.thydom-admin .top,
body.thydom-admin .pill,
body.thydom-admin .logout,
body.thydom-admin .thydom-admin-account-strip,
body.thydom-admin .thy-admin-legacy-top-badge {
  display: none !important;
  visibility: hidden !important;
}

body.thydom-admin .admin-main {
  background: var(--admin-bg, #F5F2ED) !important;
  color: var(--admin-text, #1A1A1A) !important;
}

/* Menú admin jerárquico por dominios: nivel 1 + submenús nivel 2. */
.admin-nav-tree {
  display: grid;
  gap: 14px;
}

.admin-menu-group {
  border-bottom: 3px solid var(--admin-red, #E4002B);
  padding-bottom: 10px;
}

.admin-menu-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
  font-family: var(--font-display, Arial, Helvetica, sans-serif);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .11em;
  padding: 12px 0 10px;
}

.admin-menu-group summary::-webkit-details-marker {
  display: none;
}

.admin-menu-group summary span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.admin-menu-chevron {
  transition: transform .15s ease;
  font-size: 11px;
  color: #ccc;
}

.admin-menu-group[open] .admin-menu-chevron {
  transform: rotate(180deg);
}

.admin-subnav {
  display: grid;
  gap: 7px;
}

.admin-subnav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px 10px 20px;
  background: #111;
  border: 1px solid #333;
  color: #fff;
  font-family: var(--font-display, Arial, Helvetica, sans-serif);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.admin-subnav a:hover {
  border-color: var(--admin-red, #E4002B);
  background: #171717;
}

.admin-subnav a.is-active,
.admin-subnav a[aria-current="page"] {
  border-left: 4px solid var(--admin-red, #E4002B);
  background: #1A1A1A;
}

@media(max-width:900px) {
  .admin-nav-tree {
    padding-bottom: 40px;
  }

  .admin-menu-group summary {
    min-height: 44px;
  }

  .admin-subnav a {
    min-height: 46px;
  }
}

/* Menú claro jerárquico: estilo administrativo limpio, inspirado en paneles editoriales. */
body.thydom-admin .admin-sidebar {
  background: #F4F4F2 !important;
  color: #1A1A1A !important;
  border-right: 1px solid #D6D6D2 !important;
  border-left: 5px solid var(--admin-red, #E4002B) !important;
}

body.thydom-admin .admin-brand {
  color: #1A1A1A !important;
  border-bottom: 1px solid #CFCFCA !important;
  padding-bottom: 18px !important;
  margin-bottom: 18px !important;
}

body.thydom-admin .admin-brand img {
  background: #FFFFFF !important;
  border: 1px solid #D6D6D2 !important;
  box-shadow: 0 1px 6px rgba(26,26,26,.08) !important;
}

body.thydom-admin .admin-brand-text {
  color: #1A1A1A !important;
}

body.thydom-admin .admin-brand-text small {
  color: #555 !important;
}

body.thydom-admin .admin-nav-tree {
  display: grid !important;
  gap: 14px !important;
}

body.thydom-admin .admin-nav-home {
  padding: 0 0 14px !important;
  border-bottom: 1px solid #CFCFCA !important;
}

body.thydom-admin .admin-nav-home a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 40px !important;
  padding: 8px 0 !important;
  color: #006C7A !important;
  background: transparent !important;
  border: 0 !important;
  border-left: 0 !important;
  font-family: var(--font-body, Arial, Helvetica, sans-serif) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body.thydom-admin .admin-nav-home a:hover {
  color: var(--admin-red, #E4002B) !important;
}

body.thydom-admin .admin-menu-group {
  border: 0 !important;
  border-bottom: 1px solid #CFCFCA !important;
  padding: 0 0 12px !important;
  margin: 0 !important;
}

body.thydom-admin .admin-menu-group summary {
  list-style: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  min-height: 34px !important;
  padding: 8px 0 !important;
  color: #1A1A1A !important;
  background: transparent !important;
  border: 0 !important;
  font-family: var(--font-body, Arial, Helvetica, sans-serif) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: .02em !important;
}

body.thydom-admin .admin-menu-group summary::-webkit-details-marker {
  display: none !important;
}

body.thydom-admin .admin-menu-group summary span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

body.thydom-admin .admin-menu-group summary i:first-child {
  color: var(--admin-red, #E4002B) !important;
  width: 18px !important;
  text-align: center !important;
}

body.thydom-admin .admin-menu-chevron {
  color: #777 !important;
  font-size: 11px !important;
  transition: transform .15s ease !important;
}

body.thydom-admin .admin-menu-group[open] .admin-menu-chevron {
  transform: rotate(180deg) !important;
}

body.thydom-admin .admin-subnav {
  display: grid !important;
  gap: 0 !important;
  margin: 2px 0 0 !important;
  padding-left: 22px !important;
}

body.thydom-admin .admin-subnav a {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  min-height: 32px !important;
  padding: 6px 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: #333 !important;
  font-family: var(--font-body, Arial, Helvetica, sans-serif) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body.thydom-admin .admin-subnav a i {
  width: 16px !important;
  color: #686868 !important;
  text-align: center !important;
}

body.thydom-admin .admin-subnav a:hover {
  color: #006C7A !important;
  background: transparent !important;
  border: 0 !important;
}

body.thydom-admin .admin-subnav a:hover i {
  color: #006C7A !important;
}

body.thydom-admin .admin-subnav a.is-active,
body.thydom-admin .admin-subnav a[aria-current="page"],
body.thydom-admin .admin-nav-home a.is-active,
body.thydom-admin .admin-nav-home a[aria-current="page"] {
  color: #006C7A !important;
  font-weight: 800 !important;
  border: 0 !important;
  background: transparent !important;
}

body.thydom-admin .admin-subnav a.is-active::before,
body.thydom-admin .admin-subnav a[aria-current="page"]::before {
  content: "";
  width: 4px;
  height: 18px;
  background: var(--admin-red, #E4002B);
  margin-left: -12px;
  margin-right: 8px;
  display: inline-block;
}

body.thydom-admin .admin-menu-group--app {
  margin-top: 6px !important;
  border-bottom: 0 !important;
}

@media(max-width:900px) {
  body.thydom-admin .admin-sidebar {
    border-left: 0 !important;
    border-top: 5px solid var(--admin-red, #E4002B) !important;
  }

  body.thydom-admin .admin-nav-home a,
  body.thydom-admin .admin-subnav a {
    min-height: 42px !important;
  }
}

/* Refuerzo final: menú claro, nodos negros y sin herencia de iteraciones antiguas. */
body.thydom-admin .admin-sidebar {
  background: #F4F4F2 !important;
  color: #1A1A1A !important;
  border-right: 1px solid #D0D0CC !important;
  border-left: 5px solid var(--admin-red, #E4002B) !important;
}

body.thydom-admin .admin-menu-group > summary,
body.thydom-admin .admin-menu-group > summary span,
body.thydom-admin .admin-menu-group > summary span *,
body.thydom-admin .admin-menu-group > summary:not(.sr-only) {
  color: #1A1A1A !important;
  opacity: 1 !important;
}

body.thydom-admin .admin-menu-group > summary i:first-child {
  color: var(--admin-red, #E4002B) !important;
  opacity: 1 !important;
}

body.thydom-admin .admin-menu-chevron {
  color: #777 !important;
  opacity: 1 !important;
}

body.thydom-admin .admin-nav-home a,
body.thydom-admin .admin-nav-home a span {
  color: #006C7A !important;
  opacity: 1 !important;
}

body.thydom-admin .admin-subnav a {
  color: #333 !important;
  opacity: 1 !important;
}

body.thydom-admin .top,
body.thydom-admin .pill,
body.thydom-admin .logout,
body.thydom-admin .navTitle,
body.thydom-admin .nav,
body.thydom-admin .sidebar,
body.thydom-admin .main,
body.thydom-admin .shell {
  all: unset;
}

/* Fix visual: icono Dashboard en rojo como el resto de nodos principales. */
body.thydom-admin .admin-nav-home a i,
body.thydom-admin .admin-nav-home a svg {
  color: var(--admin-red, #E4002B) !important;
  fill: var(--admin-red, #E4002B) !important;
  opacity: 1 !important;
}

/* Botón subir: fijo, visible al hacer scroll y por encima del layout. */
body.thydom-admin #backTop {
  position: fixed !important;
  right: 22px !important;
  bottom: 22px !important;
  z-index: 20000 !important;
  width: 46px !important;
  height: 46px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--admin-red, #E4002B) !important;
  color: #fff !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(10px) !important;
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease !important;
  box-shadow: 0 6px 18px rgba(26,26,26,.22) !important;
}

body.thydom-admin #backTop.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

body.thydom-admin #backTop i {
  color: #fff !important;
}

/* Estándar Thydom: interface tipo grid. */
body.thydom-admin .thy-admin-page {
  display: grid;
  gap: 22px;
}

body.thydom-admin .thy-admin-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

body.thydom-admin .thy-admin-page__header h1 {
  margin: 0;
  font-family: var(--font-display, Arial, Helvetica, sans-serif);
  font-size: clamp(40px, 5vw, 68px);
  line-height: .95;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #1A1A1A;
}

body.thydom-admin .thy-admin-page__header p {
  margin: 8px 0 0;
  color: #5f6368;
  font-size: 16px;
}

body.thydom-admin .thy-admin-kicker {
  margin: 0 0 8px !important;
  color: var(--admin-red, #E4002B) !important;
  font-family: var(--font-display, Arial, Helvetica, sans-serif);
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

body.thydom-admin .thy-grid-card {
  background: #fff;
  border: 1px solid #D0D0CC;
  border-top: 5px solid var(--admin-red, #E4002B);
  box-shadow: 0 2px 10px rgba(26,26,26,.06);
  padding: 20px;
}

body.thydom-admin .thy-grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

body.thydom-admin .thy-grid-counter {
  color: #1A1A1A;
  font-weight: 700;
}

body.thydom-admin .thy-grid-counter strong {
  font-family: var(--font-display, Arial, Helvetica, sans-serif);
  font-size: 28px;
  margin-right: 6px;
}

body.thydom-admin .thy-grid-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 240px);
  gap: 12px;
  margin-bottom: 16px;
}

body.thydom-admin .thy-grid-filters label,
body.thydom-admin .thy-form-grid label {
  display: grid;
  gap: 6px;
  color: #1A1A1A;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

body.thydom-admin .thy-grid-filters input,
body.thydom-admin .thy-grid-filters select,
body.thydom-admin .thy-form-grid input,
body.thydom-admin .thy-form-grid select,
body.thydom-admin .thy-form-grid textarea {
  width: 100%;
  border: 1px solid #D0D0CC;
  background: #F5F2ED;
  color: #1A1A1A;
  padding: 10px 12px;
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
}

body.thydom-admin .thy-grid-table-wrap {
  overflow-x: auto;
  border: 1px solid #D0D0CC;
}

body.thydom-admin .thy-grid-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: #fff;
}

body.thydom-admin .thy-grid-table th {
  background: #111;
  color: #fff;
  padding: 12px;
  text-align: left;
  font-family: var(--font-display, Arial, Helvetica, sans-serif);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.thydom-admin .thy-grid-table td {
  border-top: 1px solid #D0D0CC;
  padding: 12px;
  color: #1A1A1A;
  vertical-align: middle;
}

body.thydom-admin .thy-grid-action-col {
  width: 64px;
  text-align: center !important;
}

body.thydom-admin .thy-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #D0D0CC;
  background: #fff;
  color: var(--admin-red, #E4002B);
  cursor: pointer;
}

body.thydom-admin .thy-icon-btn:hover {
  border-color: var(--admin-red, #E4002B);
}

body.thydom-admin .thy-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  background: #F5F2ED;
  border-left: 4px solid var(--admin-red, #E4002B);
  color: #1A1A1A;
  font-weight: 800;
}

body.thydom-admin .thy-grid-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

body.thydom-admin .thy-btn {
  min-height: 38px;
  border: 1px solid #D0D0CC;
  background: #fff;
  color: #1A1A1A;
  padding: 8px 14px;
  font-weight: 900;
  cursor: pointer;
}

body.thydom-admin .thy-btn-primary {
  background: var(--admin-red, #E4002B);
  border-color: var(--admin-red, #E4002B);
  color: #fff;
}

body.thydom-admin .thy-btn-danger {
  border-color: var(--admin-red, #E4002B);
  color: var(--admin-red, #E4002B);
}

body.thydom-admin .thy-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

body.thydom-admin .thy-modal {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.48);
}

body.thydom-admin .thy-modal.is-open {
  display: flex;
}

body.thydom-admin .thy-modal__dialog {
  width: min(920px, 96vw);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-top: 5px solid var(--admin-red, #E4002B);
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
  padding: 22px;
}

body.thydom-admin .thy-modal__header,
body.thydom-admin .thy-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

body.thydom-admin .thy-modal__header {
  border-bottom: 1px solid #D0D0CC;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

body.thydom-admin .thy-modal__header h2 {
  margin: 0;
  font-family: var(--font-display, Arial, Helvetica, sans-serif);
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.thydom-admin .thy-modal__close {
  width: 38px;
  height: 38px;
  border: 0;
  background: var(--admin-red, #E4002B);
  color: #fff;
  cursor: pointer;
}

body.thydom-admin .thy-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.thydom-admin .thy-detail-grid div {
  border: 1px solid #D0D0CC;
  background: #F5F2ED;
  padding: 10px;
}

body.thydom-admin .thy-detail-grid strong {
  display: block;
  color: #1A1A1A;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

body.thydom-admin .thy-detail-grid span {
  word-break: break-word;
}

body.thydom-admin .thy-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.thydom-admin .thy-form-grid label:has(textarea) {
  grid-column: 1 / -1;
}

body.thydom-admin .thy-modal__footer {
  border-top: 1px solid #D0D0CC;
  padding-top: 16px;
  margin-top: 18px;
  justify-content: flex-end;
}

@media(max-width:900px) {
  body.thydom-admin .thy-grid-filters,
  body.thydom-admin .thy-form-grid,
  body.thydom-admin .thy-detail-grid {
    grid-template-columns: 1fr;
  }

  body.thydom-admin .thy-grid-toolbar,
  body.thydom-admin .thy-admin-page__header {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Ajuste estándar de modales para interface tipo grid. */
body.thydom-admin .thy-modal--wide .thy-modal__dialog,
body.thydom-admin .thy-modal__dialog--wide {
  width: min(1280px, 96vw) !important;
  max-height: 92vh !important;
  padding: 24px !important;
}

body.thydom-admin .thy-modal__dialog--sub {
  width: min(620px, 94vw) !important;
}

body.thydom-admin .thy-modal__header--actions {
  align-items: flex-start !important;
}

body.thydom-admin .thy-modal-actions-top {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-left: auto !important;
}

body.thydom-admin .thy-detail-form-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

body.thydom-admin .thy-detail-form-grid label {
  display: grid !important;
  gap: 6px !important;
  color: #1A1A1A !important;
  font-weight: 900 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
}

body.thydom-admin .thy-detail-form-grid input,
body.thydom-admin .thy-detail-form-grid select,
body.thydom-admin .thy-detail-form-grid textarea {
  width: 100% !important;
  min-height: 42px !important;
  border: 1px solid #D0D0CC !important;
  background: #F5F2ED !important;
  color: #1A1A1A !important;
  padding: 10px 12px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body.thydom-admin .thy-detail-form-grid textarea {
  min-height: 110px !important;
  resize: vertical !important;
}

body.thydom-admin .thy-detail-form-grid input[readonly] {
  background: #ECEAE5 !important;
  color: #666 !important;
}

body.thydom-admin .thy-modal .thy-btn:not(:disabled),
body.thydom-admin .thy-modal__close:not(:disabled) {
  opacity: 1 !important;
  cursor: pointer !important;
}

body.thydom-admin .thy-modal .thy-btn[disabled] {
  display: none !important;
}

@media(max-width:1100px) {
  body.thydom-admin .thy-detail-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media(max-width:760px) {
  body.thydom-admin .thy-detail-form-grid {
    grid-template-columns: 1fr !important;
  }

  body.thydom-admin .thy-modal-actions-top {
    justify-content: flex-start !important;
    width: 100% !important;
  }
}

/* Mejora funcional de modales de cuenta. */
body.thydom-admin .thy-modal--wide .thy-modal__dialog,
body.thydom-admin .thy-modal__dialog--wide {
  width: min(1420px, 96vw) !important;
  max-height: 92vh !important;
  padding: 26px !important;
}

body.thydom-admin .thy-detail-form-grid--account {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(190px, 1fr)) !important;
  gap: 16px !important;
  align-items: start !important;
}

body.thydom-admin .thy-detail-form-grid--account label {
  min-width: 0 !important;
}

body.thydom-admin .thy-detail-form-grid--account input,
body.thydom-admin .thy-detail-form-grid--account select,
body.thydom-admin .thy-detail-form-grid--account textarea {
  width: 100% !important;
  min-width: 0 !important;
  border: 1px solid #cfcfca !important;
  background: #f5f2ed !important;
  padding: 11px 12px !important;
  font-size: 15px !important;
  line-height: 1.35 !important;
}

body.thydom-admin .thy-detail-form-grid--account textarea {
  min-height: 130px !important;
  resize: vertical !important;
}

body.thydom-admin .thy-field-full {
  grid-column: 1 / -1 !important;
}

body.thydom-admin .thy-field-bio {
  margin-top: 8px !important;
  padding-top: 16px !important;
  border-top: 1px solid #d0d0cc !important;
}

body.thydom-admin .thy-inline-form {
  display: inline-flex !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.thydom-admin .thy-alert {
  border-left: 5px solid var(--admin-red, #E4002B) !important;
  background: #fff !important;
  padding: 14px 16px !important;
  margin-bottom: 16px !important;
  box-shadow: 0 1px 8px rgba(26,26,26,.06) !important;
  font-weight: 700 !important;
}

body.thydom-admin .thy-alert-ok {
  border-left-color: #006C7A !important;
}

body.thydom-admin .thy-alert-error {
  border-left-color: var(--admin-red, #E4002B) !important;
}

@media(max-width:1300px) {
  body.thydom-admin .thy-detail-form-grid--account {
    grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
  }
}

@media(max-width:980px) {
  body.thydom-admin .thy-detail-form-grid--account {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media(max-width:680px) {
  body.thydom-admin .thy-detail-form-grid--account {
    grid-template-columns: 1fr !important;
  }
}

/* Modal de cuenta no apiñada: secciones limpias y campos apilados. */
body.thydom-admin .thy-account-form {
  display: grid !important;
  gap: 22px !important;
}

body.thydom-admin .thy-form-section {
  display: grid !important;
  gap: 12px !important;
  padding: 16px !important;
  border: 1px solid #D0D0CC !important;
  background: #FFFFFF !important;
}

body.thydom-admin .thy-form-section-title {
  margin: 0 !important;
  color: var(--admin-red, #E4002B) !important;
  font-family: var(--font-display, Arial, Helvetica, sans-serif) !important;
  font-weight: 900 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  font-size: 13px !important;
}

body.thydom-admin .thy-form-grid-clean {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(190px, 1fr)) !important;
  gap: 16px !important;
  align-items: start !important;
}

body.thydom-admin .thy-form-grid-clean label,
body.thydom-admin .thy-field-bio {
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
  color: #1A1A1A !important;
  font-weight: 900 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
}

body.thydom-admin .thy-form-grid-clean input,
body.thydom-admin .thy-form-grid-clean select,
body.thydom-admin .thy-field-bio textarea {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 42px !important;
  box-sizing: border-box !important;
  border: 1px solid #CFCFCA !important;
  background: #F5F2ED !important;
  color: #1A1A1A !important;
  padding: 10px 12px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

body.thydom-admin .thy-form-grid-clean input[readonly] {
  background: #ECEAE5 !important;
  color: #666 !important;
}

body.thydom-admin .thy-form-section-bio {
  border-top: 4px solid var(--admin-red, #E4002B) !important;
}

body.thydom-admin .thy-field-bio textarea {
  min-height: 150px !important;
  resize: vertical !important;
}

body.thydom-admin .thy-modal--wide .thy-modal__dialog,
body.thydom-admin .thy-modal__dialog--wide {
  width: min(1500px, 96vw) !important;
  max-height: 92vh !important;
  overflow: auto !important;
}

@media(max-width:1350px) {
  body.thydom-admin .thy-form-grid-clean {
    grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
  }
}

@media(max-width:1000px) {
  body.thydom-admin .thy-form-grid-clean {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media(max-width:700px) {
  body.thydom-admin .thy-form-grid-clean {
    grid-template-columns: 1fr !important;
  }
}

/* Tipos de cuenta como tarifas. */
body.thydom-admin .thy-grid-table td:nth-child(4) {
  font-weight: 800;
}

body.thydom-admin .thy-form-grid-clean select {
  cursor: pointer;
}

/* Corrección menú: nodo Social bajo Supervisor y estilo homogéneo. */
body.thydom-admin .admin-menu-group-social {
  margin-top: 14px !important;
  padding-top: 14px !important;
  border-top: 1px solid #D0D0CC !important;
}

body.thydom-admin .admin-menu-group-social summary {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  color: #111 !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
}

body.thydom-admin .admin-menu-group-social summary i {
  color: var(--admin-red, #E4002B) !important;
  width: 18px !important;
  min-width: 18px !important;
  text-align: center !important;
}

body.thydom-admin .admin-menu-group-social summary span {
  color: #111 !important;
}

body.thydom-admin .admin-menu-group-social .admin-subnav {
  display: grid !important;
  gap: 8px !important;
  margin-top: 12px !important;
  padding-left: 24px !important;
}

body.thydom-admin .admin-menu-group-social .admin-subnav a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #111 !important;
  text-decoration: none !important;
}

body.thydom-admin .admin-menu-group-social .admin-subnav a i {
  color: #777 !important;
  width: 18px !important;
  min-width: 18px !important;
  text-align: center !important;
}

body.thydom-admin .admin-menu-group-social .admin-subnav a:hover,
body.thydom-admin .admin-menu-group-social .admin-subnav a:focus {
  color: var(--admin-red, #E4002B) !important;
}

body.thydom-admin .admin-menu-group-social .admin-subnav a:hover i,
body.thydom-admin .admin-menu-group-social .admin-subnav a:focus i {
  color: var(--admin-red, #E4002B) !important;
}

/* Corrección definitiva del nodo Social dentro del menú lateral. */
body.thydom-admin .admin-menu-group-social summary span {
  color: #111 !important;
}

body.thydom-admin .admin-menu-group-social summary span i {
  color: var(--admin-red, #E4002B) !important;
}

body.thydom-admin .admin-menu-group-social .admin-menu-chevron {
  color: #777 !important;
}

body.thydom-admin .admin-menu-group-social .admin-subnav a {
  color: #111 !important;
}

body.thydom-admin .admin-menu-group-social .admin-subnav a i {
  color: #777 !important;
}

body.thydom-admin .admin-menu-group-social .admin-subnav a:hover,
body.thydom-admin .admin-menu-group-social .admin-subnav a:hover i {
  color: var(--admin-red, #E4002B) !important;
}

/* Reconstrucción controlada del menú lateral completo. */
body.thydom-admin .admin-menu-link,
body.thydom-admin .admin-menu-group summary,
body.thydom-admin .admin-subnav a {
  text-decoration: none !important;
}

body.thydom-admin .admin-menu-link {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #006C7A !important;
  font-weight: 800 !important;
}

body.thydom-admin .admin-menu-link i {
  color: var(--admin-red, #E4002B) !important;
  width: 18px !important;
  text-align: center !important;
}

body.thydom-admin .admin-menu-group summary span {
  color: #111 !important;
}

body.thydom-admin .admin-menu-group summary span i {
  color: var(--admin-red, #E4002B) !important;
  width: 18px !important;
  text-align: center !important;
}

body.thydom-admin .admin-menu-chevron {
  color: #777 !important;
}

body.thydom-admin .admin-subnav a {
  color: #111 !important;
}

body.thydom-admin .admin-subnav a i {
  color: #777 !important;
  width: 18px !important;
  text-align: center !important;
}

body.thydom-admin .admin-subnav a:hover,
body.thydom-admin .admin-subnav a:hover i {
  color: var(--admin-red, #E4002B) !important;
}

/* FIX FINAL: Dashboard siempre legible en menú lateral. */
body.thydom-admin aside a[href*="/admin/dashboard"],
body.thydom-admin aside a[href*="/admin/dashboard"] span,
body.thydom-admin .admin-sidebar a[href*="/admin/dashboard"],
body.thydom-admin .admin-sidebar a[href*="/admin/dashboard"] span,
body.thydom-admin .admin-menu-link[href*="/admin/dashboard"],
body.thydom-admin .admin-menu-link[href*="/admin/dashboard"] span,
body.thydom-admin .admin-nav-home a[href*="/admin/dashboard"],
body.thydom-admin .admin-nav-home a[href*="/admin/dashboard"] span {
  color: #111111 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.thydom-admin aside a[href*="/admin/dashboard"] i,
body.thydom-admin .admin-sidebar a[href*="/admin/dashboard"] i,
body.thydom-admin .admin-menu-link[href*="/admin/dashboard"] i,
body.thydom-admin .admin-nav-home a[href*="/admin/dashboard"] i {
  color: var(--admin-red, #E4002B) !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body.thydom-admin aside a[href*="/admin/dashboard"]:hover,
body.thydom-admin aside a[href*="/admin/dashboard"]:hover span,
body.thydom-admin aside a[href*="/admin/dashboard"].is-active,
body.thydom-admin aside a[href*="/admin/dashboard"].is-active span,
body.thydom-admin aside a[href*="/admin/dashboard"][aria-current="page"],
body.thydom-admin aside a[href*="/admin/dashboard"][aria-current="page"] span {
  color: #111111 !important;
}

/* THYDOM EDITORIAL GRID PHASE3A */
.thy-filters{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
    margin:18px 0;
}
.thy-filters input,
.thy-filters select,
.thy-modal input,
.thy-modal textarea{
    border:1px solid var(--admin-line,#D0D0CC);
    border-radius:8px;
    padding:9px 11px;
    background:#fff;
    color:var(--admin-text,#1A1A1A);
}
.thy-filters input{min-width:280px}
.thy-grid-meta{
    margin:10px 0 14px;
    color:var(--admin-muted,#666);
}
.thy-table-wrap{
    overflow:auto;
    border:1px solid var(--admin-line,#D0D0CC);
    border-radius:12px;
    background:#fff;
}
.thy-table{
    width:100%;
    border-collapse:collapse;
}
.thy-table th,
.thy-table td{
    padding:10px 12px;
    border-bottom:1px solid var(--admin-line,#D0D0CC);
    text-align:left;
    vertical-align:top;
}
.thy-table th{
    background:#f4f4f2;
    color:var(--admin-text,#1A1A1A);
    font-weight:800;
}
.thy-btn,
.thy-icon-btn{
    border:1px solid var(--admin-line,#D0D0CC);
    border-radius:8px;
    padding:8px 12px;
    background:#fff;
    color:var(--admin-text,#1A1A1A);
    text-decoration:none;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
}
.thy-btn-primary{
    background:var(--admin-red,#E4002B);
    border-color:var(--admin-red,#E4002B);
    color:#fff;
}
.thy-btn-danger{
    margin-top:10px;
    border-color:#9b1c1c;
    color:#9b1c1c;
}
.thy-icon-btn{
    min-width:34px;
    min-height:34px;
    padding:6px 8px;
}
.thy-modal{
    width:min(760px, calc(100vw - 36px));
    border:1px solid var(--admin-line,#D0D0CC);
    border-radius:14px;
    padding:18px;
}
.thy-modal::backdrop{
    background:rgba(0,0,0,.45);
}
.thy-modal-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    margin-bottom:14px;
}
.thy-modal label{
    display:flex;
    flex-direction:column;
    gap:6px;
    margin:10px 0;
    font-weight:700;
}
.thy-modal .thy-check{
    flex-direction:row;
    align-items:center;
    font-weight:600;
}
.thy-modal-actions{
    display:flex;
    gap:10px;
    margin-top:14px;
    flex-wrap:wrap;
}
.thy-pagination{
    margin-top:16px;
}

/* THYDOM 6A.4 - reparación modal compartida.
   El bloque editorial legacy anterior usa .thy-modal para <dialog> nativo.
   Estas reglas restauran el overlay moderno usado por Cuentas y los CRUD nuevos. */
body.thydom-admin div.thy-modal {
    position: fixed !important;
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 24px !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0,0,0,.52) !important;
    z-index: 30000 !important;
    overflow: hidden !important;
}

body.thydom-admin div.thy-modal.is-open {
    display: flex !important;
}

body.thydom-admin div.thy-modal > .thy-modal__dialog,
body.thydom-admin div.thy-modal > .thy-modal__panel {
    box-sizing: border-box !important;
    width: min(1040px, calc(100vw - 48px)) !important;
    max-width: calc(100vw - 48px) !important;
    max-height: calc(100vh - 48px) !important;
    margin: 0 auto !important;
    overflow: auto !important;
    overflow-x: hidden !important;
    background: #fff !important;
    border: 1px solid var(--admin-line,#D0D0CC) !important;
    border-top: 5px solid var(--admin-red,#E4002B) !important;
    border-radius: 0 !important;
    padding: 24px !important;
    box-shadow: 0 24px 70px rgba(0,0,0,.30) !important;
}

body.thydom-admin div.thy-modal--wide > .thy-modal__dialog,
body.thydom-admin div.thy-modal > .thy-modal__dialog--wide {
    width: min(1120px, calc(100vw - 48px)) !important;
}

body.thydom-admin div.thy-modal--sub > .thy-modal__dialog,
body.thydom-admin div.thy-modal > .thy-modal__dialog--sub {
    width: min(620px, calc(100vw - 48px)) !important;
}

body.thydom-admin .thy-form-grid-clean,
body.thydom-admin .thy-detail-form-grid--account {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}

body.thydom-admin .thy-form-section,
body.thydom-admin .thy-form-section-bio,
body.thydom-admin .thy-field-bio {
    min-width: 0 !important;
}

body.thydom-admin .thy-modal textarea,
body.thydom-admin .thy-modal input,
body.thydom-admin .thy-modal select {
    max-width: 100% !important;
}

@media(max-width:760px) {
    body.thydom-admin div.thy-modal {
        padding: 12px !important;
        align-items: flex-start !important;
    }

    body.thydom-admin div.thy-modal > .thy-modal__dialog,
    body.thydom-admin div.thy-modal > .thy-modal__panel,
    body.thydom-admin div.thy-modal--wide > .thy-modal__dialog,
    body.thydom-admin div.thy-modal > .thy-modal__dialog--wide {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 24px) !important;
        padding: 18px !important;
    }
}

/* THYDOM 6A.6 - ajustes UI editorial acotados */
body.thydom-admin .thy-grid-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    width: 100%;
    font-size: 13px;
}

body.thydom-admin .thy-grid-pagination nav,
body.thydom-admin .thy-grid-pagination > div {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

body.thydom-admin .thy-grid-pagination svg {
    width: 16px !important;
    height: 16px !important;
}

body.thydom-admin .thy-grid-pagination a,
body.thydom-admin .thy-grid-pagination span {
    min-width: auto;
    min-height: auto;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.1;
}

body.thydom-admin label.thy-check {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--admin-line);
    background: var(--admin-paper);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

body.thydom-admin .thy-check input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    accent-color: var(--admin-red);
}

body.thydom-admin .thy-image-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

body.thydom-admin .thy-attach-btn {
    min-height: 44px;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
}

body.thydom-admin .thy-attach-btn[data-file]::after {
    content: attr(data-file);
    display: block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 700;
}

body.thydom-admin .thy-book-builder {
    display: grid;
    gap: 24px;
}

body.thydom-admin .thy-builder-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

body.thydom-admin .thy-builder-stats article {
    border: 1px solid var(--admin-line);
    border-top: 4px solid var(--admin-red);
    background: var(--admin-paper);
    padding: 16px;
    box-shadow: var(--admin-shadow);
}

body.thydom-admin .thy-builder-stats span {
    display: block;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--admin-muted);
}

body.thydom-admin .thy-builder-stats strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    line-height: 1;
}

body.thydom-admin .thy-book-workbench {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

body.thydom-admin .thy-chapter-rail {
    position: sticky;
    top: 88px;
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 8px 5px;
    border: 1px solid var(--admin-line);
    background: var(--admin-paper);
    box-shadow: var(--admin-shadow);
}

body.thydom-admin .thy-chapter-rail a,
body.thydom-admin .thy-chapter-rail button {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--admin-line);
    background: #fff;
    color: var(--admin-ink);
    font-weight: 900;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

body.thydom-admin .thy-chapter-rail a.is-published {
    border-color: var(--admin-red);
    box-shadow: inset 4px 0 0 var(--admin-red);
}

body.thydom-admin .thy-book-workbench__main {
    display: grid;
    gap: 24px;
    min-width: 0;
}

body.thydom-admin .thy-builder-section {
    border: 1px solid var(--admin-line);
    border-top: 4px solid var(--admin-red);
    background: var(--admin-paper);
    padding: 22px;
    box-shadow: var(--admin-shadow);
}

body.thydom-admin .thy-book-cover-editor {
    padding: 24px;
}

body.thydom-admin .thy-book-cover-layout {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    margin-top: 8px;
}

body.thydom-admin .thy-book-cover-preview {
    width: 100%;
    aspect-ratio: 2 / 3;
    border: 1px solid var(--admin-red);
    background: #111;
    box-shadow: 0 18px 36px rgba(0,0,0,.18);
    overflow: hidden;
}

body.thydom-admin .thy-book-cover-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

body.thydom-admin .thy-book-grid-cover {
    width: 46px;
    height: 64px;
    display: block;
    object-fit: cover;
    border: 1px solid var(--admin-line);
    background: #111;
    box-shadow: 0 6px 14px rgba(0,0,0,.14);
}

body.thydom-admin .thy-book-cover-main {
    display: grid;
    gap: 20px;
    min-width: 0;
}

body.thydom-admin .thy-book-cover-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.thydom-admin .thy-book-cover-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #edf4ff;
    color: #004b86;
    font-size: 12px;
    font-weight: 900;
}

body.thydom-admin .thy-book-title-field {
    display: grid;
    gap: 8px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

body.thydom-admin .thy-book-title-field input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--admin-line);
    background: transparent;
    padding: 6px 0 14px;
    font-size: clamp(34px, 4vw, 62px);
    line-height: .98;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: none;
}

body.thydom-admin .thy-book-synopsis-editor {
    border: 1px solid var(--admin-line);
    background: #fff;
    padding: 18px;
}

body.thydom-admin .thy-book-synopsis-editor .thy-rich-editor {
    min-height: 190px;
}

body.thydom-admin .thy-builder-chapter {
    border: 1px solid var(--admin-line);
    background: #fff;
    padding: 18px;
    margin-top: 16px;
}

body.thydom-admin .thy-chapter-card {
    scroll-margin-top: 92px;
}

body.thydom-admin .thy-chapter-card.is-target-chapter {
    outline: 3px solid var(--admin-red);
    outline-offset: 4px;
}

body.thydom-admin .thy-chapter-hero {
    min-height: 170px;
    margin: -22px -22px 22px;
    display: flex;
    align-items: flex-end;
    padding: 22px;
    background-color: #111;
    background-position: center;
    background-size: cover;
    color: #fff;
}

body.thydom-admin .thy-builder-new-compact {
    padding: 16px 22px;
}

body.thydom-admin .thy-chapter-title-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    margin-right: 10px;
    background: var(--admin-ink);
    color: #fff;
    font-size: 20px;
    line-height: 1;
}

body.thydom-admin .thy-chapter-hero span {
    display: inline-flex;
    padding: 8px 12px;
    background: rgba(0,0,0,.76);
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

body.thydom-admin .thy-rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--admin-line);
    border-bottom: 0;
    background: #f4f1eb;
}

body.thydom-admin .thy-rich-toolbar button {
    min-width: 36px;
    min-height: 34px;
    border: 1px solid var(--admin-line);
    background: #fff;
    font-weight: 900;
    cursor: pointer;
}

body.thydom-admin .thy-rich-toolbar select,
body.thydom-admin .thy-rich-toolbar input[type="color"] {
    min-height: 34px;
    border: 1px solid var(--admin-line);
    background: #fff;
    font-weight: 800;
}

body.thydom-admin .thy-rich-editor {
    width: 100%;
    min-height: 240px;
    border: 1px solid var(--admin-line);
    padding: 14px;
    font: inherit;
    line-height: 1.65;
    background: var(--admin-paper);
}

@media (max-width: 760px) {
    body.thydom-admin .thy-image-input-row {
        grid-template-columns: 1fr;
    }

    body.thydom-admin .thy-grid-pagination {
        justify-content: center;
    }

    body.thydom-admin .thy-builder-stats,
    body.thydom-admin .thy-book-workbench {
        grid-template-columns: 1fr;
    }

    body.thydom-admin .thy-book-cover-layout {
        grid-template-columns: 1fr;
    }

    body.thydom-admin .thy-book-cover-preview {
        max-width: 280px;
    }

    body.thydom-admin .thy-chapter-rail {
        position: static;
        display: flex;
        overflow-x: auto;
        justify-content: flex-start;
    }
}

/* THYDOM_ADMIN_GRID_HEADER_REAL_FIX_START */
/*
   Corrección real de cabeceras de grids/tablas en administración.

   Problema:
   Algunas interfaces admin muestran thead/th con fondo claro sucio y texto demasiado claro,
   dejando los títulos de columna ilegibles.

   Alcance:
   Solo afecta a tablas renderizadas dentro del dominio/layout admin.
   No toca lógica, rutas, controladores ni base de datos.
*/

.admin-main table thead,
.admin-content table thead,
.admin-page table thead,
.admin-panel table thead,
.admin-card table thead,
.thydom-admin table thead,
main table thead {
    background: #ffffff !important;
}

.admin-main table thead tr,
.admin-content table thead tr,
.admin-page table thead tr,
.admin-panel table thead tr,
.admin-card table thead tr,
.thydom-admin table thead tr,
main table thead tr {
    background: #ffffff !important;
}

.admin-main table thead th,
.admin-content table thead th,
.admin-page table thead th,
.admin-panel table thead th,
.admin-card table thead th,
.thydom-admin table thead th,
main table thead th {
    background: #ffffff !important;
    color: #111111 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    border-bottom: 1px solid #cfc8bd !important;
}

.admin-main table thead th *,
.admin-content table thead th *,
.admin-page table thead th *,
.admin-panel table thead th *,
.admin-card table thead th *,
.thydom-admin table thead th *,
main table thead th * {
    color: #111111 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Compatibilidad con clases habituales de grids/listados admin */
.table thead,
.table-list thead,
.data-table thead,
.admin-table thead,
.td-table thead,
.grid-table thead {
    background: #ffffff !important;
}

.table thead tr,
.table-list thead tr,
.data-table thead tr,
.admin-table thead tr,
.td-table thead tr,
.grid-table thead tr {
    background: #ffffff !important;
}

.table thead th,
.table-list thead th,
.data-table thead th,
.admin-table thead th,
.td-table thead th,
.grid-table thead th {
    background: #ffffff !important;
    color: #111111 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    border-bottom: 1px solid #cfc8bd !important;
}

.table thead th *,
.table-list thead th *,
.data-table thead th *,
.admin-table thead th *,
.td-table thead th *,
.grid-table thead th * {
    color: #111111 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}
/* THYDOM_ADMIN_GRID_HEADER_REAL_FIX_END */
