:root {
  --navy: #0b2d4f;
  --navy-2: #123e67;
  --blue: #174c78;
  --gold: #e4b33f;
  --paper: #f2f5f8;
  --white: #fff;
  --line: #dce3ea;
  --muted: #a8b8c8;
  --text: #20364a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--text); background: var(--paper); }
button, a { font: inherit; }
button { cursor: pointer; }

.app { min-height: 100vh; display: grid; grid-template-columns: 19rem minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; color: #eaf1f7; background: var(--navy); border-right: 1px solid rgba(255,255,255,.08); z-index: 20; }
.brand { display: flex; align-items: center; gap: .75rem; min-height: 5.5rem; padding: 1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand__mark { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; flex: 0 0 auto; color: #142d44; background: var(--gold); border-radius: .55rem; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; }
.brand small { margin-top: .35rem; color: var(--muted); font-size: .82rem; }

.nav { flex: 1; overflow-y: auto; padding: .25rem .5rem 1rem; scrollbar-width: thin; }
.nav__group { margin-top: 1rem; }
.nav__group h2 { margin: 0 0 .45rem; padding: 0 .5rem; color: #8ba5bc; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.nav__item { width: 100%; display: flex; align-items: center; gap: .65rem; min-height: 2.7rem; padding: .65rem .65rem; color: #e5edf5; text-align: left; background: transparent; border: 0; border-radius: .55rem; line-height: 1.3; transition: background .18s, color .18s; }
.nav__item span { width: 1rem; flex: 0 0 1rem; text-align: center; }
.nav__item:hover { background: rgba(255,255,255,.08); }
.nav__item.activo { color: #17344d; background: var(--gold); font-weight: 700; }
.sidebar__footer { display: flex; gap: .55rem; align-items: center; min-height: 3.3rem; padding: .85rem 1.2rem; color: var(--muted); border-top: 1px solid rgba(255,255,255,.1); font-size: .82rem; }

.viewer { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.viewer__header { min-height: 4.65rem; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 1rem; padding: .75rem 1.8rem; background: var(--white); border-bottom: 1px solid var(--line); }
.viewer__heading span, .viewer__heading strong { display: block; }
.viewer__heading span { color: #3076a2; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.viewer__heading strong { margin-top: .25rem; font-size: 1rem; }
.menu-toggle { width: 2.4rem; height: 2.4rem; display: none; place-items: center; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: .45rem; }
.open-button { padding: .68rem .9rem; color: var(--white); background: var(--blue); border-radius: .5rem; text-decoration: none; font-weight: 700; white-space: nowrap; }
.open-button:hover { background: var(--navy); }

.viewer__content { flex: 1; min-height: 0; padding: 1.1rem; }
.overview, .frame-wrap { min-height: calc(100vh - 6.85rem); border-radius: .85rem; overflow: hidden; }
.overview { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 8vw, 6rem); color: var(--white); background: linear-gradient(135deg, var(--navy), #174b77); }
.eyebrow { margin: 0 0 1.35rem; color: #7fc1e4; font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.overview h1 { max-width: 56rem; margin: 0; font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.03; letter-spacing: -.035em; }
.overview > p:not(.eyebrow) { max-width: 54rem; margin: 1rem 0 0; color: #d9e5ef; font-size: 1.08rem; line-height: 1.6; }
.metrics { max-width: 48rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 2.2rem 0 0; }
.metrics div { min-height: 5.2rem; padding: 1rem 1.1rem; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: .55rem; }
.metrics dt { color: #c4d5e3; font-size: .78rem; }
.metrics dd { margin: .7rem 0 0; color: var(--white); font-size: 1rem; font-weight: 800; }
.frame-wrap { position: relative; background: var(--white); border: 1px solid var(--line); }
.frame-wrap iframe { width: 100%; height: calc(100vh - 6.85rem); display: block; border: 0; background: var(--white); }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: #597085; background: var(--white); }
.frame-wrap.cargado .loading { display: none; }
.oculto { display: none !important; }
.overlay { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: min(19rem, 86vw); transition: transform .22s ease; }
  .sidebar.abierto { transform: translateX(0); }
  .menu-toggle { display: grid; }
  .overlay { position: fixed; inset: 0; z-index: 15; background: rgba(3,18,31,.55); }
  .overlay.visible { display: block; }
  .viewer__header { padding: .65rem .9rem; }
  .viewer__content { padding: .65rem; }
  .overview, .frame-wrap { min-height: calc(100vh - 5.95rem); }
  .frame-wrap iframe { height: calc(100vh - 5.95rem); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .viewer__header { grid-template-columns: auto minmax(0,1fr); }
  .open-button { grid-column: 1 / -1; text-align: center; }
  .overview { padding: 2rem 1.25rem; justify-content: flex-start; }
  .overview h1 { font-size: 2.35rem; }
  .metrics { grid-template-columns: 1fr; width: 100%; }
}
