/* Shared Blade theme. Source: docs/references/coberturas-design-system.html.
   Existing application classes remain as functional hooks; adapters below
   change their appearance without changing form, modal or chart behaviour. */
.app-theme {
  color-scheme: light;
  --fondo: #f9f9fc;
  --superficie: #fff;
  --superficie-baja: #f3f3f6;
  --superficie-alta: #e8e8ea;
  --superficie-maxima: #e2e2e5;
  --texto: #1a1c1e;
  --texto-variante: #3b4949;
  --contorno: #6b7a7a;
  --contorno-variante: #bac9c9;
  --primario: #01696b;
  --primario-oscuro: #004f51;
  --primario-claro: #85d4d5;
  --acento: #2ddbde;
  --ok: #005c5e;
  --ok-fondo: #cce8e7;
  --error: #ba1a1a;
  --error-fondo: #ffdad6;
  --aviso: #8a5a00;
  --aviso-fondo: #f7e7c8;
  --boton-texto: #fff;
  --cabecera-fondo: rgba(249, 249, 252, .85);
  --logo-fondo: transparent;
  --bs-primary: var(--primario);
  --bs-success: var(--ok);
  --bs-danger: var(--error);
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: "Space Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.app-theme *, .app-theme *::before, .app-theme *::after { box-sizing: border-box; }
.app-theme a { color: var(--primario); }
.app-theme a:hover { color: var(--primario-oscuro); }
.app-theme :is(a, button, summary):focus-visible {
  outline: 2px solid var(--primario);
  outline-offset: 3px;
}
.app-theme .material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 20px;
  flex: 0 0 20px;
}
html:not(.icons-ready) .app-theme .material-symbols-outlined { visibility: hidden; }
.app-theme .skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .75rem; background: white; }
.app-theme .skip-link:focus { top: .5rem; }
.app-theme .cabecera {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: .8rem 1.5rem;
  background: var(--cabecera-fondo);
  backdrop-filter: blur(20px);
}
.app-theme .marca { display: flex; align-items: center; gap: .75rem; min-width: 0; color: var(--texto); text-decoration: none; font-size: 1.25rem; font-weight: 700; letter-spacing: -.05em; }
.app-theme .marca span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-theme .application-logo { display: block; object-fit: contain; }
.app-theme .marca-logo { width: auto; height: 2.5rem; flex-shrink: 0; }
.app-theme .mobile-menu-toggle, .app-theme .mobile-menu-backdrop { display: none; }
.app-theme .mobile-menu-toggle { align-items: center; gap: .5rem; min-height: 2.5rem; padding: .35rem .6rem; border: 1px solid var(--contorno-variante); background: var(--superficie); color: var(--texto); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.app-theme .mobile-menu-lines { position: relative; width: 1.1rem; height: 2px; background: currentColor; }
.app-theme .mobile-menu-lines::before, .app-theme .mobile-menu-lines::after { content: ''; position: absolute; left: 0; width: 1.1rem; height: 2px; background: currentColor; }
.app-theme .mobile-menu-lines::before { top: -.35rem; }
.app-theme .mobile-menu-lines::after { top: .35rem; }
.app-theme.auth-theme .application-logo { width: 12rem; height: auto; max-width: 100%; }
.app-theme .chip-cabecera { color: var(--primario); font-size: .7rem; font-weight: 700; border-bottom: 2px solid var(--acento); padding: .2rem .5rem; max-width: 45%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.app-theme .lateral { position: fixed; top: 4rem; left: 0; bottom: 0; width: 15rem; z-index: 30; display: flex; flex-direction: column; overflow-y: auto; background: var(--superficie-baja); }
.app-theme .lateral-titulo { padding: 1.5rem 1.5rem 1.75rem; font-weight: 700; font-size: .8rem; overflow-wrap: anywhere; }
.app-theme .nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .9rem 1.25rem;
  background: transparent;
  color: var(--texto-variante);
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 0;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .05em;
  text-decoration: none;
  transition: background 150ms ease;
}
.app-theme .nav-item:hover { background: var(--superficie-maxima); color: var(--texto); text-decoration: none; }
.app-theme .nav-item.activo { background: var(--superficie); color: var(--primario); border-left-color: var(--acento); font-weight: 700; }
.app-theme .lateral-cuenta { margin-top: auto; padding-top: 2rem; padding-bottom: 1rem; }
.app-theme .lateral-usuario { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.5rem; font-size: .75rem; overflow-wrap: anywhere; }
.app-theme .lateral-usuario span { color: var(--texto-variante); font-size: .65rem; }
.app-theme .app-main { margin-left: 15rem; width: calc(100% - 15rem); max-width: none; min-width: 0; padding: 2rem 2.5rem 4rem; }
.app-theme .page-heading { border-bottom: 1px solid rgba(186, 201, 201, .35); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.app-theme .page-heading h2 { font-size: 2rem; line-height: 1.15; font-weight: 700; text-transform: uppercase; letter-spacing: -.04em; color: var(--texto); margin: 0; overflow-wrap: anywhere; }
.app-theme .page-container, .app-theme .page-surface, .app-theme .page-body { min-width: 0; }
.app-theme .section-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.app-theme .app-main :is(h3, section h2) { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: -.01em; color: var(--texto); }
.app-theme .section-toolbar h3 { margin: 0; }
.app-theme .profile-section { padding: 1.5rem; background: var(--superficie); border-left: 4px solid var(--primario); box-shadow: 0 1px 2px rgba(26,28,30,.05); }
.app-theme .app-main p { line-height: 1.5; }
.app-theme .home-overview { max-width: 64rem; background: var(--superficie); border-left: 4px solid var(--primario); box-shadow: 0 1px 2px rgba(26,28,30,.05); }
.app-theme .home-intro { padding: clamp(1.5rem, 4vw, 3rem); }
.app-theme .home-eyebrow { margin: 0 0 1rem; color: var(--primario); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.app-theme .home-intro h3 { margin: 0 0 1rem; font-size: clamp(1.5rem, 3vw, 2.5rem); line-height: 1.15; overflow-wrap: anywhere; }
.app-theme .home-account { padding: 1.5rem clamp(1.5rem, 4vw, 3rem); background: var(--superficie-baja); border-top: 1px solid var(--contorno-variante); }
.app-theme .home-account h4 { margin: 0 0 1.25rem; color: var(--texto); font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.app-theme .home-account-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.app-theme .home-account-facts dt { margin-bottom: .4rem; color: var(--texto-variante); font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.app-theme .home-account-facts dd { margin: 0; color: var(--texto); font-size: .85rem; overflow-wrap: anywhere; }
@media (max-width: 700px) { .app-theme .home-account-facts { grid-template-columns: 1fr; } }
.app-theme .dashboard-overview { display: grid; gap: 1.5rem; }
.app-theme .dashboard-summary { padding: 1.5rem; border-left: 4px solid var(--primario); background: var(--superficie); box-shadow: 0 1px 2px rgba(26,28,30,.05); }
.app-theme .dashboard-section-heading { margin-bottom: 1.5rem; }
.app-theme .dashboard-section-heading h3, .app-theme .dashboard-panel-heading h3 { margin: 0; }
.app-theme .dashboard-section-heading p { margin: .35rem 0 0; color: var(--texto-variante); font-size: .8rem; }
.app-theme .dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--contorno-variante); border: 1px solid var(--contorno-variante); }
.app-theme .dashboard-metric { display: flex; flex-direction: column; min-width: 0; min-height: 8rem; padding: 1.25rem; background: var(--superficie-baja); color: var(--texto); text-decoration: none; }
.app-theme .dashboard-metric:hover { background: var(--superficie-alta); color: var(--texto); }
.app-theme .dashboard-metric span { color: var(--texto-variante); font-size: .68rem; font-weight: 700; line-height: 1.35; text-transform: uppercase; }
.app-theme .dashboard-metric strong { margin: .4rem 0; font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1; font-variant-numeric: tabular-nums; }
.app-theme .dashboard-metric small { margin-top: auto; color: var(--texto-variante); font-size: .7rem; }
.app-theme .dashboard-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
.app-theme .dashboard-panel { min-width: 0; background: var(--superficie); box-shadow: 0 1px 2px rgba(26,28,30,.05); }
.app-theme .dashboard-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--contorno-variante); }
.app-theme .dashboard-panel-heading a { font-size: .75rem; font-weight: 700; white-space: nowrap; }
.app-theme .dashboard-list-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-width: 0; padding: 1rem 1.5rem; border-bottom: 1px solid var(--contorno-variante); color: var(--texto); text-decoration: none; }
.app-theme .dashboard-list-row:last-child { border-bottom: 0; }
.app-theme .dashboard-list-row:hover { background: var(--superficie-baja); color: var(--texto); }
.app-theme .dashboard-row-content { display: flex; flex-direction: column; min-width: 0; gap: .3rem; }
.app-theme .dashboard-row-kind { color: var(--texto-variante); font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.app-theme .dashboard-row-content strong { font-size: .85rem; line-height: 1.3; overflow-wrap: anywhere; }
.app-theme .dashboard-row-content time { color: var(--texto-variante); font-size: .7rem; }
.app-theme .dashboard-list-row .status-badge { flex: 0 0 auto; }
.app-theme .dashboard-empty { margin: 0; padding: 1.5rem; color: var(--texto-variante); font-size: .8rem; }
@media (max-width: 1100px) { .app-theme .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .app-theme .dashboard-columns { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .app-theme .dashboard-summary { padding: 1rem; } .app-theme .dashboard-metric { min-height: 7rem; padding: .85rem; } .app-theme .dashboard-list-row { flex-wrap: wrap; padding: 1rem; } .app-theme .dashboard-panel-heading { padding: 1rem; } }

/* Existing Tailwind and Bootstrap components keep their layout and JS hooks. */
.app-theme :is([class~="rounded"], [class~="rounded-md"], [class~="rounded-lg"], [class~="rounded-full"], [class~="sm:rounded-lg"]) { border-radius: 0; }
.app-theme :is(.shadow, .shadow-sm, .shadow-md, .shadow-xl) { box-shadow: 0 1px 2px rgba(26,28,30,.05); }
.app-theme :is(.text-gray-900, .text-gray-800) { color: var(--texto); }
.app-theme :is(.text-gray-700, .text-gray-600, .text-gray-500, .text-gray-400) { color: var(--texto-variante); }
.app-theme :is(.bg-gray-100, .bg-gray-50) { background-color: var(--superficie-baja); }
.app-theme :is(.bg-green-100, .bg-green-50) { background-color: var(--ok-fondo); }
.app-theme :is(.text-green-900, .text-green-800, .text-green-700, .text-green-600) { color: var(--ok); }
.app-theme :is(.bg-red-100, .bg-red-50) { background-color: var(--error-fondo); }
.app-theme :is(.text-red-800, .text-red-700, .text-red-600) { color: var(--error); }
.app-theme :is(.bg-blue-100, .bg-blue-50) { background-color: var(--superficie-baja); }
.app-theme :is(.text-blue-900, .text-blue-800, .text-blue-700) { color: var(--primario); }
.app-theme .text-danger { color: var(--error) !important; }
.app-theme .border-danger { border-color: var(--error) !important; }
.app-theme .border-success { border-color: var(--ok) !important; }
.app-theme .border-primary { border-color: var(--primario) !important; }
.app-theme label { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-variante); }
.app-theme :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea) {
  font-family: inherit;
  font-size: .85rem !important;
  font-weight: 600 !important;
  padding: .5rem .75rem !important;
  background-color: var(--superficie-alta) !important;
  color: var(--texto) !important;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0 !important;
  box-shadow: none !important;
  max-width: 100%;
  min-width: 0;
}
.app-theme select { padding-right: 2.5rem !important; }
.app-theme input.form-control { border-width: 0 0 2px !important; border-style: solid !important; }
.app-theme :is(input, select, textarea):focus {
  background-color: var(--superficie) !important;
  border-bottom-color: var(--acento) !important;
  outline: 2px solid var(--primario) !important;
  outline-offset: 2px;
  box-shadow: none !important;
}
.app-theme input::placeholder, .app-theme textarea::placeholder { color: var(--texto-variante); font-weight: 400; opacity: 1; }
.app-theme :is(input, select, textarea):disabled { opacity: .65; cursor: not-allowed; }
.app-theme :is(input[type="checkbox"], input[type="radio"]) { color: var(--primario); accent-color: var(--primario); }
.app-theme :is(.app-main, .auth-theme) button,
.app-theme.auth-theme button {
  font-family: inherit;
  border-radius: 0 !important;
  font-size: .7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .08em;
  line-height: 1.4;
  border: 0;
  padding: .55rem 1rem;
  color: var(--boton-texto);
  background: var(--primario);
  box-shadow: none;
  transition: background 150ms ease;
}
.app-theme .app-main button:hover, .app-theme.auth-theme button:hover { background: var(--primario-oscuro); color: var(--boton-texto); }
.app-theme .btn-primary { background-color: var(--primario) !important; border-color: var(--primario) !important; }
.app-theme .btn-primary:hover { background-color: var(--primario-oscuro) !important; }
.app-theme .app-main :is(.theme-secondary, button[id^="btn-cancelar"], button[id^="btn-cerrar"]) { background: transparent; color: var(--primario); }
.app-theme .app-main :is(.theme-secondary, button[id^="btn-cancelar"], button[id^="btn-cerrar"]):hover { background: var(--superficie-maxima); }
.app-theme .app-main .theme-danger { background: var(--error); color: white; }
.app-theme .app-main .theme-danger:hover { background: #930a0a; }
.app-theme button:disabled { opacity: .5; cursor: not-allowed; }

.app-theme .tabla { width: 100%; border-collapse: collapse; background: var(--superficie); margin-bottom: 1.25rem; font-variant-numeric: tabular-nums; }
.app-theme .tabla :is(th, td) { padding: .5rem .75rem; font-size: .8rem; border: 0; vertical-align: middle; }
.app-theme .tabla thead { background: var(--superficie); }
.app-theme .tabla th { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-variante); white-space: nowrap; border-bottom: 2px solid rgba(186,201,201,.5); }
.app-theme .tabla tbody { background: var(--superficie) !important; }
.app-theme .tabla tbody tr { border: 0; background: var(--superficie); color: var(--texto); }
.app-theme .tabla tbody tr:nth-child(odd) { background: var(--superficie-baja); }
.app-theme .tabla button { background: transparent; color: var(--primario); padding: .3rem .45rem; min-height: 2rem; min-width: 2rem; font-size: .8rem !important; }
.app-theme .tabla button:hover { background: var(--superficie-maxima); color: var(--primario); }
.app-theme .tabla form:has(input[name="_method"][value="DELETE"]) button { color: var(--error); }
.app-theme .tabla form:has(input[name="_method"][value="DELETE"]) button:hover { background: var(--error-fondo); }
.app-theme .alerta { padding: .8rem 1rem; margin-bottom: 1rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.app-theme .alerta-ok { color: var(--ok); background: var(--ok-fondo); }
.app-theme .alerta-error { color: var(--error); background: var(--error-fondo); }
.app-theme .alerta-aviso { color: var(--aviso); background: var(--aviso-fondo); }
.app-theme .alerta ul { margin-bottom: 0; }
/* Preserve modal hidden/flex toggling. Their layer is above the entire shell. */
.app-theme .app-main [id^="modal-"] { z-index: 60; overflow-y: auto; padding: 1rem 0; }
.app-theme .app-main [id^="modal-"] > div { max-height: calc(100dvh - 2rem); overflow-y: auto; border-top: 4px solid var(--primario); }
.app-theme .app-main [id^="modal-"] h3 { margin: 0; }
.app-theme .app-main dl dd { overflow-wrap: anywhere; }
.app-theme .app-form-modal-panel { background: var(--superficie) !important; color: var(--texto) !important; border: 1px solid var(--contorno-variante); border-top: 4px solid var(--primario); box-shadow: 0 12px 36px rgba(0,0,0,.2); }
.app-theme .app-form-modal-header { background: var(--superficie); border-bottom: 1px solid var(--contorno-variante); }
.app-theme .app-form-modal-header h3 { color: var(--texto); }
.app-theme .app-form-modal-body { background: var(--superficie); color: var(--texto); }
.app-theme .app-form-modal-errors { margin: 1rem 0 0 1.5rem; text-transform: none; letter-spacing: normal; }
.app-theme .app-form-modal-errors ul { margin: 0; padding-left: 1.25rem; }
.app-theme .app-form-modal-footer { background: var(--superficie-baja) !important; border-top: 1px solid var(--contorno-variante); }
.app-theme .simulation-detail-panel { width: min(32rem, calc(100% - 2rem)); margin: auto; background: var(--superficie); color: var(--texto); box-shadow: 0 12px 36px rgba(0,0,0,.2); }
.app-theme .simulation-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--contorno-variante); }
.app-theme .simulation-detail-header h3 { color: var(--texto); font-size: 1rem; }
.app-theme .simulation-detail-header button { min-width: 2rem; min-height: 2rem; padding: .2rem; color: var(--texto-variante); background: transparent; font-size: 1.1rem !important; }
.app-theme .simulation-detail-list { display: grid; grid-template-columns: minmax(0, 8rem) minmax(0, 1fr); gap: .75rem 1rem; margin: 0; padding: 1.5rem; font-size: .8rem; }
.app-theme .simulation-detail-list dt { color: var(--texto-variante); font-weight: 700; }
.app-theme .simulation-detail-list dd { margin: 0; color: var(--texto); }
.app-theme .simulation-detail-footer { display: flex; justify-content: flex-end; padding: 1rem 1.5rem; background: var(--superficie-baja); border-top: 1px solid var(--contorno-variante); }
.app-theme .simulation-detail-footer button { color: var(--primario); background: transparent; }
.app-theme .highcharts-container { font-family: "Space Grotesk", system-ui, sans-serif !important; }
.app-theme.auth-theme > .min-h-screen { background: var(--fondo); padding: 2rem 1.25rem; }
.app-theme.auth-theme .auth-shell { min-height: 100svh; justify-content: center; gap: 1.75rem; }
.app-theme.auth-theme .auth-brand { display: flex; justify-content: center; }
.app-theme.auth-theme .auth-card {
  width: 100%; max-width: 30rem; padding: 2rem;
  background: #e8e8ec; border: 1px solid #d2d6da;
  border-left: 4px solid var(--primario);
  box-shadow: 0 8px 24px rgba(26, 28, 30, .08);
}
.app-theme.auth-theme .auth-card :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea) { background-color: #fff !important; }
.app-theme.auth-theme .auth-card .mb-10 { margin-bottom: 0 !important; }
.app-theme.auth-theme .auth-shell .auth-card { max-width: 25rem; margin: 0; padding: 2rem; }
.app-theme.auth-theme .auth-login-form h1 { margin: 0 0 .5rem; color: var(--texto); font-size: 1.5rem; font-weight: 700; line-height: 1.2; text-transform: uppercase; }
.app-theme.auth-theme .auth-login-help { margin: 0 0 1.75rem; color: var(--texto-variante); font-size: .85rem; line-height: 1.5; }
.app-theme.auth-theme .auth-login-form label { display: block; margin-bottom: .5rem; }
.app-theme.auth-theme .auth-login-fields { display: grid; gap: 1rem; }
.app-theme.auth-theme .auth-login-fields input { width: 100%; min-height: 2.75rem; }
.app-theme.auth-theme .auth-login-fields button { width: 100%; min-height: 2.75rem; margin: 0 !important; }
.app-theme.auth-theme .auth-login-form #email_no_registrado p { margin: 0; font-size: .8rem; line-height: 1.5; }
@media (max-width: 480px) {
  .app-theme.auth-theme .auth-card { padding: 1.5rem 1.25rem; }
  .app-theme.auth-theme .auth-shell .auth-card { padding: 1.5rem; }
}
.app-theme.auth-theme svg { fill: var(--primario); }
@media (max-width: 860px) {
  .app-theme .cabecera { padding: .8rem 1.25rem; gap: .75rem; }
  .app-theme .lateral { position: static; width: 100%; flex-direction: row; align-items: stretch; overflow-x: auto; }
  .app-theme .lateral-titulo, .app-theme .lateral-usuario { display: none; }
  .app-theme .lateral-opciones, .app-theme .lateral-cuenta { display: flex; flex: 0 0 auto; margin: 0; padding: 0; }
  .app-theme .nav-item { width: auto; height: 100%; flex: 0 0 auto; white-space: nowrap; padding: .9rem 1.25rem; border-left: 0; border-bottom: 3px solid transparent; }
  .app-theme .nav-item.activo { border-bottom-color: var(--acento); }
  .app-theme .app-main { margin-left: 0; width: 100%; padding: 1.5rem 1.25rem 3rem; }
  .app-theme .page-heading h2 { font-size: 1.65rem; }
  html.mobile-nav-enabled .app-theme .mobile-menu-toggle { display: inline-flex; }
  html.mobile-nav-enabled .app-theme .lateral { position: fixed; top: 4rem; right: .75rem; bottom: auto; left: auto; z-index: 49; display: block; width: min(20rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 4.75rem); overflow-y: auto; background: var(--superficie); border: 1px solid var(--contorno-variante); box-shadow: 0 12px 28px rgba(0,0,0,.18); visibility: hidden; opacity: 0; pointer-events: none; transform: translateY(-.5rem); transition: opacity 150ms ease, transform 150ms ease; }
  html.mobile-nav-enabled .app-theme .lateral-opciones { display: block; }
  html.mobile-nav-enabled .app-theme .nav-item { width: 100%; min-height: 3rem; padding: .75rem 1rem; border: 0; border-left: 4px solid transparent; white-space: normal; }
  html.mobile-nav-enabled .app-theme .nav-item.activo { border-left-color: var(--acento); }
  html.mobile-nav-enabled.mobile-nav-open .app-theme .lateral { visibility: visible; opacity: 1; pointer-events: auto; transform: none; }
  html.mobile-nav-enabled.mobile-nav-open .app-theme .mobile-menu-backdrop { position: fixed; inset: 4rem 0 0; z-index: 48; display: block; background: rgba(0,0,0,.25); }
  html.mobile-nav-enabled .app-theme .cabecera { z-index: 50; }
}
@media (prefers-reduced-motion: reduce) {
  .app-theme *, .app-theme *::before, .app-theme *::after { transition: none !important; }
}

/* Explicit preference: only authenticated layouts load the theme controller. */
html[data-theme="dark"] { color-scheme: dark; background: #101719; }
html[data-theme="dark"] .app-theme:not(.auth-theme) {
  color-scheme: dark;
  --fondo: #101719;
  --superficie: #1b2528;
  --superficie-baja: #151f22;
  --superficie-alta: #283538;
  --superficie-maxima: #35464a;
  --texto: #edf3f3;
  --texto-variante: #bfcece;
  --contorno: #94aaaa;
  --contorno-variante: #4c6265;
  --primario: #85d4d5;
  --primario-oscuro: #ade8e8;
  --primario-claro: #25474a;
  --acento: #2ddbde;
  --ok: #a0e3d7;
  --ok-fondo: #193d38;
  --error: #ffb4ab;
  --error-fondo: #4d2526;
  --aviso: #f2ce85;
  --aviso-fondo: #42351e;
  --boton-texto: #102729;
  --cabecera-fondo: rgba(16, 23, 25, .94);
  --logo-fondo: transparent;
}
.app-theme .bg-white { background-color: var(--superficie); }
.app-theme .bg-gray-200 { background-color: var(--superficie-alta); }
.app-theme :is(.border-b, .border-gray-100, .border-gray-200, .border-gray-300) { border-color: var(--contorno-variante); }
.app-theme .skip-link { background: var(--superficie); }
.app-theme .marca-logo { background: var(--logo-fondo); }
html[data-theme="dark"] .app-theme:not(.auth-theme) .application-logo { filter: brightness(0) invert(1); }
html[data-theme="dark"] .app-theme .theme-danger { color: #32100c; }
html[data-theme="dark"] .app-theme .theme-danger:hover { background: #ffd0ca; color: #32100c; }
.app-theme .cabecera-acciones { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; min-width: 0; }
.app-theme .cabecera-acciones .chip-cabecera { max-width: 16rem; min-width: 0; }
/* Rounded switch is an intentional exception to the square component style. */
.app-theme .theme-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 68px; min-height: 44px; padding: 0; background: transparent; border: 0; border-radius: 999px; cursor: pointer; }
.app-theme .theme-toggle-track { position: relative; display: block; width: 64px; height: 32px; border-radius: 999px; background: #dce5e5; border: 1px solid #bac9c9; transition: background 180ms ease, border-color 180ms ease; }
.app-theme .theme-toggle-track .material-symbols-outlined { position: absolute; top: 7px; font-size: 16px; line-height: 16px; color: #3b4949; }
.app-theme .theme-toggle-sun { left: 7px; }
.app-theme .theme-toggle-moon { right: 7px; }
.app-theme .theme-toggle-thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform 180ms ease; }
html[data-theme="dark"] .app-theme .theme-toggle-track { background: #01696b; border-color: #85d4d5; }
html[data-theme="dark"] .app-theme .theme-toggle-track .material-symbols-outlined { color: #fff; }
html[data-theme="dark"] .app-theme .theme-toggle-thumb { transform: translateX(32px); }
.app-theme .theme-toggle:hover .theme-toggle-track { border-color: var(--primario); }
@media (max-width: 600px) {
  .app-theme .cabecera-acciones { gap: .5rem; }
  .app-theme .cabecera-acciones .chip-cabecera { max-width: 7rem; }
}

/* Saturated actions against dark surfaces; no white or pastel backgrounds. */
html[data-theme="dark"] .app-theme .app-main button.theme-primary {
  background: #ff9800;
  color: #101719 !important;
  border: 1px solid #ff9800;
}
html[data-theme="dark"] .app-theme .app-main button.theme-primary:hover {
  background: #ffb300;
  border-color: #ffb300;
}
html[data-theme="dark"] .app-theme .app-main button.theme-primary:active {
  background: #f57c00;
  border-color: #f57c00;
}
html[data-theme="dark"] .app-theme .app-main button.theme-primary:focus-visible {
  outline: 2px solid #ff9800;
  outline-offset: 3px;
}
html[data-theme="dark"] .app-theme .tabla button {
  --accion: #22d3ee;
  --accion-hover: #06b6d4;
  background: var(--accion);
  color: #101719 !important;
  border: 1px solid var(--accion);
}
html[data-theme="dark"] .app-theme .tabla button:hover {
  background: var(--accion-hover);
  border-color: var(--accion-hover);
}
html[data-theme="dark"] .app-theme .tabla button:focus-visible {
  outline: 2px solid var(--accion);
  outline-offset: 3px;
}
html[data-theme="dark"] .app-theme .tabla form:has(input[name="_method"][value="PATCH"]) button {
  --accion: #34d399;
  --accion-hover: #10b981;
}
html[data-theme="dark"] .app-theme .tabla form:has(input[name="_method"][value="DELETE"]) button {
  --accion: #ff5252;
  --accion-hover: #f44336;
  background: var(--accion);
}
html[data-theme="dark"] .app-theme .tabla form:has(input[name="_method"][value="DELETE"]) button:hover {
  background: var(--accion-hover);
}
html[data-theme="dark"] .app-theme .app-main .theme-danger {
  background: #ff5252;
  color: #101719 !important;
}
html[data-theme="dark"] .app-theme .app-main .theme-danger:hover {
  background: #f44336;
}
/* Account disclosure in the header, after the theme switch. */
.app-theme .user-menu { position: relative; flex-shrink: 0; }
.app-theme .user-menu-trigger { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: transparent; color: var(--texto-variante); border: 0; cursor: pointer; }
.app-theme .user-menu-trigger .material-symbols-outlined { font-size: 28px; }
.app-theme .user-menu-trigger:hover, .app-theme .user-menu-trigger[aria-expanded="true"] { color: var(--texto); background: var(--superficie-alta); }
.app-theme .user-menu-panel { position: absolute; top: calc(100% + .5rem); right: 0; width: min(17rem, calc(100vw - 2.5rem)); padding: .5rem 0; background: var(--superficie); color: var(--texto); border: 1px solid var(--contorno-variante); box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.app-theme .user-menu-identity { display: flex; flex-direction: column; gap: .25rem; padding: .75rem 1rem; margin-bottom: .25rem; border-bottom: 1px solid var(--contorno-variante); font-size: .75rem; overflow-wrap: anywhere; }
.app-theme .user-menu-identity span { color: var(--texto-variante); }
.app-theme .user-menu-link { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .75rem 1rem; border: 0; background: transparent; color: var(--texto-variante); font-family: inherit; font-size: .8rem; text-align: left; text-decoration: none; cursor: pointer; }
.app-theme .user-menu-link:hover, .app-theme .user-menu-link[aria-current="page"] { color: var(--texto); background: var(--superficie-alta); text-decoration: none; }

/* Explicit cell backgrounds prevent Bootstrap utilities leaking white stripes. */
.app-theme .tabla tbody tr:nth-child(even) > td { background-color: var(--superficie) !important; }
.app-theme .tabla tbody tr:nth-child(odd) > td { background-color: var(--superficie-baja) !important; }
.app-theme .status-badge { display: inline-block; padding: .25rem .55rem; font-size: .7rem; line-height: 1.4; font-weight: 700; white-space: nowrap; border: 1px solid transparent; border-radius: 0; }
.app-theme .status-badge--pending { background: var(--aviso-fondo); color: var(--aviso); }
.app-theme .status-badge--progress { background: #d0edf7; color: #07536b; }
.app-theme .status-badge--success { background: var(--ok-fondo); color: var(--ok); }
.app-theme .status-badge--error { background: var(--error-fondo); color: var(--error); }
.app-theme .status-badge--neutral { background: var(--superficie-alta); color: var(--texto-variante); }
html[data-theme="dark"] .app-theme .status-badge--pending { background: #fbbf24; color: #101719; }
html[data-theme="dark"] .app-theme .status-badge--progress { background: #22d3ee; color: #101719; }
html[data-theme="dark"] .app-theme .status-badge--success { background: #34d399; color: #101719; }
html[data-theme="dark"] .app-theme .status-badge--error { background: #ff5252; color: #101719; }

/* Operation forecasts: wide source table within the available viewport. */
.app-theme .operation-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-bottom: 2rem; }
.app-theme .operation-field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.app-theme .operation-clear { padding: .55rem 0; font-size: .8rem; }
.app-theme .operation-table-scroll { max-width: 100%; overflow-x: auto; }
.app-theme .operation-table-scroll:focus-visible { outline: 2px solid var(--primario); outline-offset: 2px; }
.app-theme .operation-table td { white-space: nowrap; }
.app-theme .operation-table .operation-number { text-align: right; font-variant-numeric: tabular-nums; }
.app-theme .operation-table .operation-empty { padding: 2rem 1rem; white-space: normal; text-align: center; color: var(--texto-variante); }
/* Simulation rows expand into their quarter-hour breakdown. */
.app-theme .operation-help { margin: -.5rem 0 1rem; color: var(--texto-variante); font-size: .8rem; }
.app-theme .operation-master > tbody > tr.operation-expandable { cursor: pointer; }
.app-theme .operation-master > tbody > tr.operation-expandable:hover > td { background-color: var(--superficie-alta) !important; }
.app-theme .operation-master > tbody > tr.operation-expanded > td { background-color: var(--ok-fondo) !important; }
.app-theme .operation-master > tbody > tr.operation-expanded > td:first-child { box-shadow: inset 4px 0 0 var(--primario); }
.app-theme .operation-master > tbody > tr > td:first-child { width: 2.5rem; padding-right: 0; }
.app-theme .tabla button.operation-toggle { display: inline-flex; align-items: center; justify-content: center; padding: .15rem; }
.app-theme .operation-toggle .material-symbols-outlined { transition: transform 150ms ease; }
.app-theme .operation-toggle[aria-expanded="true"] .material-symbols-outlined { transform: rotate(180deg); }
.app-theme .operation-master > tbody > tr.operation-detail-row > td { padding: 0; white-space: normal; background-color: var(--fondo) !important; cursor: default; }
.app-theme .operation-detail { width: 100%; min-width: 0; max-width: 100%; padding: 1rem 1.25rem 1.25rem; border-left: 4px solid var(--primario); border-bottom: 1px solid var(--contorno-variante); }
.app-theme .operation-detail [hidden] { display: none !important; }
.app-theme .operation-detail-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .75rem; }
.app-theme .operation-detail-header h4 { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--texto); }
.app-theme .operation-detail-header h4 span { text-transform: none; letter-spacing: normal; overflow-wrap: anywhere; }
.app-theme .operation-detail-count { color: var(--texto-variante); font-size: .75rem; font-variant-numeric: tabular-nums; }
.app-theme .operation-detail .alerta { margin-bottom: .75rem; text-transform: none; }
.app-theme .operation-detail-params { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0 0 .75rem; font-size: .75rem; }
.app-theme .operation-detail-params div { display: flex; gap: .4rem; min-width: 0; }
.app-theme .operation-detail-params dt { color: var(--texto-variante); }
.app-theme .operation-detail-params dd { margin: 0; color: var(--texto); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.app-theme .operation-detail .operation-empty { margin: 0; padding: 1rem; text-align: center; color: var(--texto-variante); }
.app-theme .operation-detail-scroll { width: 100%; max-width: 100%; max-height: 28rem; overflow: auto; background: var(--superficie); }
.app-theme .operation-detail-scroll:focus-visible { outline: 2px solid var(--primario); outline-offset: 2px; }
.app-theme .operation-detail-table { width: max-content; min-width: 100%; margin-bottom: 0; }
.app-theme .operation-detail-table thead th { position: sticky; top: 0; z-index: 1; background: var(--superficie); }
/* Simulation detail screen: summary, chart and full breakdown. */
.app-theme .operation-master > tbody > tr > td:last-child { width: 2.5rem; text-align: center; }
.app-theme .operation-view-link { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; min-height: 2rem; color: var(--primario); text-decoration: none; }
.app-theme .operation-view-link:hover { background: var(--superficie-maxima); color: var(--primario); }
.app-theme .operation-view-link:focus-visible { outline: 2px solid var(--primario); outline-offset: 2px; }
html[data-theme="dark"] .app-theme .operation-view-link { background: #22d3ee; color: #101719; }
html[data-theme="dark"] .app-theme .operation-view-link:hover { background: #06b6d4; color: #101719; }
html[data-theme="dark"] .app-theme .operation-view-link:focus-visible { outline-color: #22d3ee; }
.app-theme .operation-back { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 700; text-decoration: none; }
.app-theme .operation-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem 1.5rem; margin: 0 0 1.5rem; padding: 1rem 1.25rem; background: var(--superficie); border-left: 4px solid var(--primario); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.app-theme .operation-summary dt { margin-bottom: .25rem; color: var(--texto-variante); font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.app-theme .operation-summary dd { margin: 0; color: var(--texto); font-size: .85rem; font-variant-numeric: tabular-nums; }
.app-theme .operation-summary dd.operation-number { text-align: left; }
.app-theme .operation-show-params { margin-bottom: 2rem; }
.app-theme .operation-detail-error { text-transform: none; }
.app-theme .operation-block { min-width: 0; max-width: 100%; margin-bottom: 2rem; }
.app-theme .operation-block > h3 { margin: 0 0 1rem; }
.app-theme .operation-block > .operation-empty { padding: 2rem 1rem; text-align: center; color: var(--texto-variante); background: var(--superficie); }
/* Series colours validated for CVD separation against each surface. */
.app-theme .operation-chart {
  --grafica-precio: #e34948;
  --grafica-descarga: #eda100;
  --grafica-carga: #4a3aa7;
  --grafica-soc: #2a78d6;
  min-width: 0; max-width: 100%; background: var(--superficie); box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
html[data-theme="dark"] .app-theme .operation-chart {
  --grafica-precio: #e66767;
  --grafica-descarga: #c98500;
  --grafica-carga: #9085e9;
  --grafica-soc: #3987e5;
}

.app-theme #modal-nueva-simulacion-bess .bess-modal-panel { width: min(42rem, calc(100% - 2rem)); margin: auto; background: var(--superficie); color: var(--texto); box-shadow: 0 12px 36px rgba(0,0,0,.16); }
.app-theme .bess-modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.5rem 1.75rem 1.25rem; border-bottom: 1px solid var(--contorno-variante); }
.app-theme .bess-modal-kicker { display: block; margin-bottom: .55rem; color: var(--primario); font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.app-theme .bess-modal-header h3 { margin: 0 0 .5rem !important; }
.app-theme .bess-modal-header p { margin: 0; color: var(--texto-variante); font-size: .8rem; line-height: 1.5; }
.app-theme .app-main button.bess-modal-close { flex: 0 0 auto; min-width: 2rem; padding: .1rem .4rem; background: transparent; color: var(--texto-variante); font-size: 1.5rem !important; line-height: 1; }
.app-theme .app-main button.bess-modal-close:hover { background: var(--superficie-alta); color: var(--texto); }
.app-theme .bess-modal-body { display: grid; gap: 1.5rem; padding: 1.5rem 1.75rem; }
.app-theme .bess-modal-section { min-width: 0; margin: 0; padding: 0; border: 0; }
.app-theme .bess-modal-section legend { width: 100%; margin-bottom: .8rem; padding: 0 0 .4rem; border-bottom: 1px solid var(--contorno-variante); color: var(--texto); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.app-theme .bess-modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.app-theme .bess-modal-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.app-theme .bess-modal-field { min-width: 0; }
.app-theme .bess-modal-field label { display: block; margin-bottom: .35rem; }
.app-theme .bess-modal-field :is(input, select) { display: block; width: 100%; }
.app-theme .bess-soc-heading { display: flex; justify-content: flex-end; margin-bottom: .35rem; color: var(--primario); font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.app-theme .bess-soc-field input[type="range"] { appearance: none; -webkit-appearance: none; height: .75rem; margin: .5rem 0 1rem; padding: 0 !important; border: 0; background: linear-gradient(to right, var(--primario) 0 var(--soc-fill, 0%), var(--superficie-alta) var(--soc-fill, 0%) 100%) !important; cursor: pointer; }
.app-theme .bess-soc-field input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 1.25rem; height: 1.25rem; border: 2px solid var(--superficie); border-radius: 50%; background: var(--primario); box-shadow: 0 0 0 1px var(--primario); }
.app-theme .bess-soc-field input[type="range"]::-moz-range-thumb { width: 1rem; height: 1rem; border: 2px solid var(--superficie); border-radius: 50%; background: var(--primario); box-shadow: 0 0 0 1px var(--primario); }
.app-theme .bess-soc-field select { margin-top: .25rem; }
.app-theme .bess-modal-hint { margin: .7rem 0 0; color: var(--texto-variante); font-size: .75rem; }
.app-theme .bess-modal-errors { margin: 1rem 1.75rem 0; }
.app-theme .bess-modal-footer { display: flex; justify-content: flex-end; gap: .5rem; padding: 1rem 1.75rem; background: var(--superficie-baja); }
@media (max-width: 600px) { .app-theme .bess-modal-grid, .app-theme .bess-modal-grid--three { grid-template-columns: 1fr; } }

/* DataTables controls follow the shared light and dark theme. */
.app-theme .dt-container { color: var(--texto); font-family: inherit; font-size: .8rem; max-width: 100%; }
.app-theme .dt-container .dt-layout-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin: .75rem 0; }
.app-theme .dt-container .dt-layout-cell { min-width: 0; }
.app-theme .dt-container .dt-input { border: 0; border-radius: 0; background: var(--superficie-alta); color: var(--texto); padding: .45rem .65rem; font: inherit; }
.app-theme .dt-container .dt-input:focus-visible { outline: 2px solid var(--primario); outline-offset: 2px; background: var(--superficie); }
.app-theme .dt-container .dt-paging .dt-paging-button { border: 0 !important; border-radius: 0 !important; background: var(--superficie-alta) !important; color: var(--texto) !important; margin-left: .25rem; }
.app-theme .dt-container .dt-paging .dt-paging-button:hover,
.app-theme .dt-container .dt-paging .dt-paging-button.current { background: var(--primario) !important; color: #fff !important; }
.app-theme .dt-container .dt-paging .dt-paging-button.disabled { opacity: .45; }
.app-theme .dt-container .dt-paging .dt-paging-button:focus-visible { outline: 2px solid var(--primario); outline-offset: 2px; }
.app-theme .dt-container .dt-scroll-body { max-width: 100%; }
.app-theme .dt-container table.tabla { margin-bottom: 0; }
.app-theme .mobile-row-toggle { display: none; }
.app-theme .mobile-summary-toggle { display: none !important; }
.app-theme .mobile-row-primary { display: block; }
.app-theme .mobile-detail-row > td { padding: 0 !important; background: var(--superficie) !important; }
.app-theme .mobile-row-panel { padding: 1rem; border-left: 4px solid var(--primario); }
.app-theme .mobile-row-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem 1rem; margin: 0 0 1rem; }
.app-theme .mobile-row-facts div { min-width: 0; }
.app-theme .mobile-row-facts dt { color: var(--texto-variante); font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.app-theme .mobile-row-facts dd { margin: .2rem 0 0; color: var(--texto); font-size: .8rem; overflow-wrap: anywhere; }
.app-theme .operation-detail > .mobile-row-facts { display: none; }

@media (max-width: 600px) {
  .app-theme .operation-field { flex: 1 1 9rem; }
}
@media (max-width: 640px) {
  html.mobile-tables-loading .app-theme [data-mobile-table-shell]:not(.mobile-table-ready):not(.mobile-table-fallback) { position: relative; width: 100%; max-width: 100%; height: 5rem; overflow: hidden; background: var(--superficie-baja); }
  html.mobile-tables-loading .app-theme [data-mobile-table-shell]:not(.mobile-table-ready):not(.mobile-table-fallback) > * { visibility: hidden; }
  html.mobile-tables-loading .app-theme [data-mobile-table-shell]:not(.mobile-table-ready):not(.mobile-table-fallback)::after { content: 'Cargando tabla…'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--texto-variante); font-size: .8rem; font-weight: 700; visibility: visible; }
  html.mobile-tables-loading .app-theme [data-mobile-table-shell].mobile-table-fallback { max-width: 100%; overflow-x: auto; }
  html.mobile-tables-loading .app-theme [data-mobile-table-shell].mobile-table-fallback > table { width: max-content; min-width: 100%; white-space: nowrap; }
  .app-theme .cabecera { padding-inline: .75rem; }
  .app-theme .cabecera-acciones { gap: .4rem; }
  .app-theme .app-main { padding: 1.25rem .75rem 2.5rem; }
  .app-theme .page-heading h2 { font-size: 1.45rem; }
  .app-theme .section-toolbar { align-items: stretch; }
  .app-theme .section-toolbar > :is(button, a) { max-width: 100%; }
  .app-theme .operation-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .app-theme .operation-filters .operation-field:first-child { grid-column: 1 / -1; }
  .app-theme .operation-filters :is(input, select) { width: 100%; }
  .app-theme #modal-nueva-simulacion-bess .bess-modal-panel { width: calc(100% - 1rem); }
  .app-theme .bess-modal-header, .app-theme .bess-modal-body, .app-theme .bess-modal-footer { padding-inline: 1rem; }
  .app-theme .mobile-summary-table { min-width: 0; width: 100%; }
  .app-theme .mobile-summary-table.mobile-ready, .app-theme .operation-master.operation-mobile-ready { width: 100% !important; min-width: 0 !important; table-layout: auto; }
  .app-theme .mobile-summary-table :is(th, td) { white-space: normal; overflow-wrap: anywhere; }
  .app-theme .mobile-ready > thead > tr > :is(:nth-child(2), :nth-child(3), :nth-child(4)),
  .app-theme .mobile-ready > tbody > tr:not(.mobile-detail-row) > :is(:nth-child(2), :nth-child(3), :nth-child(4)) { display: none !important; }
  .app-theme .mobile-ready > colgroup > :is(:nth-child(2), :nth-child(3), :nth-child(4)) { display: none; }
  .app-theme .mobile-ready > thead > tr > :nth-child(5),
  .app-theme .mobile-ready > tbody > tr:not(.mobile-detail-row) > :nth-child(5),
  .app-theme .mobile-ready > colgroup > :nth-child(5) { display: none !important; }
  .app-theme .mobile-summary-simulations.mobile-ready > thead > tr > :is(:nth-child(5), :nth-child(6), :nth-child(7), :nth-child(8), :nth-child(9), :nth-child(10)),
  .app-theme .mobile-summary-simulations.mobile-ready > tbody > tr:not(.mobile-detail-row) > :is(:nth-child(5), :nth-child(6), :nth-child(7), :nth-child(8), :nth-child(9), :nth-child(10)) { display: none !important; }
  .app-theme .mobile-summary-simulations.mobile-ready > colgroup > :is(:nth-child(5), :nth-child(6), :nth-child(7), :nth-child(8), :nth-child(9), :nth-child(10)) { display: none; }
  .app-theme .mobile-summary-simulations.mobile-ready > thead > tr > :nth-child(11),
  .app-theme .mobile-summary-simulations.mobile-ready > tbody > tr:not(.mobile-detail-row) > :nth-child(11),
  .app-theme .mobile-summary-simulations.mobile-ready > colgroup > :nth-child(11) { display: none !important; }
  .app-theme .mobile-summary-table.mobile-ready > tbody > tr:not(.mobile-detail-row) > td:first-child { width: auto; min-width: 0; }
  .app-theme .mobile-row-primary { display: flex; align-items: flex-start; gap: .6rem; min-width: 0; }
  .app-theme .mobile-row-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
  .app-theme .tabla button.mobile-summary-toggle { display: inline-flex !important; flex: 0 0 2rem; align-items: center; justify-content: center; margin: 0; vertical-align: middle; }
  .app-theme .mobile-summary-table > tbody > tr.operation-expandable { cursor: pointer; }
  .app-theme .mobile-summary-table > tbody > tr.operation-expanded > td { background-color: var(--ok-fondo) !important; }
  .app-theme .mobile-row-actions { width: 6.75rem; min-width: 6.75rem; padding-inline: .2rem !important; white-space: nowrap !important; text-align: right; }
  .app-theme .mobile-row-actions form { display: inline-flex !important; margin-left: .1rem !important; vertical-align: middle; }
  .app-theme .mobile-row-actions > button,
  .app-theme .mobile-row-actions form > button { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; min-width: 1.9rem; min-height: 1.9rem; padding: .15rem; vertical-align: middle; }
  .app-theme .mobile-row-actions .bi { font-size: .85rem; }
  .app-theme .operation-mobile-ready > thead > tr > :is(:nth-child(2), :nth-child(5), :nth-child(6), :nth-child(7), :nth-child(8), :nth-child(9), :nth-child(10), :nth-child(11), :nth-child(12)),
  .app-theme .operation-mobile-ready > tbody > tr:not(.operation-detail-row) > :is(:nth-child(2), :nth-child(5), :nth-child(6), :nth-child(7), :nth-child(8), :nth-child(9), :nth-child(10), :nth-child(11), :nth-child(12)) { display: none !important; }
  .app-theme .operation-mobile-ready > colgroup > :is(:nth-child(2), :nth-child(5), :nth-child(6), :nth-child(7), :nth-child(8), :nth-child(9), :nth-child(10), :nth-child(11), :nth-child(12)) { display: none; }
  .app-theme .operation-master > tbody > tr > td:first-child,
  .app-theme .operation-master > tbody > tr > td:last-child { width: 2.25rem; }
  .app-theme .operation-master > tbody > tr > td:nth-child(3) { white-space: normal; overflow-wrap: anywhere; }
  .app-theme .operation-detail { padding: .75rem; }
  .app-theme .operation-master > tbody > tr.operation-detail-row > td { width: 0; max-width: 0; }
  .app-theme .operation-detail { width: calc(100vw - 1.5rem); max-width: calc(100vw - 1.5rem); overflow: hidden; }
  .app-theme .operation-detail-scroll { overscroll-behavior-inline: contain; }
  .app-theme .operation-block .operation-table-scroll { width: 100%; max-width: calc(100vw - 1.5rem); }
  .app-theme .operation-block .dt-container { min-width: 0; max-width: 100%; }
  .app-theme .operation-chart, .app-theme .operation-chart .highcharts-container { max-width: 100%; }
  .app-theme .operation-detail > .mobile-row-facts { display: grid; }
  .app-theme .dt-container .dt-layout-row { align-items: center; gap: .5rem; margin-block: .5rem; }
  .app-theme .dt-container .dt-layout-row:first-child { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .app-theme .dt-container .dt-layout-cell { width: auto; min-width: 0; }
  .app-theme .dt-container, .app-theme .dt-container > .dt-layout-row.dt-layout-table, .app-theme .dt-container > .dt-layout-row.dt-layout-table > .dt-layout-cell { width: 100% !important; min-width: 0; }
  .app-theme .dt-container > .dt-layout-row.dt-layout-table { display: block; }
  .app-theme .dt-container > .dt-layout-row.dt-layout-table > .dt-layout-cell { display: block; }
  .app-theme .dt-container > .dt-layout-row.dt-layout-table table.tabla { width: 100% !important; }
  .app-theme .dt-container .dt-layout-row:first-child .dt-layout-cell:last-child { justify-self: end; }
  .app-theme .dt-container .dt-search { display: flex; align-items: center; gap: .3rem; white-space: nowrap; }
  .app-theme .dt-container .dt-search .dt-input { width: min(32vw, 8rem); min-width: 0; margin: 0; }
  .app-theme .dt-container .dt-length { white-space: nowrap; }
  .app-theme .dt-container .dt-length .dt-input { width: auto; margin: 0 .2rem; }
  .app-theme .dt-container .dt-paging .dt-paging-button:is(.first, .last) { display: none !important; }
  .app-theme .dt-container .dt-paging .dt-paging-button { min-width: 2rem; padding: .3rem .45rem !important; margin-left: .15rem; }
}
@media (max-width: 420px) {
  .app-theme .operation-filters { grid-template-columns: minmax(0, 1fr); }
  .app-theme .operation-filters .operation-field:first-child { grid-column: auto; }
  .app-theme .mobile-row-facts { grid-template-columns: minmax(0, 1fr); }
}
