/* Portal · portada «Inicio» · encargo 04 Experiencia/I · 23-sep-2026
 * Archivo propio del área: se carga desde _layout_head.php después de portal-navigation.css.
 * Todo bajo #mrh. Primaria negra; ámbar = te toca; rojo = sólo urgente/alerta. Objetivos ≥ 44 px. */

/* Los bloques propios respetan `hidden` aunque tengan display propio. */
#mrh .p-home-now [hidden], #mrh .p-search-sec[hidden], #mrh .p-inbox[hidden] { display: none !important; }

/* Intro de sección más compacta en móvil: la portada empieza por lo que hay que hacer. */
@media (max-width: 759px) {
  #mrh .p-section-intro { padding: 2px 2px 0; }
  #mrh .p-section-intro h2 { font-size: 22px; }
  #mrh .p-section-intro p { display: none; }
}

/* ---------- Cabecera: saludo + búsqueda + conversaciones ---------- */
#mrh .p-home-hello { display: flex; flex-direction: column; gap: 10px; }
#mrh .p-home-hello__text { min-width: 0; }
#mrh .p-home-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
#mrh .p-home-search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px;
  border: 1px solid #deded9; border-radius: 12px; background: var(--bg); color: var(--muted);
  font-weight: 500; font-size: 14px; line-height: 1.2; font-family: inherit; text-align: left; cursor: text;
}
#mrh .p-home-search i { color: var(--ink); font-size: 15px; }
#mrh .p-home-search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mrh .p-home-search kbd { display: none; padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-weight: 600; font-size: 12px; line-height: 1.5; font-family: inherit; color: var(--muted); }
#mrh .p-home-search:hover { border-color: #c9c9c4; background: var(--surface); }
#mrh .p-home-search:focus-visible, #mrh .p-home-chat:focus-visible { outline: none; box-shadow: var(--ring); }
#mrh .p-home-chat {
  position: relative; flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid #deded9; background: var(--surface); color: var(--ink); font-size: 18px; text-decoration: none;
}
#mrh .p-home-chat__badge {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--ink); color: #fff; font-weight: 750; font-size: 12px; line-height: 20px; font-family: inherit; text-align: center; border: 2px solid var(--surface);
}
/* Con la búsqueda en la cabecera, el botón flotante de búsqueda sobra en la portada. */
body#mrh.p-has-home-search .p-shell-search { display: none; }
@media (min-width: 760px) {
  #mrh .p-home-hello { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
  #mrh .p-home-tools { flex: 0 1 460px; }
  #mrh .p-home-search kbd { display: inline-block; }
}

/* ---------- Acceso de operaciones (antes con estilos en línea) ---------- */
#mrh .p-home-ops {
  display: flex; align-items: center; gap: 12px; min-height: 56px; margin: 12px 16px 0; padding: 12px 14px;
  border: 1px solid var(--line); border-left: 3px solid var(--ink); border-radius: 12px; background: var(--surface);
  color: var(--ink); text-decoration: none;
}
#mrh .p-home-ops > i:first-child { font-size: 18px; color: var(--ink-2); }
#mrh .p-home-ops span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#mrh .p-home-ops small { color: var(--muted); font-size: 12.5px; }
#mrh .p-home-ops > i:last-child { color: var(--faint); font-size: 18px; }
#mrh .p-home-ops:focus-visible { outline: none; box-shadow: var(--ring); }
@media (min-width: 760px) { #mrh .p-home-ops { width: min(calc(100% - 48px), var(--portal-max)); margin: 16px auto 0; } }

/* ---------- Requiere tu acción ---------- */
#mrh .p-home-now { padding: 14px 14px 10px; }
#mrh .p-home-now__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
#mrh .p-home-now__head h2 { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
#mrh .p-home-now__count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--ink); color: #fff; font-weight: 750; font-size: 12px; line-height: 22px; font-family: inherit; text-align: center; }
#mrh .p-home-acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
#mrh .p-home-acts > li + li { border-top: 1px solid var(--line-2); }
#mrh .p-home-act {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 60px; padding: 10px 4px; color: var(--ink); text-decoration: none; border-radius: 10px;
}
#mrh .p-home-act:hover { background: var(--accent-tint); }
#mrh .p-home-act:focus-visible { outline: none; box-shadow: var(--ring); }
#mrh .p-home-act__ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-tint); color: var(--ink-2); font-size: 15px; }
#mrh .p-home-act--warn .p-home-act__ic { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px #f5e2ad; }
#mrh .p-home-act--danger .p-home-act__ic { background: var(--danger-bg); color: var(--danger); }
#mrh .p-home-act--info .p-home-act__ic { background: var(--info-bg); color: var(--info); }
#mrh .p-home-act__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#mrh .p-home-act__body strong { font-size: 14.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
#mrh .p-home-act__body small { font-size: 12.5px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
#mrh .p-home-act__cta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 750; color: var(--ink); white-space: nowrap; }
#mrh .p-home-act__cta i { color: var(--faint); font-size: 16px; }
#mrh .p-home-act__n { font-variant-numeric: tabular-nums; }
#mrh .p-home-colas { margin-top: 2px; }
#mrh .p-home-colas .p-home-acts { border-top: 1px solid var(--line-2); }
#mrh .p-home-colas__state { margin: 6px 4px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#mrh .p-home-colas__state[data-state="error"] { color: var(--warn); }
#mrh .p-home-colas__state button { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; font-family: inherit; color: var(--ink); cursor: pointer; }
#mrh .p-home-empty { margin: 4px 4px 6px; font-size: 13.5px; color: var(--ink-2); }
@media (min-width: 1180px) {
  #mrh .p-home-acts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  #mrh .p-home-acts > li + li { border-top: 0; }
  #mrh .p-home-acts > li { border-bottom: 1px solid var(--line-2); }
}

/* ---------- Atajos de tu trabajo: una fila compacta, no cuatro losas ---------- */
#mrh .p-home-shortcuts { padding: 12px 14px; }
#mrh .p-home-shortcuts .p-head { margin-bottom: 8px; }
#mrh .p-home-shortcuts .p-work-launchers { display: flex; flex-wrap: wrap; gap: 8px; }
#mrh .p-home-shortcuts .p-work-launchers a {
  flex: 0 1 auto; flex-direction: row; min-height: 44px; padding: 0 14px; gap: 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13.5px;
}
#mrh .p-home-shortcuts .p-work-launchers a:hover { outline: none; border-color: var(--ink); background: var(--surface); }
#mrh .p-home-shortcuts .p-work-launchers a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
#mrh .p-home-shortcuts .p-work-launchers i { font-size: 15px; color: var(--ink-2); }

/* ---------- Mi semana compacta ---------- */
#mrh .p-week { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
#mrh .p-week__day { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 9px; font-size: 13px; }
#mrh .p-week__day.is-today { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--ink); }
#mrh .p-week__day.is-past { opacity: .55; }
#mrh .p-week__date { font-weight: 700; color: var(--ink-2); white-space: nowrap; }
#mrh .p-week__hoy { display: block; width: max-content; margin-top: 2px; padding: 0 6px; border-radius: 5px; background: var(--ink); color: #fff; font-size: 12px; line-height: 18px; }
#mrh .p-week__what { min-width: 0; display: flex; flex-direction: column; gap: 3px; color: var(--ink); overflow-wrap: anywhere; }
#mrh .p-week__day.is-off .p-week__what { color: var(--faint); }
#mrh .p-week__shift { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#mrh .p-week__logo { line-height: 0; }
#mrh .p-week__logo img, #mrh .p-week__logo .mh-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: contain; }
@media (min-width: 1180px) {
  #mrh .p-home-week .p-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
  #mrh .p-home-week .p-week__day { grid-template-columns: 1fr; align-content: start; min-height: 86px; padding: 10px; border: 1px solid var(--line-2); }
  #mrh .p-home-week .p-week__day.is-today { box-shadow: inset 0 3px 0 var(--ink); }
}

/* ---------- Bandeja contextual (sólo si el controlador la entrega) ---------- */
#mrh .p-inbox { list-style: none; margin: 0 0 10px; padding: 0; }
#mrh .p-inbox li + li { border-top: 1px solid var(--line-2); }
#mrh .p-inbox__row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start; min-height: 60px; padding: 10px 4px; color: var(--ink); text-decoration: none; border-radius: 10px; }
#mrh .p-inbox__row:hover { background: var(--accent-tint); }
#mrh .p-inbox__row:focus-visible { outline: none; box-shadow: var(--ring); }
#mrh .p-inbox__av { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 750; }
#mrh .p-inbox__av i { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink); font-size: 11px; box-shadow: 0 0 0 1px var(--line); }
#mrh .p-inbox__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#mrh .p-inbox__who { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
#mrh .p-inbox__who strong { color: var(--ink); }
#mrh .p-inbox__what { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
#mrh .p-inbox__obj { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
#mrh .p-inbox__when { font-size: 12px; color: var(--faint); white-space: nowrap; }

/* ---------- Dirección: orden nuevo ---------- */
#mrh .p-ceo-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 32px; margin: 8px 0 24px; }
#mrh .p-ceo-top .p-dir2-block { margin: 0; }
#mrh .p-ceo-top .p-dir2-alerts { margin-top: 8px; }
#mrh .p-ceo-today { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-bottom: 28px; }
#mrh .p-ceo-today .p-ceo-hours { margin: 0; }
#mrh .p-ceo-hour-rating { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--muted); }
#mrh .p-ceo-hour-rating.is-warn { color: var(--warn); }
@media (min-width: 1100px) {
  #mrh .p-ceo-top { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
  #mrh .p-ceo-today { grid-template-columns: minmax(280px, .8fr) minmax(0, 1.4fr); align-items: start; }
}
@media (max-width: 560px) {
  #mrh .p-ceo { padding: 18px 14px; }
}

/* ---------- Secciones: foco del cambio de pestaña sin marco negro ---------- */
#mrh .p-section-intro:focus:not(:focus-visible) { outline: none; box-shadow: none; }
#mrh .p-section-intro:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 6px; }

/* ---------- Buscador: grupos por objeto, filtros y estados ---------- */
#mrh .p-search-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 4px; }
#mrh .p-search-filters::-webkit-scrollbar { display: none; }
#mrh .p-search-filter { flex: 0 0 auto; min-height: 40px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 700; font-size: 13px; font-family: inherit; cursor: pointer; }
#mrh .p-search-filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
#mrh .p-search-filter:focus-visible { outline: none; box-shadow: var(--ring); }
#mrh .p-search-filter span { font-weight: 500; opacity: .75; margin-left: 4px; }
#mrh .p-search-act { flex: 0 0 auto; font-size: 12px; font-weight: 750; color: var(--ink); white-space: nowrap; }
#mrh .p-search-state { margin: 16px 2px; font-size: 13.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#mrh .p-search-state button { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; font-family: inherit; color: var(--ink); cursor: pointer; }
#mrh .p-search-skel { height: 52px; border-radius: 12px; background: linear-gradient(90deg, var(--line-2), #fafaf8, var(--line-2)); background-size: 200% 100%; animation: pSkel 1.1s linear infinite; margin: 8px 0; }
@keyframes pSkel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { #mrh .p-search-skel { animation: none; } }
#mrh .p-search-example { min-height: 44px; }
#mrh .p-search-examples { display: flex; flex-wrap: wrap; gap: 8px; }
#mrh .p-search-example { padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; font-family: inherit; cursor: pointer; }
#mrh .p-search-example:focus-visible { outline: none; box-shadow: var(--ring); }

/* La regla ≥1200 de portal-navigation.css manda las decisiones a la columna 2 del bloque de ventas.
   En el orden nuevo viven arriba, en su propio contenedor: decisiones a la izquierda, alertas a la derecha. */
#mrh .p-ceo[data-ceo-view] .p-ceo-top > .p-ceo-decisions { grid-column: 1; padding: 0; border-left: 0; }
#mrh .p-ceo[data-ceo-view="hoy"] .p-ceo-top .p-ceo-decisions .p-dir2-decide,
#mrh .p-ceo[data-ceo-view="noche"] .p-ceo-top .p-ceo-decisions .p-dir2-decide { display: block; }
#mrh .p-ceo-top > .p-dir2-block:not(.p-ceo-decisions) { grid-column: 2; }
#mrh .p-ceo-top > .p-dir2-note { grid-column: 1 / -1; }
@media (max-width: 1099px) { #mrh .p-ceo-top > .p-dir2-block:not(.p-ceo-decisions) { grid-column: 1; margin-top: 16px; } }
@media (min-width: 1100px) { #mrh .p-ceo-top .p-ceo-decisions .p-dir2-links { flex-direction: row; } #mrh .p-ceo-top .p-ceo-decisions .p-dir2-links .p-btn { flex: 1; } }
@media (max-width: 759px) { #mrh .p-home-header .p-brandbar { margin-bottom: 8px; } }

/* Pulso de Dirección en móvil: rejilla de dos columnas en vez de carrusel que corta la tercera cifra. */
@media (max-width: 560px) {
  #mrh .p-dir2-pulse { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: visible; scroll-snap-type: none; }
  #mrh .p-dir2-pulse__item { min-width: 0; width: auto; flex: none; }
  #mrh .p-dir2-pulse__item:last-child:nth-child(odd) { grid-column: 1 / -1; }
  #mrh .p-dir2-pulse__item { padding: 8px 10px; min-height: 64px; }
}

/* El buscador es modal (aria-modal): por encima de la barra inferior (z-index 1000), no debajo. */
#mrh .p-search-overlay { z-index: 1010; }
#mrh .p-search-results { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); }

/* [24-sep-2026 · portal-perfiles] Bloque superior de la portada según el perfil activo.
   Encargado: estado del cierre de esta noche por local. Dirección: cola + tablero. */
#mrh .p-perfil-hoy__alerta{display:flex;align-items:baseline;gap:8px;margin:0 0 12px;padding:10px 12px;border:1px solid var(--line);border-left:3px solid #b3261e;border-radius:10px;background:#fdf6f5;color:#7a1c16;font:550 13px/1.45 'Geist',system-ui,sans-serif;}
#mrh .p-perfil-hoy__alerta i{color:#b3261e;}
#mrh .p-perfil-hoy__alerta a{color:#17181b;font-weight:700;white-space:nowrap;}
#mrh .p-perfil-hoy__locales{display:grid;gap:10px;}
@media (min-width:900px){#mrh .p-perfil-hoy__locales{grid-template-columns:repeat(auto-fit,minmax(260px,1fr));}}
#mrh .p-perfil-hoy__local{display:flex;flex-direction:column;gap:8px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);}
#mrh .p-perfil-hoy__local-head{display:flex;align-items:center;justify-content:space-between;gap:10px;}
#mrh .p-perfil-hoy__local-head strong{font:750 15px/1.2 'Geist',system-ui,sans-serif;color:#17181b;}
#mrh .p-perfil-hoy__meta{margin:0;font:500 12.5px/1.45 'Geist',system-ui,sans-serif;color:#6b6f76;}
#mrh .p-perfil-hoy__acciones{display:flex;flex-wrap:wrap;gap:8px;margin-top:2px;}
#mrh .p-perfil-hoy__acciones .p-btn{min-height:36px;padding:6px 12px;font-size:12.5px;}
#mrh .p-perfil-hoy__acciones .p-btn.is-disabled{opacity:.55;pointer-events:none;}
#mrh .p-perfil-hoy__dirgrid{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));}
#mrh .p-perfil-hoy__dato{display:flex;flex-direction:column;gap:4px;min-height:84px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:#17181b;text-decoration:none;transition:border-color .15s ease;}
#mrh .p-perfil-hoy__dato:hover{border-color:#17181b;}
#mrh .p-perfil-hoy__dato strong{font:800 22px/1.1 'Geist',system-ui,sans-serif;}
#mrh .p-perfil-hoy__dato span{font:550 12.5px/1.4 'Geist',system-ui,sans-serif;color:#6b6f76;}

/* [24-sep-2026 · perfiles] Selector de sociedad del bloque de dirección (perfil CEO).
   «Como en el banco»: pastilla junto al título, select nativo (robusto sin JS; con JS
   el onchange envía el formulario). Negro para la acción primaria; rojo reservado a alertas. */
#mrh .p-ceo-soc{display:inline-flex;align-items:center;gap:2px;margin-left:auto;padding:2px 3px 2px 10px;border:1px solid var(--line);border-radius:999px;background:var(--surface);max-width:100%;}
#mrh .p-ceo-soc__label{display:inline-flex;align-items:center;gap:6px;font:700 12.5px/1 'Geist',system-ui,sans-serif;color:var(--ink);white-space:nowrap;max-width:32vw;overflow:hidden;text-overflow:ellipsis;}
#mrh .p-ceo-soc__label i{color:var(--muted);font-size:11px;}
#mrh .p-ceo-soc__select{min-height:32px;max-width:34vw;padding:2px 2px;border:0;background:transparent;color:var(--ink-2);font:600 12.5px/1 'Geist',system-ui,sans-serif;cursor:pointer;}
#mrh .p-ceo-soc__select:focus-visible{outline:none;box-shadow:var(--ring);border-radius:999px;}
#mrh .p-ceo-soc__btn{min-height:32px;padding:0 12px;border:0;border-radius:999px;background:var(--ink);color:#fff;font:700 12px/1 'Geist',system-ui,sans-serif;cursor:pointer;white-space:nowrap;}
#mrh .p-ceo-soc__btn:focus-visible{outline:none;box-shadow:var(--ring);}
/* Móvil: el selector baja a su propia fila de ancho completo — el título no se parte
   y «Cambiar» no se sale de la tarjeta. */
@media (max-width:640px){
  #mrh .p-ceo .p-head{flex-wrap:wrap;}
  #mrh .p-ceo .p-head h2{white-space:nowrap;}
  #mrh .p-ceo-soc{flex:1 1 100%;width:100%;margin-left:0;margin-top:2px;}
  #mrh .p-ceo-soc__label{max-width:none;}
  #mrh .p-ceo-soc__select{flex:1;min-width:0;max-width:none;}
}
/* Fila de la comparativa cuyo grupo quedó fuera del filtro de sociedad: no abre dialog. */
#mrh .p-ceo-pace-row:disabled{opacity:.55;cursor:default;}

/* [7-oct-2026 · oleada 2] Trabajo › «Personas y selección»: .p-action-grid no tenía estilo
   y los botones negros salían pegados unos a otros, sin aire entre ellos.
   Una columna en el móvil; en el ordenador, en filas de 2-3. */
#mrh .p-action-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;}
@media (min-width:720px){
  #mrh .p-action-grid{grid-template-columns:repeat(auto-fill,minmax(260px,1fr));}
}
