.hemsa-detalle-modal {
  margin: auto;
  width: 95vw;
  height: 95vh;
  max-width: 95vw;
  max-height: 95vh;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}

.hemsa-detalle-modal::backdrop {
  background: rgba(17, 24, 39, 0.58);
}
.hemsa-detalle-modal--external[open] { display: flex; flex-direction: column; }
.social-modal-toolbar { padding: 14px 80px 14px 20px; flex: 0 0 auto; border-bottom: 1px solid #d9e2e8; }
.social-modal-toolbar p { margin: 0 0 6px; }
.hemsa-detalle-modal--external iframe { flex: 1 1 auto; min-height: 0; }

.hemsa-detalle-modal.hemsa-detalle-modal--96 {
  width: 96vw;
  height: 96vh;
  max-width: 96vw;
  max-height: 96vh;
}

.hemsa-detalle-modal iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.hemsa-detalle-close {
  border: 1px solid #c9d5dc;
  background: transparent;
  font-size: 1.7rem;
  line-height: 1;
  color: #667985;
  position: absolute;
  top: 18px;
  right: 32px;
  z-index: 5;
}

.hemsa-detalle-close:hover {
  background: #f3f7f9;
  color: #0d4f70;
}

.hemsa-detalle-close[hidden] {
  display: none;
}

body.hemsa-detalle-open {
  overflow: hidden;
}

.detalle-tabs.hemsa-solapas { display: flex; overflow-x: auto; }
.detalle-tabs.hemsa-solapas {
  position: relative;
  z-index: 1;
  align-items: end;
  gap: 5px;
  margin: 0 0 -1px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  scrollbar-width: thin;
}

/* Solapas de carpeta: mismo patrón visual que previsión de tesorería. */
.detalle-tabs.hemsa-solapas .detalle-tab {
  flex: 1 0 175px;
  width: 175px;
  box-sizing: border-box;
  height: 54px;
  min-width: 0;
  white-space: normal;
  text-align: center;
  min-height: 43px;
  padding: 10px 16px;
  border: 1px solid #c9d5dc;
  border-bottom-color: #d9e2e8;
  border-radius: 9px 9px 0 0;
  background: #e9eef2;
  color: #455e6a;
  font-size: 1.28rem;
  font-weight: 600;
  box-shadow: none;
}

.detalle-tabs.hemsa-solapas .detalle-tab:hover {
  border-color: #9fb5c1;
  background: #f3f7f9;
  color: #0d4f70;
}

.detalle-tabs.hemsa-solapas .detalle-tab.is-active {
  position: relative;
  z-index: 2;
  padding-top: 12px;
  border-color: #d9e2e8;
  border-top: 3px solid #146c94;
  border-bottom-color: #fff;
  background: #fff;
  color: #0d4f70;
}

.detalle-tabs.hemsa-solapas .detalle-tab:focus-visible {
  outline: 3px solid rgba(20, 108, 148, .22);
  outline-offset: -3px;
}

.hemsa-paneles--independiente,
.detalle-tabs.hemsa-solapas + .hemsa-paneles,
.detalle-tabs.hemsa-solapas ~ [data-detalle-tab-panel].is-active {
  border: 1px solid #d9e2e8;
  border-radius: 0 10px 10px 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(31, 56, 70, .06);
}


.hemsa-detalle-close { min-width: 38px; min-height: 38px; border-radius: 7px; cursor: pointer; }
body.hemsa-detalle-embebido > header, body.hemsa-detalle-embebido > footer, body.hemsa-detalle-embebido .hemsa-sidebar, body.hemsa-detalle-embebido #hemsa-sidebar-rail { display: none; }
body.hemsa-detalle-embebido > .hemsa-workspace { padding-left: 0 !important; margin-left: 0 !important; width: 100% !important; max-width: 100% !important; }
.vestuario-page .hemsa-detalle-close { position: static; }
.top-bar-actions > .hemsa-detalle-close { position: static; order: 10; flex-shrink: 0; }
@media (max-width: 800px) {
  .top-bar-actions:has(> [data-cerrar-detalle]) { width: 100%; justify-content: flex-end; }
}
.detalle-tabs.hemsa-solapas .detalle-tab { display: flex; align-items: center; justify-content: center; text-decoration: none; }

.hemsa-paneles--independiente { border-radius: 10px; }

/* Solapas optativas para vistas con apartados generados por el componente com?n. */
.detalle-tabs-enhanced .detalle-auto-tabs.hemsa-solapas { align-items: end; gap: 5px; padding: 0; margin: 0 0 -1px; border: 0; border-radius: 0; background: transparent; }
