/* ═══════════════════════════════════════════════════════════
   SGI-ASG · Sistema de Gestión Interno ASG Medical
   styles.css · v1.0 · 2026
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800&family=Sora:wght@400;600;700;800&display=swap');

/* ─── VARIABLES ─────────────────────────────────────────── */
:root {
  --azul:         #1B3A8C;
  --azul-med:     #2457C5;
  --azul-light:   #D6E4F7;
  --azul-pale:    #EBF3FC;
  --naranja:      #F47920;
  --naranja-l:    #FFF0E6;
  --verde:        #1A7A3C;
  --verde-l:      #D4EDDA;
  --rojo:         #B92C2C;
  --rojo-l:       #FDECEA;
  --amarillo:     #D4930A;
  --amarillo-l:   #FFF8E1;
  --gris-bg:      #F2F5FB;
  --gris-border:  #E2E8F4;
  --gris-text:    #64748B;
  --texto:        #0F1F3D;
  --blanco:       #FFFFFF;

  --shadow-sm:    0 1px 4px rgba(27,58,140,0.08);
  --shadow:       0 4px 20px rgba(27,58,140,0.10);
  --shadow-md:    0 8px 32px rgba(27,58,140,0.14);
  --shadow-hover: 0 12px 40px rgba(27,58,140,0.18);

  --radius:       14px;
  --radius-sm:    8px;
  --radius-xs:    5px;

  --transition:   0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito Sans', system-ui, sans-serif;
  background: var(--gris-bg);
  color: var(--texto);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── HEADER ────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--azul);
  display: flex;
  align-items: center;
  height: 68px;
  padding: 0 28px 0 0;
  box-shadow: 0 2px 20px rgba(0,0,0,0.18);
}

/* Caja blanca solo para el logo */
.header-logo-zone {
  background: var(--blanco);
  height: 100%;
  padding: 0 22px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-right: 3px solid var(--naranja);
  margin-right: 24px;
}

.header-logo-zone img {
  height: 44px;
  width: auto;
  display: block;
}

/* Zona azul — título + versión */
.header-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 8px;
}

.header-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header-brand-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--blanco);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.header-brand-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.version-pill {
  background: var(--naranja);
  color: var(--blanco);
  font-family: 'Sora', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.header-date {
  color: rgba(255,255,255,0.55);
  font-size: 0.75rem;
  white-space: nowrap;
}

/* ─── HERO ──────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-med) 100%);
  padding: 52px 32px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -50px;
  width: 260px; height: 260px;
  background: rgba(244,121,32,0.08);
  border-radius: 50%;
  pointer-events: none;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
  margin-top: 8px;
}

.hero-meta span {
  background: rgba(255,255,255,0.12);
  color: var(--blanco);
  font-size: 0.82rem;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  letter-spacing: 0.01em;
}

.hero h1 {
  font-family: 'Sora', sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--blanco);
  line-height: 1.2;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.hero h1 span { color: var(--naranja); }

.hero p {
  color: rgba(255,255,255,0.78);
  font-size: 0.97rem;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

/* ─── MAIN CONTAINER ────────────────────────────────────── */
.main-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 28px 72px;
}

/* ─── SECTION LABEL ─────────────────────────────────────── */
.section-label {
  font-family: 'Sora', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--azul);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gris-border);
}

.section-label::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--naranja);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ─── VIEWER PANEL ──────────────────────────────────────── */
.viewer-panel {
  background: var(--blanco);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 36px;
  display: none;
  border: 1px solid var(--gris-border);
  animation: slideDown 0.28s var(--transition) both;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.viewer-panel.visible { display: block; }

.viewer-bar {
  background: #afcbf9;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.viewer-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.viewer-area-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
  color: #3f3f3f;
  flex-shrink: 0;
}

.viewer-title {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  color: #3f3f3f;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-xs);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity var(--transition), transform var(--transition);
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-naranja { background: var(--naranja); color: var(--blanco); }
.btn-ghost   { background: rgba(255,255,255,0.14); color: var(--blanco); border: 1px solid rgba(255,255,255,0.2); }

.viewer-body { padding: 0; }

.viewer-iframe {
  width: 100%;
  height: 700px;
  border: none;
  display: block;
}

.viewer-placeholder {
  padding: 56px 32px;
  text-align: center;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  background: var(--azul-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.viewer-placeholder h3 {
  font-family: 'Sora', sans-serif;
  color: var(--azul);
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.viewer-placeholder p {
  color: var(--gris-text);
  font-size: 0.88rem;
  line-height: 1.7;
  max-width: 400px;
  margin: 0 auto;
}

.placeholder-badge {
  display: inline-block;
  margin-top: 18px;
  background: var(--amarillo-l);
  color: var(--amarillo);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

/* ─── AREAS GRID ────────────────────────────────────────── */
.areas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ─── AREA CARD ─────────────────────────────────────────── */
.area-card {
  background: var(--blanco);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1.5px solid var(--gris-border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.area-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--azul-light);
}

.area-card-header {
  padding: 18px 20px 15px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--gris-border);
}

/* Ícono SVG por área — fondo coloreado */
.area-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.area-icon-wrap svg {
  width: 22px;
  height: 22px;
}


.area-card-name {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--azul);
  line-height: 1.3;
}

.area-card-sub {
  font-size: 0.72rem;
  color: var(--gris-text);
  margin-top: 1px;
}

/* ─── DOC LIST ──────────────────────────────────────────── */
.doc-list {
  list-style: none;
  padding: 6px 0;
}

.doc-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--gris-border);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

.doc-row:last-child { border-bottom: none; }

.doc-row:hover {
  background: var(--azul-pale);
}

.doc-row:hover .doc-name { color: var(--azul); }

.doc-row::after {
  content: '›';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gris-text);
  font-size: 1rem;
  opacity: 0;
  transition: opacity var(--transition), right var(--transition);
}

.doc-row:hover::after {
  opacity: 1;
  right: 12px;
}

/* Tags de tipo */
.doc-tag {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  margin-top: 2px;
  line-height: 1;
}

.tag-flujo    { background: #DBEAFE; color: #1D4ED8; }
.tag-proc     { background: var(--verde-l); color: var(--verde); }
.tag-norm     { background: var(--naranja-l); color: #C05600; }
.tag-excep    { background: var(--rojo-l); color: var(--rojo); }
.tag-doc      { background: #F3F0FF; color: #5B21B6; }

.doc-content { flex: 1; min-width: 0; }

.doc-name {
  font-size: 0.82rem;
  color: var(--texto);
  font-weight: 600;
  line-height: 1.4;
  transition: color var(--transition);
}

.doc-desc {
  font-size: 0.73rem;
  color: var(--gris-text);
  margin-top: 2px;
  line-height: 1.4;
}

/* ─── PENDING BADGE ─────────────────────────────────────── */
.pending-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amarillo);
  flex-shrink: 0;
  margin-top: 6px;
}

.ready-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--verde);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ─── FOOTER ────────────────────────────────────────────── */
.site-footer {
  background: var(--azul);
  padding: 22px 28px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-text {
  color: rgba(255,255,255,0.55);
  font-size: 0.75rem;
  line-height: 1.6;
}

.footer-text strong { color: rgba(255,255,255,0.85); }

.footer-badge {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.65);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.12);
  white-space: nowrap;
}

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-logo-zone { min-width: 0; padding: 0 16px; }
  .header-logo-zone img { height: 36px; }
  .header-main { padding: 0 16px; }
  .header-date { display: none; }
  .header-brand-title { font-size: 0.9rem; }
  .hero h1 { font-size: 1.5rem; }
  .main-wrap { padding: 28px 16px 56px; }
  .areas-grid { grid-template-columns: 1fr; }
  .viewer-iframe { height: 460px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .hero { padding: 36px 16px 32px; }
  .hero h1 { font-size: 1.3rem; }
  .viewer-bar { flex-wrap: wrap; gap: 8px; }
}


.subti { font-size: 17px!important }



/* ─── NORMATIVA GENERAL ─────────────────────────────────── */
.normativa-section {
  background: var(--blanco);
 /* border-top: 3px solid var(--naranja);
  border-bottom: 3px solid var(--naranja);*/
  padding: 28px 32px;
}

.normativa-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.normativa-label {
  font-family: 'Sora', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--naranja);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.normativa-label::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--naranja);
  flex-shrink: 0;
}

.normativa-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.normativa-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gris-bg);
  border: 1.5px solid var(--gris-border);
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  flex: 1 1 170px;
  min-width: 160px;
  max-width: 260px;
}

.normativa-card:hover {
  background: var(--azul-pale);
  border-color: var(--azul-light);
  transform: translateY(-2px);
}

.normativa-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--naranja-l);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.normativa-card-icon svg {
  width: 18px;
  height: 18px;
}

.normativa-card-text {
  font-family: 'Sora', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--texto);
  line-height: 1.3;
}

.normativa-card:hover .normativa-card-text {
  color: var(--azul);
}

@media (max-width: 768px) {
  .normativa-section { padding: 20px 16px; }
  .normativa-grid { gap: 8px; }
  .normativa-card { flex: 1 1 140px; min-width: 130px; }
}