/* ===========================================================
   Associació NextGen — Motor de Retos Continuos
   Estilos de la APP (app.html): autenticación + panel
   Reutiliza tokens y componentes base de styles.css
   (.btn, .card, .input, .field, .badge, .rows, .seg, .brand,
    .toast, .icon, y el sprite de icons.js).

   Semántica de color:
     azul   -> organización / plataforma
     violeta-> joven / talento / credencial
     verde  -> validado
   =========================================================== */

body.is-app { overflow-x: hidden; }

/* ===========================================================
   CAMPOS Y CONTROLES
   =========================================================== */

/* Wrappers de icono dentro de inputs */
.input-icon { position: relative; }
.input-icon > .icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.input-icon .input { padding-left: 40px; }

.pw-field .input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; background: transparent; color: var(--gray-2);
  display: grid; place-items: center; border-radius: 8px; transition: .16s;
}
.pw-toggle:hover { color: var(--blue); background: var(--bg-blue); }
.pw-toggle .icon { width: 19px; height: 19px; }

/* Errores de campo */
.field-error { display: none; color: var(--bad); font-size: .8rem; font-weight: 600; }
.field.has-error .field-error { display: block; }
.field.has-error .input { border-color: var(--bad); }
.field.has-error .input:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .14); }

/* Medidor de fuerza de contraseña */
.pw-meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pw-meter-track { flex: 1; height: 6px; border-radius: 999px; background: rgba(8,13,52, .09); overflow: hidden; }
.pw-meter-bar { height: 100%; width: 0; border-radius: 999px; background: var(--bad); transition: width .28s var(--ease), background .28s; }
.pw-meter.is-weak   .pw-meter-bar { width: 34%; background: #DC2626; }
.pw-meter.is-medium .pw-meter-bar { width: 67%; background: #F59E0B; }
.pw-meter.is-strong .pw-meter-bar { width: 100%; background: var(--ok); }
.pw-meter-label { font-size: .76rem; font-weight: 700; color: var(--gray-2); min-width: 56px; text-align: right; }

/* Filas de casilla de verificación */
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: .88rem; color: var(--gray); font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; flex: none; }
.check.terms { align-items: flex-start; line-height: 1.45; }
.check.terms a { color: var(--blue); font-weight: 600; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.link-strong { color: var(--blue); font-weight: 700; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.link-strong:hover { text-decoration: underline; }
.link-muted { color: var(--gray-2); font-size: .86rem; font-weight: 600; background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }
.link-muted:hover { color: var(--blue); }

/* Bloques de campos condicionales del registro (#jovenFields / #orgFields) */
.field-group { display: grid; gap: 16px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.field-group-title { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-2); }
.field-group-title .icon { width: 15px; height: 15px; color: var(--blue); }

/* ===========================================================
   AUTENTICACIÓN
   =========================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.02fr .98fr; }

.auth-aside {
  position: relative; overflow: hidden; color: #fff;
  background: var(--grad-blue); padding: 46px 52px;
  display: flex; flex-direction: column;
  transition: background .35s var(--ease);
}
.auth-aside::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(640px 380px at 92% 112%, rgba(255, 255, 255, .18), transparent 60%),
    radial-gradient(420px 300px at -8% -8%, rgba(255, 255, 255, .12), transparent 58%);
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .brand-next { color: #fff; }
.auth-aside .brand-mark { background: rgba(255, 255, 255, .16); box-shadow: none; }

/* Variante violeta: el visitante ha elegido el perfil "joven" */
.auth-aside[data-role="joven"],
.auth[data-role="joven"] .auth-aside { background: var(--grad-violet); }

.auth-aside-body { margin: auto 0; }
.auth-aside-body h2 { color: #fff; font-size: clamp(1.8rem, 2.6vw, 2.45rem); max-width: 16ch; }
.auth-aside-body p { color: rgba(255, 255, 255, .88); margin-top: 16px; max-width: 42ch; font-size: 1.05rem; }
.auth-points { display: grid; gap: 14px; margin-top: 30px; }
.auth-points li { display: flex; align-items: center; gap: 13px; font-weight: 600; }
.pt-ic { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex: none; }
.pt-ic .icon { width: 19px; height: 19px; color: #fff; }
.auth-aside-foot { margin-top: 30px; font-size: .82rem; color: rgba(255, 255, 255, .62); display: inline-flex; align-items: center; gap: 8px; }
.auth-aside-foot .icon { width: 15px; height: 15px; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--grad-soft); }
.auth-card { width: 100%; max-width: 452px; }
.auth-mini-brand { display: none; justify-content: center; margin-bottom: 18px; }

.auth-tabs { display: flex; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-sm); }
.auth-tab { flex: 1; padding: 11px; border: 0; background: transparent; border-radius: 10px; font-weight: 700; color: var(--gray-2); font-size: .92rem; transition: .16s; }
.auth-tab:hover { color: var(--navy); }
.auth-tab.is-active { background: var(--bg-blue); color: var(--blue); box-shadow: inset 0 0 0 1px rgba(0,103,255, .14); }

.auth-form { margin-top: 22px; display: grid; gap: 16px; }
.auth-form .form-grid { grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 0; }
.auth-head h2 { font-size: 1.5rem; }
.auth-head p { color: var(--gray); margin-top: 6px; }
.auth-switch { text-align: center; color: var(--gray); font-size: .9rem; }

/* Elección de rol en el registro (#signupRole) y conmutador compacto */
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 0; padding: 0; margin: 0; }
.role-switch legend { font-size: .85rem; font-weight: 600; color: var(--navy); margin-bottom: 9px; padding: 0; }
.role-switch label { position: relative; display: block; cursor: pointer; }
.role-switch input { position: absolute; opacity: 0; pointer-events: none; }
.role-switch label > span,
.role-switch .seg-body {
  display: block; padding: 14px 15px; background: #fff;
  border: 1.5px solid var(--line-2); border-radius: 14px; transition: .18s;
}
.role-switch strong { display: block; font-size: .93rem; color: var(--navy); }
.role-switch small { display: block; color: var(--gray-2); font-size: .78rem; line-height: 1.4; margin-top: 2px; }
.role-switch .icon { width: 20px; height: 20px; color: var(--gray-2); margin-bottom: 8px; }
.role-switch label:hover > span,
.role-switch label:hover .seg-body { border-color: rgba(0,103,255, .4); }

.role-switch input:checked + span,
.role-switch input:checked + .seg-body,
.role-switch label:has(input:checked) > span,
.role-switch label:has(input:checked) .seg-body {
  border-color: var(--blue); background: var(--bg-blue); box-shadow: 0 0 0 3px rgba(0,103,255, .1);
}
.role-switch input:checked + span .icon,
.role-switch label:has(input:checked) .icon { color: var(--blue); }

.role-switch input[value="joven"]:checked + span,
.role-switch input[value="joven"]:checked + .seg-body,
.role-switch label:has(input[value="joven"]:checked) > span,
.role-switch label:has(input[value="joven"]:checked) .seg-body {
  border-color: var(--violet); background: var(--violet-bg); box-shadow: 0 0 0 3px rgba(109, 90, 248, .12);
}
.role-switch input[value="joven"]:checked + span .icon,
.role-switch label:has(input[value="joven"]:checked) .icon { color: var(--violet); }
.role-switch input:focus-visible + span,
.role-switch input:focus-visible + .seg-body { box-shadow: var(--ring); }

/* Accesos de demostración (#btnDemoJoven / #btnDemoOrg) */
.auth-demo { display: grid; gap: 10px; margin-top: 4px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.auth-demo-title { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-2); }
.auth-demo-title .icon { width: 15px; height: 15px; color: var(--violet); }
.auth-demo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-demo p { font-size: .8rem; color: var(--gray-2); line-height: 1.45; }

/* ===========================================================
   LAYOUT DE LA APP
   =========================================================== */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

.app-sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  background: var(--navy); display: flex; flex-direction: column; padding: 22px 16px; gap: 10px;
}
.app-brand { padding: 6px 8px 14px; }
.app-sidebar .brand-next { color: #fff; }

.app-nav { display: grid; gap: 4px; }
.app-nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px;
  color: rgba(255, 255, 255, .66); font-weight: 600; font-size: .93rem; transition: background .16s, color .16s;
}
.app-nav-item .icon { width: 20px; height: 20px; }
.app-nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.app-nav-item.is-active { background: rgba(59,140,255, .2); color: #fff; box-shadow: inset 3px 0 0 var(--blue-2); }

/* Contador junto a un ítem del menú (entregas pendientes de evaluar) */
.app-nav-item .nav-count,
.app-nav-item .nav-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: .72rem; font-weight: 800;
  display: inline-grid; place-items: center; line-height: 1; flex: none;
}

/* Variante de rol: el panel del joven vira al acento violeta */
.app-sidebar[data-role="joven"] .app-nav-item.is-active { background: rgba(109, 90, 248, .26); box-shadow: inset 3px 0 0 var(--violet-2); }
.app-sidebar[data-role="joven"] .app-nav-item .nav-count,
.app-sidebar[data-role="joven"] .app-nav-item .nav-badge { background: var(--violet); }
.app-sidebar[data-role="joven"] .avatar,
.app-sidebar[data-role="joven"] ~ .app-main .avatar { background: var(--grad-violet); }
.app-sidebar[data-role="joven"] ~ .app-main .chip-filter.is-active {
  background: var(--violet-bg); color: var(--violet-700); border-color: var(--violet-line);
  box-shadow: inset 0 0 0 1px rgba(109, 90, 248, .18);
}
.app-sidebar[data-role="joven"] ~ .app-main .progress-bar { background: var(--bar, var(--violet)); }

.app-side-foot { margin-top: auto; display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); }
.app-user { display: flex; align-items: center; gap: 11px; padding: 4px 6px; min-width: 0; }
.app-user-meta { min-width: 0; line-height: 1.25; }
.app-user-meta strong { display: block; color: #fff; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-user-meta span { display: block; color: rgba(255, 255, 255, .55); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-logout { color: rgba(255, 255, 255, .82) !important; border-color: rgba(255, 255, 255, .18) !important; background: transparent !important; }
.app-logout:hover { background: rgba(255, 255, 255, .08) !important; color: #fff !important; border-color: rgba(255, 255, 255, .32) !important; }

.app-main { min-width: 0; background: var(--bg-soft); display: flex; flex-direction: column; }
.app-topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 13px 28px; background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-topbar-title { flex: 1; min-width: 0; }
.app-topbar-title h1 { font-size: 1.22rem; }
.app-topbar-title p { color: var(--gray-2); font-size: .85rem; margin-top: 2px; }
.app-topbar-actions { display: flex; align-items: center; gap: 12px; }
.app-burger { display: none; }

/* Distintivo de rol en la barra superior (#roleChip) */
.role-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; color: var(--blue);
  background: var(--bg-blue); border: 1px solid rgba(0,103,255, .16);
}
.role-chip .icon { width: 15px; height: 15px; }
.role-chip[data-role="joven"] { color: var(--violet-700); background: var(--violet-bg); border-color: var(--violet-line); }

.app-content { padding: 28px; max-width: 1080px; width: 100%; margin: 0 auto; flex: 1; }
.app-view { display: none; }
.app-view.is-active { display: block; animation: viewIn .34s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.app-scrim { position: fixed; inset: 0; background: rgba(8,13,52, .45); z-index: 25; opacity: 0; pointer-events: none; transition: opacity .25s; }

/* ---------- Avatar ---------- */
.avatar {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad-blue); color: #fff; font-weight: 800; font-size: .95rem; flex: none; letter-spacing: .02em;
}
.avatar.sm { width: 32px; height: 32px; border-radius: 9px; font-size: .8rem; }
.avatar.lg { width: 58px; height: 58px; border-radius: 17px; font-size: 1.2rem; }

/* ---------- Menú de usuario ---------- */
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 5px;
  border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--navy); font-weight: 700; font-size: .9rem;
  transition: border-color .16s;
}
.user-btn:hover { border-color: var(--blue); }
.user-btn .icon { width: 16px; height: 16px; color: var(--gray-2); }
.user-btn-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.menu.is-open { display: block; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: transparent; border-radius: 9px; color: var(--navy); font-weight: 600; font-size: .9rem; }
.menu button:hover { background: var(--bg-soft); color: var(--blue); }
.menu button .icon { width: 18px; height: 18px; }

/* ===========================================================
   KPIs Y PANELES
   =========================================================== */
.welcome { margin-bottom: 22px; }
.welcome h2 { font-size: 1.45rem; }
.welcome p { color: var(--gray); margin-top: 6px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.kpi-card { position: relative; overflow: hidden; padding: 22px; }
.kpi-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--card-accent, var(--blue)); }
.kpi-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--bg-blue); color: var(--blue); margin-bottom: 14px; }
.kpi-ic .icon { width: 24px; height: 24px; }
.kpi-ic.is-violet { background: var(--violet-bg); color: var(--violet); }
.kpi-ic.is-ok { background: var(--ok-bg); color: var(--ok); }
.kpi-ic.is-warn { background: var(--warn-bg); color: var(--warn); }
.kpi-val { font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1; }
.kpi-label { color: var(--gray-2); font-size: .88rem; font-weight: 600; margin-top: 6px; }

.panel-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { font-size: 1.05rem; }

.activity { display: grid; }
.activity-item { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-blue); color: var(--blue); flex: none; }
.activity-ic.is-ok { background: var(--ok-bg); color: var(--ok); }
.activity-ic.is-bad { background: var(--bad-bg); color: var(--bad); }
.activity-ic.is-warn { background: var(--warn-bg); color: var(--warn); }
.activity-ic.is-violet { background: var(--violet-bg); color: var(--violet); }
.activity-ic .icon { width: 19px; height: 19px; }
.activity-meta { flex: 1; min-width: 0; }
.activity-meta strong { display: block; font-size: .92rem; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-meta span { font-size: .8rem; color: var(--gray-2); }
.activity-time { font-size: .78rem; color: var(--muted); white-space: nowrap; }

.quick-actions { display: grid; gap: 10px; }

/* ===========================================================
   BARRA DE VISTA, FILTROS Y ESTADOS
   =========================================================== */
.view-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.view-toolbar .input-icon { flex: 1; min-width: 220px; }
.view-toolbar .filters { flex-basis: 100%; }

.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filters-label { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-2); margin-right: 2px; }
.chip-filter {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff; color: var(--gray);
  font-family: inherit; font-size: .82rem; font-weight: 700; line-height: 1; cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}
.chip-filter .icon { width: 15px; height: 15px; }
.chip-filter:hover { color: var(--blue); border-color: rgba(0,103,255, .4); background: var(--bg-blue); }
.chip-filter.is-active { background: var(--bg-blue); color: var(--blue); border-color: rgba(0,103,255, .35); box-shadow: inset 0 0 0 1px rgba(0,103,255, .14); }
.chip-filter .chip-count { font-size: .72rem; font-weight: 800; color: var(--muted); }
.chip-filter.is-active .chip-count { color: var(--blue); }

.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--gray); display: grid; place-items: center; transition: .16s; }
.icon-btn:hover { color: var(--blue); border-color: var(--blue); background: var(--bg-blue); }
.icon-btn.danger:hover { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.icon-btn .icon { width: 18px; height: 18px; }

.empty { text-align: center; padding: 56px 24px; }
.empty-ic { width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 18px; background: var(--bg-blue); color: var(--blue); }
.empty-ic .icon { width: 32px; height: 32px; }
.empty h3 { font-size: 1.18rem; }
.empty p { color: var(--gray); margin: 8px auto 22px; max-width: 430px; }

/* ===========================================================
   REJILLAS DE VISTA, MINI-CABECERAS Y AJUSTES
   =========================================================== */
.app-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 22px; align-items: start; }
.section-mini-head { margin-bottom: 18px; }
.section-mini-head h3 { font-size: 1.15rem; }
.section-mini-head p { color: var(--gray); margin-top: 6px; font-size: .95rem; }

.settings-stack { display: grid; gap: 18px; max-width: 620px; }
.settings-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.settings-card > p { color: var(--gray); font-size: .92rem; margin-bottom: 16px; }
.settings-card .form-grid { margin-top: 18px; }
.danger-zone { border-color: var(--bad-line); }
.danger-zone h3 { color: var(--bad); }

/* ===========================================================
   MODAL
   =========================================================== */
.modal { position: fixed; inset: 0; z-index: 140; display: none; }
.modal.is-open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8,13,52, .55); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; z-index: 1; max-width: 720px; margin: 6vh auto; max-height: 86vh; overflow: auto;
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 26px;
}
.modal-card[data-size="sm"], .modal-card.is-sm { max-width: 460px; }
.modal-card[data-size="md"], .modal-card.is-md { max-width: 620px; }
.modal-card[data-size="lg"], .modal-card.is-lg { max-width: 900px; }
.modal-close { position: absolute; right: 16px; top: 16px; z-index: 2; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--gray); display: grid; place-items: center; }
.modal-close:hover { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.modal-head { padding-right: 48px; margin-bottom: 18px; }
.modal-head h3 { font-size: 1.22rem; }
.modal-head p { color: var(--gray); font-size: .92rem; margin-top: 6px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; min-width: 160px; }
.modal-card .cred-doc { box-shadow: none; margin: 0; max-width: none; border: 0; padding: 4px 0 0; }

/* ===========================================================
   RETOS
   =========================================================== */
.reto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

.reto-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 11px;
  width: 100%; text-align: left; font-family: inherit; padding: 22px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.reto-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--card-accent, var(--blue)); }
.reto-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(0,103,255, .18); }
.reto-card:focus-visible { box-shadow: var(--ring); }
.reto-card h3 { font-size: 1.05rem; line-height: 1.25; }
.reto-card > p { color: var(--gray); font-size: .9rem; line-height: 1.5; }

.reto-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.reto-org { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: .82rem; font-weight: 600; color: var(--gray-2); }
.reto-org .icon { width: 16px; height: 16px; color: var(--blue); flex: none; }
.reto-org strong { display: block; color: var(--navy); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reto-org span { display: block; font-size: .74rem; color: var(--muted); }

.reto-meta {
  display: flex; flex-wrap: wrap; gap: 7px 16px; margin-top: auto; padding-top: 12px;
  border-top: 1px dashed var(--line); font-size: .8rem; font-weight: 600; color: var(--gray-2);
}
.reto-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.reto-meta .icon { width: 15px; height: 15px; color: var(--muted); }
.reto-meta .is-urgent { color: var(--warn); }
.reto-meta .is-urgent .icon { color: var(--warn); }
.reto-meta .is-ok { color: var(--ok); }
.reto-meta .is-ok .icon { color: var(--ok); }

.reto-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; line-height: 1.5; white-space: nowrap;
  color: var(--gray); background: var(--bg-soft); border: 1px solid var(--line);
}
.tag .icon { width: 13px; height: 13px; }
.tag.is-blue { color: var(--blue); background: var(--bg-blue); border-color: rgba(0,103,255, .16); }
.tag.is-violet { color: var(--violet-700); background: var(--violet-bg); border-color: var(--violet-line); }
.tag.is-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.tag.is-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.tag.is-bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }

/* ===========================================================
   RÚBRICA DE EVALUACIÓN
   =========================================================== */
.rubric { display: grid; gap: 14px; }
.rubric-row {
  display: grid; gap: 9px; padding: 15px 17px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.rubric-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rubric-row strong { font-size: .9rem; color: var(--navy); }
.rubric-row small,
.rubric-help { display: block; font-size: .78rem; color: var(--gray-2); line-height: 1.45; }
.rubric-weight { font-size: .74rem; font-weight: 700; color: var(--muted); font-family: var(--mono); }

/* Deslizador 1..5 estilado a mano: pista visible, marcas y pulgar violeta */
.rubric-range {
  -webkit-appearance: none; appearance: none; accent-color: var(--violet);
  width: 100%; height: 22px; margin: 0; padding: 0; background: transparent; cursor: pointer;
}
.rubric-range:focus { outline: none; }
.rubric-range::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px;
  background: rgba(8,13,52, .1)
    repeating-linear-gradient(90deg, rgba(8,13,52, .18) 0 2px, transparent 2px 25%);
}
.rubric-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 5px solid var(--violet); box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease), border-color .15s, box-shadow .15s;
}
.rubric-range:hover::-webkit-slider-thumb { transform: scale(1.08); }
.rubric-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(109, 90, 248, .24); }
.rubric-range::-moz-range-track {
  height: 8px; border-radius: 999px;
  background: rgba(8,13,52, .1)
    repeating-linear-gradient(90deg, rgba(8,13,52, .18) 0 2px, transparent 2px 25%);
}
.rubric-range::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--grad-violet); }
.rubric-range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 5px solid var(--violet); box-shadow: var(--shadow-sm);
}
.rubric-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(109, 90, 248, .24); }
.rubric-range[disabled] { cursor: default; opacity: .9; }
.rubric-range[disabled]::-webkit-slider-thumb { border-color: var(--muted); }
.rubric-range[disabled]::-moz-range-thumb { border-color: var(--muted); }

.rubric-scale { display: flex; justify-content: space-between; font-size: .72rem; font-weight: 700; color: var(--muted); font-family: var(--mono); }

.rubric-val {
  display: inline-flex; align-items: baseline; gap: 3px; flex: none;
  min-width: 52px; justify-content: center; padding: 4px 11px; border-radius: 999px;
  font-size: .88rem; font-weight: 800; color: var(--violet-700);
  background: var(--violet-bg); border: 1px solid var(--violet-line);
}
.rubric-val small { font-size: .7rem; font-weight: 700; color: var(--violet); }

.rubric-total {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 17px 19px; border-radius: var(--r-sm);
  background: var(--violet-bg); border: 1px solid var(--violet-line);
}
.rubric-total strong { font-size: .92rem; color: var(--navy); }
.rubric-total span { display: block; font-size: .78rem; color: var(--gray-2); margin-top: 2px; }
.rubric-total b,
.rubric-total .rubric-total-val { font-size: 1.9rem; font-weight: 800; color: var(--violet-700); line-height: 1; }
.rubric-total .rubric-total-side { display: flex; align-items: center; gap: 12px; }

/* ===========================================================
   CREDENCIAL — PASAPORTE DE DESEMPEÑO
   (clon de .cert-doc de ProofVideo, en clave violeta)
   =========================================================== */
.cred-doc {
  position: relative; max-width: 760px; margin: 0 auto; overflow: hidden;
  background:
    linear-gradient(180deg, #fff, #fff),
    radial-gradient(420px 220px at 100% 0%, rgba(109, 90, 248, .1), transparent 60%);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: 34px 38px;
}
.cred-doc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--grad-violet); }
.cred-doc[data-nivel="oro"]::before,   .cred-doc[data-level="oro"]::before   { background: linear-gradient(180deg, #E7C173 0%, #B7791F 100%); }
.cred-doc[data-nivel="plata"]::before, .cred-doc[data-level="plata"]::before { background: linear-gradient(180deg, #CBD5E1 0%, #64748B 100%); }
.cred-doc[data-nivel="bronce"]::before,.cred-doc[data-level="bronce"]::before{ background: linear-gradient(180deg, #D89A72 0%, #9A5B34 100%); }

.cred-doc-watermark { position: absolute; right: -30px; bottom: -30px; color: rgba(109, 90, 248, .06); pointer-events: none; }
.cred-doc-watermark .icon { width: 230px; height: 230px; stroke-width: 1; }

.cred-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cred-doc-head .cdh-brand { display: flex; align-items: center; gap: 11px; }
.cred-doc-tag {
  font-size: .78rem; font-weight: 700; color: var(--violet-700);
  background: var(--violet-bg); border: 1px solid var(--violet-line);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.cred-doc-title { font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin-top: 24px; position: relative; z-index: 1; }
.cred-doc-seal {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
  font-size: .82rem; font-weight: 700; color: var(--ok);
  background: var(--ok-bg); border: 1px solid var(--ok-line); padding: 6px 12px; border-radius: 999px;
}
.cred-doc-seal .icon { width: 16px; height: 16px; }
.cred-doc-rows { margin-top: 22px; position: relative; z-index: 1; }
.cred-doc-rows dd { font-size: .92rem; }
.cred-doc-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; position: relative; z-index: 1; }
.cred-doc-actions .btn { flex: 1; min-width: 200px; }

/* Nivel alcanzado, con su puntuación */
.cred-level {
  display: inline-flex; align-items: center; gap: 11px; margin-top: 16px; padding: 10px 16px;
  border-radius: 999px; font-weight: 800; font-size: .88rem; position: relative; z-index: 1;
  color: var(--violet-700); background: var(--violet-bg); border: 1px solid var(--violet-line);
}
.cred-level .icon { width: 18px; height: 18px; }
.cred-level b { font-size: 1.05rem; }
.cred-level small { font-weight: 700; opacity: .8; }
.cred-level.is-oro,    .cred-level.badge-oro    { color: var(--oro); background: var(--oro-bg); border-color: var(--oro-line); }
.cred-level.is-plata,  .cred-level.badge-plata  { color: var(--plata); background: var(--plata-bg); border-color: var(--plata-line); }
.cred-level.is-bronce, .cred-level.badge-bronce { color: var(--bronce); background: var(--bronce-bg); border-color: var(--bronce-line); }

/* Competencias evaluadas (admite .progress dentro de cada fila) */
.cred-comp { display: grid; gap: 13px; margin-top: 22px; position: relative; z-index: 1; }
.cred-comp > * { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 14px; }
.cred-comp strong { font-size: .86rem; font-weight: 600; color: var(--navy); }
.cred-comp .cred-comp-val { font-size: .84rem; font-weight: 800; color: var(--violet-700); font-family: var(--mono); }
.cred-comp .progress { grid-column: 1 / -1; }

/* Bloque de verificación con QR (o código verificable de reserva) */
.cred-qr {
  margin-top: 22px; padding: 18px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; position: relative; z-index: 1;
}
.cred-qr canvas, .cred-qr img, .cred-qr .cred-qr-box {
  width: 104px; height: 104px; flex: none; padding: 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); image-rendering: pixelated;
}
.cred-qr-text { flex: 1; min-width: 200px; }
.cred-qr-label { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-2); }
.cred-qr-label .icon { width: 15px; height: 15px; color: var(--violet); }
.cred-qr code { display: block; margin-top: 8px; font-size: .86rem; color: var(--violet-700); word-break: break-all; font-family: var(--mono); }
.cred-qr-hint { display: block; margin-top: 8px; font-size: .82rem; color: var(--gray); }
.cred-qr-caption { display: block; width: 104px; text-align: center; font-size: .72rem; font-weight: 700; color: var(--gray-2); letter-spacing: .04em; }

/* Rejilla de credenciales del pasaporte (tarjeta tipo insignia) */
.cred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.cred-badge {
  display: flex; flex-direction: column; align-items: flex-start; gap: 9px; width: 100%; text-align: left;
  font-family: inherit; padding: 20px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.cred-badge:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--violet-line); }
.cred-badge:focus-visible { box-shadow: var(--ring); }
.cred-badge-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--violet-bg); color: var(--violet); }
.cred-badge-ic .icon { width: 25px; height: 25px; }
.cred-badge-ic.is-oro { background: var(--oro-bg); color: var(--oro); }
.cred-badge-ic.is-plata { background: var(--plata-bg); color: var(--plata); }
.cred-badge-ic.is-bronce { background: var(--bronce-bg); color: var(--bronce); }
.cred-badge strong { font-size: .98rem; line-height: 1.3; }
.cred-badge span { font-size: .82rem; color: var(--gray-2); }
.cred-badge code { font-family: var(--mono); font-size: .76rem; color: var(--muted); }

/* ---------- Distintivos de nivel ---------- */
.badge-oro { color: var(--oro); background: var(--oro-bg); border-color: var(--oro-line); }
.badge-plata { color: var(--plata); background: var(--plata-bg); border-color: var(--plata-line); }
.badge-bronce { color: var(--bronce); background: var(--bronce-bg); border-color: var(--bronce-line); }
.badge-violet { color: var(--violet-700); background: var(--violet-bg); border-color: var(--violet-line); }
.badge-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.badge-info { color: var(--blue); background: var(--bg-blue); border-color: rgba(0,103,255, .16); }
.badge-muted { color: var(--gray-2); background: var(--bg-soft); border-color: var(--line-2); }

/* ===========================================================
   CANTERA DE TALENTO
   =========================================================== */
.talent-list { display: grid; gap: 12px; }
.talent-row {
  display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 16px;
  padding: 15px 18px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, border-color .18s;
}
.talent-row:hover { box-shadow: var(--shadow); border-color: var(--violet-line); }
.talent-main { min-width: 0; }
.talent-main strong { display: block; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.talent-main span { display: block; font-size: .82rem; color: var(--gray-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.talent-row .reto-tags { flex-wrap: nowrap; }
.talent-stat { text-align: center; font-size: .78rem; color: var(--gray-2); white-space: nowrap; }
.talent-stat b { display: block; font-size: 1.05rem; font-weight: 800; color: var(--navy); line-height: 1.2; }

.talent-score {
  width: 54px; height: 54px; flex: none; border-radius: 15px; display: grid; place-items: center; align-content: center;
  font-weight: 800; font-size: 1.05rem; line-height: 1;
  color: var(--violet-700); background: var(--violet-bg); border: 1px solid var(--violet-line);
}
.talent-score small { display: block; font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .75; margin-top: 3px; }
.talent-score.is-oro { color: var(--oro); background: var(--oro-bg); border-color: var(--oro-line); }
.talent-score.is-plata { color: var(--plata); background: var(--plata-bg); border-color: var(--plata-line); }
.talent-score.is-bronce { color: var(--bronce); background: var(--bronce-bg); border-color: var(--bronce-line); }

/* ===========================================================
   PANEL DE IMPACTO
   =========================================================== */
.impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.impact-card {
  padding: 22px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.impact-card h3 { font-size: 1.02rem; }
.impact-card > p { color: var(--gray); font-size: .88rem; margin-top: 6px; }
.impact-card .kpi-val { margin-top: 12px; }
.impact-card.is-wide { grid-column: 1 / -1; }

.sdg-line { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.sdg-line:last-child { border-bottom: 0; }
.sdg-num {
  width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center;
  font-weight: 800; font-size: .95rem; color: #fff; background: var(--sdg, var(--blue)); line-height: 1;
}
.sdg-line[data-ods="4"]  { --sdg: #C5192D; }
.sdg-line[data-ods="8"]  { --sdg: #A21942; }
.sdg-line[data-ods="10"] { --sdg: #DD1367; }
.sdg-line-meta { flex: 1; min-width: 0; }
.sdg-line-meta strong { display: block; font-size: .92rem; color: var(--navy); }
.sdg-line-meta span { display: block; font-size: .8rem; color: var(--gray-2); }
.sdg-line-meta .progress { margin-top: 8px; }
.sdg-line-val { font-weight: 800; color: var(--navy); white-space: nowrap; }

/* Serie mensual con barras CSS */
.impact-chart { display: flex; align-items: flex-end; gap: 8px; height: 180px; margin-top: 18px; }
.impact-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.impact-chart-bar {
  width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: var(--grad-blue);
  min-height: 4px; transition: height .5s var(--ease);
}
.impact-chart-col.is-violet .impact-chart-bar { background: var(--grad-violet); }
.impact-chart-cap { font-size: .72rem; font-weight: 700; color: var(--gray-2); white-space: nowrap; }

/* ===========================================================
   LÍNEA DE TIEMPO (vencimientos, hitos)
   =========================================================== */
.timeline { position: relative; display: grid; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 10px; bottom: 10px; width: 2px; background: var(--line-2); border-radius: 2px; }
.timeline-item { position: relative; display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -22px; top: 50%; transform: translateY(-50%);
  width: 11px; height: 11px; border-radius: 50%; background: #fff;
  border: 2.5px solid var(--violet); box-shadow: 0 0 0 3px var(--violet-bg);
}
.timeline-item.is-urgent::before { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.timeline-item.is-ok::before { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.timeline-item.is-muted::before { border-color: var(--muted); box-shadow: 0 0 0 3px var(--bg-soft); }
.timeline-item-meta { flex: 1; min-width: 0; }
.timeline-item strong { display: block; font-size: .92rem; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-item span { font-size: .8rem; color: var(--gray-2); }
.timeline-time { font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.timeline-item.is-urgent .timeline-time { color: var(--warn); }

/* ===========================================================
   BARRAS DE PROGRESO
   =========================================================== */
.progress { height: 8px; border-radius: 999px; background: rgba(8,13,52, .08); overflow: hidden; }
.progress.sm { height: 6px; }
.progress.lg { height: 12px; }
.progress-bar { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--bar, var(--blue)); transition: width .5s var(--ease); }
.progress-bar.is-violet { background: var(--violet); }
.progress-bar.is-ok { background: var(--ok); }
.progress-bar.is-warn { background: var(--warn); }
.progress-bar.is-bad { background: var(--bad); }
.progress-bar.is-oro { background: var(--oro); }
.progress-bar.is-plata { background: var(--plata); }
.progress-bar.is-bronce { background: var(--bronce); }

/* ===========================================================
   AVISO DE DEMOSTRACIÓN
   =========================================================== */
.demo-banner {
  display: flex; align-items: flex-start; gap: 11px; margin-bottom: 20px;
  padding: 13px 16px; border-radius: 14px; font-size: .86rem; font-weight: 600; line-height: 1.45;
  color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line);
}
.demo-banner .icon { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.demo-banner strong { font-weight: 800; }
.demo-banner p { font-weight: 500; }
.demo-banner.is-info { color: var(--blue); background: var(--bg-blue); border-color: rgba(0,103,255, .16); }
.demo-banner.is-violet { color: var(--violet-700); background: var(--violet-bg); border-color: var(--violet-line); }

/* ===========================================================
   VISTA PREVIA EN VIVO (publicar reto)
   =========================================================== */
.form-preview { position: sticky; top: 92px; display: grid; gap: 14px; }
.form-preview-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-2);
}
.form-preview-label .icon { width: 15px; height: 15px; color: var(--blue); }
.form-preview-body {
  padding: 16px; border-radius: var(--r-md); background: var(--bg-soft);
  border: 1px dashed var(--line-2);
}
.form-preview .reto-card { box-shadow: var(--shadow-sm); }
.form-preview .reto-card:hover { transform: none; }
.form-preview-note { display: flex; align-items: flex-start; gap: 8px; font-size: .8rem; color: var(--gray-2); line-height: 1.45; }
.form-preview-note .icon { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--blue); }
.form-preview .rubric-row { padding: 11px 13px; }

/* ---------- Utilidades ---------- */
.btn-sm { padding: 7px 13px; font-size: .8rem; }
.print-only { display: none; }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 1024px) {
  .app-grid { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
  .form-preview { position: static; }
}
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .app-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 270px; height: 100%;
    transform: translateX(-100%); transition: transform .26s var(--ease); z-index: 40; box-shadow: var(--shadow-lg);
  }
  .app.nav-open .app-sidebar { transform: none; }
  .app.nav-open .app-scrim { opacity: 1; pointer-events: auto; }
  .app-burger { display: inline-flex; }
  .app-content { padding: 22px 18px; }
  .cred-doc { padding: 28px 24px; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mini-brand { display: flex; }
  .reto-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .app-topbar { padding: 12px 16px; }
  .app-topbar-actions .btn-pill span.btn-label { display: none; }
  .user-btn-name { display: none; }
  .role-chip { display: none; }
  .modal-card { padding: 20px; margin: 4vh 12px; }
  .talent-row { grid-template-columns: auto 1fr auto; }
  .talent-row .talent-stat, .talent-row .badge { display: none; }
  .role-switch { grid-template-columns: 1fr; }
  .auth-form .form-grid { grid-template-columns: 1fr; }
  .auth-demo-row { grid-template-columns: 1fr; }
  .cred-doc { padding: 24px 18px; border-radius: var(--r-lg); }
  .cred-doc-actions .btn { min-width: 100%; }
  .rubric-total b, .rubric-total .rubric-total-val { font-size: 1.6rem; }
  .impact-chart { height: 140px; }
}

/* ===========================================================
   IMPRESIÓN
   Credencial e informe de impacto limpios: sin panel lateral,
   sin barra superior y sin controles.
   =========================================================== */
@media print {
  @page { margin: 14mm; }

  body.is-app { background: #fff; }

  .app-sidebar, .app-topbar, .app-scrim, .app-side-foot,
  .toast, .modal-backdrop, .modal-close,
  .quick-actions, .view-toolbar, .filters, .demo-banner,
  .cred-doc-actions, .modal-actions, .icon-btn, .btn, .no-print { display: none !important; }

  .print-only { display: block; }

  .app { display: block; grid-template-columns: 1fr; min-height: 0; }
  .app-main { display: block; background: #fff; }
  .app-content { padding: 0; max-width: none; margin: 0; }
  .app-view.is-active { animation: none; }

  .modal:not(.is-open) { display: none !important; }
  .modal.is-open { position: static; display: block; }
  .modal-card {
    position: static; max-width: none; max-height: none; margin: 0; padding: 0;
    overflow: visible; box-shadow: none; border-radius: 0;
  }

  .card, .kpi-card, .impact-card, .cred-doc, .talent-row, .reto-card, .settings-card {
    box-shadow: none !important; border: 1px solid #D8DEE9;
    break-inside: avoid; page-break-inside: avoid;
  }
  .cred-doc { max-width: none; margin: 0; padding: 24px 26px; }
  .cred-doc-watermark { display: none; }

  /* Conservar los colores que aportan significado */
  .cred-doc::before, .kpi-card::before, .badge, .tag, .progress, .progress-bar,
  .sdg-num, .cred-level, .cred-doc-seal, .cred-doc-tag, .impact-chart-bar {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }

  .kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .impact-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .panel-grid { grid-template-columns: 1fr; }
  a[href]::after { content: ""; }
}
