/* CONNECTIO hotfix 2026-07-26 v52
   Capa transversal: contraste, limites de pantalla, tablas, paneles no montados, codificacion visual y login siempre visible. */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body .content,
body .workbench,
body .module-grid,
body .cx-dashboard-grid,
body .cx-module-header,
body .coverage-panel,
body .sales-panel,
body .catalog-panel,
body .tuu-panel,
body .admin-panel,
body .routes-panel,
body .profit-panel,
body .goals-panel,
body .connectio-home,
body .source-governed-panel {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body .workbench,
body .cx-module-header,
body .coverage-panel,
body .sales-card,
body .cx-card,
body .admin-editor,
body .module-card,
body .connectio-home-card,
body .commerce-toolbar,
body .analysis-filter-panel {
  border-radius: 3px !important;
}

body .cx-module-header,
body .workbench,
body .coverage-panel,
body .sales-card,
body .cx-card {
  border-width: 1px !important;
  box-shadow: none !important;
}

body .cx-tabs,
body .planes-entel-tabs,
body .cobros-tabs,
body [class*="-tabs"] {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  z-index: 2 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 .75rem !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-gutter: stable !important;
}

body .sales-table,
body .routes-table,
body .commerce-table,
body .cap-table,
body .cx-table,
body .admin-checks,
body .tareas-table,
body .incidentes-table {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-gutter: stable both-edges !important;
}

body .sales-table table,
body .routes-table table,
body .commerce-table table,
body .cap-table table,
body .cx-table table,
body .tareas-table table,
body .incidentes-table table {
  min-width: 920px !important;
}

body .source-status,
body .cx-loading-state,
body .status-pill,
body .nav-item,
body .side-group-toggle,
body .topbar-actions button,
body .user-chip,
body input,
body select,
body textarea {
  border-radius: 3px !important;
}

body .source-status,
body .cx-loading-state {
  width: fit-content !important;
  max-width: min(100%, 760px) !important;
  min-height: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: .55rem !important;
  margin: .35rem 0 .65rem !important;
  padding: .42rem .65rem !important;
  border: 1px solid rgba(14, 165, 233, .34) !important;
  border-left: 3px solid #0ea5e9 !important;
  border-radius: 3px !important;
  background: rgba(224, 242, 254, .78) !important;
  color: #075985 !important;
  box-shadow: none !important;
  line-height: 1.25 !important;
  overflow-wrap: anywhere !important;
}

body .source-status.is-empty-status,
body .cx-loading-state.is-empty-status {
  display: none !important;
}

body .source-status.is-loading::before,
body .cx-loading-state.is-loading::before,
body .modal-inline-status.is-loading::before {
  content: "";
  width: .64rem;
  height: .64rem;
  flex: 0 0 .64rem;
  border: 2px solid rgba(14, 165, 233, .24);
  border-top-color: #0ea5e9;
  border-radius: 999px;
  animation: cxCompactSpin .76s linear infinite;
}

body .source-status.is-error-status,
body .cx-loading-state.is-error-status {
  width: auto !important;
  max-width: 100% !important;
  display: flex !important;
  border-color: rgba(239, 68, 68, .28) !important;
  border-left-color: #ef4444 !important;
  background: rgba(254, 226, 226, .82) !important;
  color: #7f1d1d !important;
}

body .source-status.is-success-status,
body .cx-loading-state.is-success-status {
  border-color: rgba(16, 185, 129, .32) !important;
  border-left-color: #10b981 !important;
  background: rgba(209, 250, 229, .72) !important;
  color: #065f46 !important;
}

@keyframes cxCompactSpin {
  to {
    transform: rotate(360deg);
  }
}

body .eyebrow,
body small,
body label,
body .muted,
body .status-pill,
body .source-status {
  color: #334155 !important;
}

body h1,
body h2,
body h3,
body h4,
body strong,
body b,
body .section-head h3,
body .cx-module-header h3,
body .cx-module-header h2 {
  color: #091936 !important;
}

body .smart-topbar,
body .cx-header {
  background: #ffffff !important;
  color: #091936 !important;
}

body .smart-topbar *,
body .cx-header *,
body .topbar-actions button,
body .user-chip,
body .user-chip *,
body .connectia-btn,
body .theme-toggle-btn {
  color: #091936 !important;
  opacity: 1 !important;
}

body .user-chip,
body .connectia-btn,
body .theme-toggle-btn,
body .notification-btn {
  background: #eef8ff !important;
  border-color: #8bd3ff !important;
}

body.auth-locked .app-shell.sidebar-collapsed {
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr) !important;
}

body.auth-locked .app-shell.sidebar-collapsed .sidebar {
  width: auto !important;
}

body.auth-locked .app-shell.sidebar-collapsed .brand-copy,
body.auth-locked .app-shell.sidebar-collapsed .login-panel {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
  display: grid !important;
}

body.auth-locked .login-panel input,
body.auth-locked .login-panel button,
body.auth-locked .google-login-btn {
  width: 100% !important;
  min-height: 44px !important;
  box-sizing: border-box !important;
}

.telco-recipient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.telco-recipient-item {
  align-items: flex-start;
  background: rgba(14, 165, 233, 0.11);
  border-left: 4px solid var(--accent, #0ea5e9);
  border-radius: 8px;
  padding: 10px 12px;
}

.telco-recipient-item span {
  display: grid;
  gap: 3px;
}

.telco-recipient-item small {
  color: var(--muted, #64748b);
  font-size: 0.78rem;
  line-height: 1.25;
}

.button-row.compact {
  gap: 8px;
  margin-top: 10px;
}

body.telco-module-active #workbench,
body.telco-module-active .workbench,
body.telco-module-active .telco-command-center,
body.telco-module-active .module-subpanel.active,
body.telco-module-active .source-list,
body.telco-module-active .source-card,
body.telco-module-active .source-status,
body.telco-module-active .telco-delivery-mode,
body.telco-module-active .telco-action-bar,
body.telco-module-active .telco-recipient-grid {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow-wrap: anywhere;
}

body.telco-module-active .telco-command-center {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1.35fr) !important;
}

body.telco-module-active .telco-step-grid,
body.telco-module-active .kpi-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
}

body.telco-module-active .module-heading-row,
body.telco-module-active .telco-heading-actions,
body.telco-module-active .button-row,
body.telco-module-active .telco-selection-actions {
  flex-wrap: wrap !important;
  min-width: 0 !important;
}

body.telco-module-active .module-heading-row > *,
body.telco-module-active .telco-delivery-mode > *,
body.telco-module-active .telco-action-bar > * {
  min-width: 0 !important;
}

body.telco-module-active .telco-action-bar {
  grid-template-columns: minmax(220px, .85fr) minmax(260px, 1.1fr) minmax(220px, .85fr) !important;
}

body.telco-module-active .telco-recipient-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
}

body.telco-module-active .source-list {
  display: grid !important;
  gap: 12px !important;
}

body.telco-module-active .source-card .button-row {
  display: flex !important;
}

body.telco-module-active .source-card .button-row > *,
body.telco-module-active .telco-heading-actions > *,
body.telco-module-active .telco-selection-actions > * {
  flex: 1 1 190px !important;
}

body.telco-module-active .workbench .telco-step-panel:not(.is-active),
body.telco-module-active .workbench .telco-step-panel[aria-hidden="true"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

body.telco-module-active .workbench .telco-step-panel.is-active {
  display: block !important;
  max-height: calc(100vh - 260px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 18px !important;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

body.telco-module-active .telco-step-grid button.active,
body.telco-module-active .telco-step-grid button:focus-visible {
  background: #ffffff !important;
  color: #071326 !important;
  border-color: #2dd4bf !important;
  outline: 3px solid rgba(45, 212, 191, .35);
}

body.telco-module-active .telco-step-grid button.active b {
  background: #071326 !important;
  color: #2dd4bf !important;
}

body.telco-module-active .telco-step-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, .28);
  background: linear-gradient(180deg, rgba(255,255,255,.88), #fff 38%);
}

body.telco-module-active .telco-step-footer > * {
  flex: 0 1 260px;
}

body.telco-module-active .telco-command-center {
  position: sticky;
  top: 72px;
  z-index: 30;
  margin: 0 0 18px !important;
  padding: 16px 18px !important;
  align-items: stretch !important;
  gap: 16px !important;
  background: linear-gradient(135deg, #071326 0%, #0f2f46 62%, #0f766e 100%) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(45, 212, 191, .58) !important;
  border-left: 6px solid #2dd4bf !important;
  border-radius: 10px !important;
  box-shadow: 0 18px 34px rgba(7, 19, 38, .18) !important;
}

body.telco-module-active .telco-command-center .eyebrow,
body.telco-module-active .telco-command-center h3,
body.telco-module-active .telco-command-center p {
  color: #f8fafc !important;
}

body.telco-module-active .telco-command-center p {
  opacity: .88;
}

body.telco-module-active .telco-step-grid {
  align-content: stretch !important;
  align-items: stretch !important;
  gap: 10px !important;
}

body.telco-module-active .telco-step-grid button {
  min-height: 58px !important;
  padding: 12px 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  text-align: left !important;
  color: #071326 !important;
  background: #f8fbff !important;
  border: 1px solid rgba(147, 197, 253, .95) !important;
  border-left: 5px solid #38bdf8 !important;
  border-radius: 9px !important;
  box-shadow: none !important;
}

body.telco-module-active .telco-step-grid button b {
  flex: 0 0 28px !important;
  width: 28px !important;
  height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
  background: #0f766e !important;
  border-radius: 7px !important;
}

body.telco-module-active .telco-step-grid button span {
  color: inherit !important;
  line-height: 1.15 !important;
}

body.telco-module-active .telco-step-grid button.active,
body.telco-module-active .telco-step-grid button:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(135deg, #0ea5e9, #14b8a6) !important;
  border-color: rgba(45, 212, 191, .95) !important;
  border-left-color: #ffffff !important;
  outline: 3px solid rgba(45, 212, 191, .28) !important;
}

body.telco-module-active .telco-step-grid button.active b,
body.telco-module-active .telco-step-grid button:focus-visible b {
  color: #0f766e !important;
  background: #ffffff !important;
}

body.telco-module-active .workbench .telco-step-panel.is-active {
  position: relative !important;
  z-index: 1 !important;
  clear: both !important;
  margin-top: 0 !important;
  padding-top: 18px !important;
  border-top: 4px solid #2dd4bf !important;
  border-radius: 10px !important;
}

body.telco-module-active .telco-command-center + .telco-step-panel.is-active {
  margin-top: 16px !important;
}

body.telco-module-active .telco-step-panel.is-active::before {
  content: "Desplaza esta sección para ver todo";
  position: sticky;
  top: 0;
  z-index: 2;
  display: block;
  width: fit-content;
  margin: -8px 0 12px auto;
  padding: 7px 11px;
  border-left: 4px solid #0ea5e9;
  background: #e0f2fe;
  color: #075985;
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body.telco-module-active .telco-step-panel.is-active::-webkit-scrollbar,
body.telco-module-active .source-list::-webkit-scrollbar,
body.telco-module-active #telcoBulletinPreview::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

body.telco-module-active .telco-step-panel.is-active::-webkit-scrollbar-track,
body.telco-module-active .source-list::-webkit-scrollbar-track,
body.telco-module-active #telcoBulletinPreview::-webkit-scrollbar-track {
  background: #dbeafe;
  border-radius: 0;
}

body.telco-module-active .telco-step-panel.is-active::-webkit-scrollbar-thumb,
body.telco-module-active .source-list::-webkit-scrollbar-thumb,
body.telco-module-active #telcoBulletinPreview::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0ea5e9, #14b8a6);
  border: 3px solid #dbeafe;
  border-radius: 0;
}

@media (max-width: 1180px) {
  body.telco-module-active .telco-command-center,
  body.telco-module-active .telco-delivery-mode,
  body.telco-module-active .telco-action-bar {
    grid-template-columns: 1fr !important;
  }

  body.telco-module-active .telco-step-panel.is-active {
    max-height: calc(100vh - 220px) !important;
  }

  body.telco-module-active .telco-heading-actions {
    width: 100%;
    justify-content: stretch !important;
  }

  body.telco-module-active .telco-heading-actions > *,
  body.telco-module-active .telco-action-bar .cx-button,
  body.telco-module-active .telco-step-footer > * {
    width: 100%;
    flex-basis: 100%;
  }
}

body.telco-module-active[data-theme="dark"] .telco-command-center,
body.telco-module-active[data-theme="dark"] .module-subpanel.active,
body.telco-module-active[data-theme="dark"] .telco-delivery-mode,
body.telco-module-active[data-theme="dark"] .telco-action-bar,
body.telco-module-active[data-theme="dark"] #telcoBulletinPreview,
body.telco-module-active[data-theme="dark"] .source-status,
body.telco-module-active[data-theme="dark"] .source-card {
  color: #e5edf8 !important;
  background: #111c2f !important;
  border-color: rgba(45, 212, 191, .32) !important;
}

body.telco-module-active[data-theme="dark"] .telco-command-center {
  background: linear-gradient(135deg, #030712, #083344) !important;
}

body.telco-module-active[data-theme="dark"] .telco-step-grid button {
  color: #e5edf8 !important;
  background: #111c2f !important;
  border-color: rgba(56, 189, 248, .48) !important;
  border-left-color: #38bdf8 !important;
}

body.telco-module-active[data-theme="dark"] .telco-step-grid button b {
  color: #03111f !important;
  background: #67e8f9 !important;
}

body.telco-module-active[data-theme="dark"] .telco-step-grid button.active,
body.telco-module-active[data-theme="dark"] .telco-step-grid button:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(135deg, #0369a1, #0f766e) !important;
  border-color: rgba(103, 232, 249, .78) !important;
  border-left-color: #ffffff !important;
}

body.telco-module-active[data-theme="dark"] .telco-step-grid button.active b,
body.telco-module-active[data-theme="dark"] .telco-step-grid button:focus-visible b {
  color: #083344 !important;
  background: #ffffff !important;
}

body.telco-module-active[data-theme="dark"] .telco-instruction,
body.telco-module-active[data-theme="dark"] .telco-send-confirm,
body.telco-module-active[data-theme="dark"] .telco-recipient-item {
  color: #f8fafc !important;
  background: rgba(45, 212, 191, .10) !important;
}

body.telco-module-active[data-theme="dark"] .telco-manual-panel > summary strong,
body.telco-module-active[data-theme="dark"] .telco-manual-panel > summary small,
body.telco-module-active[data-theme="dark"] #telcoModeHelp {
  color: #e5edf8 !important;
}

body.telco-module-active[data-theme="dark"] .telco-step-footer {
  background: linear-gradient(180deg, rgba(17, 28, 47, .88), #111c2f 38%) !important;
}

body.telco-module-active[data-theme="dark"] .telco-step-panel.is-active::before {
  background: #083344 !important;
  color: #cffafe !important;
  border-left-color: #2dd4bf !important;
}

body.telco-module-active[data-theme="dark"] .telco-step-panel.is-active::-webkit-scrollbar-track,
body.telco-module-active[data-theme="dark"] .source-list::-webkit-scrollbar-track,
body.telco-module-active[data-theme="dark"] #telcoBulletinPreview::-webkit-scrollbar-track {
  background: #0f172a !important;
}

body.telco-module-active[data-theme="dark"] .telco-step-panel.is-active::-webkit-scrollbar-thumb,
body.telco-module-active[data-theme="dark"] .source-list::-webkit-scrollbar-thumb,
body.telco-module-active[data-theme="dark"] #telcoBulletinPreview::-webkit-scrollbar-thumb {
  border-color: #0f172a !important;
}

body[data-theme="dark"] {
  --ink: #f8fafc;
  --muted: #cbd5e1;
  --line: #334155;
  --soft: #0f172a;
  --card: #111c2f;
}

body[data-theme="dark"] .content,
body[data-theme="dark"] .workbench,
body[data-theme="dark"] .cx-module-header,
body[data-theme="dark"] .coverage-panel,
body[data-theme="dark"] .sales-card,
body[data-theme="dark"] .cx-card,
body[data-theme="dark"] .admin-editor,
body[data-theme="dark"] .module-card,
body[data-theme="dark"] .connectio-home-card {
  background: #111c2f !important;
  color: #e5edf8 !important;
  border-color: rgba(148, 163, 184, .34) !important;
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] strong,
body[data-theme="dark"] b,
body[data-theme="dark"] .section-head h3,
body[data-theme="dark"] .cx-module-header h3,
body[data-theme="dark"] .cx-module-header h2 {
  color: #f8fafc !important;
}

body[data-theme="dark"] p,
body[data-theme="dark"] span,
body[data-theme="dark"] td,
body[data-theme="dark"] th,
body[data-theme="dark"] label,
body[data-theme="dark"] small,
body[data-theme="dark"] .muted,
body[data-theme="dark"] .eyebrow {
  color: #cbd5e1 !important;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .topbar-search input {
  background: #07111f !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #94a3b8 !important;
}

body[data-theme="dark"] .source-status,
body[data-theme="dark"] .cx-loading-state {
  background: #0b1728 !important;
  color: #e0f2fe !important;
  border-color: rgba(45, 212, 191, .38) !important;
}

body[data-theme="dark"] .topbar-actions button,
body[data-theme="dark"] .user-chip,
body[data-theme="dark"] .profile-dropdown {
  background: #0f1d33 !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body[data-theme="dark"] .smart-topbar,
body[data-theme="dark"] .cx-header {
  background: #0b1324 !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body[data-theme="dark"] .smart-topbar *,
body[data-theme="dark"] .cx-header *,
body[data-theme="dark"] .topbar-actions button,
body[data-theme="dark"] .user-chip,
body[data-theme="dark"] .user-chip *,
body[data-theme="dark"] .connectia-btn,
body[data-theme="dark"] .theme-toggle-btn {
  color: #f8fafc !important;
  opacity: 1 !important;
}

body[data-theme="dark"] .notification-btn span {
  background: #2563eb !important;
  color: #ffffff !important;
}

body[data-theme="dark"] .connectio-home,
body[data-theme="dark"] .executive-board,
body[data-theme="dark"] .connectio-home-panel {
  background: #0f172a !important;
  color: #f8fafc !important;
}

body[data-theme="dark"] .profile-dropdown button {
  color: #f8fafc !important;
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .cx-sidebar {
  background: #050914 !important;
}

body[data-theme="dark"] .sidebar .brand strong,
body[data-theme="dark"] .sidebar .brand small,
body[data-theme="dark"] .side-nav strong,
body[data-theme="dark"] .side-nav span,
body[data-theme="dark"] .side-subnav button {
  color: #f8fafc !important;
}

body[data-theme="dark"] .module-card small,
body[data-theme="dark"] .connectio-home-area small,
body[data-theme="dark"] .cx-kpi small {
  color: #cbd5e1 !important;
}

body .admin-panel {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 1rem !important;
  align-items: stretch !important;
  overflow: visible !important;
}

body .admin-panel > div:first-child,
body .admin-panel .admin-editor {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  max-height: none !important;
  overflow: visible !important;
  transform: none !important;
}

body .admin-panel .admin-editor {
  margin-top: .75rem !important;
  padding: clamp(.85rem, 1.2vw, 1.1rem) !important;
  border: 0 !important;
  border-left: 5px solid #0ea5e9 !important;
  border-radius: 3px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  z-index: 1 !important;
}

body .admin-panel .admin-profile-summary {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
  gap: .7rem !important;
  width: 100% !important;
}

body .admin-panel .admin-checks {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: .7rem !important;
  width: 100% !important;
  max-height: min(68vh, 760px) !important;
  overflow: auto !important;
  padding: .45rem .45rem 5.5rem !important;
  border: 1px solid rgba(14, 165, 233, .28) !important;
  border-radius: 3px !important;
  background: rgba(224, 242, 254, .34) !important;
  scrollbar-gutter: stable both-edges !important;
}

body .admin-panel .admin-subpermissions-guide {
  display: grid !important;
  grid-template-columns: minmax(180px, .35fr) minmax(0, 1fr) !important;
  gap: .75rem !important;
  align-items: center !important;
  padding: .8rem 1rem !important;
  border-left: 4px solid #2563eb !important;
  background: linear-gradient(90deg, rgba(219, 234, 254, .95), rgba(240, 253, 250, .75)) !important;
  color: #0f172a !important;
}

body .admin-panel .admin-subpermissions-guide strong {
  color: #075985 !important;
  font-size: .82rem !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}

body .admin-panel .admin-subpermissions-guide span {
  color: #334155 !important;
  line-height: 1.35 !important;
}

body .admin-panel .admin-users {
  max-height: 420px !important;
  overflow: auto !important;
}

body .admin-panel .admin-permission-card {
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: .65rem !important;
  padding: .75rem .85rem !important;
  border: 1px solid rgba(14, 165, 233, .2) !important;
  border-left: 4px solid #0ea5e9 !important;
  border-radius: 3px !important;
  background: rgba(255, 255, 255, .9) !important;
  box-shadow: none !important;
}

body .admin-panel .admin-permission-main {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  gap: .65rem !important;
  align-items: start !important;
  cursor: pointer !important;
}

body .admin-panel .admin-permission-card strong,
body .admin-panel .admin-permission-card small {
  overflow-wrap: anywhere !important;
}

body .admin-panel .admin-rbac-permissions {
  display: block !important;
  gap: .5rem !important;
  padding: .7rem !important;
  border-top: 1px solid rgba(14, 165, 233, .22) !important;
  background: rgba(14, 165, 233, .08) !important;
  border-left: 4px solid #14b8a6 !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

body .admin-panel .admin-rbac-permissions summary {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: .75rem !important;
  align-items: start !important;
  list-style: none !important;
  cursor: pointer !important;
  min-width: 0 !important;
}

body .admin-panel .admin-rbac-permissions summary::-webkit-details-marker {
  display: none !important;
}

body .admin-panel .admin-rbac-permissions summary strong {
  display: block !important;
  font-size: .72rem !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  color: #0369a1 !important;
}

body .admin-panel .admin-rbac-permissions summary small {
  display: block !important;
  margin-top: .25rem !important;
  color: #334155 !important;
  line-height: 1.35 !important;
}

body .admin-panel .admin-rbac-permissions summary em {
  align-self: center !important;
  padding: .35rem .55rem !important;
  background: #e0f2fe !important;
  color: #075985 !important;
  font-size: .72rem !important;
  font-style: normal !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
}

body .admin-panel .admin-rbac-permissions summary em::before {
  content: "▾ ";
  font-weight: 900 !important;
}

body .admin-panel .admin-rbac-permissions:not([open]) summary em::before {
  content: "▸ ";
}

body .admin-panel .admin-rbac-permissions > p {
  margin: 0 !important;
  color: #334155 !important;
}

body .admin-panel .admin-rbac-options {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
  gap: .5rem !important;
  margin-top: .65rem !important;
  max-height: min(42vh, 430px) !important;
  overflow: auto !important;
  padding: .1rem .25rem .25rem 0 !important;
  scrollbar-gutter: stable !important;
}

body .admin-panel .admin-rbac-permissions:not([open]) .admin-rbac-options {
  display: none !important;
}

body .admin-panel .admin-rbac-option {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  gap: .45rem !important;
  align-items: start !important;
  padding: .55rem !important;
  background: rgba(255, 255, 255, .72) !important;
  border-left: 3px solid #14b8a6 !important;
  min-height: 66px !important;
}

body .admin-panel .admin-rbac-option b {
  display: block !important;
  font-size: .82rem !important;
  line-height: 1.15 !important;
}

body .admin-panel .admin-rbac-option small {
  display: block !important;
  margin-top: .18rem !important;
  font-size: .72rem !important;
  line-height: 1.25 !important;
}

body .admin-panel .admin-editor > button[data-admin-action="save"] {
  position: sticky !important;
  bottom: .75rem !important;
  z-index: 8 !important;
  justify-self: end !important;
  min-width: min(260px, 100%) !important;
  box-shadow: 0 10px 24px rgba(14, 165, 233, .24) !important;
}

body[data-theme="dark"] .admin-panel .admin-editor {
  background: #0f172a !important;
}

body[data-theme="dark"] .admin-panel .admin-checks {
  background: rgba(15, 23, 42, .82) !important;
  border-color: rgba(45, 212, 191, .28) !important;
}

body[data-theme="dark"] .admin-panel .admin-subpermissions-guide {
  background: linear-gradient(90deg, rgba(14, 165, 233, .22), rgba(45, 212, 191, .12)) !important;
  border-left-color: #38bdf8 !important;
  color: #e5f7ff !important;
}

body[data-theme="dark"] .admin-panel .admin-subpermissions-guide strong {
  color: #7dd3fc !important;
}

body[data-theme="dark"] .admin-panel .admin-subpermissions-guide span {
  color: #dbeafe !important;
}

body[data-theme="dark"] .admin-panel .admin-permission-card {
  background: rgba(15, 23, 42, .92) !important;
  border-color: rgba(45, 212, 191, .24) !important;
  border-left-color: #2dd4bf !important;
}

body[data-theme="dark"] .admin-panel .admin-rbac-permissions {
  background: rgba(45, 212, 191, .09) !important;
  border-top-color: rgba(45, 212, 191, .2) !important;
  border-left-color: #2dd4bf !important;
}

body[data-theme="dark"] .admin-panel .admin-rbac-permissions summary strong {
  color: #67e8f9 !important;
}

body[data-theme="dark"] .admin-panel .admin-rbac-permissions summary small,
body[data-theme="dark"] .admin-panel .admin-rbac-permissions > p {
  color: #cbd5e1 !important;
}

body[data-theme="dark"] .admin-panel .admin-rbac-permissions summary em {
  background: rgba(45, 212, 191, .14) !important;
  color: #a7f3d0 !important;
}

body[data-theme="dark"] .admin-panel .admin-rbac-option {
  background: rgba(15, 23, 42, .86) !important;
  border-left-color: #2dd4bf !important;
}

/* Dashboard TV publico interno: sin foco financiero, compacto para TV 55". */
body .tv-55-panel .tv-stage {
  min-height: min(82vh, 920px) !important;
  padding: clamp(14px, 1.5vw, 24px) !important;
  border-radius: 6px !important;
  background:
    radial-gradient(circle at 8% 0%, rgba(45, 212, 191, .22), transparent 30%),
    linear-gradient(135deg, #06111f 0%, #0b1730 48%, #07111f 100%) !important;
}

body .tv-55-panel .tv-control-bar,
body .tv-55-panel .tv-broadcast-strip article,
body .tv-55-panel .tv-slide,
body .tv-55-panel .tv-metrics article,
body .tv-55-panel .tv-chart,
body .tv-55-panel .tv-list,
body .tv-55-panel .tv-alerts article,
body .tv-55-panel .tv-signal-strip article,
body .tv-55-panel .tv-area-context {
  border-radius: 4px !important;
}

body .tv-55-panel .tv-control-bar {
  padding: 10px 12px !important;
  margin-bottom: 8px !important;
}

body .tv-55-panel .tv-control-bar strong {
  font-size: clamp(18px, 1.5vw, 28px) !important;
}

body .tv-55-panel .tv-control-bar small,
body .tv-55-panel .tv-room-label {
  font-size: 11px !important;
}

body .tv-55-panel .tv-control-actions button {
  min-height: 30px !important;
  padding: 6px 10px !important;
  border-radius: 4px !important;
}

body .tv-55-panel .tv-broadcast-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 8px 0 !important;
}

body .tv-55-panel .tv-broadcast-strip article {
  padding: 8px 10px !important;
  min-height: 52px !important;
}

body .tv-55-panel .tv-tabs {
  opacity: .85 !important;
  margin: 4px 0 6px !important;
}

body .tv-55-panel .tv-tabs button {
  width: 42px !important;
  height: 8px !important;
  border-radius: 0 !important;
}

body .tv-55-panel .tv-slide {
  --tv-screen-a: rgba(14, 165, 233, .20);
  --tv-screen-b: rgba(45, 212, 191, .16);
  padding: clamp(14px, 1.4vw, 22px) !important;
  border: 1px solid rgba(125, 211, 252, .16) !important;
  background:
    linear-gradient(90deg, var(--tv-screen-a), transparent 28%, var(--tv-screen-b)),
    linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(8, 19, 38, .94)) !important;
}

body .tv-55-panel .tv-slide.green {
  --tv-screen-a: rgba(34, 197, 94, .22);
  --tv-screen-b: rgba(20, 184, 166, .18);
}

body .tv-55-panel .tv-slide.purple {
  --tv-screen-a: rgba(124, 58, 237, .24);
  --tv-screen-b: rgba(14, 165, 233, .14);
}

body .tv-55-panel .tv-slide.orange {
  --tv-screen-a: rgba(245, 158, 11, .24);
  --tv-screen-b: rgba(45, 212, 191, .12);
}

body .tv-55-panel .tv-slide.red {
  --tv-screen-a: rgba(239, 68, 68, .22);
  --tv-screen-b: rgba(245, 158, 11, .15);
}

body .tv-55-panel .tv-slide-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 10px !important;
  align-items: center !important;
  max-width: none !important;
  margin-bottom: 6px !important;
}

body .tv-55-panel .tv-slide-head .eyebrow {
  font-size: 11px !important;
  letter-spacing: .12em !important;
  color: #67e8f9 !important;
}

body .tv-55-panel .tv-slide-head h2 {
  margin: 2px 0 0 !important;
  font-size: clamp(24px, 2.2vw, 42px) !important;
  line-height: 1.02 !important;
}

body .tv-55-panel .tv-slide-head p {
  display: none !important;
}

body .tv-55-panel .tv-slide-head > strong {
  min-width: 54px !important;
  padding: 7px 10px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
}

body .tv-55-panel .tv-signal-strip,
body .tv-55-panel .tv-area-context {
  display: none !important;
}

body .tv-55-panel .tv-metrics {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 10px !important;
  margin: 12px 0 !important;
}

body .tv-55-panel .tv-metrics article {
  min-height: 96px !important;
  padding: 12px 14px !important;
  background: rgba(226, 232, 240, .08) !important;
  border-left: 5px solid #2dd4bf !important;
}

body .tv-55-panel .tv-metrics strong {
  font-size: clamp(28px, 2.9vw, 48px) !important;
}

body .tv-55-panel .tv-metrics span {
  color: #e0f2fe !important;
  font-size: 11px !important;
}

body .tv-55-panel .tv-content-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)) !important;
  gap: 10px !important;
}

body .tv-55-panel .tv-chart,
body .tv-55-panel .tv-list,
body .tv-55-panel .tv-alerts article {
  min-height: 190px !important;
  padding: 13px !important;
  background: rgba(15, 23, 42, .72) !important;
  border-left: 5px solid #0ea5e9 !important;
}

body .tv-55-panel .tv-chart h4 {
  margin-bottom: 10px !important;
  font-size: clamp(17px, 1.25vw, 24px) !important;
  color: #f8fafc !important;
}

body .tv-55-panel .tv-bar {
  grid-template-columns: minmax(130px, 12vw) 1fr minmax(64px, 5vw) !important;
  gap: 8px !important;
}

body .tv-55-panel .tv-bar div {
  height: 12px !important;
}

body .tv-55-panel .tv-pie-orbit::before,
body .tv-55-panel .tv-pie-orbit::after {
  display: none !important;
}

body .tv-55-panel .tv-pie {
  transform: none !important;
  box-shadow: none !important;
  width: 170px !important;
  min-height: 170px !important;
}

body .tv-55-panel .tv-pie strong,
body .tv-55-panel .tv-pie span {
  transform: none !important;
}

body .tv-55-panel .tv-ticker {
  margin-top: 8px !important;
  padding: 8px 10px !important;
  border-radius: 4px !important;
}

body .tv-55-panel .tv-ticker span {
  font-size: clamp(14px, 1.25vw, 22px) !important;
}

/* Dashboard TV: modo sala real, aprovechando el viewport antes y durante fullscreen. */
body.dashboard-tv-active .sidebar,
body.dashboard-tv-active .workbench-head,
body.dashboard-tv-active #moduleDescription,
body.dashboard-tv-active #moduleActions,
body.dashboard-tv-active .module-grid,
body.dashboard-tv-active .hero,
body.dashboard-tv-active .kpis {
  display: none !important;
}

body.dashboard-tv-active .app-shell,
body.dashboard-tv-active .app-shell.sidebar-collapsed {
  grid-template-columns: 1fr !important;
}

body.dashboard-tv-active .content,
body.dashboard-tv-active .workbench {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

body.dashboard-tv-active .content {
  padding: 8px !important;
}

body.dashboard-tv-active .smart-topbar {
  min-height: 42px !important;
  margin: 0 0 8px !important;
  padding: 6px 10px !important;
  border-radius: 0 !important;
}

body.dashboard-tv-active .topbar-left,
body.dashboard-tv-active .topbar-search,
body.dashboard-tv-active .topbar-actions > button:not(.user-chip),
body.dashboard-tv-active .topbar-actions .notification-button {
  display: none !important;
}

body.dashboard-tv-active .topbar-actions {
  margin-left: auto !important;
}

body.dashboard-tv-active .tv-panel {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  gap: 0 !important;
}

body.dashboard-tv-active .tv-55-panel .tv-stage {
  min-height: calc(100vh - 50px) !important;
  height: calc(100vh - 50px) !important;
  display: flex !important;
  flex-direction: column !important;
  padding: clamp(8px, .85vw, 14px) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.dashboard-tv-active .tv-55-panel .tv-control-bar {
  flex: 0 0 auto !important;
  min-height: 30px !important;
  padding: 4px 7px !important;
  background: rgba(2, 6, 23, .55) !important;
  border: 1px solid rgba(45, 212, 191, .28) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-control-bar > div:first-child {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
}

body.dashboard-tv-active .tv-55-panel .tv-control-bar .tv-room-label {
  font-size: clamp(9px, .62vw, 12px) !important;
  letter-spacing: .14em !important;
}

body.dashboard-tv-active .tv-55-panel #tvClock {
  font-size: clamp(12px, .9vw, 18px) !important;
}

body.dashboard-tv-active .tv-55-panel #tvStatus {
  max-width: 26vw !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: clamp(9px, .62vw, 12px) !important;
}

body.dashboard-tv-active .tv-55-panel .tv-control-actions {
  opacity: .72 !important;
  display: flex !important;
  gap: 5px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-control-actions button {
  min-height: 26px !important;
  padding: 4px 8px !important;
  font-size: clamp(9px, .62vw, 12px) !important;
  border-radius: 4px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-fullscreen-primary {
  color: #02111f !important;
  background: linear-gradient(135deg, #2dd4bf, #38bdf8) !important;
  border-color: rgba(45, 212, 191, .85) !important;
  box-shadow: 0 0 18px rgba(45, 212, 191, .28) !important;
}

body.dashboard-tv-active .tv-fullscreen-hint {
  display: block !important;
  margin: 3px 0 4px !important;
  padding: 4px 8px !important;
  color: #dffcff !important;
  background: rgba(14, 165, 233, .10) !important;
  border-left: 3px solid #2dd4bf !important;
  font-size: clamp(9px, .65vw, 12px) !important;
  font-weight: 800 !important;
}

body.dashboard-tv-active .tv-55-panel .tv-broadcast-strip {
  flex: 0 0 auto !important;
  grid-template-columns: minmax(70px, .55fr) minmax(120px, 1.35fr) minmax(70px, .55fr) !important;
  gap: 5px !important;
  margin: 4px 0 !important;
  max-width: min(520px, 52vw) !important;
}

body.dashboard-tv-active .tv-55-panel .tv-broadcast-strip article {
  min-height: 28px !important;
  padding: 4px 7px !important;
  border-radius: 4px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-broadcast-strip strong {
  font-size: clamp(11px, .85vw, 16px) !important;
}

body.dashboard-tv-active .tv-55-panel .tv-broadcast-strip span {
  font-size: clamp(8px, .55vw, 10px) !important;
}

body.dashboard-tv-active .tv-persistent-alerts {
  display: none !important;
}

body.dashboard-tv-active .tv-persistent-alerts.active {
  position: absolute !important;
  z-index: 8 !important;
  right: clamp(10px, 1vw, 18px) !important;
  top: clamp(74px, 6.5vw, 112px) !important;
  width: min(520px, 35vw) !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) minmax(145px, .82fr) !important;
  align-items: center !important;
  gap: 9px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border-left: 6px solid #f59e0b !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(88, 28, 135, .82)) !important;
  color: #fff7ed !important;
  box-shadow: 0 18px 42px rgba(2, 6, 23, .42), 0 0 28px rgba(245, 158, 11, .28) !important;
  pointer-events: none !important;
  animation: tvAlertPulse 1.8s ease-in-out infinite !important;
}

body.dashboard-tv-active .tv-persistent-alerts.active.danger {
  border-left-color: #ef4444 !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, .97), rgba(127, 29, 29, .86)) !important;
  box-shadow: 0 18px 42px rgba(2, 6, 23, .45), 0 0 32px rgba(239, 68, 68, .36) !important;
}

body.dashboard-tv-active .tv-alert-pop-icon {
  display: grid !important;
  place-items: center !important;
  width: clamp(32px, 2.45vw, 44px) !important;
  height: clamp(32px, 2.45vw, 44px) !important;
  background: #f59e0b !important;
  color: #111827 !important;
  font-size: clamp(18px, 1.45vw, 26px) !important;
  font-weight: 1000 !important;
}

body.dashboard-tv-active .tv-persistent-alerts.danger .tv-alert-pop-icon {
  background: #ef4444 !important;
  color: #fff !important;
}

body.dashboard-tv-active .tv-alert-pop-body,
body.dashboard-tv-active .tv-alert-pop-owner {
  min-width: 0 !important;
}

body.dashboard-tv-active .tv-alert-pop-body span,
body.dashboard-tv-active .tv-alert-pop-owner span {
  display: block !important;
  font-size: clamp(9px, .65vw, 12px) !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: .12em !important;
  color: #fde68a !important;
}

body.dashboard-tv-active .tv-alert-pop-body strong,
body.dashboard-tv-active .tv-alert-pop-owner strong {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: clamp(12px, .95vw, 18px) !important;
  color: #ffffff !important;
}

body.dashboard-tv-active .tv-alert-pop-body p,
body.dashboard-tv-active .tv-alert-pop-owner small {
  display: -webkit-box !important;
  margin: 2px 0 0 !important;
  overflow: hidden !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  color: #e0f2fe !important;
  font-size: clamp(10px, .72vw, 13px) !important;
  line-height: 1.25 !important;
}

@keyframes tvAlertPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

body.dashboard-tv-active .tv-55-panel .tv-tabs {
  flex: 0 0 auto !important;
  margin: 2px 0 3px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-slide {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding: clamp(8px, .9vw, 14px) !important;
}

body.dashboard-tv-active .tv-55-panel .tv-slide-head h2 {
  font-size: clamp(24px, 3.15vw, 54px) !important;
}

body.dashboard-tv-active .tv-55-panel .tv-slide-head {
  flex: 0 0 auto !important;
}

body.dashboard-tv-active .tv-55-panel .tv-metrics {
  flex: 0 0 auto !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  margin: 6px 0 !important;
}

body.dashboard-tv-active .tv-55-panel .tv-metrics article {
  min-height: 72px !important;
  padding: 9px 11px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-metrics strong {
  font-size: clamp(24px, 3vw, 44px) !important;
}

body.dashboard-tv-active .tv-55-panel .tv-content-grid {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 10px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-chart,
body.dashboard-tv-active .tv-55-panel .tv-list,
body.dashboard-tv-active .tv-55-panel .tv-alerts {
  min-height: 0 !important;
  height: 100% !important;
}

body.dashboard-tv-active .tv-55-panel .tv-chart,
body.dashboard-tv-active .tv-55-panel .tv-list,
body.dashboard-tv-active .tv-55-panel .tv-alerts article {
  padding: 10px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-line-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: linear-gradient(135deg, rgba(7, 11, 22, 0.96), rgba(10, 38, 59, 0.9)) !important;
  border-color: rgba(45, 212, 191, 0.55) !important;
}

body.dashboard-tv-active .tv-55-panel .tv-line-card header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-line-card header strong {
  color: #d7fff7 !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.04em !important;
  white-space: nowrap !important;
}

body.dashboard-tv-active .tv-55-panel .tv-line-card svg {
  width: 100% !important;
  min-height: 112px !important;
  flex: 1 1 auto !important;
  overflow: visible !important;
}

body.dashboard-tv-active .tv-55-panel .tv-line-card circle {
  fill: #eafffb !important;
  stroke: #2dd4bf !important;
  stroke-width: 1.5 !important;
}

body.dashboard-tv-active .tv-55-panel .tv-line-footer {
  display: flex !important;
  justify-content: space-between !important;
  gap: 8px !important;
  color: rgba(234, 255, 251, 0.82) !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
}

body.dashboard-tv-active .tv-55-panel .tv-ticker {
  flex: 0 0 auto !important;
  margin-top: 6px !important;
  white-space: nowrap !important;
}

body.dashboard-tv-active .tv-stage:fullscreen,
body.dashboard-tv-active .tv-55-panel .tv-stage:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  padding: clamp(8px, .85vw, 14px) !important;
}

body.dashboard-tv-active .tv-stage:fullscreen .tv-fullscreen-hint {
  display: none !important;
}

body.dashboard-tv-active .tv-stage:fullscreen .tv-control-actions {
  opacity: .18 !important;
}

body.dashboard-tv-active .tv-stage:fullscreen .tv-control-actions:hover {
  opacity: 1 !important;
}

/* Dashboard TV operativo v2: menos navegador, más información útil para sala de control. */
body.dashboard-tv-active .smart-topbar {
  display: none !important;
}

body.dashboard-tv-active .content {
  min-height: 100vh !important;
  padding: 0 !important;
}

body.dashboard-tv-active .tv-55-panel .tv-stage {
  height: 100vh !important;
  min-height: 100vh !important;
  padding: 8px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-control-bar {
  min-height: 28px !important;
  margin: 0 0 4px !important;
  padding: 3px 7px !important;
  border-color: rgba(45, 212, 191, .42) !important;
  background: rgba(2, 6, 23, .52) !important;
}

body.dashboard-tv-active .tv-55-panel .tv-room-label {
  display: none !important;
}

body.dashboard-tv-active .tv-55-panel #tvStatus {
  max-width: 18vw !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.dashboard-tv-active .tv-55-panel .tv-control-actions {
  gap: 4px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-control-actions button {
  min-height: 22px !important;
  padding: 2px 7px !important;
  font-size: 10px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-broadcast-strip,
body.dashboard-tv-active .tv-55-panel .tv-fullscreen-hint,
body.dashboard-tv-active .tv-55-panel .tv-signal-strip,
body.dashboard-tv-active .tv-55-panel .tv-area-context {
  display: none !important;
}

body.dashboard-tv-active .tv-55-panel .tv-tabs {
  position: absolute !important;
  top: 40px !important;
  left: 10px !important;
  z-index: 7 !important;
  width: auto !important;
  max-width: 18vw !important;
  gap: 3px !important;
  opacity: .55 !important;
}

body.dashboard-tv-active .tv-55-panel .tv-tabs:hover {
  opacity: 1 !important;
}

body.dashboard-tv-active .tv-55-panel .tv-tabs button {
  width: 24px !important;
  height: 5px !important;
  min-height: 5px !important;
  padding: 0 !important;
}

body.dashboard-tv-active .tv-55-panel .tv-slide {
  padding: 8px 10px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-slide-head {
  margin-left: 28px !important;
  margin-bottom: 4px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-slide-head .eyebrow {
  font-size: 9px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-slide-head h2 {
  font-size: clamp(22px, 2.5vw, 44px) !important;
  line-height: .98 !important;
}

body.dashboard-tv-active .tv-55-panel .tv-slide-head p {
  max-width: 72vw !important;
  font-size: clamp(11px, .9vw, 16px) !important;
}

body.dashboard-tv-active .tv-55-panel .tv-slide-head > strong {
  min-width: 44px !important;
  padding: 4px 6px !important;
  font-size: 10px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-metrics {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
  gap: 7px !important;
  margin: 4px 0 7px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-metrics article {
  min-height: 58px !important;
  padding: 7px 9px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-metrics strong {
  font-size: clamp(20px, 2.3vw, 36px) !important;
}

body.dashboard-tv-active .tv-55-panel .tv-metrics span {
  font-size: 9px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-content-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 7px !important;
  min-height: 0 !important;
}

body.dashboard-tv-active .tv-55-panel .tv-chart,
body.dashboard-tv-active .tv-55-panel .tv-list,
body.dashboard-tv-active .tv-55-panel .tv-alerts article {
  min-height: 0 !important;
  padding: 8px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-chart h4,
body.dashboard-tv-active .tv-55-panel .tv-list h4 {
  margin-bottom: 6px !important;
  font-size: clamp(13px, 1vw, 18px) !important;
}

body.dashboard-tv-active .tv-55-panel .tv-bar {
  grid-template-columns: minmax(90px, 8vw) 1fr minmax(52px, 4vw) !important;
  font-size: clamp(9px, .72vw, 12px) !important;
}

body.dashboard-tv-active .tv-55-panel .tv-bar div {
  height: 9px !important;
}

body.dashboard-tv-active .tv-persistent-alerts.active {
  top: 42px !important;
  width: min(480px, 32vw) !important;
  transform: scale(.92) !important;
  transform-origin: top right !important;
}

body.dashboard-tv-active .tv-55-panel .tv-ticker {
  margin-top: 5px !important;
  padding: 5px 8px !important;
}

body.dashboard-tv-active .tv-55-panel .tv-ticker span {
  font-size: clamp(11px, .9vw, 16px) !important;
}

@media (max-width: 1500px) {
  body.dashboard-tv-active .tv-55-panel .tv-content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
.session-idle-notice {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  z-index: 10050;
  display: grid;
  gap: 12px;
  width: min(440px, calc(100vw - 32px));
  padding: 24px;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  background: #fff7ed;
  color: #422006;
  text-align: center;
  box-shadow:
    0 0 0 100vmax rgba(7, 11, 22, .62),
    0 24px 64px rgba(7, 11, 22, .42);
}

.session-idle-notice[hidden] {
  display: none;
}

.session-idle-notice b {
  font-size: clamp(2.6rem, 8vw, 4.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.session-idle-notice button {
  min-height: 52px;
  width: 100%;
  font-weight: 800;
}

@media (max-width: 640px) {
  .session-idle-notice {
    width: calc(100vw - 24px);
    padding: 20px 16px;
  }
}

/* CONNECTIO acceso v20260727: login siempre visible y portada sin desborde horizontal.
   El problema anterior era que el panel de acceso quedaba fijo a la derecha dentro de
   un lienzo más ancho que el navegador, por eso el usuario veía la portada pero no podía entrar. */
body.auth-locked {
  width: 100vw !important;
  max-width: 100vw !important;
  min-height: 100vh !important;
  overflow-x: hidden !important;
}

body.auth-locked .app-shell,
body.auth-locked .app-shell.sidebar-collapsed {
  display: block !important;
  width: 100vw !important;
  max-width: 100vw !important;
  min-height: 100vh !important;
  overflow-x: hidden !important;
}

body.auth-locked .sidebar {
  position: fixed !important;
  inset: 0 auto auto 0 !important;
  width: min(320px, 32vw) !important;
  min-width: 260px !important;
  height: auto !important;
  max-height: 100vh !important;
  overflow: visible !important;
  padding: clamp(18px, 2vw, 30px) !important;
  background: linear-gradient(180deg, rgba(3, 10, 24, .96), rgba(3, 10, 24, .74)) !important;
  border-right: 1px solid rgba(45, 212, 191, .20) !important;
  z-index: 35 !important;
}

body.auth-locked .content {
  position: relative !important;
  width: 100vw !important;
  max-width: 100vw !important;
  min-height: 100vh !important;
  margin-left: 0 !important;
  padding: clamp(28px, 4vw, 72px) !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 18% 18%, rgba(45, 212, 191, .20), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(14, 165, 233, .22), transparent 30%),
    linear-gradient(135deg, #070b16 0%, #0b1d34 52%, #061224 100%) !important;
}

body.auth-locked .content::after {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  pointer-events: none !important;
  opacity: .18 !important;
  background-image:
    linear-gradient(rgba(45, 212, 191, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 212, 191, .10) 1px, transparent 1px) !important;
  background-size: 72px 72px !important;
}

body.auth-locked .hero {
  position: fixed !important;
  left: clamp(330px, 24vw, 440px) !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: min(760px, calc(100vw - 920px)) !important;
  min-height: auto !important;
  max-width: none !important;
  z-index: 5 !important;
}

body.auth-locked .hero h1 {
  font-size: clamp(48px, 5.4vw, 96px) !important;
}

body.auth-locked .hero p {
  max-width: 640px !important;
}

body.auth-locked .access-gate {
  position: fixed !important;
  left: clamp(330px, 24vw, 440px) !important;
  bottom: clamp(32px, 5vh, 72px) !important;
  width: min(660px, calc(100vw - 940px)) !important;
  max-width: none !important;
  margin: 0 !important;
  z-index: 6 !important;
}

body.auth-locked .access-gate h2,
body.auth-locked .access-gate p {
  display: none !important;
}

body.auth-locked .access-gate div {
  margin: 0 !important;
}

body.auth-locked .login-panel {
  position: fixed !important;
  top: 50% !important;
  right: clamp(28px, 5vw, 90px) !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  z-index: 60 !important;
  width: min(430px, calc(100vw - 56px)) !important;
  max-height: calc(100vh - 56px) !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

body.auth-locked .login-panel input,
body.auth-locked .login-panel button,
body.auth-locked .login-panel .google-login-btn {
  color: #071126 !important;
  opacity: 1 !important;
}

body.auth-locked .login-panel #loginButton,
body.auth-locked .login-panel .google-login-btn {
  color: #ffffff !important;
}

@media (max-width: 1280px) {
  body.auth-locked .sidebar {
    width: 100% !important;
    min-width: 0 !important;
    padding: 16px 22px !important;
    background: rgba(3, 10, 24, .88) !important;
  }

  body.auth-locked .content {
    padding: 24px !important;
  }

  body.auth-locked .hero,
  body.auth-locked .access-gate {
    display: none !important;
  }

  body.auth-locked .login-panel {
    top: 54% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
    width: min(460px, calc(100vw - 32px)) !important;
  }
}

/* Back Office TUU: ventana real, no montada sobre la tabla */
#tuuEditorModal.platform-modal {
  z-index: 2147483000 !important;
  align-items: stretch !important;
  justify-content: center !important;
  padding: 14px !important;
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, .18), transparent 28%),
    rgba(7, 11, 22, .78) !important;
  backdrop-filter: blur(10px) saturate(118%) !important;
}

#tuuEditorModal .tuu-editor-card {
  width: min(1720px, calc(100vw - 28px)) !important;
  height: calc(100dvh - 28px) !important;
  max-height: calc(100dvh - 28px) !important;
  border-radius: 6px !important;
  border: 1px solid rgba(45, 212, 191, .42) !important;
  background: #f8fbff !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .38) !important;
}

#tuuEditorModal .platform-modal-head {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
  align-items: center !important;
  background: linear-gradient(180deg, #ffffff, #eef7ff) !important;
}

#tuuEditorModal .tuu-editor-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  overscroll-behavior: contain !important;
  padding: 18px clamp(14px, 1.8vw, 28px) !important;
}

#tuuEditorModal .modal-actions {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 5 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: linear-gradient(180deg, rgba(248, 251, 255, .92), #ffffff) !important;
}

#tuuEditorModal .tuu-form fieldset,
#tuuEditorModal .tuu-form-priority,
#tuuEditorModal input,
#tuuEditorModal select,
#tuuEditorModal textarea,
#tuuEditorModal button,
#tuuEditorModal .source-status,
#tuuEditorModal .modal-inline-status {
  border-radius: 4px !important;
}

#tuuEditorModal .modal-head-actions {
  flex: 0 0 auto !important;
}

#tuuEditorModal .primary-btn,
#tuuEditorModal [data-tuu-action="guardar"] {
  background: #0f766e !important;
  color: #ffffff !important;
}

#tuuEditorModal .modal-close,
#tuuEditorModal [data-tuu-action="cerrar-formulario"] {
  background: #eff6ff !important;
  color: #075985 !important;
}

.tuu-haulmer-tabs {
  top: 0 !important;
  z-index: 8 !important;
  border-radius: 6px !important;
  padding: 8px !important;
  align-items: center !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

.tuu-haulmer-tabs::before {
  content: "Secciones TUU" !important;
}

.tuu-haulmer-tabs button {
  border-bottom: 1px solid color-mix(in srgb, var(--agenda-accent) 28%, #dbe7f5) !important;
  border-radius: 4px !important;
  max-width: none !important;
  min-height: 40px !important;
}

.tuu-haulmer-tabs button[hidden] {
  display: none !important;
}

.tuu-view.active {
  border-radius: 0 !important;
  border-top-width: 2px !important;
}

body[data-theme="dark"] #tuuEditorModal .tuu-editor-card {
  background: #0f172a !important;
  border-color: rgba(45, 212, 191, .5) !important;
}

body[data-theme="dark"] #tuuEditorModal .platform-modal-head,
body[data-theme="dark"] #tuuEditorModal .modal-actions {
  background: linear-gradient(180deg, #111c31, #0f172a) !important;
}

body[data-theme="dark"] .tuu-haulmer-tabs {
  background: #111c31 !important;
  border-color: rgba(45, 212, 191, .3) !important;
}

/* Permisos: edición por ficha/modal, no por sábana dentro del listado. */
body .admin-panel .admin-rbac-store {
  display: none !important;
}

body .admin-panel .admin-permission-card {
  min-height: auto !important;
  overflow: hidden !important;
}

body .admin-panel .admin-permission-toolbar {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  gap: .65rem !important;
  align-items: center !important;
  padding-top: .45rem !important;
  border-top: 1px solid rgba(14, 165, 233, .14) !important;
}

body .admin-panel .admin-permission-toolbar button {
  min-height: 36px !important;
  padding: .45rem .75rem !important;
  border: 1px solid rgba(14, 165, 233, .45) !important;
  border-radius: 3px !important;
  background: #e0f2fe !important;
  color: #075985 !important;
  font-weight: 900 !important;
  cursor: pointer !important;
}

body .admin-panel .admin-permission-toolbar small {
  color: #475569 !important;
  font-size: .74rem !important;
  line-height: 1.25 !important;
}

/* admin-module-modal-centered-v3
   La ficha de subcategorías debe comportarse como ventana real: fondo completo
   opaco, centrada en el viewport y con scroll interno. */
html body #adminModulePermissionModal.platform-modal {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: none !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: none !important;
  z-index: 2147483500 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: clamp(18px, 3vw, 42px) !important;
  border: 0 !important;
  border-left: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background:
    radial-gradient(circle at 12% 8%, rgba(45, 212, 191, .18), transparent 34%),
    linear-gradient(135deg, rgba(2, 6, 23, .88), rgba(15, 23, 42, .84)) !important;
  backdrop-filter: blur(10px) saturate(112%) !important;
  overflow: hidden !important;
}

html body #adminModulePermissionModal.platform-modal:not([hidden]) {
  display: flex !important;
}

html body #adminModulePermissionModal.platform-modal[hidden] {
  display: none !important;
}

html body:has(#adminModulePermissionModal.platform-modal:not([hidden])) {
  overflow: hidden !important;
}

html body #adminModulePermissionModal .admin-module-permission-card {
  position: relative !important;
  inset: auto !important;
  margin: auto !important;
  transform: none !important;
  align-self: center !important;
  justify-self: center !important;
  width: min(1040px, calc(100vw - 72px)) !important;
  height: min(78vh, 760px) !important;
  max-width: min(1040px, calc(100vw - 72px)) !important;
  max-height: calc(100dvh - 72px) !important;
  border-radius: 4px !important;
  border-top: 5px solid #2dd4bf !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  box-shadow: 0 30px 90px rgba(2, 6, 23, .56) !important;
}

body #adminModulePermissionModal .platform-modal-head,
body #adminModulePermissionModal .admin-module-permission-actions {
  position: sticky !important;
  z-index: 3 !important;
  background: rgba(248, 250, 252, .98) !important;
}

body #adminModulePermissionModal .platform-modal-head {
  min-height: 0 !important;
  padding: .9rem 1rem !important;
}

body #adminModulePermissionModal .platform-modal-head h3 {
  font-size: clamp(1.45rem, 2vw, 2rem) !important;
  line-height: 1.05 !important;
}

body #adminModulePermissionModal .platform-modal-head p {
  margin-top: .35rem !important;
}

body #adminModulePermissionModal .platform-modal-head {
  top: 0 !important;
  border-bottom: 1px solid rgba(14, 165, 233, .18) !important;
}

body #adminModulePermissionModal .admin-module-permission-actions {
  bottom: 0 !important;
  border-top: 1px solid rgba(14, 165, 233, .18) !important;
  min-height: 58px !important;
  padding: .65rem 1rem !important;
}

body #adminModulePermissionModal .admin-module-permission-body {
  overflow: auto !important;
  padding: .9rem 1rem !important;
  scrollbar-gutter: stable !important;
}

body .admin-module-permission-hero,
body .admin-module-requirements,
body .admin-module-subpermissions {
  border-radius: 4px !important;
  border: 1px solid rgba(14, 165, 233, .22) !important;
  background: #ffffff !important;
  padding: 1rem !important;
  margin-bottom: .85rem !important;
}

body .admin-module-permission-hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 1rem !important;
  align-items: center !important;
  border-left: 5px solid #64748b !important;
}

body .admin-module-permission-hero.enabled {
  border-left-color: #14b8a6 !important;
  background: linear-gradient(90deg, rgba(20, 184, 166, .12), #ffffff 55%) !important;
}

body .admin-module-permission-hero.disabled {
  border-left-color: #ef4444 !important;
  background: linear-gradient(90deg, rgba(239, 68, 68, .10), #ffffff 55%) !important;
}

body .admin-module-permission-hero h4,
body .admin-module-section-head h4 {
  margin: .15rem 0 .35rem !important;
  color: #0f172a !important;
}

body .admin-module-permission-hero p,
body .admin-module-requirements li,
body .admin-module-suboption small {
  color: #334155 !important;
  line-height: 1.45 !important;
}

body .admin-module-master-toggle {
  display: grid !important;
  grid-template-columns: auto auto !important;
  align-items: center !important;
  gap: .55rem !important;
  padding: .75rem .9rem !important;
  background: #e0f2fe !important;
  border-left: 4px solid #0ea5e9 !important;
  font-weight: 900 !important;
  color: #075985 !important;
  white-space: nowrap !important;
}

body .admin-module-requirements summary {
  cursor: pointer !important;
  font-weight: 900 !important;
  color: #075985 !important;
}

body .admin-module-section-head {
  display: flex !important;
  gap: 1rem !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: .75rem !important;
}

body .admin-module-mini-actions {
  display: flex !important;
  gap: .5rem !important;
  flex-wrap: wrap !important;
}

body .admin-module-mini-actions button {
  border-radius: 3px !important;
}

body .admin-module-subgrid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  gap: .65rem !important;
}

body .admin-module-suboption {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  gap: .55rem !important;
  align-items: start !important;
  padding: .75rem !important;
  min-height: 78px !important;
  border-left: 4px solid #0ea5e9 !important;
  background: #f8fafc !important;
}

body .admin-module-suboption b {
  display: block !important;
  color: #0f172a !important;
  font-size: .92rem !important;
  line-height: 1.18 !important;
}

body[data-theme="dark"] .admin-panel .admin-permission-toolbar button,
body[data-theme="dark"] .admin-module-master-toggle {
  background: rgba(45, 212, 191, .14) !important;
  border-color: rgba(45, 212, 191, .4) !important;
  color: #a7f3d0 !important;
}

body[data-theme="dark"] .admin-panel .admin-permission-toolbar small {
  color: #cbd5e1 !important;
}

body[data-theme="dark"] #adminModulePermissionModal .platform-modal-head,
body[data-theme="dark"] #adminModulePermissionModal .admin-module-permission-actions,
body[data-theme="dark"] .admin-module-permission-hero,
body[data-theme="dark"] .admin-module-requirements,
body[data-theme="dark"] .admin-module-subpermissions {
  background: #0f172a !important;
  border-color: rgba(45, 212, 191, .24) !important;
}

body[data-theme="dark"] .admin-module-permission-hero.enabled {
  background: linear-gradient(90deg, rgba(45, 212, 191, .16), #0f172a 55%) !important;
}

body[data-theme="dark"] .admin-module-permission-hero.disabled {
  background: linear-gradient(90deg, rgba(239, 68, 68, .14), #0f172a 55%) !important;
}

body[data-theme="dark"] .admin-module-permission-hero h4,
body[data-theme="dark"] .admin-module-section-head h4,
body[data-theme="dark"] .admin-module-suboption b {
  color: #f8fafc !important;
}

body[data-theme="dark"] .admin-module-permission-hero p,
body[data-theme="dark"] .admin-module-requirements li,
body[data-theme="dark"] .admin-module-suboption small {
  color: #dbeafe !important;
}

body[data-theme="dark"] .admin-module-suboption {
  background: rgba(15, 23, 42, .9) !important;
  border-left-color: #2dd4bf !important;
}

@media (max-width: 760px) {
  body .admin-module-permission-hero,
  body .admin-panel .admin-permission-toolbar {
    grid-template-columns: 1fr !important;
  }

  body #adminModulePermissionModal .admin-module-permission-card {
    width: calc(100vw - 18px) !important;
    height: calc(100vh - 18px) !important;
    max-height: calc(100vh - 18px) !important;
  }
}

/* admin-permission-card-grid-v1
   El editor de permisos debe mostrar fichas legibles; las opciones internas
   se configuran en modal amplio, no como filas aplastadas dentro del listado. */
body .admin-panel #adminModuleChecks.admin-checks {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 14px !important;
  align-items: stretch !important;
  max-height: min(68vh, 720px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 16px !important;
  background: rgba(239, 248, 255, .72) !important;
  border: 1px solid rgba(14, 165, 233, .24) !important;
  scrollbar-gutter: stable !important;
}

body .admin-panel #adminModuleChecks .admin-permission-card {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  min-width: 0 !important;
  min-height: 148px !important;
  height: auto !important;
  padding: 14px !important;
  overflow: visible !important;
  border: 1px solid rgba(14, 165, 233, .24) !important;
  border-left: 5px solid #0ea5e9 !important;
  border-radius: 4px !important;
  background: #ffffff !important;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .06) !important;
}

body .admin-panel #adminModuleChecks .admin-permission-card.allowed,
body .admin-panel #adminModuleChecks .admin-permission-card.inherited {
  border-left-color: #10b981 !important;
}

body .admin-panel #adminModuleChecks .admin-permission-card.denied {
  border-left-color: #ef4444 !important;
  background: #fff7f7 !important;
}

body .admin-panel #adminModuleChecks .admin-permission-main {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: start !important;
  min-height: 58px !important;
}

body .admin-panel #adminModuleChecks .admin-permission-main input[data-module-permission] {
  width: 18px !important;
  height: 18px !important;
  margin: 3px 0 0 !important;
  accent-color: #0ea5e9 !important;
}

body .admin-panel #adminModuleChecks .admin-permission-main strong {
  display: block !important;
  color: #07132b !important;
  font-size: 15px !important;
  line-height: 1.18 !important;
  letter-spacing: .035em !important;
  text-transform: uppercase !important;
}

body .admin-panel #adminModuleChecks .admin-permission-main small {
  display: block !important;
  margin-top: 6px !important;
  color: #475569 !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  white-space: normal !important;
}

body .admin-panel #adminModuleChecks .admin-permission-toolbar {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  align-items: stretch !important;
  min-height: 72px !important;
  margin-top: auto !important;
  padding: 10px !important;
  border: 1px solid rgba(14, 165, 233, .22) !important;
  border-radius: 4px !important;
  background: #eff8ff !important;
}

body .admin-panel #adminModuleChecks .admin-permission-toolbar button {
  width: 100% !important;
  min-height: 38px !important;
  padding: 0 12px !important;
  border: 1px solid rgba(14, 165, 233, .55) !important;
  border-radius: 4px !important;
  background: linear-gradient(135deg, #0ea5e9, #14b8a6) !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: .03em !important;
  text-transform: none !important;
}

body .admin-panel #adminModuleChecks .admin-permission-toolbar small {
  display: block !important;
  color: #334155 !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  white-space: normal !important;
}

body .admin-panel #adminModuleChecks .admin-rbac-store {
  display: none !important;
}

body.theme-dark .admin-panel #adminModuleChecks.admin-checks,
body[data-theme="dark"] .admin-panel #adminModuleChecks.admin-checks {
  background: rgba(15, 23, 42, .72) !important;
  border-color: rgba(45, 212, 191, .28) !important;
}

body.theme-dark .admin-panel #adminModuleChecks .admin-permission-card,
body[data-theme="dark"] .admin-panel #adminModuleChecks .admin-permission-card {
  background: #111c2f !important;
  border-color: rgba(148, 163, 184, .28) !important;
  box-shadow: none !important;
}

body.theme-dark .admin-panel #adminModuleChecks .admin-permission-card.denied,
body[data-theme="dark"] .admin-panel #adminModuleChecks .admin-permission-card.denied {
  background: rgba(127, 29, 29, .22) !important;
}

body.theme-dark .admin-panel #adminModuleChecks .admin-permission-main strong,
body[data-theme="dark"] .admin-panel #adminModuleChecks .admin-permission-main strong {
  color: #f8fafc !important;
}

body.theme-dark .admin-panel #adminModuleChecks .admin-permission-main small,
body.theme-dark .admin-panel #adminModuleChecks .admin-permission-toolbar small,
body[data-theme="dark"] .admin-panel #adminModuleChecks .admin-permission-main small,
body[data-theme="dark"] .admin-panel #adminModuleChecks .admin-permission-toolbar small {
  color: #cbd5e1 !important;
}

body.theme-dark .admin-panel #adminModuleChecks .admin-permission-toolbar,
body[data-theme="dark"] .admin-panel #adminModuleChecks .admin-permission-toolbar {
  background: rgba(8, 47, 73, .55) !important;
  border-color: rgba(45, 212, 191, .26) !important;
}

@media (max-width: 820px) {
  body .admin-panel #adminModuleChecks.admin-checks {
    grid-template-columns: 1fr !important;
    max-height: none !important;
  }
}

/* connectio-modal-system-v32
   Patron global para toda ventana emergente CONNECTIO: la pagina queda opaca,
   la ficha se centra en el viewport y el contenido scrollea dentro del modal. */
html body :where(.platform-modal, .approval-modal) {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100vw !important;
  min-width: 100vw !important;
  max-width: none !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: none !important;
  margin: 0 !important;
  padding: clamp(14px, 2.2vw, 34px) !important;
  box-sizing: border-box !important;
  border: 0 !important;
  border-left: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  overscroll-behavior: contain !important;
  isolation: isolate !important;
  background-color: rgba(2, 6, 23, .91) !important;
  background:
    radial-gradient(circle at 22% 8%, rgba(45, 212, 191, .18), transparent 36%),
    linear-gradient(135deg, rgba(2, 6, 23, .91), rgba(15, 23, 42, .84)) !important;
  backdrop-filter: blur(10px) saturate(112%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(112%) !important;
}

html body :where(.platform-modal[hidden], .approval-modal[hidden]) {
  display: none !important;
}

html body :where(.platform-modal:not([hidden]), .approval-modal:not([hidden])) {
  display: flex !important;
}

html body:has(:where(.platform-modal:not([hidden]), .approval-modal:not([hidden]))) {
  overflow: hidden !important;
}

html:has(body.modal-open),
body.modal-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

html body :where(.platform-modal-card, .approval-modal > div) {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  align-self: center !important;
  justify-self: center !important;
  width: min(1120px, calc(100vw - 72px)) !important;
  max-width: min(1120px, calc(100vw - 72px)) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: calc(100dvh - 72px) !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  overscroll-behavior: contain !important;
  border: 0 !important;
  border-left: 0 !important;
  border-radius: 4px !important;
  border-top: 5px solid #2dd4bf !important;
  background: #f8fbff !important;
  color: #071126 !important;
  box-shadow: 0 28px 90px rgba(2, 6, 23, .58) !important;
}

html body :where(.data-editor-card, .catalog-editor-card, .inventory-editor-card, .tuu-editor-card) {
  width: min(1200px, calc(100vw - 72px)) !important;
  max-width: min(1200px, calc(100vw - 72px)) !important;
}

html body :where(.platform-confirm-card, .platform-modal-card.platform-confirm-card) {
  width: min(620px, calc(100vw - 48px)) !important;
  max-width: min(620px, calc(100vw - 48px)) !important;
}

html body :where(.platform-modal-head, .approval-modal > div > header:first-child) {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
  flex: 0 0 auto !important;
  min-height: 0 !important;
  padding: .95rem 1.05rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  border-bottom: 1px solid rgba(14, 165, 233, .18) !important;
  background: #f8fbff !important;
  color: #071126 !important;
}

html body :where(.platform-modal-head h1, .platform-modal-head h2, .platform-modal-head h3, .platform-modal-head p, .platform-modal-head small) {
  color: #071126 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html body :where(
  .data-editor-body,
  .tuu-editor-scroll,
  .platform-confirm-body,
  .platform-modal-card > form,
  .platform-modal-card > .source-form,
  .platform-modal-card > .compact-modal-form,
  .platform-modal-card > .modal-body,
  .platform-modal-card > .platform-modal-body,
  .platform-modal-card > [data-inventory-modal-view],
  .approval-modal > div > section
) {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 1rem !important;
  background: #ffffff !important;
  color: #071126 !important;
  scrollbar-gutter: stable !important;
}

html body :where(.modal-actions, .platform-modal-actions, .admin-module-permission-actions, .approval-modal > div > footer) {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 5 !important;
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: .6rem !important;
  min-height: 58px !important;
  padding: .65rem 1rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  border-top: 1px solid rgba(14, 165, 233, .18) !important;
  background: #f8fbff !important;
  color: #071126 !important;
}

html body :where(.platform-modal-card input, .platform-modal-card select, .platform-modal-card textarea) {
  background: #ffffff !important;
  color: #071126 !important;
  border-color: rgba(14, 165, 233, .36) !important;
}

html body :where(.platform-modal-card label, .platform-modal-card legend, .platform-modal-card strong, .platform-modal-card p, .platform-modal-card small, .platform-modal-card li, .approval-modal > div *) {
  color: #071126 !important;
}

html body :where(.platform-modal-card button, .approval-modal > div button) {
  border-radius: 4px !important;
}

body.theme-dark :where(.platform-modal-card, .approval-modal > div),
body[data-theme="dark"] :where(.platform-modal-card, .approval-modal > div),
body.theme-dark :where(.platform-modal-head, .approval-modal > div > header:first-child),
body[data-theme="dark"] :where(.platform-modal-head, .approval-modal > div > header:first-child),
body.theme-dark :where(.modal-actions, .platform-modal-actions, .admin-module-permission-actions, .approval-modal > div > footer),
body[data-theme="dark"] :where(.modal-actions, .platform-modal-actions, .admin-module-permission-actions, .approval-modal > div > footer) {
  background: #f8fbff !important;
  color: #071126 !important;
}

@media (max-width: 760px) {
  html body :where(.platform-modal, .approval-modal) {
    padding: 10px !important;
  }

  html body :where(.platform-modal-card, .approval-modal > div, .data-editor-card, .catalog-editor-card, .inventory-editor-card, .tuu-editor-card) {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
  }

  html body :where(.platform-modal-head, .approval-modal > div > header:first-child) {
    padding: .78rem .85rem !important;
  }

  html body :where(.data-editor-body, .tuu-editor-scroll, .platform-confirm-body, .platform-modal-card > form, .platform-modal-card > .source-form, .platform-modal-card > .compact-modal-form, .platform-modal-card > .modal-body, .platform-modal-card > .platform-modal-body, .platform-modal-card > [data-inventory-modal-view], .approval-modal > div > section) {
    padding: .85rem !important;
  }
}
/* Acceso CONNECTIO v34: portada unificada, equilibrada y sin elementos montados. */
body.auth-locked .sidebar {
  inset: 0 0 auto 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 92px !important;
  min-height: 92px !important;
  padding: 18px clamp(28px, 4vw, 72px) !important;
  overflow: hidden !important;
  background: rgba(3, 10, 24, .92) !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(45, 212, 191, .20) !important;
  backdrop-filter: blur(18px) saturate(120%) !important;
}

body.auth-locked .sidebar .brand {
  width: max-content !important;
  max-width: 100% !important;
  padding: 0 !important;
  border: 0 !important;
}

body.auth-locked .sidebar .brand-mark {
  width: 56px !important;
  height: 56px !important;
  border-radius: 5px !important;
  background: #fff !important;
  box-shadow: none !important;
}

body.auth-locked .sidebar .brand-copy strong {
  font-size: 1.2rem !important;
}

body.auth-locked .sidebar .brand-copy small {
  color: #b8c7dc !important;
}

body.auth-locked .content {
  display: block !important;
  min-height: 100dvh !important;
  margin: 0 !important;
  padding: 92px 0 0 !important;
}

body.auth-locked .hero {
  position: fixed !important;
  inset: 92px auto 0 clamp(42px, 7vw, 132px) !important;
  display: flex !important;
  align-items: center !important;
  width: min(660px, 48vw) !important;
  max-width: none !important;
  min-height: 0 !important;
  padding: 0 0 4vh !important;
  z-index: 5 !important;
}

body.auth-locked .hero::before {
  position: absolute !important;
  top: clamp(34px, 7vh, 76px) !important;
  left: 0 !important;
  margin: 0 !important;
}

body.auth-locked .hero > div:not(.hero-actions) {
  width: 100% !important;
}

body.auth-locked .hero h1 {
  max-width: 650px !important;
  margin: .75rem 0 1.15rem !important;
  font-size: clamp(3.4rem, 5.2vw, 6.15rem) !important;
  line-height: .91 !important;
  letter-spacing: -.055em !important;
}

body.auth-locked .hero p {
  max-width: 620px !important;
  margin: 0 !important;
  font-size: clamp(1rem, 1.2vw, 1.22rem) !important;
}

body.auth-locked .hero-brand-watermark,
body.auth-locked .access-gate {
  display: none !important;
}

body.auth-locked .login-panel {
  position: fixed !important;
  top: calc(50% + 40px) !important;
  right: clamp(42px, 7vw, 132px) !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  width: min(440px, 38vw) !important;
  max-height: calc(100dvh - 132px) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-rows: auto !important;
  align-content: start !important;
  gap: 12px !important;
  padding: 28px !important;
  overflow-y: auto !important;
}

body.auth-locked .login-panel::before {
  content: none !important;
  display: none !important;
}

body.auth-locked .login-kicker {
  color: #0284c7 !important;
  font-size: .76rem !important;
  font-weight: 950 !important;
  letter-spacing: .17em !important;
  text-transform: uppercase !important;
}

body.auth-locked .login-title {
  margin: 2px 0 0 !important;
  color: #071126 !important;
  font-size: clamp(1.75rem, 2vw, 2.15rem) !important;
  line-height: 1.05 !important;
}

body.auth-locked .login-intro {
  margin: 0 0 8px !important;
  color: #475569 !important;
  font-size: .95rem !important;
  line-height: 1.45 !important;
}

body.auth-locked #sessionName,
body.auth-locked #sessionRole {
  display: none !important;
}

body.session-authenticated .login-kicker,
body.session-authenticated .login-title,
body.session-authenticated .login-intro {
  display: none !important;
}

@media (max-width: 1120px) {
  body.auth-locked .hero {
    left: 36px !important;
    width: calc(56vw - 64px) !important;
  }

  body.auth-locked .login-panel {
    right: 32px !important;
    width: min(410px, 39vw) !important;
  }
}

@media (max-width: 820px) {
  body.auth-locked {
    overflow-y: auto !important;
  }

  body.auth-locked .sidebar {
    position: fixed !important;
    height: 78px !important;
    min-height: 78px !important;
    padding: 12px 18px !important;
  }

  body.auth-locked .sidebar .brand-mark {
    width: 48px !important;
    height: 48px !important;
  }

  body.auth-locked .content {
    min-height: 100dvh !important;
    padding: 78px 18px 28px !important;
    overflow-y: auto !important;
  }

  body.auth-locked .hero {
    position: static !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    padding: 44px 0 20px !important;
  }

  body.auth-locked .hero::before {
    position: static !important;
    display: inline-flex !important;
    margin-bottom: 24px !important;
  }

  body.auth-locked .hero h1 {
    font-size: clamp(2.75rem, 13vw, 4.6rem) !important;
  }

  body.auth-locked .login-panel {
    position: static !important;
    width: 100% !important;
    max-height: none !important;
    margin: 0 auto !important;
    transform: none !important;
  }
}

/* Acceso CONNECTIO v35: paisajes de Chile, seleccion aleatoria y lectura ejecutiva. */
body.auth-locked {
  position: relative !important;
  min-height: 100dvh !important;
  overflow: hidden !important;
  background: #061426 !important;
}

body.auth-locked::before,
body.auth-locked::after {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  pointer-events: none !important;
}

body.auth-locked::before {
  z-index: 0 !important;
  background-image: var(--login-chile-image) !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  transform: scale(1.012) !important;
  animation: connectioChileReveal 900ms ease-out both !important;
}

body.auth-locked::after {
  z-index: 1 !important;
  background:
    linear-gradient(90deg, rgba(3, 12, 27, .93) 0%, rgba(3, 12, 27, .74) 43%, rgba(3, 12, 27, .28) 68%, rgba(3, 12, 27, .48) 100%),
    linear-gradient(0deg, rgba(3, 12, 27, .55), transparent 46%) !important;
}

body.auth-locked .app-shell {
  position: relative !important;
  z-index: 2 !important;
  min-height: 100dvh !important;
  background: transparent !important;
}

body.auth-locked .sidebar {
  height: 76px !important;
  min-height: 76px !important;
  padding: 10px clamp(24px, 4vw, 68px) !important;
  background: rgba(3, 11, 25, .56) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .14) !important;
  backdrop-filter: blur(14px) saturate(120%) !important;
}

body.auth-locked .sidebar .brand-mark {
  width: 50px !important;
  height: 50px !important;
}

body.auth-locked .sidebar .brand-copy strong {
  color: #ffffff !important;
  letter-spacing: .08em !important;
}

body.auth-locked .content {
  padding-top: 76px !important;
  background: transparent !important;
}

body.auth-locked .hero {
  inset: 76px auto 0 clamp(34px, 6vw, 110px) !important;
  width: min(690px, 50vw) !important;
  padding: 0 0 2vh !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.auth-locked .hero::before,
body.auth-locked .hero::after {
  content: none !important;
}

body.auth-locked .hero .eyebrow {
  color: #5eead4 !important;
  font-size: .78rem !important;
  letter-spacing: .2em !important;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .6) !important;
}

body.auth-locked .hero h1 {
  max-width: 690px !important;
  margin: .7rem 0 1rem !important;
  color: #ffffff !important;
  font-size: clamp(3.15rem, 5.1vw, 6rem) !important;
  line-height: .94 !important;
  letter-spacing: -.055em !important;
  text-wrap: balance !important;
  text-shadow: 0 5px 34px rgba(0, 0, 0, .5) !important;
}

body.auth-locked .hero p {
  max-width: 600px !important;
  color: #e5edf7 !important;
  font-size: clamp(1rem, 1.2vw, 1.22rem) !important;
  line-height: 1.55 !important;
  text-shadow: 0 3px 22px rgba(0, 0, 0, .72) !important;
}

body.auth-locked .login-scene-caption {
  display: inline-flex !important;
  align-items: center !important;
  gap: .55rem !important;
  margin-top: 1.5rem !important;
  padding: .55rem .75rem !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, .24) !important;
  border-radius: 3px !important;
  background: rgba(3, 12, 27, .38) !important;
  backdrop-filter: blur(8px) !important;
  font-size: .78rem !important;
  font-weight: 800 !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
}

body.auth-locked .login-scene-caption::before {
  content: "" !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #2dd4bf !important;
  box-shadow: 0 0 16px rgba(45, 212, 191, .85) !important;
}

body.auth-locked .login-panel {
  top: calc(50% + 32px) !important;
  right: clamp(32px, 6vw, 110px) !important;
  width: min(430px, 38vw) !important;
  max-height: calc(100dvh - 116px) !important;
  gap: 10px !important;
  padding: 32px !important;
  border: 0 !important;
  border-top: 4px solid #2dd4bf !important;
  border-radius: 5px !important;
  background: rgba(250, 252, 255, .97) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42) !important;
  backdrop-filter: blur(18px) saturate(120%) !important;
}

body.auth-locked .login-title {
  font-size: clamp(1.85rem, 2.25vw, 2.45rem) !important;
}

body.auth-locked .login-panel input,
body.auth-locked .login-panel button,
body.auth-locked .google-login-btn {
  min-height: 50px !important;
  border-radius: 3px !important;
}

body.auth-locked .login-panel input {
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #071126 !important;
}

body.auth-locked .login-panel input:focus {
  border-color: #0ea5e9 !important;
  outline: 3px solid rgba(14, 165, 233, .16) !important;
}

body.auth-locked #loginButton {
  background: linear-gradient(90deg, #0ea5e9, #10b981) !important;
  color: #ffffff !important;
}

body.auth-locked .google-login-btn {
  background: #071126 !important;
  color: #ffffff !important;
}

body.auth-locked .login-help {
  color: #64748b !important;
}

@keyframes connectioChileReveal {
  from { opacity: 0; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1.012); }
}

@media (max-width: 1120px) {
  body.auth-locked .hero {
    left: 32px !important;
    width: calc(56vw - 50px) !important;
  }

  body.auth-locked .login-panel {
    right: 28px !important;
    width: min(400px, 40vw) !important;
  }
}

@media (max-width: 820px) {
  body.auth-locked {
    overflow-y: auto !important;
  }

  body.auth-locked::after {
    background: linear-gradient(180deg, rgba(3, 12, 27, .68), rgba(3, 12, 27, .9)) !important;
  }

  body.auth-locked .sidebar {
    height: 68px !important;
    min-height: 68px !important;
    padding: 9px 16px !important;
  }

  body.auth-locked .sidebar .brand-mark {
    width: 44px !important;
    height: 44px !important;
  }

  body.auth-locked .content {
    padding: 68px 16px 28px !important;
  }

  body.auth-locked .hero {
    width: 100% !important;
    padding: 30px 2px 18px !important;
  }

  body.auth-locked .hero h1 {
    max-width: 620px !important;
    font-size: clamp(2.55rem, 11vw, 4.2rem) !important;
  }

  body.auth-locked .login-panel {
    width: 100% !important;
    max-width: 520px !important;
    padding: 24px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.auth-locked::before {
    animation: none !important;
  }
}

/* Acceso CONNECTIO v36: bienvenida, transparencia y seguridad de ingreso. */
body.auth-locked .login-panel {
  width: min(455px, 40vw) !important;
  max-height: calc(100dvh - 94px) !important;
  gap: 8px !important;
  padding: 27px 30px 24px !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: #94a3b8 transparent !important;
}

body.auth-locked .login-welcome {
  padding-bottom: 12px !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.auth-locked .login-kicker {
  display: block !important;
  margin-bottom: 7px !important;
  color: #0284c7 !important;
  font-size: .76rem !important;
  font-weight: 800 !important;
  letter-spacing: .16em !important;
  text-transform: uppercase !important;
}

body.auth-locked .login-title {
  margin: 0 0 7px !important;
  color: #071126 !important;
  font-size: clamp(1.75rem, 2vw, 2.2rem) !important;
  line-height: 1.05 !important;
}

body.auth-locked .login-intro {
  margin: 0 !important;
  color: #475569 !important;
  font-size: .91rem !important;
  line-height: 1.45 !important;
}

body.auth-locked .login-field-label {
  display: block !important;
  margin: 3px 0 -3px !important;
  color: #334155 !important;
  font-size: .69rem !important;
  font-weight: 800 !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
}

body.auth-locked .login-divider {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #94a3b8 !important;
  font-size: .71rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
}

body.auth-locked .login-divider::before,
body.auth-locked .login-divider::after {
  content: "" !important;
  flex: 1 !important;
  height: 1px !important;
  background: #e2e8f0 !important;
}

body.auth-locked .login-trust {
  margin-top: 3px !important;
  padding: 13px 14px !important;
  border: 0 !important;
  border-left: 3px solid #14b8a6 !important;
  border-radius: 2px !important;
  background: #eefbf8 !important;
  color: #334155 !important;
}

body.auth-locked .login-trust-heading {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: #0f766e !important;
  font-size: .83rem !important;
}

body.auth-locked .login-trust-heading > span {
  display: grid !important;
  width: 21px !important;
  height: 21px !important;
  place-items: center !important;
  border-radius: 50% !important;
  background: #14b8a6 !important;
  color: #ffffff !important;
  font-weight: 900 !important;
}

body.auth-locked .login-trust p {
  margin: 8px 0 6px !important;
  color: #475569 !important;
  font-size: .76rem !important;
  line-height: 1.38 !important;
}

body.auth-locked .login-trust ul {
  display: grid !important;
  gap: 3px !important;
  margin: 0 !important;
  padding-left: 17px !important;
  color: #64748b !important;
  font-size: .7rem !important;
  line-height: 1.32 !important;
}

body.session-authenticated .login-welcome,
body.session-authenticated .login-field-label,
body.session-authenticated .login-divider,
body.session-authenticated .login-trust {
  display: none !important;
}

@media (max-height: 790px) and (min-width: 821px) {
  body.auth-locked .login-panel {
    top: calc(50% + 38px) !important;
    max-height: calc(100dvh - 88px) !important;
    padding: 20px 26px !important;
  }

  body.auth-locked .login-trust ul {
    display: none !important;
  }
}

@media (max-width: 1120px) {
  body.auth-locked .login-panel {
    width: min(430px, 42vw) !important;
  }
}

@media (max-width: 820px) {
  body.auth-locked .login-panel {
    width: 100% !important;
    max-width: 540px !important;
    max-height: none !important;
    padding: 23px !important;
    overflow: visible !important;
  }

  body.auth-locked .login-trust {
    padding: 12px !important;
  }
}

/* Acceso CONNECTIO v37: el formulario nunca queda detrás de la portada. */
body.auth-locked {
  isolation: isolate !important;
}

body.auth-locked::before {
  z-index: 0 !important;
}

body.auth-locked::after {
  z-index: 1 !important;
}

body.auth-locked .app-shell {
  position: relative !important;
  z-index: 2 !important;
  isolation: isolate !important;
}

body.auth-locked .hero {
  position: relative !important;
  z-index: 3 !important;
}

body.auth-locked .login-panel,
body.auth-locked .app-shell.sidebar-collapsed .login-panel {
  position: fixed !important;
  z-index: 1000 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(-50%) !important;
  background: #ffffff !important;
  color: #071126 !important;
  box-shadow: 0 28px 72px rgba(1, 10, 24, 0.44) !important;
}

body.auth-locked .login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #ffffff;
}

body.auth-locked .login-panel > * {
  position: relative;
  z-index: 1;
}

body.auth-locked .login-welcome,
body.auth-locked .login-trust,
body.auth-locked .login-trust-item {
  opacity: 1 !important;
  visibility: visible !important;
}

body.auth-locked .login-trust {
  background: #e8faf5 !important;
  border-left: 4px solid #16a085 !important;
  color: #102a43 !important;
}

@media (max-width: 820px) {
  body.auth-locked .login-panel,
  body.auth-locked .app-shell.sidebar-collapsed .login-panel {
    transform: none !important;
  }
}
/* Acceso CONNECTIO v38: capa raíz, independiente del menú y de las fotografías. */
body.auth-locked > .auth-login-layer {
  position: fixed !important;
  inset: 50% clamp(24px, 7vw, 132px) auto auto !important;
  width: min(440px, calc(100vw - 48px)) !important;
  max-height: calc(100dvh - 48px) !important;
  overflow: auto !important;
  transform: translateY(-50%) !important;
  z-index: 2147483000 !important;
  display: grid !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  isolation: isolate !important;
  background: #fff !important;
  color: #071126 !important;
  box-shadow: 0 30px 90px rgba(0, 8, 22, .58) !important;
}

body.auth-locked::before,
body.auth-locked::after,
body.auth-locked .app-shell::before,
body.auth-locked .app-shell::after,
body.auth-locked .content::before,
body.auth-locked .content::after,
body.auth-locked .hero::before,
body.auth-locked .hero::after,
body.auth-locked .hero-brand-watermark {
  pointer-events: none !important;
}

body:not(.auth-locked) > .auth-login-layer {
  display: none !important;
}

@media (max-width: 820px) {
  body.auth-locked > .auth-login-layer {
    inset: auto 16px 16px 16px !important;
    width: auto !important;
    max-height: calc(100dvh - 32px) !important;
    transform: none !important;
  }
}

/* Inicio ejecutivo: conserva una sola identidad oscura y evita el efecto de
   tarjetas claras superpuestas que desordena la portada. */
html body .connectio-home-status {
  background: #071733 !important;
  color: #f8fbff !important;
}

html body .connectio-home-status .cx-kpi {
  background: #15233a !important;
  color: #f8fbff !important;
}

html body .connectio-home-status .cx-kpi span {
  color: #5eead4 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #5eead4 !important;
}

html body .connectio-home-status .cx-kpi strong {
  color: #f8fbff !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #f8fbff !important;
}

html body .connectio-home-status .cx-kpi small {
  color: #cbd5e1 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
}

/* Cabecera CONNECTIO v41: acciones separadas, legibles y adaptables. */
body:not(.dashboard-tv-active) .smart-topbar.cx-header {
  display: grid !important;
  grid-template-columns: minmax(230px, 0.72fr) minmax(300px, 1.25fr) auto !important;
  align-items: center !important;
  column-gap: 12px !important;
  row-gap: 10px !important;
  min-height: 66px !important;
  padding: 10px 14px !important;
  overflow: visible !important;
}

body:not(.dashboard-tv-active) .smart-topbar .topbar-left,
body:not(.dashboard-tv-active) .smart-topbar .topbar-search,
body:not(.dashboard-tv-active) .smart-topbar .topbar-actions {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
}

body:not(.dashboard-tv-active) .smart-topbar .topbar-actions {
  display: flex !important;
  flex-flow: row nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 9px !important;
  overflow: visible !important;
}

body:not(.dashboard-tv-active) .smart-topbar .topbar-actions > *,
body:not(.dashboard-tv-active) .smart-topbar .topbar-actions > button {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body:not(.dashboard-tv-active) .smart-topbar .connectia-btn,
body:not(.dashboard-tv-active) .smart-topbar .theme-toggle-btn,
body:not(.dashboard-tv-active) .smart-topbar .notification-btn,
body:not(.dashboard-tv-active) .smart-topbar .user-chip {
  height: 44px !important;
  border: 1px solid #b8dcf6 !important;
  border-radius: 7px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

body:not(.dashboard-tv-active) .smart-topbar .connectia-btn {
  width: 110px !important;
  padding-inline: 14px !important;
}

body:not(.dashboard-tv-active) .smart-topbar .theme-toggle-btn {
  width: 148px !important;
  padding-inline: 13px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body:not(.dashboard-tv-active) .smart-topbar .notification-btn {
  position: relative !important;
  width: 76px !important;
  padding-inline: 11px !important;
}

body:not(.dashboard-tv-active) .smart-topbar .notification-btn > span {
  position: absolute !important;
  top: -8px !important;
  right: -6px !important;
  min-width: 21px !important;
  height: 21px !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 5px !important;
  border: 2px solid var(--cx-surface, #fff) !important;
  border-radius: 999px !important;
  line-height: 1 !important;
}

body:not(.dashboard-tv-active) .smart-topbar .profile-menu {
  flex: 0 0 276px !important;
  width: 276px !important;
  min-width: 276px !important;
  max-width: 276px !important;
  overflow: visible !important;
}

body:not(.dashboard-tv-active) .smart-topbar .user-chip {
  width: 100% !important;
  max-width: none !important;
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 10px !important;
  overflow: hidden !important;
}

body:not(.dashboard-tv-active) .smart-topbar .user-chip strong,
body:not(.dashboard-tv-active) .smart-topbar .user-chip small {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Cabecera CONNECTIO v42: una sola barra operativa clara.
   Mantiene contexto, busqueda y acciones en la misma linea incluso con zoom
   moderado. Solo pasa a dos filas cuando el ancho real ya no permite operar. */
@media (min-width: 901px) {
  body:not(.dashboard-tv-active) .smart-topbar.cx-header {
    grid-template-columns: minmax(190px, auto) minmax(170px, 1fr) auto !important;
    column-gap: 10px !important;
    row-gap: 0 !important;
    min-height: 64px !important;
    padding: 9px 12px !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .topbar-left {
    width: auto !important;
    max-width: 300px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    overflow: hidden !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .breadcrumb {
    min-width: 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .topbar-search {
    width: 100% !important;
    max-width: 520px !important;
    justify-self: end !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .topbar-actions {
    grid-column: auto !important;
    width: auto !important;
    justify-self: end !important;
    justify-content: flex-end !important;
    padding-top: 0 !important;
    border-top: 0 !important;
    gap: 7px !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .connectia-btn {
    width: 96px !important;
    padding-inline: 10px !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .theme-toggle-btn {
    width: 92px !important;
    padding-inline: 10px !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .notification-btn {
    width: 72px !important;
    padding-inline: 9px !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .profile-menu {
    flex-basis: 220px !important;
    width: 220px !important;
    min-width: 190px !important;
    max-width: 220px !important;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  body:not(.dashboard-tv-active) .smart-topbar.cx-header {
    grid-template-columns: minmax(170px, auto) minmax(120px, 1fr) auto !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .topbar-search {
    max-width: 310px !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .profile-menu {
    flex-basis: 190px !important;
    width: 190px !important;
  }
}

@media (max-width: 900px) {
  body:not(.dashboard-tv-active) .smart-topbar.cx-header {
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) !important;
    gap: 8px !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .topbar-actions {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(190px, 1.4fr) !important;
    padding-top: 8px !important;
    border-top: 1px solid #d8e7f3 !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .connectia-btn,
  body:not(.dashboard-tv-active) .smart-topbar .theme-toggle-btn,
  body:not(.dashboard-tv-active) .smart-topbar .notification-btn,
  body:not(.dashboard-tv-active) .smart-topbar .profile-menu {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

/* Acceso público: la cabecera operativa pertenece al interior de CONNECTIO.
   Esta regla debe permanecer después de las reglas responsivas de la cabecera
   para que no vuelva a mostrarse mientras no exista una sesión válida. */
html body.auth-locked .smart-topbar.cx-header,
html body.auth-locked #smartTopbar {
  display: none !important;
}

/* En pantallas medianas las acciones ocupan una fila propia y dejan de competir
   con el buscador. */
@media (max-width: 900px) {
  body:not(.dashboard-tv-active) .smart-topbar.cx-header {
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .topbar-actions {
    grid-column: 1 / -1 !important;
    justify-content: flex-end !important;
    padding-top: 9px !important;
    border-top: 1px solid #d8e7f3 !important;
  }
}

/* En celular cada control conserva su caja y texto; no hay botones montados. */
@media (max-width: 760px) {
  body:not(.dashboard-tv-active) .smart-topbar.cx-header {
    grid-template-columns: 1fr !important;
    padding: 9px !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .topbar-actions {
    grid-column: 1 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body:not(.dashboard-tv-active) .smart-topbar .connectia-btn,
  body:not(.dashboard-tv-active) .smart-topbar .theme-toggle-btn,
  body:not(.dashboard-tv-active) .smart-topbar .notification-btn,
  body:not(.dashboard-tv-active) .smart-topbar .profile-menu {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

/* Acceso CONNECTIO v39: paisaje visible y filtro equilibrado. */
body.auth-locked .app-shell {
  background-color: #061426 !important;
  background-image:
    linear-gradient(90deg, rgba(2, 10, 24, .72) 0%, rgba(2, 10, 24, .46) 43%, rgba(2, 10, 24, .16) 68%, rgba(2, 10, 24, .30) 100%),
    linear-gradient(0deg, rgba(2, 10, 24, .30), transparent 52%),
    var(--login-chile-image) !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
}

body.auth-locked::before {
  opacity: 0 !important;
}

body.auth-locked::after {
  background: transparent !important;
}

body.auth-locked .content {
  background: transparent !important;
}

/* La navegación interna solo aparece después de autenticar. En la portada de
   acceso competía visualmente con el formulario y exponía controles inútiles. */
body.auth-locked .smart-topbar {
  display: none !important;
}

body.auth-locked .hero {
  background: transparent !important;
}

body.auth-locked .sidebar {
  background: rgba(2, 10, 24, .68) !important;
}

@media (max-width: 820px) {
  body.auth-locked .app-shell {
    background-image:
      linear-gradient(180deg, rgba(2, 10, 24, .38), rgba(2, 10, 24, .68)),
      var(--login-chile-image) !important;
    background-position: center !important;
  }
}

/* Acceso CONNECTIO v40: respeta siempre la cabecera institucional. */
body.auth-locked > .auth-login-layer {
  top: calc(50% + 38px) !important;
  right: clamp(24px, 7vw, 132px) !important;
  bottom: auto !important;
  left: auto !important;
  max-height: calc(100dvh - 100px) !important;
  transform: translateY(-50%) !important;
  overscroll-behavior: contain !important;
  scroll-padding-top: 18px !important;
}

body.auth-locked > .auth-login-layer .login-welcome {
  scroll-margin-top: 18px !important;
}

@media (max-width: 820px) {
  body.auth-locked > .auth-login-layer {
    top: 76px !important;
    right: 14px !important;
    bottom: 14px !important;
    left: 14px !important;
    width: auto !important;
    max-height: none !important;
    transform: none !important;
    overflow-y: auto !important;
  }
}

/* Acceso CONNECTIO v41: el mensaje de bienvenida vive bajo la cabecera.
   Esta regla final evita que overrides antiguos vuelvan a posicionarlo
   relativamente y oculten la primera linea detras de la marca institucional. */
@media (min-width: 821px) {
  body.auth-locked .hero {
    position: fixed !important;
    top: 76px !important;
    right: auto !important;
    bottom: 0 !important;
    left: clamp(34px, 4vw, 76px) !important;
    display: flex !important;
    align-items: center !important;
    width: min(720px, 53vw) !important;
    min-height: 0 !important;
    height: calc(100dvh - 76px) !important;
    padding: 24px 0 28px !important;
    overflow: visible !important;
    transform: none !important;
    box-sizing: border-box !important;
    z-index: 3 !important;
  }

  body.auth-locked .hero > div:not(.hero-actions) {
    width: 100% !important;
    max-height: 100% !important;
    transform: none !important;
  }
}

@media (min-width: 821px) and (max-height: 760px) {
  body.auth-locked .hero h1 {
    font-size: clamp(3rem, 4.6vw, 5rem) !important;
  }
}

/* Acceso CONNECTIO v42: rotacion suave de paisajes cada 30 segundos. */
body.auth-locked .app-shell {
  background-color: transparent !important;
  background-image:
    linear-gradient(90deg, rgba(2, 10, 24, .72) 0%, rgba(2, 10, 24, .46) 43%, rgba(2, 10, 24, .16) 68%, rgba(2, 10, 24, .30) 100%),
    linear-gradient(0deg, rgba(2, 10, 24, .30), transparent 52%) !important;
}

body.auth-locked::before {
  opacity: 1 !important;
  transition: opacity 700ms ease-in-out !important;
  will-change: opacity !important;
}

body.auth-locked.login-scene-fading::before {
  opacity: 0 !important;
}

@media (max-width: 820px) {
  body.auth-locked .app-shell {
    background-image: linear-gradient(180deg, rgba(2, 10, 24, .38), rgba(2, 10, 24, .68)) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.auth-locked::before {
    transition-duration: 1ms !important;
  }
}
.iccid-package-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 8px;
}

.iccid-package-pagination button {
  min-width: 40px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #b8cce0;
  border-radius: 9px;
  background: #fff;
  color: #0f2942;
  font-weight: 800;
  cursor: pointer;
}

.iccid-package-pagination button.active {
  border-color: #078b83;
  background: #078b83;
  color: #fff;
}

.iccid-package-pagination button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.iccid-page-ellipsis {
  padding: 0 4px;
  color: #5d7185;
  font-weight: 800;
}
.iccid-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 8px;
}

.iccid-filter-actions button {
  min-height: 42px;
  padding: 9px 16px;
  font-weight: 800;
}

.iccid-filter-actions button:disabled {
  cursor: wait;
  opacity: .65;
}

.iccid-packages-panel input[type="date"][data-connectio-date-native] {
  min-height: 44px;
  cursor: text;
  color-scheme: light;
}

.iccid-packages-panel input[type="date"][data-connectio-date-native]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
}
