/* =====================================================
   NORMOGRAMA – Outsourcing  |  Diseño Premium v3
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #E8000D;
  --red-dark:   #B5000A;
  --red-light:  #FF3B47;
  --red-bg:     #FFF2F3;
  --red-glass:  rgba(232,0,13,.08);
  --black:      #0A0A0F;
  --dark:       #161620;
  --gray-900:   #1A1A2E;
  --gray-700:   #3D3D56;
  --gray-500:   #6B7280;
  --gray-300:   #D1D5DB;
  --gray-100:   #F3F4F6;
  --bg:         #F0F2F8;
  --surface:    #FFFFFF;
  --surface-2:  #F8F9FC;
  --border:     #E5E7EB;
  --border-dk:  #CBD5E1;
  --text:       #0F172A;
  --text-soft:  #64748B;
  --text-muted: #94A3B8;
  --si-bg:     #DCFCE7; --si-color:  #14532D; --si-border: #86EFAC;
  --no-bg:     #FEE2E2; --no-color:  #7F1D1D; --no-border: #FCA5A5;
  --inf-bg:    #FEF3C7; --inf-color: #78350F; --inf-border: #FCD34D;
  --cum-bg:    #DBEAFE; --cum-color: #1E3A8A; --cum-border: #93C5FD;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.04);
  --shadow:    0 4px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
  --shadow-md: 0 8px 24px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 20px 48px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.08);
  --transition: .2s cubic-bezier(.4,0,.2,1);
  --transition-slow: .35s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════ */
.site-header {
  background: linear-gradient(135deg, #C0000A 0%, var(--red) 50%, #FF1A24 100%);
  position: sticky; top: 0; z-index: 300;
  box-shadow: 0 4px 20px rgba(200,0,10,.35);
}
.site-header::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px; background: rgba(255,255,255,.15);
}
.header-inner {
  max-width: 1760px; margin: auto; padding: 10px 36px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.header-logo { display: flex; align-items: center; gap: 20px; }
.logo-img { height: 60px; width: auto; object-fit: contain; mix-blend-mode: screen; filter: brightness(1.05); }
.header-divider { width: 1px; height: 44px; background: rgba(255,255,255,.2); flex-shrink: 0; }
.header-title h1 {
  font-size: 1.2rem; font-weight: 800; color: #fff;
  letter-spacing: -.3px; line-height: 1.2;
}
.header-title p { font-size: .72rem; color: rgba(255,255,255,.75); margin-top: 3px; font-weight: 400; letter-spacing: .2px; }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.header-meta {
  font-size: .7rem; color: rgba(255,255,255,.85); font-weight: 500;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  padding: 5px 14px; border-radius: 20px; white-space: nowrap; backdrop-filter: blur(4px);
}
.btn-edit-mode {
  padding: 7px 16px; background: rgba(255,255,255,.12); color: #fff;
  border: 1.5px solid rgba(255,255,255,.35); border-radius: var(--radius-sm);
  font-size: .75rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all var(--transition); backdrop-filter: blur(4px); letter-spacing: .3px;
}
.btn-edit-mode:hover { background: rgba(255,255,255,.24); border-color: rgba(255,255,255,.6); }
.btn-edit-mode.active { background: #fff; color: var(--red); border-color: #fff; font-weight: 700; }

/* ══════════════════════════════════════════════════════
   INTRO – Hero premium
══════════════════════════════════════════════════════ */
.intro-section { background: var(--surface); border-bottom: 1px solid var(--border); }

/* ── Hero Banner ── */
.hero-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0D0D0D 0%, #1A0000 40%, #2A0000 70%, #0D0D0D 100%);
  padding: 60px 36px;
}
.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; }
.hero-shape {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,0,13,.25) 0%, transparent 70%);
}
.hero-shape.s1 { width: 600px; height: 600px; top: -200px; right: -100px; }
.hero-shape.s2 { width: 300px; height: 300px; bottom: -100px; left: 200px; background: radial-gradient(circle, rgba(255,50,50,.1) 0%, transparent 70%); }
.hero-shape.s3 { width: 200px; height: 200px; top: 20px; left: -60px; background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%); }

.hero-inner {
  max-width: 1760px; margin: 0 auto; position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 48px;
}
.hero-content { flex: 1; max-width: 620px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(232,0,13,.15); border: 1px solid rgba(232,0,13,.35);
  color: #FF6B6B; font-size: .72rem; font-weight: 700;
  padding: 5px 14px; border-radius: 20px; letter-spacing: .8px;
  text-transform: uppercase; margin-bottom: 18px;
}
.hero-eyebrow::before { content: ''; width: 6px; height: 6px; background: var(--red); border-radius: 50%; display: inline-block; }
.hero-title {
  font-size: 2.6rem; font-weight: 800; color: #fff; line-height: 1.15;
  letter-spacing: -1px; margin-bottom: 16px;
}
.hero-title-accent {
  background: linear-gradient(135deg, var(--red) 0%, #FF6B6B 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: .95rem; color: rgba(255,255,255,.65); line-height: 1.8;
  margin-bottom: 24px; font-weight: 400;
}
.hero-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-pill {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.75); font-size: .75rem; font-weight: 500;
  padding: 7px 16px; border-radius: 20px; backdrop-filter: blur(4px);
  cursor: pointer; font-family: inherit;
  transition: all var(--transition);
}
.hero-pill:hover {
  background: var(--red); border-color: var(--red);
  color: #fff; transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(232,0,13,.35);
}
.hero-pill.active {
  background: var(--red); border-color: var(--red); color: #fff;
  box-shadow: 0 4px 14px rgba(232,0,13,.35);
}

/* Tarjeta flotante visual */
.hero-visual { position: relative; width: 300px; flex-shrink: 0; }
.hero-card-float {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 18px 20px; backdrop-filter: blur(8px);
  display: flex; flex-direction: column; gap: 10px;
}
.hcf-header { display: flex; gap: 6px; margin-bottom: 4px; }
.hcf-dot    { width: 10px; height: 10px; border-radius: 50%; }
.hcf-dot.red    { background: #FF5F57; }
.hcf-dot.yellow { background: #FEBC2E; }
.hcf-dot.green  { background: #28C840; }
.hcf-row { height: 8px; background: rgba(255,255,255,.15); border-radius: 4px; }
.hcf-title { height: 12px; background: rgba(255,255,255,.3); width: 70%; border-radius: 4px; }
.w80 { width: 80%; } .w60 { width: 60%; } .w90 { width: 90%; } .w70 { width: 70%; } .w50 { width: 50%; }
.hcf-divider { height: 1px; background: rgba(255,255,255,.1); }
.hcf-badges { display: flex; gap: 8px; }
.hcf-badge {
  font-size: .65rem; font-weight: 700; padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .4px;
}
.hcf-badge.green  { background: rgba(34,197,94,.2);  color: #4ADE80; border: 1px solid rgba(34,197,94,.3); }
.hcf-badge.orange { background: rgba(251,146,60,.2); color: #FB923C; border: 1px solid rgba(251,146,60,.3); }

.hero-stat-float {
  position: absolute; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15); border-radius: 12px;
  padding: 10px 16px; backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.hs1 { top: -20px; right: -24px; }
.hs2 { bottom: -18px; left: -20px; }
.hs-num  { font-size: 1.4rem; font-weight: 800; color: #fff; line-height: 1; }
.hs-lbl  { font-size: .65rem; color: rgba(255,255,255,.55); font-weight: 500; }
.hs-icon { font-size: 1.1rem; color: #28C840; }

/* ── Barra descripción ── */
.intro-desc-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.intro-desc-inner {
  max-width: 1760px; margin: 0 auto; padding: 22px 36px;
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
}
.intro-desc-text { flex: 1; min-width: 260px; }
.intro-desc-text strong { display: block; font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.intro-desc-text p { font-size: .82rem; color: var(--text-soft); line-height: 1.65; margin: 0; }
.intro-desc-text p strong { display: inline; font-weight: 600; color: var(--text); }
.intro-desc-divider { width: 1px; height: 60px; background: var(--border); flex-shrink: 0; }
.intro-desc-stats { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.ids-item { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ids-num  { font-size: 1.6rem; font-weight: 800; color: var(--red); line-height: 1; }
.ids-lbl  { font-size: .66rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.ids-sep  { width: 1px; height: 40px; background: var(--border); }

/* ── Tarjetas features ── */
.feature-cards { background: var(--bg); padding: 28px 0; }
.feature-cards-inner {
  max-width: 1760px; margin: 0 auto; padding: 0 36px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.fc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 22px;
  display: flex; align-items: flex-start; gap: 16px;
  box-shadow: var(--shadow-xs); cursor: default;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  position: relative; overflow: hidden;
}
.fc-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--border); transition: background var(--transition);
}
.fc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: transparent; }
.fc-card:hover::after { background: var(--red); }

.fc-icon-wrap {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.fc-icon-wrap svg { width: 22px; height: 22px; }
.fc-red    { background: #FEE2E2; color: #DC2626; }
.fc-green  { background: #DCFCE7; color: #16A34A; }
.fc-blue   { background: #DBEAFE; color: #1D4ED8; }
.fc-orange { background: #FEF3C7; color: #D97706; }
.fc-purple { background: #EDE9FE; color: #7C3AED; }
.fc-dark   { background: #F1F5F9; color: #334155; }

.fc-body { flex: 1; }
.fc-body strong { display: block; font-size: .88rem; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.fc-body span   { font-size: .78rem; color: var(--text-soft); line-height: 1.55; }
.fc-arrow { color: var(--text-muted); font-size: 1rem; align-self: center; transition: transform var(--transition), color var(--transition); }
.fc-card:hover .fc-arrow { transform: translateX(4px); color: var(--red); }

@media (max-width: 1100px) { .feature-cards-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px)  {
  .feature-cards-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .hero-title  { font-size: 1.8rem; }
  .hero-banner { padding: 40px 16px; }
  .intro-desc-divider, .intro-desc-stats { display: none; }
  .intro-desc-inner { padding: 18px 16px; }
  .feature-cards-inner { padding: 0 16px; }
}

/* ══════════════════════════════════════════════════════
   SECCIONES NAV – Chip Style
══════════════════════════════════════════════════════ */
.sections-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--red);
  position: sticky; top: 82px; z-index: 250;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.sections-nav-inner {
  max-width: 1760px; margin: auto; padding: 0 36px;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; min-height: 56px;
}
.sections-label {
  font-size: .65rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 1px; white-space: nowrap; font-weight: 700;
  border-left: 2px solid var(--red); padding-left: 8px;
  margin-right: 4px;
}
.sections-tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Wrap de cada chip */
.section-tab-wrap { display: inline-flex; align-items: center; }

/* Chip base */
.section-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  background: var(--gray-100); color: var(--text-soft);
  border: 1.5px solid var(--border-dk);
  font-size: .81rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all var(--transition); white-space: nowrap; letter-spacing: .2px;
  position: relative;
}
.section-tab:hover:not(.active) {
  background: #F0F0F0;
  border-color: var(--gray-300);
  color: var(--text);
}
/* Chip activo */
.section-tab.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 2px 10px rgba(232,0,13,.3);
}

/* Botón × dentro del chip */
.section-tab-del {
  display: none;
  width: 16px; height: 16px; border-radius: 50%;
  border: none; cursor: pointer; font-family: inherit;
  font-size: .7rem; font-weight: 700; line-height: 1;
  align-items: center; justify-content: center; flex-shrink: 0;
  transition: all var(--transition);
  padding: 0; margin-left: 2px;
  /* Color según estado del chip */
  background: rgba(0,0,0,.12);
  color: inherit;
}
.section-tab-del:hover { background: rgba(0,0,0,.25); transform: scale(1.1); }
/* X dentro del chip activo (rojo) */
.section-tab.active + .section-tab-del,
.section-tab-wrap .section-tab.active ~ .section-tab-del {
  background: rgba(255,255,255,.25);
  color: #fff;
}
.section-tab-wrap .section-tab.active ~ .section-tab-del:hover {
  background: rgba(255,255,255,.45);
}
body.edit-mode .section-tab-del { display: inline-flex; }

/* Botón Nueva sección */
.btn-upload-section {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 18px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border-dk);
  border-radius: 20px;
  font-size: .78rem; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: all var(--transition); white-space: nowrap; letter-spacing: .2px;
}
.btn-upload-section:hover {
  background: var(--red); color: #fff;
  border-color: var(--red);
  box-shadow: 0 2px 10px rgba(232,0,13,.25);
}

/* ══════════════════════════════════════════════════════
   DASHBOARD
══════════════════════════════════════════════════════ */
.dashboard { padding: 24px 36px 0; max-width: 1760px; margin: 0 auto; }
.dashboard-inner { display: flex; gap: 16px; flex-wrap: wrap; align-items: stretch; }
.stats-grid { display: flex; gap: 12px; flex-wrap: wrap; flex: 1; min-width: 280px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: flex-start;
  flex: 1; min-width: 100px; position: relative; overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--border-dk); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 60px; height: 60px; border-radius: 50%;
  opacity: .05; transform: translate(20px,-20px);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.stat-card.stat-total::before { background: var(--gray-900); }
.stat-card.stat-total::after  { background: var(--gray-900); }
.stat-card.stat-all::before   { background: var(--black); }
.stat-card.stat-all::after    { background: var(--black); }
.stat-card.stat-si::before    { background: #16A34A; }
.stat-card.stat-si::after     { background: #16A34A; }
.stat-card.stat-no::before    { background: var(--red); }
.stat-card.stat-no::after     { background: var(--red); }
.stat-card.stat-inf::before   { background: #D97706; }
.stat-card.stat-inf::after    { background: #D97706; }
.stat-card.stat-pend::before  { background: #6366F1; }
.stat-card.stat-pend::after   { background: #6366F1; }
.stat-num {
  font-size: 2.2rem; font-weight: 800; color: var(--text);
  line-height: 1; letter-spacing: -1px; margin-bottom: 4px;
}
.stat-card.stat-no  .stat-num { color: var(--red); }
.stat-card.stat-all .stat-num { color: var(--text); }
.stat-label {
  font-size: .68rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .8px; font-weight: 600;
}

.compliance-panel {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 22px 26px; box-shadow: var(--shadow-sm);
  flex: 2; min-width: 240px; display: flex; flex-direction: column;
  justify-content: center; gap: 14px; border: 1px solid var(--border);
}
.compliance-header { display: flex; justify-content: space-between; align-items: center; }
.compliance-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-soft); }
.compliance-pct   { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.progress-track {
  height: 10px; background: var(--gray-100); border-radius: 10px;
  overflow: hidden; display: flex; gap: 1px;
}
.progress-bar { height: 100%; transition: width .7s cubic-bezier(.4,0,.2,1); }
.bar-si  { background: linear-gradient(90deg, #16A34A, #22C55E); }
.bar-inf { background: linear-gradient(90deg, #D97706, #F59E0B); }
.bar-no  { background: linear-gradient(90deg, var(--red-dark), var(--red)); }
.progress-legend { display: flex; gap: 16px; }
.leg { font-size: .68rem; font-weight: 600; color: var(--text-soft); display: flex; align-items: center; gap: 6px; }
.leg::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.leg-si::before  { background: #22C55E; }
.leg-inf::before { background: #F59E0B; }
.leg-no::before  { background: var(--red); }

/* ══════════════════════════════════════════════════════
   TOOLBAR
══════════════════════════════════════════════════════ */
.toolbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 14px 36px;
  position: sticky; top: 132px; z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  margin-top: 20px;
}
.toolbar-inner { max-width: 1760px; margin: auto; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

.search-wrap { display: flex; align-items: center; flex: 3; min-width: 220px; position: relative; }
.search-icon { position: absolute; left: 12px; width: 15px; height: 15px; pointer-events: none; color: var(--text-muted); }
.search-wrap input {
  width: 100%; padding: 9px 36px 9px 36px;
  border: 1.5px solid var(--border-dk); border-radius: var(--radius);
  font-size: .87rem; outline: none; color: var(--text);
  background: var(--surface-2); font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.search-wrap input:focus {
  border-color: var(--red); box-shadow: 0 0 0 3px rgba(232,0,13,.1);
  background: var(--surface);
}
.search-wrap input::placeholder { color: var(--text-muted); }
.btn-clear {
  position: absolute; right: 8px; background: none; border: none;
  color: var(--text-muted); cursor: pointer; padding: 4px; display: flex;
  align-items: center; border-radius: 50%;
  transition: color var(--transition), background var(--transition);
}
.btn-clear svg { width: 13px; height: 13px; }
.btn-clear:hover { color: var(--red); background: var(--red-bg); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label {
  font-size: .64rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px;
}
.filter-group select {
  padding: 8px 10px; border: 1.5px solid var(--border-dk);
  border-radius: var(--radius); font-size: .82rem; background: var(--surface-2);
  color: var(--text); cursor: pointer; outline: none; font-family: inherit;
  min-width: 130px; max-width: 200px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.filter-group select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(232,0,13,.1); }

.toolbar-actions { display: flex; gap: 8px; margin-left: auto; align-items: flex-end; }
.btn-action {
  padding: 9px 18px; border: none; border-radius: var(--radius);
  font-size: .82rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all var(--transition); white-space: nowrap; letter-spacing: .2px;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary   { background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(232,0,13,.3); }
.btn-primary:hover { background: var(--red-dark); box-shadow: 0 4px 14px rgba(232,0,13,.4); transform: translateY(-1px); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1.5px solid var(--border-dk); }
.btn-secondary:hover { background: var(--red); color: #fff; border-color: var(--red); transform: translateY(-1px); }
.btn-danger    { background: #DC2626; color: #fff; }
.btn-danger:hover { background: #991B1B; transform: translateY(-1px); }

/* ══════════════════════════════════════════════════════
   GRÁFICAS
══════════════════════════════════════════════════════ */
.charts-section { max-width: 1760px; margin: 20px auto 0; padding: 0 36px; }
.charts-inner { display: grid; grid-template-columns: 1fr 1fr 1fr 2fr; gap: 16px; }
.chart-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 20px 22px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.chart-card:hover { box-shadow: var(--shadow-md); }
.chart-card h3 {
  font-size: .7rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 7px;
}
.chart-card h3::before {
  content: ''; display: inline-block; width: 3px; height: 14px;
  background: var(--red); border-radius: 3px;
}
.chart-wrap { position: relative; height: 185px; }
@media (max-width: 1300px) { .charts-inner { grid-template-columns: 1fr 1fr 1fr; } .chart-card:last-child { grid-column: span 3; } }
@media (max-width: 900px)  { .charts-inner { grid-template-columns: 1fr 1fr; } .chart-card:last-child { grid-column: span 2; } }
@media (max-width: 640px)  { .charts-inner { grid-template-columns: 1fr; } .chart-card:last-child { grid-column: span 1; } }

/* ══════════════════════════════════════════════════════
   RESULTS BAR
══════════════════════════════════════════════════════ */
.results-bar { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-top: 16px; }
.results-bar-inner { max-width: 1760px; margin: auto; padding: 0 36px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; flex-wrap: wrap; }

/* Pestañas de vista */
.view-tabs { display: flex; gap: 2px; }
.view-tab {
  padding: 13px 20px; background: transparent; border: none;
  border-bottom: 3px solid transparent; font-size: .82rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer; font-family: inherit;
  transition: all var(--transition); white-space: nowrap; display: flex; align-items: center; gap: 7px;
}
.view-tab:hover  { color: var(--text); background: var(--gray-100); }
.view-tab.active { color: var(--red); border-bottom-color: var(--red); }
.view-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--inf-bg); color: var(--inf-color); border: 1px solid var(--inf-border);
  font-size: .66rem; font-weight: 700; padding: 1px 7px; border-radius: 20px; min-width: 22px;
}
.tab-count-pending { background: var(--no-bg); color: var(--no-color); border-color: var(--no-border); }
.view-tab.active .view-tab-count { background: var(--red); color: #fff; border-color: var(--red); }
.results-count { font-size: .78rem; color: var(--text-soft); font-weight: 500; }
.results-right { display: flex; align-items: center; gap: 10px; }
.per-page-label { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
.results-right select { padding: 4px 8px; border: 1.5px solid var(--border-dk); border-radius: var(--radius-sm); font-size: .78rem; background: var(--surface); cursor: pointer; outline: none; font-family: inherit; }
.results-right select:focus { border-color: var(--red); }
.btn-reset { background: none; border: 1.5px solid var(--border-dk); padding: 5px 14px; border-radius: 20px; cursor: pointer; font-size: .73rem; font-weight: 600; color: var(--text-soft); font-family: inherit; transition: all var(--transition); }
.btn-reset:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ══════════════════════════════════════════════════════
   TABLA
══════════════════════════════════════════════════════ */
.table-section { max-width: 1760px; margin: 10px auto 0; padding: 0 36px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .82rem; table-layout: fixed; }

thead tr {
  background: linear-gradient(135deg, #B5000A 0%, var(--red) 100%);
}
thead th {
  padding: 13px 12px; text-align: left; font-weight: 700;
  font-size: .7rem; letter-spacing: .5px; text-transform: uppercase;
  white-space: normal; word-break: break-word; line-height: 1.3;
  border-right: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.95);
  user-select: none;
}
thead th:last-child { border-right: none; }
thead th.sortable { cursor: pointer; transition: background var(--transition); }
thead th.sortable:hover { background: rgba(0,0,0,.15); }
.sort-icon { display: inline-block; width: 12px; text-align: center; opacity: .35; font-style: normal; font-size: .7em; }
thead th.sorted-asc  .sort-icon::after { content: ' ▲'; opacity: 1; }
thead th.sorted-desc .sort-icon::after { content: ' ▼'; opacity: 1; }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:last-child  { border-bottom: none; }
tbody tr:nth-child(even) { background: #FAFBFD; }
tbody tr:hover { background: var(--red-bg) !important; }

td { padding: 11px 12px; vertical-align: middle; line-height: 1.45; overflow: hidden; font-size: .82rem; color: var(--text); }
td.loading { text-align: center; padding: 70px 20px; color: var(--text-muted); font-size: .95rem; }

.col-norma  { width: 10%; } .col-anio  { width: 5%; text-align: center; }
.col-ente   { width: 14%; } .col-tema  { width: 18%; }
.col-art    { width: 11%; } .col-estado{ width: 10%; text-align: center; }
.col-tipo   { width: 10%; text-align: center; } .col-acc { width: 9%; text-align: center; }

.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 0; }
td.truncate { cursor: default; }
mark { background: #FEF08A; color: #713F12; border-radius: 3px; padding: 0 2px; font-weight: 600; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 20px; font-size: .69rem; font-weight: 700;
  letter-spacing: .3px; text-transform: uppercase;
  border: 1.5px solid transparent; white-space: nowrap;
}
.badge-IMPLEMENTADA { background: var(--si-bg);  color: var(--si-color);  border-color: var(--si-border); }
.badge-NO_APLICA    { background: var(--no-bg);  color: var(--no-color);  border-color: var(--no-border); }
.badge-INFORMATIVA  { background: var(--inf-bg); color: var(--inf-color); border-color: var(--inf-border); }
.badge-CUMPLIMIENTO { background: var(--cum-bg); color: var(--cum-color); border-color: var(--cum-border); }
.badge-             { background: var(--gray-100); color: var(--gray-500); border-color: var(--gray-300); }

/* BOTONES FILA */
.row-actions { display: flex; gap: 5px; justify-content: center; align-items: center; flex-wrap: wrap; }
.btn-detail, .btn-edit-row, .btn-delete-row {
  background: var(--surface-2); border: 1.5px solid var(--border-dk);
  border-radius: var(--radius-sm); padding: 4px 10px;
  font-size: .71rem; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all var(--transition); color: var(--text-soft);
}
.btn-detail:hover    { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 2px 8px rgba(232,0,13,.3); }
.btn-edit-row        { display: none; }
.btn-edit-row:hover  { background: #1D4ED8; color: #fff; border-color: #1D4ED8; }
.btn-delete-row      { display: none; }
.btn-delete-row:hover{ background: #DC2626; color: #fff; border-color: #DC2626; }
body.edit-mode .btn-edit-row, body.edit-mode .btn-delete-row { display: inline-flex; }

/* ══════════════════════════════════════════════════════
   PAGINACIÓN
══════════════════════════════════════════════════════ */
.pagination-wrap { max-width: 1760px; margin: 14px auto 48px; padding: 0 36px; }
.pagination { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.page-btn {
  padding: 6px 12px; border: 1.5px solid var(--border-dk);
  background: var(--surface); border-radius: var(--radius-sm);
  cursor: pointer; font-size: .79rem; font-weight: 500;
  color: var(--text); font-family: inherit; transition: all var(--transition);
}
.page-btn:hover:not(:disabled) { background: var(--red); color: #fff; border-color: var(--red); transform: translateY(-1px); }
.page-btn.active { background: var(--red); color: #fff; border-color: var(--red); font-weight: 700; box-shadow: 0 2px 8px rgba(232,0,13,.3); }
.page-btn:disabled { opacity: .3; cursor: default; }
.page-info { font-size: .76rem; color: var(--text-muted); margin: 0 6px; font-weight: 500; }
.page-ellipsis { padding: 6px 3px; color: var(--text-muted); font-size: .8rem; }

/* ══════════════════════════════════════════════════════
   MODALES
══════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(10,10,20,.55); z-index: 1000;
  align-items: center; justify-content: center;
  padding: 24px; backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface); border-radius: var(--radius-xl);
  max-width: 860px; width: 100%; max-height: 92vh; overflow-y: auto;
  padding: 32px 36px; position: relative;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .22s cubic-bezier(.34,1.56,.64,1);
  border: 1px solid var(--border);
}
.modal-sm { max-width: 440px; }
@keyframes fadeUp { from { transform: translateY(20px) scale(.97); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.modal-close {
  position: absolute; top: 16px; right: 18px;
  background: var(--gray-100); border: none; border-radius: 50%;
  width: 30px; height: 30px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close svg { width: 13px; height: 13px; color: var(--text-soft); }
.modal-close:hover { background: var(--red); transform: rotate(90deg); }
.modal-close:hover svg { color: #fff; }

.modal-header { margin-bottom: 22px; padding-right: 40px; padding-bottom: 16px; border-bottom: 2px solid var(--border); }
.modal-tag {
  display: inline-flex; align-items: center;
  background: var(--red); color: #fff;
  font-size: .64rem; font-weight: 700; padding: 3px 12px;
  border-radius: 20px; letter-spacing: .5px; text-transform: uppercase; margin-bottom: 8px;
}
.modal-tag-danger { background: #DC2626; }
#modalTitle { font-size: 1.1rem; font-weight: 800; color: var(--text); line-height: 1.35; letter-spacing: -.3px; }

.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modal-field { display: flex; flex-direction: column; gap: 6px; }
.modal-field.full { grid-column: 1 / -1; }
.modal-field label {
  font-size: .64rem; font-weight: 700; color: var(--red);
  text-transform: uppercase; letter-spacing: .7px;
}
.modal-field p {
  font-size: .87rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); padding: 11px 14px;
  border-radius: var(--radius); border-left: 3px solid var(--border-dk);
  color: var(--text); margin: 0; border: 1px solid var(--border);
}
.modal-field p.badge-field { background: transparent; padding: 0; border: none; }
.modal-field input, .modal-field textarea, .modal-field select {
  padding: 9px 12px; border: 1.5px solid var(--border-dk);
  border-radius: var(--radius); font-size: .85rem; color: var(--text);
  background: var(--surface-2); font-family: inherit; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.modal-field input:focus, .modal-field textarea:focus, .modal-field select:focus {
  border-color: var(--red); background: var(--surface); box-shadow: 0 0 0 3px rgba(232,0,13,.1);
}
.modal-field textarea { resize: vertical; min-height: 80px; }
.modal-footer { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.login-desc { font-size: .87rem; color: var(--text-soft); margin-bottom: 18px; line-height: 1.6; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input { padding: 10px 14px; border: 1.5px solid var(--border-dk); border-radius: var(--radius); font-size: .9rem; outline: none; font-family: inherit; background: var(--surface-2); }
.login-form input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(232,0,13,.1); background: var(--surface); }
.login-error { font-size: .78rem; color: var(--red); min-height: 16px; font-weight: 500; }
.login-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ══════════════════════════════════════════════════════
   SCROLL TOP & TOAST
══════════════════════════════════════════════════════ */
.scroll-top {
  position: fixed; bottom: 28px; right: 28px;
  width: 42px; height: 42px; background: var(--red); color: #fff;
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(232,0,13,.4);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  z-index: 500;
}
.scroll-top svg { width: 16px; height: 16px; }
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { background: var(--red-dark); transform: translateY(-3px); box-shadow: 0 6px 20px rgba(232,0,13,.5); }

.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--gray-900); color: #fff;
  padding: 11px 24px; border-radius: 24px;
  font-size: .83rem; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s; z-index: 2000;
  border-left: 4px solid var(--red); box-shadow: var(--shadow-lg);
  white-space: nowrap; max-width: 90vw; font-family: inherit;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .header-inner, .intro-inner, .dashboard,
  .sections-nav-inner, .toolbar, .results-bar-inner,
  .table-section, .pagination-wrap, .charts-section {
    padding-left: 16px !important; padding-right: 16px !important;
  }
  .toolbar-inner { flex-direction: column; align-items: stretch; }
  .toolbar-actions { justify-content: flex-end; }
  .header-divider, .header-title { display: none; }
}
@media (max-width: 640px) {
  .logo-img    { height: 46px; }
  .stat-card   { padding: 14px 16px; }
  .stat-num    { font-size: 1.8rem; }
  .modal-grid  { grid-template-columns: 1fr; }
  .modal-box   { padding: 20px; }
  .intro-inner { padding: 20px; }
}

/* ══════════════════════════════════════════════════════
   SCROLLBAR PERSONALIZADO
══════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--border-dk); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* Iconos SVG intro */
.intro-icon-svg { width: 28px; height: 28px; color: var(--red); margin-bottom: 2px; }

.upload-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
