/* web_v2/portal/portal.css — el portal de empresas (F5 + F5b + el rediseño, 02/11/2026).
 *
 * QUÉ ES: el sistema visual del portal, y SOLO eso. Reutiliza de `styles.css` los tokens
 * (`--primary`, `--border`, `--surface`, `--radius`…) y NO los redefine: la paleta es una
 * sola en todo el sitio (`constants/colors.ts` → `web_v2/styles.css`).
 *
 * POR QUÉ UN FICHERO APARTE: (1) `styles.css` se sirve SIN `?v=` en las 5 páginas del
 * sitio y tocarlo es arriesgar caché vieja en todas; (2) la CSP de `/portal/*` lleva
 * `style-src 'self'` SIN `unsafe-inline` ⇒ un `style="…"` no valdría, y aquí no hay ni uno.
 *
 * EL PORQUÉ DEL REDISEÑO (01/11/2026, orden del PO: «parece de juguete»): el portal
 * heredaba el lenguaje de la LANDING — botón píldora con degradado y salto, 760 px
 * centrados, `h1` de marketing y las propuestas como tarjetas apiladas. Un panel se
 * reconoce por lo contrario: densidad (14 px), hairlines de 1 px, radios 8/12, UNA sombra,
 * 0 degradados, jerarquía tipográfica de verdad y una barra lateral con dos áreas.
 *
 * MAPA DE CLASES (prefijo `p-` para no pisar nada de `styles.css`):
 *   armazón · .p-shell .p-side .p-brand .p-org .p-nav .p-side-foot .p-main .p-page
 *   página  · .p-head .p-sub .p-card .p-card-h .p-card-t .p-card-b .p-dl .p-row .p-foot
 *   acción  · .p-btn (--2 --sm --quiet --danger) .p-badge (--ok --wait --bad --mute)
 *   lista   · .p-list .p-lh .p-li .p-li-main .p-thumb .p-tt .p-tm .p-date .p-acts .p-note
 *   form    · .p-field .p-label .p-in .p-sel .p-ta .p-hint .p-err .p-cats .p-sec .p-formbar
 *   estado  · .p-empty .p-skel .p-dlg .p-overlay .p-login
 */

/* ---------- que `[hidden]` GANE, pase lo que pase ----------
   `[hidden]` viene del UA con `display:none`, pero cualquier clase que fije `display`
   (`.p-page{display:grid}`, `.p-overlay{display:grid}`…) le gana por especificidad y el
   elemento se queda visible. Sin esta línea, la maqueta enseñaba todas las vistas a la vez. */
[hidden] { display: none !important; }

/* ---------- las 3 vistas de la página ---------- */
/* `data-vista` va en el <body>: alta (público) · login · app. El portal autenticado es una
   APLICACIÓN, así que se queda sin la cabecera y el pie de marketing (el HTML los conserva:
   Vara 25 exige el selector `.langs` en el fichero, no que se vea siempre). */
body[data-vista='app'] .site-header,
body[data-vista='app'] .site-footer { display: none; }
body[data-vista='alta'] #area,
body[data-vista='login'] #alta-sec,
body[data-vista='app'] #alta-sec { display: none; }

/* ---------- el armazón: barra lateral + contenido ---------- */
.p-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--surface);
}
.p-side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px 16px;
  background: var(--background);
  border-right: 1px solid var(--border);
}
.p-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 6px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.p-brand svg { flex: 0 0 auto; color: var(--primary); }
.p-brand span {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.p-org {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.p-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.p-org-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.p-org-sub { font-size: 11.5px; color: var(--text-muted); }
.p-nav { display: grid; gap: 2px; }
.p-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.p-nav button:hover { background: var(--surface-alt); color: var(--text); }
.p-nav button[aria-current='page'] { background: var(--primary-soft); color: var(--primary-dark); }
.p-nav-i { display: inline-flex; align-items: center; gap: 9px; }
.p-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}
.p-nav button[aria-current='page'] .p-count { background: var(--background); color: var(--primary-dark); }
.p-side-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 12px 6px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}
.p-side-foot a,
.p-side-foot button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.p-side-foot a:hover,
.p-side-foot button:hover { color: var(--primary); }
.p-main { min-width: 0; padding: 28px 32px 72px; }
.p-page { max-width: 860px; margin: 0 auto; display: grid; gap: 16px; }
/* ---------- cabecera de página ---------- */
.p-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
}
.p-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.p-sub { margin-top: 4px; font-size: 13px; color: var(--text-muted); }

/* ---------- botones: planos (0 degradado, 0 píldora, 0 salto) ---------- */
.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.p-btn:hover { background: var(--primary-dark); }
.p-btn--2 { background: var(--background); border-color: var(--border-strong); color: var(--text); }
.p-btn--2:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.p-btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.p-btn--quiet { height: 30px; padding: 0 8px; background: none; border-color: transparent; color: var(--primary); }
.p-btn--quiet:hover { background: var(--primary-soft); color: var(--primary-dark); }
.p-btn--danger { height: 30px; padding: 0 8px; background: none; border-color: transparent; color: var(--danger); }
.p-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
/* «Editar» dentro de la cabecera de una tarjeta (03/11/2026: la acción va DONDE ESTÁ EL
   DATO). Se pega 8 px al borde derecho para que su texto quede alineado con la columna de
   valores del `dl` y no 8 px más adentro que ellos. */
.p-card-h .p-btn--quiet { margin-right: -8px; }
.p-btn[disabled] { opacity: 0.55; cursor: default; }
.p-btn[disabled]:hover { background: var(--primary); }

/* ---------- tarjetas y ficha en lectura ---------- */
.p-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.p-card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}
.p-card-t {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.p-card-b { padding: 2px 16px 14px; }
.p-card-b--pad { padding-top: 14px; }
.p-dl { margin: 0; }
.p-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.p-row:last-child { border-bottom: 0; }
.p-row dt { font-size: 13px; color: var(--text-muted); }
.p-row dd { margin: 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.p-row dd a { color: var(--primary); }
.p-num { font-variant-numeric: tabular-nums; }
.p-vacio { color: var(--text-muted); font-weight: 400; }
.p-foot {
  margin-top: 2px;
  padding: 10px 0 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.p-foot--row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.p-foot--plain { border: 0; background: none; padding: 10px 0 0; }
.p-lock {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-muted);
}
.p-lock--plain { border: 0; background: none; padding: 10px 0 0; }

/* ---------- badges de estado: cuadrados, con punto ---------- */
.p-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.p-badge i { display: block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-badge--ok { background: #ecfdf5; color: var(--success); }
.p-badge--wait { background: var(--warning-soft); color: var(--warning); }
.p-badge--bad { background: var(--danger-soft); color: var(--danger); }
.p-badge--mute { background: var(--surface-alt); color: var(--text-muted); }

/* ---------- filtros segmentados ---------- */
.p-seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
}
.p-seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.p-seg button:hover { color: var(--text); }
.p-seg button[aria-pressed='true'] { background: var(--background); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1); }
.p-seg .n { font-size: 11px; font-weight: 700; color: var(--text-muted); }
/* ---------- la lista de propuestas ---------- */
.p-list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); overflow: hidden; }
.p-lh,
.p-li-main {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 118px 104px 140px;
  align-items: center;
  gap: 14px;
}
.p-lh {
  padding: 7px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.p-lh span:nth-child(4) { justify-self: start; }
.p-li { border-bottom: 1px solid var(--border); }
.p-li:last-child { border-bottom: 0; }
.p-li:hover { background: var(--surface); }
.p-li-main { padding: 11px 16px; }
.p-li-main > .p-badge { justify-self: start; }
.p-thumb {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--placeholder);
  overflow: hidden;
}
.p-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.p-tt { font-size: 14px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.p-tt--off { color: var(--text-muted); }
.p-tm { margin-top: 1px; font-size: 12.5px; color: var(--text-muted); }
.p-date { font-size: 13px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.p-date b { display: block; font-weight: 600; }
.p-date span { font-size: 12.5px; color: var(--text-muted); }
.p-acts { display: flex; justify-content: flex-end; gap: 2px; }
.p-note {
  margin: 0 16px 11px;
  padding: 7px 10px;
  border-left: 3px solid var(--danger);
  border-radius: 0 6px 6px 0;
  background: var(--danger-soft);
  color: #7f1d1d;
  font-size: 12.5px;
}
.p-note--ok { border-left-color: var(--success); background: #ecfdf5; color: #065f46; }
.p-note--mute { border-left-color: var(--border-strong); background: var(--surface-alt); color: var(--text-secondary); }

/* ---------- formularios ---------- */
.p-sec {
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.p-sec--sep { margin-top: 22px; }
.p-sec--tight { margin-top: 8px; }
.p-stack { display: grid; gap: 14px; }
.p-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.p-field { display: grid; gap: 5px; }
.p-field--narrow { max-width: 170px; }
.p-label { font-size: 13px; font-weight: 600; }
.p-label .req { color: var(--danger); }
.p-in,
.p-sel,
.p-ta {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--background);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.p-ta { height: auto; min-height: 78px; padding: 9px 10px; line-height: 1.5; resize: vertical; }
.p-in:focus,
.p-sel:focus,
.p-ta:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.p-in[aria-invalid='true'] { border-color: var(--danger); }
.p-in[aria-invalid='true']:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14); }
.p-hint { font-size: 12px; line-height: 1.45; color: var(--text-muted); }
.p-err { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--danger); }
.p-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 7px 12px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.p-cats legend { padding: 0 5px; font-size: 13px; font-weight: 600; }
.p-cat { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-secondary); }
.p-cat input,
.p-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.p-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.p-formbar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.p-formbar .p-hint { max-width: 380px; }
.p-formbar-acts { display: flex; gap: 8px; }
.p-thumb-edit { display: flex; align-items: center; gap: 12px; }
.p-thumb-edit .p-thumb { width: 64px; height: 64px; }
/* ---------- estado vacío + esqueleto de carga ---------- */
.p-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 40px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--background);
  text-align: center;
}
.p-empty-ic {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}
.p-empty h2 { font-size: 15.5px; font-weight: 700; }
.p-empty p { max-width: 44ch; font-size: 13px; color: var(--text-muted); }
.p-empty .p-btn { margin-top: 12px; }
.p-skel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); overflow: hidden; }
.p-skel-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.p-skel-row:last-child { border-bottom: 0; }
.p-sk { height: 11px; border-radius: 6px; background: var(--surface-alt); animation: p-pulse 1.4s ease-in-out infinite; }
.p-sk--box { width: 48px; height: 48px; border-radius: 8px; }
.p-sk--w60 { width: 60%; }
.p-sk--w40 { width: 40%; height: 9px; margin-top: 7px; }
.p-sk--end { justify-self: end; width: 72px; }
@keyframes p-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- la capa modal (nueva · corregir) ---------- */
.p-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(15, 23, 42, 0.45);
  overflow: auto;
}
.p-dlg {
  display: flex;
  flex-direction: column;
  width: min(660px, 100%);
  max-height: calc(100vh - 48px);
  border-radius: var(--radius);
  background: var(--background);
  box-shadow: 0 24px 48px -24px rgba(15, 23, 42, 0.45);
}
.p-dlg-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.p-dlg-h h2 { font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; }
.p-dlg-h p { margin-top: 2px; font-size: 12.5px; color: var(--text-muted); }
.p-dlg-x {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.p-dlg-x:hover { background: var(--surface-alt); color: var(--text); }
.p-dlg-b { padding: 18px; overflow: auto; }
.p-dlg-f {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.p-dlg-f span { font-size: 12.5px; color: var(--text-muted); }
.p-dlg-acts { display: flex; flex-wrap: wrap; gap: 8px; }
/* ---------- entrar ---------- */
.p-login { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; background: var(--surface); }
.p-login-box {
  width: min(420px, 100%);
  padding: 26px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.p-login-box .p-brand { margin-bottom: 18px; padding: 0; }
.p-login-box h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.p-login-box .p-sub { margin-bottom: 18px; }
.p-login-box form { display: grid; gap: 14px; }
.p-login-box .p-btn { width: 100%; height: 40px; }
.p-login-alt { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }
.p-linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.p-linkish:hover { color: var(--primary-dark); }

/* ---------- el alta (público): la misma ficha, más ancha ---------- */
.p-alta { display: grid; gap: 16px; max-width: 720px; margin: 0 auto; }
.p-alta-head { max-width: 640px; }
.p-alta-head h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); font-weight: 800; letter-spacing: -0.02em; }
.p-alta-head .p-sub { margin-top: 8px; font-size: 15px; line-height: 1.6; }
.p-alta-form { display: grid; gap: 16px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--background); }
.p-aviso { margin: 0; }
.p-aviso.ok,
.p-aviso.err { padding: 12px 14px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.p-aviso.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.p-aviso.err { background: var(--danger-soft); border: 1px solid #fecaca; color: var(--danger); }
/* El aviso del portal va FUERA de las dos vistas: se ve al entrar, al salir y al fallar. */
.p-aviso--top { max-width: 860px; margin: 16px auto 0; }
.p-aviso--top:empty { display: none; }
/* Honeypot: fuera de la pantalla pero en el DOM (un bot lo rellena igual). */
.p-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.p-fila-fecha { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem; gap: 10px; }
.p-atajos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.p-atajos button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--background);
  color: var(--text-secondary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.p-atajos button:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }
.p-cartel-prev img { display: block; max-width: 100%; height: auto; margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; }

/* ---------- utilidades con NOMBRE (nunca `style="…"`: la CSP lo bloquea) ---------- */
.p-sprite { position: absolute; width: 0; height: 0; }
.p-mt-8 { margin-top: 8px; }
.p-mt-22 { margin-top: 22px; }
.p-w-200 { max-width: 200px; }

/* ---------- iconos (inline: 0 peticiones, 0 que añadir a la CSP) ---------- */
.ic { flex: 0 0 auto; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic--lg { width: 18px; height: 18px; }
.ic--mid { vertical-align: -3px; }

/* ---------- móvil ---------- */
@media (max-width: 900px) {
  .p-shell { grid-template-columns: 1fr; }
  .p-side {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .p-org { order: 3; flex: 1 1 100%; padding: 8px; background: var(--background); }
  .p-nav { order: 2; flex: 1 1 100%; flex-direction: row; gap: 2px; padding-top: 10px; border-top: 1px solid var(--border); }
  .p-nav button { flex: 1 1 0; justify-content: center; }
  .p-side-foot { display: none; }
  .p-main { padding: 18px 14px 56px; }
  .p-head { flex-wrap: wrap; }
  /* Los «Editar» de tarjeta, a 36 px: 30 px es un blanco pequeño con el dedo (el de la
     cabecera ya es 36 y no se toca). */
  .p-card-h .p-btn--quiet { height: 36px; }
  .p-row { grid-template-columns: 1fr; gap: 2px; }
  .p-row dt { font-size: 12px; }
  .p-lh { display: none; }
  .p-li-main { grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 4px 12px; }
  .p-thumb { grid-row: 1 / span 4; grid-column: 1; }
  .p-li-main > div:nth-child(2) { grid-column: 2; grid-row: 1; }
  .p-li-main .p-date { grid-column: 2; grid-row: 2; display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
  .p-date b { display: inline; }
  .p-li-main .p-badge { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 7px; }
  .p-acts { grid-column: 2; grid-row: 4; justify-content: flex-start; margin-top: 7px; }
  .p-grid2 { grid-template-columns: 1fr; }
  .p-note { margin: 0 12px 10px; }
  .p-seg { max-width: 100%; overflow-x: auto; }
  .p-formbar { flex-wrap: wrap; }
  .p-dlg-b { padding: 14px; }
  .p-fila-fecha { grid-template-columns: 1fr; }
}

/* ⛔ Un solo `prefers-reduced-motion`: el esqueleto deja de latir. */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}




