/* ==========================================================================
   FUNDACIÓN REDSAVIA — Portal de Fortalecimiento Empresarial (3 columnas)
   Fiel a la identidad visual de RedSavia y al diseño de referencia:
   Sidebar izquierdo + Contenido central + Panel derecho (perfil, progreso,
   etapa actual y actividades).
   ========================================================================== */

:root {
  --p-bg: #f6f4ee;
  --p-surface: #ffffff;
  --p-verde: #1e4d30;
  --p-verde-900: #173d26;
  --p-verde-500: #3d8b4d;
  --p-verde-soft: #e3f0e5;
  --p-verde-pill: #d4e8b4;
  --p-azul: #0d2a45;
  --p-crema: #faf7f0;
  --p-crema-warm: #f5efe1;
  --p-caqui: #c8b48b;
  --p-tinta: #1b2420;
  --p-tinta-2: #4b5650;
  --p-tinta-3: #717c76;
  --p-linea: rgba(23, 61, 38, 0.1);
  --p-sombra: 0 2px 10px rgba(15, 42, 26, 0.04), 0 12px 28px -16px rgba(15, 42, 26, 0.14);
  --p-serif: "Fraunces", Georgia, serif;
  --p-sans: "Manrope", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body.portal-body {
  margin: 0;
  background: var(--p-bg);
  color: var(--p-tinta);
  font-family: var(--p-sans);
  font-size: 0.96rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
body.portal-body :focus-visible { outline: 2px solid #2c87c5; outline-offset: 2px; border-radius: 8px; }

/* Shell de 3 columnas */
.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 310px;
  gap: 22px;
  max-width: 1520px;
  margin: 0 auto;
  padding: 18px 20px 28px;
  align-items: start;
}

/* ---------------- Sidebar izquierdo ---------------- */
.portal-sidebar {
  position: sticky;
  top: 18px;
  min-height: calc(100vh - 36px);
  background: var(--p-surface);
  border: 1px solid var(--p-linea);
  border-radius: 26px;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--p-sombra);
  overflow: hidden;
}
.portal-sidebar::after {
  content: "";
  position: absolute;
  left: -30px;
  bottom: 56px;
  width: 140px;
  height: 140px;
  border-radius: 0 80px 0 80px;
  background: rgba(164, 198, 146, 0.14);
  pointer-events: none;
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--p-linea);
}
.portal-brand__mark { width: 42px; height: 42px; flex: none; }
.portal-brand__text { display: grid; line-height: 1.05; }
.portal-brand__name { font-family: var(--p-serif); font-size: 1.18rem; font-weight: 700; color: var(--p-verde-900); letter-spacing: -0.01em; }
.portal-brand__sub { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; color: var(--p-tinta-3); margin-top: 2px; }

.portal-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  position: relative;
  z-index: 1;
}
.portal-nav__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 0;
  background: transparent;
  color: var(--p-tinta-2);
  font-weight: 600;
  font-size: 0.94rem;
  text-align: left;
  transition: background 0.2s, color 0.2s;
}
.portal-nav__btn svg { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portal-nav__btn:hover { background: var(--p-crema); color: var(--p-azul); }
.portal-nav__btn.is-active {
  background: var(--p-verde);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 8px 18px -10px rgba(23, 61, 38, 0.7);
}

.portal-sidebar__footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--p-linea);
  display: grid;
  gap: 4px;
  position: relative;
  z-index: 1;
}

/* Barra móvil superior */
.portal-mobilebar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--p-surface);
  border-bottom: 1px solid var(--p-linea);
  position: sticky;
  top: 0;
  z-index: 60;
}
.portal-mobilebar__btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--p-linea);
  background: var(--p-crema);
  display: grid;
  place-items: center;
  color: var(--p-azul);
}
.portal-mobilebar__btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.portal-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(13, 42, 69, 0.35);
  display: none;
}
.portal-scrim.is-open { display: block; }

/* ---------------- Columna central ---------------- */
.portal-main {
  display: grid;
  gap: 22px;
  min-width: 0;
}

/* Banner de bienvenida */
.welcome-banner {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: linear-gradient(115deg, #f6f1e4 0%, #f1ead8 55%, #e5eedf 100%);
  border: 1px solid var(--p-linea);
  box-shadow: var(--p-sombra);
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  min-height: 224px;
}
.welcome-banner__body {
  padding: 28px 28px 26px 32px;
  display: grid;
  gap: 12px;
  align-content: center;
  position: relative;
  z-index: 2;
}
.welcome-banner__body h1 {
  margin: 0;
  font-family: var(--p-serif);
  font-size: clamp(1.55rem, 2.3vw, 2.15rem);
  line-height: 1.12;
  color: var(--p-verde-900);
  letter-spacing: -0.02em;
}
.welcome-banner__body p {
  margin: 0;
  color: var(--p-tinta-2);
  font-size: 0.95rem;
  max-width: 44ch;
}
.welcome-banner__media {
  position: relative;
  overflow: hidden;
  min-height: 200px;
}
.welcome-banner__media::before {
  content: "";
  position: absolute;
  inset: -12% auto -12% -34px;
  width: 68px;
  background: var(--p-verde-pill);
  border-radius: 50%;
  z-index: 2;
  opacity: 0.85;
}
.welcome-banner__media::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: -18px;
  width: 96px;
  height: 120px;
  background: var(--p-verde);
  border-radius: 60% 40% 0 0;
  z-index: 3;
}
.welcome-banner__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

/* Botones del portal */
.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
  justify-self: start;
}
.p-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.p-btn--verde { background: var(--p-verde); color: #ffffff; }
.p-btn--verde:hover { background: var(--p-verde-900); color: #ffffff; transform: translateY(-1px); }
.p-btn--outline { background: #fff; color: var(--p-verde-900); border-color: rgba(30, 77, 48, 0.25); }
.p-btn--outline:hover { border-color: var(--p-verde); background: var(--p-crema); }
.p-btn--sm { padding: 8px 16px; font-size: 0.84rem; }

/* Modal para crear contraseña al entrar al portal */
.p-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(13, 42, 69, 0.52);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.p-modal__card {
  width: min(490px, 100%);
  background: #ffffff;
  border-radius: 26px;
  padding: 30px 28px;
  border: 1px solid var(--p-linea);
  box-shadow: 0 24px 60px -20px rgba(15, 42, 26, 0.45);
  display: grid;
  gap: 16px;
}
.p-modal__card h2 {
  margin: 0;
  font-family: var(--p-serif);
  font-size: 1.55rem;
  color: var(--p-verde-900);
  line-height: 1.15;
}
.p-modal__email {
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--p-verde-soft);
  color: var(--p-verde-900);
  font-size: 0.9rem;
  font-weight: 700;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-card {
  width: min(460px, 100%);
  background: #ffffff;
  border: 1px solid var(--p-linea);
  border-radius: 28px;
  padding: 34px 30px;
  box-shadow: var(--p-sombra);
  display: grid;
  gap: 18px;
}
.login-card h1 {
  margin: 0;
  font-family: var(--p-serif);
  font-size: 1.75rem;
  color: var(--p-azul);
  line-height: 1.15;
}
.login-card__foot {
  padding-top: 14px;
  border-top: 1px solid var(--p-linea);
  font-size: 0.88rem;
  color: var(--p-tinta-2);
  display: grid;
  gap: 10px;
  text-align: center;
}

/* Encabezado de sección central */
.section-bar {
  display: grid;
  gap: 4px;
}
.section-bar__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--p-serif);
  font-size: 1.45rem;
  color: var(--p-verde-900);
}
.section-bar__title svg { width: 22px; height: 22px; color: var(--p-verde); stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.section-bar__sub { margin: 0; color: var(--p-tinta-2); font-size: 0.92rem; }

/* Grilla 3x3 de módulos / funciones */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.mod-card {
  position: relative;
  border-radius: 20px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(23, 61, 38, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s;
  box-shadow: 0 2px 8px rgba(15, 42, 26, 0.03);
}
.mod-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -18px rgba(15, 42, 26, 0.26);
  border-color: rgba(23, 61, 38, 0.22);
}

/* Paleta pastel suave igual a la referencia */
.mod-card--t1 { background: #edf5ea; --m-accent: #3d9a4c; }
.mod-card--t2 { background: #fdf3e4; --m-accent: #e0861c; }
.mod-card--t3 { background: #ebf4fb; --m-accent: #1d7da8; }
.mod-card--t4 { background: #f2eefb; --m-accent: #6c46b5; }
.mod-card--t5 { background: #eaf6f1; --m-accent: #2c7a56; }
.mod-card--t6 { background: #fbf1e7; --m-accent: #c96f32; }
.mod-card--t7 { background: #f9eeef; --m-accent: #a6465b; }
.mod-card--t8 { background: #edf3fa; --m-accent: #2c5f9b; }
.mod-card--t9 { background: #eff5e9; --m-accent: #4c9a3d; }

.mod-card__top {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.mod-card__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex: none;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.78);
  color: var(--m-accent, var(--p-verde));
}
.mod-card__icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mod-card__head { min-width: 0; }
.mod-card__title {
  margin: 0;
  font-family: var(--p-sans);
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--p-azul);
  line-height: 1.2;
}
.mod-card__desc {
  margin: 4px 0 0;
  font-size: 0.81rem;
  color: var(--p-tinta-2);
  line-height: 1.38;
}
.mod-card__prio {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.85);
  color: var(--m-accent, var(--p-verde));
}
.mod-card__foot {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mod-bar {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(23, 61, 38, 0.1);
  overflow: hidden;
}
.mod-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--m-accent, var(--p-verde));
  transition: width 0.4s ease;
}
.mod-card__pct {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--p-tinta-2);
  min-width: 32px;
  text-align: right;
}
.mod-card__go {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: var(--m-accent, var(--p-verde));
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 2px 6px rgba(15, 42, 26, 0.08);
  transition: transform 0.2s;
}
.mod-card__go svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mod-card:hover .mod-card__go { transform: translateX(3px); }

/* ---------------- Panel derecho ---------------- */
.portal-right {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 16px;
}
.right-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 2px;
}
.right-user__who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.avatar-btn {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  background: var(--p-verde);
  color: #fff;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: var(--p-serif);
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(15, 42, 26, 0.18);
  flex: none;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-btn__cam {
  position: absolute;
  inset: auto 0 0 0;
  background: rgba(13, 42, 69, 0.72);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.avatar-btn:hover .avatar-btn__cam { opacity: 1; }
.right-user__name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--p-azul);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.right-user__role {
  margin: 1px 0 0;
  font-size: 0.82rem;
  color: var(--p-tinta-3);
  font-weight: 600;
}
.bell-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--p-linea);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--p-azul);
  flex: none;
}
.bell-btn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.bell-btn__dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d94436;
  border: 1.5px solid #fff;
}

.right-card {
  background: var(--p-surface);
  border: 1px solid var(--p-linea);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--p-sombra);
  display: grid;
  gap: 14px;
}
.right-card__head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--p-azul);
}
.right-card__head svg { width: 19px; height: 19px; color: var(--p-verde); stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Anillo de progreso */
.ring-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ring-box { position: relative; width: 92px; height: 92px; flex: none; }
.ring-box svg { width: 92px; height: 92px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #eceae2; stroke-width: 9; }
.ring-fg { fill: none; stroke: #55a648; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.ring-val {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--p-sans);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--p-verde-900);
}
.ring-info { font-size: 0.88rem; color: var(--p-tinta-2); line-height: 1.4; }
.ring-info strong { display: block; color: var(--p-azul); font-size: 0.95rem; margin-top: 2px; }

/* Etapa actual en panel derecho */
.stage-pill {
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--p-verde-pill);
  color: var(--p-verde-900);
  font-weight: 800;
  font-size: 0.86rem;
  text-align: center;
}
.prio-title { margin: 0; font-size: 0.84rem; font-weight: 700; color: var(--p-tinta-2); }
.prio-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.prio-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--p-tinta);
  font-weight: 600;
}
.prio-list li svg { width: 17px; height: 17px; color: var(--p-verde); flex: none; margin-top: 2px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Lista de actividades en panel derecho */
.act-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.act-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--p-crema);
}
.act-item__dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--p-linea);
  display: grid;
  place-items: center;
  color: var(--p-verde);
  flex: none;
  margin-top: 2px;
}
.act-item__dot svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.act-item strong { display: block; font-size: 0.86rem; color: var(--p-azul); line-height: 1.25; }
.act-item small { display: block; font-size: 0.78rem; color: var(--p-tinta-3); margin-top: 2px; }
.right-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--p-verde);
  background: none;
  border: 0;
  padding: 4px 0 0;
}
.right-link svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Vistas secundarias del portal */
.panel-box {
  background: var(--p-surface);
  border: 1px solid var(--p-linea);
  border-radius: 24px;
  padding: 26px 28px;
  box-shadow: var(--p-sombra);
  display: grid;
  gap: 18px;
}
.panel-box h2 { margin: 0; font-family: var(--p-serif); font-size: 1.6rem; color: var(--p-azul); }
.panel-box h3 { margin: 0; font-family: var(--p-serif); font-size: 1.2rem; color: var(--p-azul); }
.p-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.p-field { display: grid; gap: 6px; align-content: start; }
.p-field--full { grid-column: 1 / -1; }
.p-field label { font-size: 0.84rem; font-weight: 700; color: var(--p-azul); }
.p-field input, .p-field textarea, .p-field select {
  width: 100%;
  font: inherit;
  font-size: 0.94rem;
  color: var(--p-tinta);
  background: var(--p-crema);
  border: 1.5px solid var(--p-linea);
  border-radius: 12px;
  padding: 11px 14px;
}
.p-field textarea { min-height: 96px; resize: vertical; }
.p-msg {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
}
.p-msg--ok { background: var(--p-verde-soft); color: var(--p-verde-900); }
.p-msg--err { background: #f8e4e2; color: #7a2f2a; }

.photo-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--p-crema);
  border: 1px dashed rgba(23, 61, 38, 0.25);
}
.photo-preview {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--p-verde);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--p-serif);
  font-weight: 700;
  font-size: 1.5rem;
  overflow: hidden;
  flex: none;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

.info-kv {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.info-kv__item {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--p-crema);
  border: 1px solid var(--p-linea);
}
.info-kv__item small { display: block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--p-tinta-3); }
.info-kv__item strong { display: block; margin-top: 3px; font-size: 0.94rem; color: var(--p-azul); }

/* ---------------- Extensiones Portal del Funcionario (Marketing Digital y áreas) ---------------- */
.portal-nav__badge {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #d94436;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}
.portal-nav__btn.is-active .portal-nav__badge {
  background: #ffffff;
  color: var(--p-verde-900);
}

.func-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.func-head__icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #f5ebd7;
  color: var(--p-verde-900);
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--p-linea);
}
.func-head__icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.func-head__kicker {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--p-tinta-2);
}
.func-head__title {
  margin: 0;
  font-family: var(--p-serif);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  color: var(--p-azul);
  line-height: 1.08;
}
.func-head__sub {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--p-tinta-3);
}

.kpi-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.kpi-mini {
  border-radius: 16px;
  padding: 12px 8px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 4px;
}
.kpi-mini--1 { background: #edf6ee; color: #1e4d30; }
.kpi-mini--2 { background: #fdf3e4; color: #9a5b12; }
.kpi-mini--3 { background: #edf5ea; color: #2b663e; }
.kpi-mini svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.kpi-mini strong { font-size: 1.35rem; font-weight: 800; line-height: 1; color: var(--p-azul); }
.kpi-mini span { font-size: 0.72rem; font-weight: 700; color: var(--p-tinta-2); line-height: 1.15; }

.emp-list { display: grid; gap: 12px; }
.emp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--p-crema);
  border: 1px solid var(--p-linea);
}
.emp-row__title { font-family: var(--p-serif); font-size: 1.12rem; font-weight: 700; color: var(--p-azul); }
.emp-row__meta { font-size: 0.84rem; color: var(--p-tinta-2); margin-top: 2px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mini-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid var(--p-linea);
  color: var(--p-verde-900);
}
.mini-tag--warn { background: #fdf1da; color: #7a4b12; border-color: transparent; }
.mini-tag--ok { background: var(--p-verde-soft); color: var(--p-verde-900); border-color: transparent; }

.note-pad {
  background: #fffdf7;
  border: 1px solid rgba(200, 180, 139, 0.45);
  border-radius: 22px;
  padding: 20px 22px;
  display: grid;
  gap: 12px;
}
.note-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fffef9;
  border: 1px solid var(--p-linea);
  border-left: 4px solid var(--p-verde);
  display: grid;
  gap: 5px;
}
.note-card__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--p-tinta-3);
  font-weight: 700;
}
.note-card strong { color: var(--p-azul); font-size: 0.96rem; }
.note-card p { margin: 0; font-size: 0.9rem; color: var(--p-tinta-2); white-space: pre-line; }

.mod-manage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--p-crema);
  border: 1px solid var(--p-linea);
}
.mod-manage-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.mod-manage-controls select,
.mod-manage-controls input[type="number"] {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--p-linea);
  background: #ffffff;
  font: inherit;
  font-size: 0.84rem;
}

.ficha-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: var(--p-crema);
  border: 1px solid var(--p-linea);
  justify-self: start;
}
.ficha-tab {
  border: 0;
  background: transparent;
  padding: 8px 15px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--p-tinta-2);
}
.ficha-tab.is-active { background: var(--p-verde); color: #ffffff; }

/* Editor de notas estilo Word (listas, alineación, interlineado, sangría, fotos y archivos) */
.note-word-wrap {
  border: 1.5px solid var(--p-linea);
  border-radius: 14px;
  background: #ffffff;
  overflow: visible;
}
.note-word-toolbar {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 12px 12px 0 0;
  background: #f1ece0;
  border-bottom: 1px solid var(--p-linea);
}
.note-tb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.note-tb-sep {
  width: 1px;
  height: 22px;
  background: rgba(23, 61, 38, 0.16);
  margin: 0 3px;
}
.note-tb-group {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}
.note-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 34px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--p-azul);
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.note-tool-btn:hover {
  background: #ffffff;
  border-color: rgba(23, 61, 38, 0.22);
}
.note-tool-btn.is-active {
  background: #ffffff;
  border-color: var(--p-verde);
  color: var(--p-verde-900);
  box-shadow: 0 0 0 2px rgba(29, 77, 47, 0.14);
}
.note-tool-btn--caret {
  min-width: 20px;
  padding: 0 4px;
  border-radius: 0 8px 8px 0;
  margin-left: -2px;
}
.note-tb-group > .note-tool-btn:first-child {
  border-radius: 8px 0 0 8px;
}
.note-tool-btn--pill {
  background: #ffffff;
  border-color: rgba(23, 61, 38, 0.16);
  padding: 0 11px;
}
.note-tool-btn--pill:hover {
  background: var(--p-verde-soft);
  border-color: var(--p-verde);
}
.note-tool-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}
.note-tool-btn svg.note-caret-svg {
  width: 11px;
  height: 11px;
}
.note-tool-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 40;
  min-width: 175px;
  padding: 6px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--p-linea);
  box-shadow: 0 14px 30px rgba(17, 46, 28, 0.16);
  display: grid;
  gap: 3px;
}
.note-tool-menu button {
  text-align: left;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--p-azul);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.note-tool-menu button:hover {
  background: var(--p-verde-soft);
  color: var(--p-verde-900);
}
.note-editor-surface {
  min-height: 145px;
  max-height: 360px;
  overflow-y: auto;
  padding: 14px 16px;
  color: var(--p-tinta);
  font-size: 0.94rem;
  line-height: 1.5;
  outline: none;
  border-radius: 0 0 12px 12px;
}
.note-editor-surface:focus {
  box-shadow: inset 0 0 0 2px rgba(29, 77, 47, 0.18);
}
.note-editor-surface:empty::before {
  content: attr(data-placeholder);
  color: #8b948d;
  pointer-events: none;
}

/* Clases de formato ricas (editor + notas guardadas, 100% CSP-safe) */
.note-editor-surface p,
.note-editor-surface div,
.note-formatted p,
.note-formatted div {
  margin: 0 0 6px;
}
.note-editor-surface p:last-child,
.note-editor-surface div:last-child,
.note-formatted p:last-child,
.note-formatted div:last-child {
  margin-bottom: 0;
}
.note-editor-surface ul,
.note-editor-surface ol,
.note-formatted ul,
.note-formatted ol {
  margin: 4px 0 8px;
  padding-left: 26px;
}
.note-editor-surface li,
.note-formatted li {
  margin: 2px 0;
  color: var(--p-tinta);
}
.note-editor-surface blockquote,
.note-formatted blockquote {
  margin: 4px 0 6px 26px;
  padding: 0;
}
.rt-left { text-align: left; }
.rt-center { text-align: center; }
.rt-right { text-align: right; }
.rt-justify { text-align: justify; }
.rt-ls-1 { line-height: 1.15; }
.rt-ls-115 { line-height: 1.35; }
.rt-ls-15 { line-height: 1.65; }
.rt-ls-2 { line-height: 2.0; }
.rt-indent-1 { padding-left: 24px; }
.rt-indent-2 { padding-left: 48px; }
.rt-indent-3 { padding-left: 72px; }
.rt-indent-4 { padding-left: 96px; }

ul.rt-list-disc { list-style-type: disc; }
ul.rt-list-circle { list-style-type: circle; }
ul.rt-list-square { list-style-type: square; }
ol.rt-list-decimal { list-style-type: decimal; }
ol.rt-list-alpha { list-style-type: lower-alpha; }
ol.rt-list-roman { list-style-type: upper-roman; }

ul.rt-checklist {
  list-style: none;
  padding-left: 4px;
}
ul.rt-checklist > li {
  position: relative;
  padding-left: 24px;
  cursor: pointer;
}
ul.rt-checklist > li::before {
  content: "☐";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--p-verde);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.3;
}
ul.rt-checklist > li.rt-check-done {
  text-decoration: line-through;
  color: var(--p-tinta-2);
}
ul.rt-checklist > li.rt-check-done::before {
  content: "☑";
  color: var(--p-verde-600);
}

.note-pending-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.note-pending-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--p-linea);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--p-azul);
}
.note-pending-chip img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}
.note-pending-chip button {
  border: 0;
  background: #f5e2e0;
  color: #7a2f2a;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.note-formatted {
  font-size: 0.92rem;
  color: var(--p-tinta-2);
  line-height: 1.5;
}

.note-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.note-gallery a {
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--p-linea);
}
.note-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.note-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.note-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--p-crema);
  border: 1px solid var(--p-linea);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--p-verde-900);
}
.note-file-link:hover { background: var(--p-verde-soft); }

/* Hub de Marketing del Empresario (herramientas y listas interactivas) */
.mkt-hub-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--p-verde-900);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(29, 77, 47, 0.14);
  padding: 4px 10px;
  border-radius: 999px;
}
.mkt-checklist {
  display: grid;
  gap: 10px;
}
.mkt-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1.5px solid var(--p-linea);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.mkt-check-item:hover {
  border-color: var(--p-verde);
  background: #fbfdf9;
}
.mkt-check-item.is-done {
  background: var(--p-verde-soft);
  border-color: rgba(29, 77, 47, 0.28);
}
.mkt-check-box {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid rgba(29, 77, 47, 0.35);
  background: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
}
.mkt-check-item.is-done .mkt-check-box {
  background: var(--p-verde);
  border-color: var(--p-verde);
}
.mkt-check-body {
  display: grid;
  gap: 3px;
}
.mkt-check-body strong {
  color: var(--p-azul);
  font-size: 0.92rem;
}
.mkt-check-body small {
  color: var(--p-tinta-2);
  font-size: 0.82rem;
  line-height: 1.45;
}
.mkt-check-item.is-done .mkt-check-body strong {
  color: var(--p-verde-900);
}

/* Responsive */
@media (max-width: 1220px) {
  .portal-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .portal-right { grid-column: 2; position: static; grid-template-columns: repeat(2, 1fr); }
  .right-user { grid-column: 1 / -1; }
  .mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .portal-mobilebar { display: flex; }
  .portal-shell { grid-template-columns: 1fr; padding: 14px; }
  .portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 268px;
    min-height: 100vh;
    border-radius: 0 24px 24px 0;
    z-index: 80;
    transform: translateX(-105%);
    transition: transform 0.3s ease;
  }
  .portal-sidebar.is-open { transform: none; }
  .portal-right { grid-column: 1; grid-template-columns: 1fr; }
  .welcome-banner { grid-template-columns: 1fr; }
  .welcome-banner__media { min-height: 170px; order: -1; }
  .welcome-banner__media::before, .welcome-banner__media::after { display: none; }
  .p-form-grid, .info-kv { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .mod-grid { grid-template-columns: 1fr; }
}
