/* ================================
   IDH - Vista principal moderna
================================ */

.idh-page {
  padding: 1.5rem 1.25rem 2rem;
  background: linear-gradient(180deg, #f4f7fb 0%, #eef3f8 100%);
  color: #0f172a;
}

.idh-shell {
  max-width: 1180px;
  margin: 0 auto;
}

/* ================================
   Header compacto del módulo
================================ */

.idh-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  padding: 1.7rem 2rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbe4ef;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: hidden;
}

.idh-module-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 7px;
  height: 100%;
  background: linear-gradient(180deg, #062f55, #0ea5e9);
}

.idh-module-header::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.10);
  pointer-events: none;
}

.idh-module-header__content {
  position: relative;
  z-index: 1;
}

.idh-eyebrow {
  margin: 0 0 0.35rem;
  color: #0b5f9f;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.idh-module-header h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.idh-module-header p {
  max-width: 760px;
  margin-top: 0.65rem;
  color: #475569;
  line-height: 1.6;
}

.idh-module-badge {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, #062f55 0%, #0b5f9f 100%);
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(11, 95, 159, 0.25);
}

/* ================================
   Layout
================================ */

.idh-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ================================
   Sidebar
================================ */

.idh-sidebar {
  background: #ffffff;
  border: 1px solid #dbe4ef;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.idh-sidebar__label {
  margin: 0 0 0.8rem 0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.idh-menu {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.idh-menu__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.78rem 0.85rem;
  border-radius: 12px;
  color: #334155;
  text-decoration: none;
  font-weight: 650;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.idh-menu__item:hover {
  background: #eef7ff;
  color: #075985;
  transform: translateX(3px);
}

.idh-menu__item.active {
  background: linear-gradient(135deg, #062f55 0%, #0b5f9f 100%);
  color: #ffffff;
}

.idh-menu__icon {
  width: 1.3rem;
  display: inline-flex;
  justify-content: center;
}

/* ================================
   Main
================================ */

.idh-main {
  min-width: 0;
}

.idh-welcome-card {
  background: #ffffff;
  border: 1px solid #dbe4ef;
  border-radius: 18px;
  padding: 1.6rem 1.8rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: hidden;
}

.idh-welcome-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 7px;
  height: 100%;
  background: linear-gradient(180deg, #062f55, #0ea5e9);
}

.idh-welcome-card__header {
  padding-left: 0.25rem;
}

.idh-welcome-card h1 {
  margin: 0;
  color: #0f172a;
  font-size: 1.6rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.idh-welcome-card p {
  margin-top: 0.9rem;
  color: #475569;
  line-height: 1.6;
}

/* ================================
   Notas
================================ */

.idh-notes {
  margin-top: 1.15rem;
  display: grid;
  gap: 0.65rem;
}

.idh-note {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem;
  border-radius: 13px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.idh-note__number {
  flex: 0 0 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
  font-size: 0.9rem;
}

.idh-note__text {
  line-height: 1.55;
  color: #334155;
}

.idh-note__text strong {
  color: #0f172a;
}


.idh-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.idh-section-header__text {
  flex: 1;
}

.idh-help-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  text-decoration: none;
  font-size: 1.25rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.idh-help-icon:hover {
  color: #ffffff;
  background: #2563eb;
  transform: translateY(-1px);
}


/* ================================
   Contenido dinámico JS
================================ */

.idh-historico-toolbar {
  display: flex;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
}

.idh-date-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.idh-date-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
}

.idh-date-input {
  height: 42px;
  min-width: 220px;
  padding: 0 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.95rem;
  background: #ffffff;
  color: #0f172a;
}

.idh-date-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.idh-btn-primary {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 1rem;
  border: none;
  border-radius: 10px;
  background: #0f3d75;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.idh-btn-primary:hover {
  background: #092f5c;
  transform: translateY(-1px);
}

.idh-iframe-wrapper {
  width: 100%;
  margin-top: 1rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.idh-report-frame {
  min-height: 800px;
  border: none;
  display: block;
}

.idh-content-card {
  background: #ffffff;
  border: 1px solid #dbe4ef;
  border-radius: 18px;
  padding: 1.6rem 1.8rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: hidden;
}

.idh-content-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 7px;
  height: 100%;
  background: linear-gradient(180deg, #062f55, #0ea5e9);
}

.idh-section-header {
  margin-bottom: 1.2rem;
  padding-left: 0.25rem;
}

.idh-section-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.idh-section-header p {
  margin-top: 0.55rem;
  color: #475569;
  line-height: 1.6;
}

.idh-report-frame {
  min-height: 800px;
  border-radius: 14px;
  border: 1px solid #dbe4ef;
  background: #ffffff;
}

.idh-upload-form {
  margin-bottom: 1.25rem;
}

.idh-upload-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
  padding: 1rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.idh-label {
  display: block;
  margin-bottom: 0.45rem;
  color: #334155;
  font-weight: 750;
  font-size: 0.88rem;
}

.idh-button {
  min-width: 150px;
  border-radius: 10px;
  font-weight: 750;
}

.idh-submit-button {
  border-radius: 12px;
  font-weight: 800;
}

.idh-table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid #dbe4ef;
  background: #ffffff;
}

.idh-table {
  margin-bottom: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
}

.idh-table thead th {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #dbe4ef;
}

.idh-table tbody td {
  color: #334155;
  vertical-align: middle;
}

.idh-empty-row {
  text-align: center;
  color: #64748b !important;
  padding: 1.3rem !important;
}

.idh-message {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  position: relative;
  z-index: 2;
}

.idh-message--success {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.idh-message--error {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

.fade-in {
  animation: idhFadeIn 180ms ease-in-out;
}

@keyframes idhFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================
   Responsive
================================ */

@media (max-width: 900px) {
  .idh-layout {
    grid-template-columns: 1fr;
  }

  .idh-module-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .idh-module-badge {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    font-size: 1.1rem;
  }
}

@media (max-width: 700px) {
  .idh-upload-box {
    grid-template-columns: 1fr;
  }

  .idh-button {
    width: 100%;
  }

  .idh-report-frame {
    min-height: 680px;
  }
}

@media (max-width: 640px) {
  .idh-page {
    padding: 1rem 0.8rem 3rem;
  }

  .idh-module-header {
    padding: 1.35rem;
  }

  .idh-welcome-card,
  .idh-content-card {
    padding: 1.35rem;
  }

  .idh-welcome-card h1,
  .idh-module-header h1 {
    font-size: 1.35rem;
  }
}