/* Panel ACHM — chrome del administrador. Usa tokens.css; sin literales de color de marca. */
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: #eef3f6; }
a { color: var(--achm-azul-desarrollo); }
h1, h2, h3 { font-family: var(--font-title); }
.muted { color: #6a7785; font-size: 14px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--achm-rojo); color: #fff; padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--achm-turquesa); outline-offset: 2px; }

/* ---- Botones / formularios ---- */
.btnx { font-family: var(--font-title); font-weight: 600; font-size: 14px; padding: 10px 18px; border-radius: 9px; border: 0; cursor: pointer; text-decoration: none; display: inline-block; transition: filter .15s, transform .15s; }
.btnx:hover { filter: brightness(1.05); }
.btnx.pri { background: var(--achm-rojo); color: #fff; }
.btnx.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--achm-azul-corp); }
.btnx.sm { padding: 7px 13px; font-size: 13px; }
.btnx.block { width: 100%; }
.btnx.danger { background: #fff; border: 1.5px solid var(--achm-rojo); color: var(--achm-rojo); }
.inline { display: inline-block; }
.adm-form { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
/* Forms con varias tarjetas (Configuración, Home, Páginas, Menús…): las secciones se
   reparten en columnas para aprovechar TODO el ancho de la pantalla. */
.adm-form:not(.noti-mainform):has(> .adm-card ~ .adm-card) { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 18px; align-items: start; }
.adm-form > .form-actions { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font-family: var(--font-title); font-weight: 600; font-size: 13.5px; color: var(--achm-azul-corp); }
.fld--check { flex-direction: row; align-items: center; gap: 10px; }
.fld--check input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--achm-turquesa); }
.fld--check > span { font-weight: 500; }
.fld input, .fld select, .fld textarea { font-family: var(--font-body); font-size: 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); width: 100%; }
.fld textarea { min-height: 160px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 2px solid var(--achm-turquesa); outline-offset: 0; border-color: var(--achm-turquesa); }
.fld .hint { font-size: 12.5px; color: #8a97a5; font-weight: 400; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; }

/* ---- Flash ---- */
.flash { padding: 12px 16px; border-radius: 9px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.flash-ok { background: #e8f7ee; border-color: #a8e0bd; color: #1c6b3a; }
.flash-error { background: #fdeaed; border-color: #f1b6c0; color: #9b1f33; }
.flash-info { background: #e6f3fb; border-color: #b5dcf2; color: #16527a; }

/* ---- Layout de autenticación (login/2fa/enroll) ---- */
/* ===== Pantallas de auth (login / 2FA): slideshow de Chile región por región ===== */
.adm-authwrap { min-height: 100vh; background: var(--achm-azul-corp); }
.adm-auth-hero { position: relative; display: grid; place-items: center; padding: 40px 20px; overflow: hidden; }
/* Fondo: capas de imagen que se van cruzando (una por región) — solo fundido, sin zoom */
.adm-hero-bg { position: absolute; inset: 0; z-index: 0; }
.adm-hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.4s ease; will-change: opacity; }
.adm-hero-slide.is-on { opacity: 1; }
.adm-hero-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,39,63,.55) 0%, rgba(0,39,63,.30) 34%, rgba(0,39,63,.62) 100%),
              radial-gradient(120% 90% at 50% 45%, transparent 40%, rgba(0,20,34,.55) 100%); }
.adm-hero-silueta { position: absolute; right: 4%; top: 50%; height: 118%; width: auto; z-index: 1; opacity: .10;
  filter: brightness(0) invert(1); transform: translateY(-50%); animation: authFloat 9s ease-in-out infinite alternate; pointer-events: none; }
@keyframes authFloat { from { transform: translateY(-53%); } to { transform: translateY(-47%); } }

/* Tarjeta de login centrada, con fondo semitransparente (glass) */
.adm-auth-hero .adm-auth-card { position: relative; z-index: 2; width: 100%; max-width: 408px; animation: authIn .6s ease .12s both; }
.adm-glass { background: rgba(255,255,255,.48); backdrop-filter: blur(30px) saturate(1.4); -webkit-backdrop-filter: blur(30px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.5); box-shadow: 0 24px 70px rgba(0,20,34,.45); }

/* Botón pequeño «Volver a la web», flotando sobre el hero */
.adm-hero-back { position: absolute; top: 20px; left: 20px; z-index: 3; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px 8px 11px; border-radius: 100px; background: rgba(255,255,255,.16); backdrop-filter: blur(8px);
  color: #fff; font-family: var(--font-title); font-weight: 600; font-size: 13px; text-decoration: none;
  border: 1px solid rgba(255,255,255,.28); transition: background .16s, transform .16s; }
.adm-hero-back:hover { background: rgba(255,255,255,.28); transform: translateX(-2px); }
@media (max-width: 560px) { .adm-hero-back { top: 12px; left: 12px; font-size: 12px; } }
@keyframes authIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Caption que va nombrando la región en pantalla */
.adm-hero-caption { position: absolute; left: 0; right: 0; bottom: 22px; z-index: 2; margin: 0; text-align: center;
  color: #fff; text-shadow: 0 1px 10px rgba(0,20,34,.6); pointer-events: none; }
.adm-hero-caption-label { display: block; font-family: var(--font-title); font-weight: 600; text-transform: uppercase;
  letter-spacing: 2.5px; font-size: 10.5px; color: var(--achm-celeste); opacity: .9; }
.adm-hero-caption-region { display: inline-block; font-family: var(--font-title); font-weight: 800; font-size: 18px; margin-top: 3px;
  transition: opacity .5s ease, transform .5s ease; }
.adm-hero-caption-region.is-swap { opacity: 0; transform: translateY(6px); }
@media (max-width: 560px) { .adm-hero-caption { bottom: 14px; } .adm-hero-caption-region { font-size: 16px; } }

/* Login: cabecera con el logo ACHM completo (con claim «346 comunas») */
.adm-login-head { text-align: center; margin-bottom: 10px; }
.adm-login-logo { display: block; width: 232px; max-width: 78%; height: auto; margin: 2px auto 18px; animation: loginLogoIn .7s cubic-bezier(.22, 1, .36, 1) both, loginFloat 5s ease-in-out 1.1s infinite; }
@keyframes loginLogoIn { from { opacity: 0; transform: translateY(-14px) scale(.93); } to { opacity: 1; transform: none; } }
@keyframes loginFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.adm-login-head .adm-h1 { margin-bottom: 4px; }
/* Enlaces auxiliares del login (olvidé contraseña / volver al ingreso) */
.adm-login-alt { text-align: center; margin: 16px 0 0; font-size: 13.5px; animation: authIn .5s ease .36s both; }
.adm-login-alt a { color: var(--achm-azul-desarrollo, #0E4975); font-family: var(--font-title); font-weight: 600; text-decoration: none; }
.adm-login-alt a:hover { color: var(--achm-turquesa, #01818B); text-decoration: underline; }

.adm-auth-card { position: relative; overflow: hidden; }

/* Login: entrada escalonada de campos + botón */
.adm-login-form .fld, .adm-login-btn { animation: authIn .5s cubic-bezier(.22, 1, .36, 1) both; }
.adm-login-form .fld:nth-of-type(1) { animation-delay: .14s; }
.adm-login-form .fld:nth-of-type(2) { animation-delay: .22s; }
.adm-login-btn { animation-delay: .30s; }

/* Login: foco animado de los inputs + etiqueta que reacciona */
.adm-login-form .fld input { transition: border-color .18s, box-shadow .18s, transform .18s; }
.adm-login-form .fld input:focus { outline: none; border-color: var(--achm-turquesa); box-shadow: 0 0 0 3px rgba(1, 129, 139, .18); transform: translateY(-1px); }
.adm-login-form .fld:focus-within > span { color: var(--achm-turquesa); transition: color .18s; }

/* Password con mostrar/ocultar */
.adm-pass { position: relative; display: block; }
.adm-pass input { padding-right: 46px; }
.adm-pass-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 34px; height: 34px; border: 0; background: transparent; color: #8a97a5; cursor: pointer; border-radius: 8px; transition: color .15s, background .15s; }
.adm-pass-toggle:hover { color: var(--achm-azul-corp); background: var(--paper); }
.adm-pass-toggle svg[hidden] { display: none; }

/* Botón de ingreso con flecha + micro-interacción */
.adm-login-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; }
.adm-login-btn svg { transition: transform .2s; }
.adm-login-btn:hover { transform: translateY(-2px); }
.adm-login-btn:hover svg { transform: translateX(3px); }
.adm-login-btn:active { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .adm-auth-logo, .adm-auth-claim, .adm-auth-sub, .adm-auth-card, .adm-auth-dots, .adm-auth-silueta, .adm-login-logo, .adm-login-form .fld, .adm-login-btn { animation: none !important; }
}
.adm-card { background: #fff; border-radius: 16px; padding: 38px 34px; width: 100%; box-shadow: 0 24px 60px rgba(10,26,58,.28); }
/* Solo en las pantallas de auth (login/2FA/respaldo) la tarjeta se mantiene angosta. */
.adm-authwrap .adm-card { max-width: 440px; }
.adm-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.adm-brand span { font-family: var(--font-title); font-weight: 700; color: var(--achm-azul-corp); font-size: 15px; }
.adm-h1 { font-size: 24px; color: var(--achm-azul-corp); margin: 0 0 4px; }
.adm-h2 { font-size: 17px; color: var(--achm-azul-corp); margin: 0 0 14px; }
.totp-qr { margin: 18px 0; }
.totp-qr img { display: block; width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.totp-secret { background: var(--achm-celeste); border-radius: 10px; padding: 14px 16px; margin: 18px 0; display: flex; flex-direction: column; gap: 4px; }
.totp-secret .totp-label { font-size: 12px; font-weight: 600; color: var(--achm-azul-corp); font-family: var(--font-title); text-transform: uppercase; letter-spacing: 1px; }
.totp-secret code { font-family: ui-monospace, monospace; font-size: 18px; letter-spacing: 2px; color: var(--achm-azul-corp); }
.totp-uri { margin: -6px 0 8px; font-size: 13px; }
.totp-uri code { word-break: break-all; font-size: 12px; color: #5a6775; }
.backup-codes { list-style: none; padding: 16px; margin: 18px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; background: var(--paper); border: 1px dashed var(--achm-turquesa); border-radius: 10px; font-family: ui-monospace, monospace; font-size: 16px; letter-spacing: 1px; }

/* ---- Layout del panel (sidebar + contenido) ---- */
body.adm { display: flex; min-height: 100vh; }
.adm-side { width: 250px; background: linear-gradient(185deg, #00314f 0%, var(--achm-azul-corp) 52%, #001a2c 100%); color: #cdd9e3; display: flex; flex-direction: column; padding: 14px 0 8px; position: sticky; top: 0; height: 100vh; flex-shrink: 0; overflow-y: auto; z-index: 20; box-shadow: inset -1px 0 0 rgba(255,255,255,.05); transition: width .22s ease; }
.adm-logo { width: 100%; border: 0; border-bottom: .5px solid rgba(255,255,255,.12); background: none; cursor: pointer; padding: 10px 20px 16px; display: flex; justify-content: center; align-items: center; }
.adm-logo img { transition: transform .25s ease; }
.adm-logo-full { height: 44px; width: auto; }
.adm-logo-mark { display: none; width: 36px; height: 36px; border-radius: 9px; }
.adm-logo:hover img { transform: scale(1.05); }
.adm-side-group { margin: 4px 0; }
.adm-side-title { width: calc(100% - 16px); margin: 8px 8px 2px; background: none; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; border-radius: 8px; font-family: var(--font-title); font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #6f8597; transition: color .15s, background .15s; }
.adm-side-title:hover { color: var(--achm-celeste); background: rgba(255,255,255,.05); }
.adm-side-chev { flex-shrink: 0; transition: transform .25s ease; }
.adm-side-group.is-collapsed .adm-side-chev { transform: rotate(-90deg); }
.adm-side-sublist { list-style: none; margin: 0; padding: 0; max-height: 640px; overflow: hidden; transition: max-height .28s ease, opacity .2s ease; }
.adm-side-group.is-collapsed .adm-side-sublist { max-height: 0; opacity: 0; }
.adm-side ul { list-style: none; margin: 0; padding: 0; }
.adm-side li a { position: relative; display: flex; align-items: center; gap: 11px; margin: 2px 10px; padding: 9px 13px; color: #cdd9e3; text-decoration: none; font-family: var(--font-title); font-weight: 500; font-size: 14px; border-radius: 11px; transition: background .15s, color .15s, transform .12s, box-shadow .15s; }
.adm-side li a:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(3px); }
.adm-side li a[aria-current] { color: #fff; background: var(--achm-turquesa); box-shadow: 0 6px 16px rgba(1,129,139,.45); }
.adm-side li a[aria-current]:hover { transform: none; filter: brightness(1.05); }
.adm-side .adm-ic { flex-shrink: 0; opacity: .82; }
.adm-side li a[aria-current] .adm-ic { opacity: 1; color: #fff; }
.adm-back { margin-top: auto; display: flex; align-items: center; gap: 11px; padding: 14px 22px; color: var(--achm-celeste); font-size: 13px; text-decoration: none; border-top: .5px solid rgba(255,255,255,.12); transition: color .15s; }
.adm-back svg { flex-shrink: 0; }
.adm-back:hover { color: #fff; }

/* Botón para colapsar/expandir todo el sidebar */
.adm-side-collapse { display: flex; align-items: center; gap: 11px; width: calc(100% - 20px); margin: 8px 10px 2px; padding: 9px 13px; background: rgba(255,255,255,.05); border: 0; border-radius: 11px; color: #9fb6c6; font-family: var(--font-title); font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s, color .15s; }
.adm-side-collapse:hover { background: rgba(255,255,255,.1); color: #fff; }
.adm-collapse-ic { flex-shrink: 0; transition: transform .25s ease; }

/* ---- Modo solo-íconos (sidebar colapsado) ---- */
.adm-side.is-mini { width: 74px; overflow: visible; z-index: 30; }
.adm-side.is-mini .adm-logo-full,
.adm-side.is-mini .adm-side-title,
.adm-side.is-mini li a > span,
.adm-side.is-mini .adm-side-collapse > span,
.adm-side.is-mini .adm-back > span { display: none; }
.adm-side.is-mini .adm-logo-mark { display: block; }
.adm-side.is-mini .adm-logo { padding: 10px 0 16px; }
.adm-side.is-mini .adm-side-group { margin: 6px 0; }
.adm-side.is-mini .adm-side-sublist { max-height: none !important; opacity: 1 !important; overflow: visible; }
.adm-side.is-mini li a { justify-content: center; padding: 11px 0; margin: 3px 13px; }
.adm-side.is-mini li a:hover { transform: none; }
.adm-side.is-mini .adm-side-collapse { justify-content: center; padding: 11px 0; width: calc(100% - 26px); margin-left: 13px; margin-right: 13px; }
.adm-side.is-mini .adm-collapse-ic { transform: rotate(180deg); }
.adm-side.is-mini .adm-back { justify-content: center; padding: 14px 0; }

/* Tooltip con el nombre al pasar el cursor (modo solo-íconos) */
.adm-side.is-mini [data-tip]::after { content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%) translateX(-4px); background: #0a1a2a; color: #fff; font-family: var(--font-title); font-weight: 600; font-size: 13px; padding: 7px 12px; border-radius: 8px; white-space: nowrap; pointer-events: none; opacity: 0; box-shadow: 0 10px 26px rgba(0,0,0,.35); transition: opacity .14s ease, transform .14s ease; z-index: 60; }
.adm-side.is-mini [data-tip]::before { content: ""; position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%); border: 6px solid transparent; border-right-color: #0a1a2a; opacity: 0; pointer-events: none; transition: opacity .14s ease; z-index: 60; }
.adm-side.is-mini [data-tip]:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.adm-side.is-mini [data-tip]:hover::before { opacity: 1; }
.adm-side.is-mini .adm-side-collapse { position: relative; }
body.adm { background:
  radial-gradient(900px 520px at 100% -8%, rgba(1,129,139,.08), transparent 60%),
  radial-gradient(760px 460px at -6% 108%, rgba(198,37,60,.05), transparent 58%),
  #eef3f6; }
.adm-shell { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
/* Marca de agua de marca: la silueta punteada de Chile (las 346 comunas) sobre el lado
   derecho del panel — referencia al claim "346 Comunas, Un Solo Chile". Sutil y decorativa. */
.adm-shell::before {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(46vw, 560px);
  z-index: 0;
  pointer-events: none;
  background: var(--achm-azul-desarrollo);
  -webkit-mask: url("../img/chile-silueta.svg") no-repeat right -20px center / auto 152%;
  mask: url("../img/chile-silueta.svg") no-repeat right -20px center / auto 152%;
  opacity: .07;
}
.adm-content, .adm-topbar { position: relative; z-index: 1; }
.adm-topbar { background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); padding: 11px 24px; display: flex; align-items: center; gap: 18px; position: sticky; top: 0; z-index: 12; }
.adm-topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--achm-grad-oscuro); opacity: .5; }
.adm-crumb { font-family: var(--font-title); font-weight: 700; color: var(--achm-azul-corp); font-size: 15px; flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-rol { color: var(--achm-turquesa); font-weight: 600; text-transform: capitalize; }

/* ---- Buscador global del header ---- */
.adm-search { position: relative; flex: 0 1 480px; display: flex; align-items: center; }
.adm-search-ic { position: absolute; left: 13px; color: #8593a3; pointer-events: none; }
.adm-search-input { width: 100%; height: 40px; border: 1.5px solid var(--line); background: #f5f8fa; border-radius: 12px; padding: 0 42px 0 40px; font-family: var(--font-body); font-size: 14px; color: var(--achm-azul-corp); transition: border-color .16s, box-shadow .16s, background .16s; }
.adm-search-input::placeholder { color: #97a3b2; }
.adm-search-input:focus { outline: none; background: #fff; border-color: var(--achm-turquesa); box-shadow: 0 0 0 3px rgba(1,129,139,.16); }
.adm-search-kbd { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-family: var(--font-body); font-size: 11px; font-weight: 600; color: #8593a3; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; pointer-events: none; }
.adm-search-input:focus ~ .adm-search-kbd { opacity: 0; }
.adm-search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: min(70vh, 520px); overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px rgba(10,26,58,.18); padding: 6px; z-index: 40; animation: admPop .16s ease both; }
@keyframes admPop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.adm-sr-head { display: flex; align-items: center; gap: 7px; padding: 9px 10px 4px; font-family: var(--font-title); font-weight: 700; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: #8593a3; }
.adm-sr-head svg { width: 13px; height: 13px; }
.adm-sr-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; text-decoration: none; color: var(--achm-azul-corp); }
.adm-sr-item:hover, .adm-sr-item.is-active { background: color-mix(in srgb, var(--achm-turquesa) 12%, white); }
.adm-sr-ic { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--achm-azul-desarrollo) 12%, white); color: var(--achm-azul-desarrollo); }
.adm-sr-ic svg { width: 17px; height: 17px; }
.adm-sr-tx { min-width: 0; display: flex; flex-direction: column; }
.adm-sr-t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-sr-s { font-size: 12px; color: #6a7785; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: capitalize; }
.adm-sr-empty { padding: 22px 14px; text-align: center; color: #6a7785; font-size: 13.5px; }

/* ---- Menú de perfil del header ---- */
.adm-userbox { display: flex; align-items: center; gap: 12px; position: relative; flex: 1 1 0; justify-content: flex-end; }
.adm-profile { display: flex; align-items: center; gap: 10px; background: transparent; border: 1.5px solid transparent; border-radius: 12px; padding: 5px 9px 5px 5px; cursor: pointer; transition: background .15s, border-color .15s; }
.adm-profile:hover { background: #f1f5f8; }
.adm-profile.is-open { background: #f1f5f8; border-color: var(--line); }
.adm-avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-family: var(--font-title); font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--achm-turquesa), var(--achm-azul-desarrollo)); box-shadow: 0 4px 12px rgba(1,129,139,.32); }
.adm-avatar.lg { width: 44px; height: 44px; border-radius: 13px; font-size: 16px; }
.adm-profile-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.adm-profile-name { font-family: var(--font-title); font-weight: 600; font-size: 13.5px; color: var(--achm-azul-corp); max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-profile-meta .adm-rol { font-size: 11.5px; }
.adm-profile-chev { color: #8593a3; transition: transform .18s; }
.adm-profile.is-open .adm-profile-chev { transform: rotate(180deg); }
.adm-profile-menu { position: absolute; top: calc(100% + 9px); right: 0; width: 270px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px rgba(10,26,58,.18); padding: 7px; z-index: 40; animation: admPop .16s ease both; }
.adm-profile-head { display: flex; align-items: center; gap: 12px; padding: 11px 11px 13px; }
.adm-profile-head > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.adm-profile-head strong { font-family: var(--font-title); font-size: 14.5px; color: var(--achm-azul-corp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-profile-mail { font-size: 12px; color: #6a7785; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-chip-rol { align-self: flex-start; margin-top: 3px; font-family: var(--font-title); font-weight: 700; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--achm-turquesa); background: color-mix(in srgb, var(--achm-turquesa) 14%, white); border-radius: 20px; padding: 2px 9px; }
.adm-profile-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px; border-radius: 10px; text-decoration: none; color: var(--achm-azul-corp); font-size: 14px; font-family: var(--font-body); background: transparent; border: 0; cursor: pointer; text-align: left; }
.adm-profile-item:hover { background: color-mix(in srgb, var(--achm-turquesa) 12%, white); }
.adm-profile-item svg { color: var(--achm-azul-desarrollo); flex: 0 0 auto; }
.adm-profile-logout { padding: 0; }
.adm-profile-logout button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px; border-radius: 10px; background: transparent; border: 0; cursor: pointer; color: var(--achm-rojo); font-size: 14px; font-family: var(--font-body); text-align: left; }
.adm-profile-logout button:hover { background: color-mix(in srgb, var(--achm-rojo) 10%, white); }
.adm-profile-logout button svg { color: var(--achm-rojo); }
.adm-profile-sep { height: 1px; background: var(--line); margin: 6px 4px; }

@media (max-width: 980px) {
  .adm-crumb { display: none; }
  .adm-search { flex: 1 1 auto; }
  .adm-profile-meta { display: none; }
}

/* ---- Mi perfil ---- */
.adm-sub { color: #6a7785; font-size: 14px; margin: 2px 0 20px; max-width: 680px; }
.adm-perfil { gap: 20px; }
.adm-perfil .adm-card { margin: 0; }
.adm-card-note { color: #6a7785; font-size: 13px; margin: -4px 0 14px; }
.adm-perfil .fld input:disabled { background: #f1f5f8; color: #8593a3; cursor: not-allowed; -webkit-text-fill-color: #8593a3; }
.adm-content { padding: 30px 32px; max-width: none; animation: admIn .45s ease both; }
.adm-h1 { animation: admIn .4s ease both; }
@keyframes admIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---- KPIs / paneles ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 16px; margin: 22px 0 28px; }
.kpi { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 20px 18px; text-decoration: none; color: inherit; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; animation: admIn .5s ease both; }
.kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--achm-grad-oscuro); transform: scaleX(0); transform-origin: left; transition: transform .28s ease; }
.kpi:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(10,26,58,.14); border-color: transparent; }
.kpi:hover::before { transform: scaleX(1); }
.kpi b { font-family: var(--font-title); font-size: 34px; font-weight: 800; color: var(--achm-azul-corp); display: block; line-height: 1; letter-spacing: -.5px; }
.kpi span { font-size: 13px; color: #6a7785; display: block; margin-top: 6px; }
.kpi:nth-child(2) { animation-delay: .04s; }
.kpi:nth-child(3) { animation-delay: .08s; }
.kpi:nth-child(4) { animation-delay: .12s; }
.kpi:nth-child(5) { animation-delay: .16s; }
.adm-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.adm-panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(10,26,58,.04); animation: admIn .5s ease both; }
.adm-h2 { font-size: 17px; position: relative; padding-left: 14px; margin-top: 0; }
.adm-h2::before { content: ""; position: absolute; left: 0; top: .18em; bottom: .18em; width: 4px; border-radius: 3px; background: var(--achm-turquesa); }
.adm-list, .adm-activity { list-style: none; margin: 0; padding: 0; }
.adm-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: .5px solid var(--line); }
.adm-list li:last-child { border-bottom: 0; }
.adm-activity li { padding: 7px 0; font-size: 13.5px; border-bottom: .5px solid var(--line); }
.ev-act { font-family: var(--font-title); font-weight: 600; color: var(--achm-azul-desarrollo); }

/* ---- Tablas ---- */
.adm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 18px 0; flex-wrap: wrap; }
.adm-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.adm-filters select, .adm-filters input { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; }
.adm-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.adm-table th, .adm-table td { text-align: left; padding: 12px 14px; border-bottom: .5px solid var(--line); font-size: 14px; }
.adm-table th { font-family: var(--font-title); font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; color: #6a7785; background: var(--paper); }
.adm-table tbody tr { transition: background .12s ease; }
.adm-table tbody tr:hover { background: var(--paper); }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table .acts { display: flex; gap: 8px; }
.adm-table a.lnk { color: var(--achm-azul-desarrollo); text-decoration: none; font-weight: 500; }
.adm-table a.del { color: var(--achm-rojo); }

/* ---- Badges de estado (color + texto, §22.1 P5) ---- */
.badge { font-family: var(--font-title); font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; text-transform: capitalize; }
.badge-publicado, .badge-activo { background: #e8f7ee; color: #1c6b3a; }
.badge-borrador, .badge-inactivo { background: #eef1f4; color: #5a6775; }
.badge-revision { background: #fff3e0; color: #9a5b00; }
.badge-archivado { background: #fdeaed; color: #9b1f33; }

/* Tarjetas del editor (Home, etc.) */
.adm-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 18px; box-shadow: 0 2px 10px rgba(10,26,58,.04); animation: admIn .5s ease both; }
.adm-card > h2 { font-size: 17px; position: relative; padding-left: 14px; margin-top: 0; }
.adm-card > h2::before { content: ""; position: absolute; left: 0; top: .18em; bottom: .18em; width: 4px; border-radius: 3px; background: var(--achm-turquesa); }

/* Miniatura en listados + campo con media-picker */
.adm-thumb { width: 46px; height: 34px; object-fit: contain; border-radius: 6px; background: #f4f7fa; border: .5px solid var(--line); }
.adm-media-field { display: flex; gap: 8px; align-items: center; }
.adm-media-field input { flex: 1; }

/* Formulario ancho con secciones (builder de boletines) */
.adm-form--wide { max-width: none; }
.adm-fs { border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px 4px; margin: 0 0 18px; background: #fff; }
.adm-fs > legend { font-family: var(--font-title); font-weight: 700; font-size: 13px; color: var(--achm-azul-corp); padding: 2px 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; }
.adm-fs select[multiple] { min-height: 150px; padding: 6px; }

/* Constructor de estructura de la portada (drag + toggle) */
.home-layout { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.home-layout-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; cursor: grab; }
.home-layout-item.is-drag { opacity: .5; box-shadow: 0 8px 22px rgba(10,26,58,.12); }
.home-layout-item.is-off { opacity: .55; }
.hl-handle { color: #9aa7b4; font-size: 18px; line-height: 1; cursor: grab; }
.hl-label { font-family: var(--font-title); font-weight: 600; color: var(--achm-azul-corp); flex: 1; }
.hl-move { display: flex; gap: 4px; }
.hl-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #5a6775; cursor: pointer; white-space: nowrap; }
.adm-rost-sep { border: 0; border-top: 1px dashed var(--line); margin: 14px 0; }

/* Vista previa del Home (iframe same-origin) */
.home-prev-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.home-prev-head h2 { margin: 0; }
.home-prev-tools { display: flex; gap: 8px; }
.home-prev-frame { width: 100%; height: 540px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-top: 8px; }
.bol-email-frame { width: 100%; height: 600px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); margin-top: 8px; }

/* ===== Escritorio (dashboard) enriquecido ===== */
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dash-head .adm-h1 { margin: 0; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dash-actions .btnx { display: inline-flex; align-items: center; gap: 5px; }
.dash-actions .btnx svg { width: 15px; height: 15px; }

.dash-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin: 20px 0 22px; }
.dash-kpi { display: flex; flex-direction: column; background: #fff; border-radius: 16px; padding: 18px 20px; text-decoration: none; color: inherit; box-shadow: 0 2px 14px rgba(10,26,58,.06); transition: transform .18s ease, box-shadow .18s ease; animation: admIn .5s ease both; }
.dash-kpi:hover { transform: translateY(-5px); box-shadow: 0 18px 38px color-mix(in srgb, var(--c, #01818b) 24%, rgba(10,26,58,.12)); }
.dash-kpi-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--c, #01818b); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--c, #01818b) 42%, transparent); margin-bottom: 12px; }
.dash-kpi-ic svg { width: 22px; height: 22px; }
.dash-kpi b { font-family: var(--font-title); font-size: 32px; font-weight: 800; color: var(--achm-azul-corp); line-height: 1; letter-spacing: -.5px; }
.dash-kpi > span:last-child { font-size: 12.5px; color: #6a7785; margin-top: 6px; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.dash-mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 10px; }
.dash-mini { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 14px; text-decoration: none; color: inherit; background: #fff; box-shadow: 0 2px 12px rgba(10,26,58,.05); transition: transform .15s ease, box-shadow .15s ease; }
.dash-mini:hover { transform: translateY(-3px); box-shadow: 0 14px 28px color-mix(in srgb, var(--c, #0e4975) 20%, rgba(10,26,58,.1)); }
.dash-mini-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--c, #0e4975) 14%, white); color: var(--c, #0e4975); margin-bottom: 8px; }
.dash-mini-ic svg { width: 21px; height: 21px; }
.dash-mini b { font-family: var(--font-title); font-size: 24px; color: var(--achm-azul-corp); line-height: 1.1; margin-top: 4px; }
.dash-mini > span:last-child { font-size: 12.5px; color: #6a7785; }

.dash-an-row { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--paper); border-radius: 10px; }
.dash-an-ic { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; background: rgba(1,129,139,.12); color: var(--achm-turquesa); }
.dash-an-stats { list-style: none; margin: 14px 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dash-an-stats li { text-align: center; padding: 12px 6px; background: var(--paper); border-radius: 10px; }
.dash-an-stats b { display: block; font-family: var(--font-title); font-size: 23px; font-weight: 800; color: var(--achm-azul-corp); }
.dash-an-stats span { font-size: 11px; color: #6a7785; }

.dash-anun-form { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--paper); border-radius: 10px; margin-bottom: 14px; }
.dash-anun-form .form-row { grid-template-columns: 1fr 128px; gap: 8px; }
.dash-anun-form input, .dash-anun-form select, .dash-anun-form textarea { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: var(--font-body); background: #fff; }
.dash-anun-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dash-anun { padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--achm-turquesa); border-radius: 10px; background: #fff; }
.dash-anun--aviso { border-left-color: #9a5b00; }
.dash-anun--urgente { border-left-color: var(--achm-rojo); }
.dash-anun-top { display: flex; align-items: center; gap: 8px; }
.dash-anun-top strong { flex: 1; color: var(--achm-azul-corp); font-family: var(--font-title); font-size: 14.5px; }
.dash-anun-badge { background: rgba(1,129,139,.14); color: var(--achm-turquesa); }
.dash-anun--aviso .dash-anun-badge { background: #fff3e0; color: #9a5b00; }
.dash-anun--urgente .dash-anun-badge { background: #fdeaed; color: var(--achm-rojo); }
.dash-anun-del { margin: 0; }
.dash-anun-x { border: 0; background: none; color: #9aa7b4; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px; line-height: 1; }
.dash-anun-x:hover { background: var(--paper); color: var(--achm-rojo); }
.dash-anun-body { font-size: 13.5px; color: #41505e; margin: 6px 0 4px; line-height: 1.5; }
.dash-anun-meta { font-size: 11.5px; color: #8a97a5; }
@media (max-width: 1240px) { .dash-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 920px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .dash-kpis { grid-template-columns: repeat(2, 1fr); } .dash-mini-grid { grid-template-columns: repeat(2, 1fr); } }

/* Editor de noticias: imagen destacada */
.rte-img { display: flex; gap: 14px; align-items: flex-start; }
.rte-img-prev { width: 180px; height: 110px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); display: flex; align-items: center; justify-content: center; }
.rte-img-prev img { width: 100%; height: 100%; object-fit: cover; }
.rte-img-prev.is-empty::after { content: "Sin imagen"; font-size: 12.5px; color: #8a97a5; }
.rte-img-ctl { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.rte-img-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.rte-upload { position: relative; cursor: pointer; }

/* Editor de noticias: WYSIWYG */
.rte { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.rte:focus-within { border-color: var(--achm-turquesa); box-shadow: 0 0 0 2px rgba(1,129,139,.15); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 7px 8px; background: var(--paper); border-bottom: 1px solid var(--line); }
.rte-b { font-family: var(--font-title); font-weight: 600; font-size: 13px; color: var(--achm-azul-corp); background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; cursor: pointer; line-height: 1; transition: background .12s, color .12s, border-color .12s; }
.rte-b:hover { background: var(--achm-turquesa); color: #fff; border-color: var(--achm-turquesa); }
.rte-sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
.rte-area { min-height: 320px; padding: 16px 18px; font-family: var(--font-body); font-size: 15.5px; line-height: 1.7; color: var(--ink); outline: none; }
.rte-area:empty::before { content: "Escribe el cuerpo de la noticia, o inserta una plantilla arriba…"; color: #9aa7b4; }
.rte-area h2 { font-size: 22px; margin: 18px 0 8px; color: var(--achm-azul-corp); }
.rte-area h3 { font-size: 18px; margin: 16px 0 6px; color: var(--achm-azul-desarrollo); }
.rte-area p { margin: 0 0 12px; }
.rte-area ul, .rte-area ol { margin: 0 0 12px 22px; }
.rte-area blockquote { margin: 14px 0; padding: 8px 16px; border-left: 4px solid var(--achm-turquesa); background: var(--paper); color: #41505e; border-radius: 0 8px 8px 0; }
.rte-area a { color: var(--achm-azul-desarrollo); }

/* Archivos no-imagen: chip en el selector y en la biblioteca */
.mp-file { width: 100%; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; background: var(--paper); border-radius: 8px; font-family: var(--font-title); font-weight: 800; font-size: 15px; color: var(--achm-azul-desarrollo); letter-spacing: .5px; }
.media-thumb.is-file { display: flex; align-items: center; justify-content: center; background: var(--paper); min-height: 130px; }
.media-fileicon { font-family: var(--font-title); font-weight: 800; font-size: 24px; color: var(--achm-azul-desarrollo); letter-spacing: 1px; }

/* ===== Dropdowns rediseñados (todos los <select> del panel) ===== */
.fld select, .adm-filters select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a7785' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 12px;
  padding-right: 36px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.fld select:hover, .adm-filters select:hover { border-color: var(--achm-turquesa); }

/* ===== Editor de noticias: ancho completo a 2 columnas (estilo WP) ===== */
.adm-content:has(.noti-grid) { max-width: none; }
.noti-head { display: flex; align-items: center; gap: 14px; }
.noti-head .adm-h1 { margin: 0; }
.noti-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; margin-top: 18px; }
.noti-main { min-width: 0; }
.noti-mainform { max-width: none; margin-top: 0; gap: 18px; }
.noti-title-input { font-family: var(--font-title); font-weight: 600; font-size: 19px !important; padding: 14px 16px !important; }
.noti-body-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.noti-body-head > span { font-family: var(--font-title); font-weight: 600; font-size: 13.5px; color: var(--achm-azul-corp); }
.noti-tpl select { font-size: 13px; padding: 7px 34px 7px 12px; border: 1px solid var(--line); border-radius: 8px; background-color: var(--paper); color: var(--achm-azul-desarrollo); font-family: var(--font-title); font-weight: 600; }
.noti-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 78px; }
.noti-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(10,26,58,.04); animation: admIn .5s ease both; }
.noti-card-t { font-family: var(--font-title); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6a7785; margin: 0 0 13px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.noti-card .fld { margin-bottom: 13px; }
.noti-card .fld:last-child { margin-bottom: 0; }
.noti-card .fld textarea { min-height: 0; }
.noti-state { margin: 0 0 12px; font-size: 13px; color: #5a6775; }
.btnx.block { width: 100%; text-align: center; margin-bottom: 8px; }
.noti-side .btnx.block:last-child { margin-bottom: 0; }
.noti-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding-top: 13px; border-top: 1px solid var(--line); }
.noti-actions form { margin: 0; }
.noti-actions .btnx.block { margin-bottom: 0; }
.rte-img--col { flex-direction: column; align-items: stretch; }
.rte-img--col .rte-img-prev { width: 100%; height: 150px; }
.noti-main .rte-area { min-height: 440px; }

/* ---- Imagen de banner con encuadre (focal point) ---- */
.noti-card-note { font-size: 12.5px; color: #8a97a5; margin: -6px 0 12px; line-height: 1.45; }
.banner-edit { display: flex; flex-direction: column; gap: 9px; }
.banner-stage { position: relative; width: 100%; aspect-ratio: 16 / 6; border-radius: 11px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); cursor: crosshair; touch-action: none; user-select: none; }
.banner-stage img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; display: block; pointer-events: none; }
.banner-edit.is-empty .banner-stage { cursor: default; }
.banner-edit.is-empty .banner-stage img { display: none; }
.banner-empty-tag { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 12.5px; color: #8a97a5; }
.banner-edit.is-empty .banner-empty-tag { display: flex; }
.banner-focus { position: absolute; width: 26px; height: 26px; transform: translate(-50%, -50%); border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 0 0 2px rgba(1,129,139,.9), 0 2px 10px rgba(0,0,0,.5); background: rgba(1,129,139,.28); pointer-events: none; transition: left .04s linear, top .04s linear; }
.banner-focus::after { content: ""; position: absolute; inset: 0; margin: auto; width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.banner-edit.is-empty .banner-focus { display: none; }
#f-banner { font-size: 13px; }
.fld--mt { margin-top: 10px; }
@media (max-width: 980px) {
  .noti-grid { grid-template-columns: 1fr; }
  .noti-side { position: static; }
}

.pagex { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.pagex a { min-width: 38px; height: 38px; padding: 0 10px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: var(--achm-azul-corp); font-weight: 600; font-size: 14px; background: #fff; transition: border-color .15s, color .15s, background .15s; }
.pagex a:hover { border-color: var(--achm-turquesa); color: var(--achm-turquesa); }
.pagex a.on { background: var(--achm-azul-corp); color: #fff; border-color: var(--achm-azul-corp); }
.pagex .pagex-nav { font-size: 18px; line-height: 1; }
.pagex .pagex-gap { color: #9aa7b4; padding: 0 2px; align-self: flex-end; }

/* ---- Edición rápida del listado (estilo WP) ---- */
.adm-table td .qedit-open { background: transparent; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--achm-azul-desarrollo); font-weight: 500; }
.adm-table td .qedit-open:hover { text-decoration: underline; }
.adm-table tr.is-editing { background: color-mix(in srgb, var(--achm-turquesa) 8%, white); }
.adm-table tr.is-editing:hover { background: color-mix(in srgb, var(--achm-turquesa) 8%, white); }
.qedit-row > td { background: color-mix(in srgb, var(--achm-turquesa) 6%, white); padding: 16px 18px !important; box-shadow: inset 0 3px 0 var(--achm-turquesa); }
.qedit-form { margin: 0; }
.qedit-grid { display: grid; grid-template-columns: 2fr 1.4fr 1.2fr 1fr; gap: 14px; align-items: end; }
.qedit-grid .fld { margin: 0; }
.qedit-grid .fld > span { font-size: 12.5px; }
.qedit-acts { display: flex; gap: 10px; margin-top: 14px; }
@media (max-width: 900px) { .qedit-grid { grid-template-columns: 1fr 1fr; } .qedit-titulo { grid-column: 1 / -1; } }
.err { color: var(--achm-rojo); font-size: 13px; }
.crumbs { font-size: 13px; color: #6a7785; margin-bottom: 8px; }
.crumbs a { color: var(--achm-azul-desarrollo); text-decoration: none; }
.adm-inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.adm-inline select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }

/* (El tratamiento móvil del sidebar vive al final del archivo: cajón off-canvas ≤900px.) */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ===== Modal de confirmación (acciones destructivas) ===== */
.adm-modal { border: 0; border-radius: 16px; padding: 0; max-width: 420px; width: calc(100% - 32px); color: var(--achm-azul-corp); box-shadow: 0 30px 70px rgba(10, 26, 58, .35); }
.adm-modal::backdrop { background: rgba(0, 39, 63, .55); }
.adm-modal[open] { animation: admModalIn .18s ease; }
.adm-modal-title { font-family: var(--font-title); font-size: 19px; font-weight: 700; margin: 0; padding: 24px 26px 0; color: var(--achm-azul-corp); }
.adm-modal-msg { margin: 10px 0 0; padding: 0 26px; color: #5a6775; font-size: 15px; line-height: 1.55; }
.adm-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 22px 26px 24px; }
@keyframes admModalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .adm-modal[open] { animation: none; } }

/* ===== Biblioteca de medios ===== */
.media-upload { display: grid; gap: 4px; max-width: 560px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 14px; }
.media-item { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.media-thumb { display: block; aspect-ratio: 4 / 3; background: #eef3f8; overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item figcaption { padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.media-name { font-family: var(--font-title); font-weight: 600; font-size: 13px; color: var(--achm-azul-corp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-meta { font-size: 11px; color: #8a97a5; }
.media-path { font-size: 11px; color: #5a6775; background: #f4f7fa; border-radius: 6px; padding: 3px 6px; word-break: break-all; }
.media-del { margin-top: 4px; }

/* ===== Bandeja de mensajes de contacto ===== */
.msg-list { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.msg-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.msg-unread { border-left: 4px solid var(--achm-rojo); }
.msg-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.msg-from { font-size: 14px; color: var(--achm-azul-corp); }
.msg-from a { color: var(--achm-azul-desarrollo); text-decoration: none; }
.msg-body { margin: 10px 0 12px; color: #2b3a4a; font-size: 14.5px; line-height: 1.55; }
.msg-actions { display: flex; gap: 10px; }

/* ===== Sitio estático (dashboard) ===== */
.cache-panel { margin-bottom: 22px; }
.cache-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* Miniatura de video en la lista del admin */
.vid-thumb-sm { border-radius: 6px; object-fit: cover; display: block; }

/* Texto de ayuda bajo un campo */
.fld-hint { margin: 2px 0 0; font-size: 13px; color: #6a7785; }

/* Selector de imágenes (media picker) */
.mp-btn { align-self: flex-start; margin-top: -6px; }
.media-picker { border: 0; border-radius: 14px; padding: 0; max-width: 760px; width: 92vw; box-shadow: 0 30px 80px rgba(10, 26, 58, .4); }
.media-picker::backdrop { background: rgba(0, 18, 30, .55); }
.mp-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.mp-close { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: #6a7785; }
.mp-search { display: block; width: calc(100% - 40px); margin: 14px 20px 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 16px 20px 22px; max-height: 60vh; overflow-y: auto; }
.mp-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; padding: 0; display: flex; flex-direction: column; text-align: left; transition: border-color .15s ease, transform .15s ease; }
.mp-item:hover { border-color: var(--achm-rojo); transform: translateY(-2px); }
.mp-item img { width: 100%; height: 90px; object-fit: cover; display: block; background: var(--paper); }
.mp-cap { font-size: 11.5px; padding: 6px 8px; color: #4a5763; line-height: 1.25; }
.mp-empty { grid-column: 1 / -1; color: #6a7785; }

/* ===== Panel responsive: pantalla completa en desktop, cajón off-canvas en móvil ===== */
/* Hamburguesa (solo visible en pantallas angostas) */
.adm-burger { display: none; place-items: center; width: 42px; height: 42px; border: 1.5px solid var(--line); border-radius: 11px; background: #fff; color: var(--achm-azul-corp); cursor: pointer; flex: 0 0 auto; transition: background .15s; }
.adm-burger:hover { background: #f1f5f8; }

/* Telón detrás del cajón de navegación */
.adm-side-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(3, 15, 26, .52); backdrop-filter: blur(2px); animation: admFadeIn .2s ease both; }
.adm-side-backdrop[hidden] { display: none; }
@keyframes admFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Tablas: el wrapper (lo añade admin-ui.js) permite scroll horizontal sin romper el layout */
.adm-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
.adm-tablewrap > .adm-table { margin: 0; }

@media (max-width: 1100px) {
  .adm-content { padding: 24px 20px; }
  .noti-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .adm-burger { display: grid; }
  /* Sidebar → cajón deslizante sobre el contenido */
  body.adm .adm-side { position: fixed; top: 0; left: 0; bottom: 0; height: 100dvh; width: min(300px, 84vw); transform: translateX(-105%); transition: transform .24s ease; z-index: 40; box-shadow: 12px 0 44px rgba(0, 0, 0, .35); }
  body.adm .adm-side.is-open { transform: translateX(0); }
  body.adm-nav-lock { overflow: hidden; }
  /* El modo solo-íconos no aplica en móvil: siempre con etiquetas */
  body.adm .adm-side.is-mini { width: min(300px, 84vw); }
  .adm-side.is-mini .adm-logo-full, .adm-side.is-mini .adm-side-title,
  .adm-side.is-mini li a > span, .adm-side.is-mini .adm-side-collapse > span,
  .adm-side.is-mini .adm-back > span { display: revert; }
  .adm-side.is-mini .adm-logo-mark { display: none; }
  .adm-side.is-mini li a { justify-content: flex-start; padding: 12px 13px; margin: 2px 10px; }
  .adm-side.is-mini [data-tip]::after, .adm-side.is-mini [data-tip]::before { display: none; }
  .adm-side-collapse { display: none; }
  /* Targets táctiles cómodos */
  .adm-side li a { padding: 12px 13px; font-size: 15px; }
  .adm-topbar { padding: 10px 14px; gap: 10px; }
  .adm-search-kbd { display: none; }
  .adm-content { padding: 20px 14px; }
  .adm-shell::before { opacity: .04; }
  .adm-card { padding: 26px 20px; }
  .adm-cols, .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .adm-content { padding: 16px 10px; }
  .adm-card { padding: 22px 16px; border-radius: 14px; }
  .adm-h1 { font-size: 20px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btnx { flex: 1 1 auto; text-align: center; }
  .adm-table th, .adm-table td { padding: 10px 10px; font-size: 13px; }
  .adm-tablewrap > .adm-table { min-width: 560px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .dash-kpis { grid-template-columns: 1fr 1fr; }
  .dash-mini-grid { grid-template-columns: 1fr 1fr; }
  .adm-inline { flex-wrap: wrap; }
  .media-picker { width: 96vw; }
}
