:root { color-scheme: light dark; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: #f7f7f8; color: #1a1a1a; }
.pm-app { max-width: 480px; margin: 0 auto; padding: 32px 16px; }
h1 { font-size: 1.3rem; margin: 0 0 20px; }
.pm-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
label { display: block; margin-bottom: 14px; font-size: .9rem; }
input { display: block; width: 100%; margin-top: 4px; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 1rem; }
button { width: 100%; padding: 11px; border: none; border-radius: 8px; background: #1a1a1a; color: #fff; font-size: 1rem; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
.pm-error { color: #c0392b; font-size: .85rem; margin: -6px 0 14px; }
.pm-list { list-style: none; margin: 0; padding: 0; }
.pm-list li { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #eee; }
.pm-list li:last-child { border-bottom: none; }
.pm-list a.btn { text-decoration: none; background: #1a1a1a; color: #fff; padding: 8px 14px; border-radius: 8px; font-size: .9rem; }
.pm-empty { color: #777; font-size: .9rem; text-align: center; padding: 20px 0; }
.pm-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.pm-logout { background: none; color: #777; width: auto; padding: 4px 8px; font-size: .85rem; }
@media (prefers-color-scheme: dark) {
  body { background: #121212; color: #eee; }
  .pm-card { background: #1e1e1e; }
  input { background: #2a2a2a; border-color: #444; color: #eee; }
  button { background: #eee; color: #121212; }
  .pm-list li { border-color: #333; }
  .pm-list a.btn { background: #eee; color: #121212; }
}

/* RMP-044: dashboard */
.hidden { display: none; }
.pm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pm-kpi { background: #fff; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.pm-kpi b { font-size: 1.4rem; }
.pm-kpi span { color: #777; font-size: .8rem; }
.pm-tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.pm-tabla th { text-align: left; color: #777; font-weight: 500; font-size: .8rem; padding: 6px 8px; }
.pm-tabla td { padding: 10px 8px; border-top: 1px solid #eee; }
.pm-row { cursor: pointer; }
.pm-detalle dl { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; margin: 0 0 10px; }
.pm-detalle dt { color: #777; }
.pm-detalle dd { margin: 0; }
.pm-detalle a.btn { text-decoration: none; background: #1a1a1a; color: #fff; padding: 8px 14px; border-radius: 8px; font-size: .9rem; display: inline-block; }
.pm-tag { padding: 2px 8px; border-radius: 99px; font-size: .78rem; white-space: nowrap; }
.pm-ok { background: #e3f6e8; color: #17692e; }
.pm-warn { background: #fff1d6; color: #8a5a00; }
.pm-bad { background: #fde2e2; color: #9b1c1c; }
@media (max-width: 600px) { .pm-tabla th:nth-child(2), .pm-tabla td:nth-child(2), .pm-tabla th:nth-child(4), .pm-tabla td:nth-child(4) { display: none; } }
@media (prefers-color-scheme: dark) {
  .pm-kpi { background: #1e1e1e; }
  .pm-tabla td { border-color: #333; }
  .pm-detalle a.btn { background: #eee; color: #121212; }
  .pm-ok { background: #123a1f; color: #8fe3a8; } .pm-warn { background: #3d2e0a; color: #f3c96b; } .pm-bad { background: #4a1616; color: #f5a3a3; }
}
.pm-app.pm-ancho { max-width: 920px; }
.pm-add { width: auto; padding: 6px 12px; font-size: .85rem; }
.pm-card small { display: block; color: #777; margin: 6px 0 10px; }

/* RMP-044: portada de tarjetas */
.pm-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pm-tarjeta { background: #fff; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pm-tarjeta header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pm-tarjeta h3 { margin: 0; font-size: 1.05rem; }
.pm-sub { margin: 0; color: #777; font-size: .85rem; }
.pm-metricas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pm-m { background: #f5f5f5; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.pm-m b { font-size: 1.1rem; } .pm-m span { color: #777; font-size: .75rem; }
.pm-aviso { margin: 0; color: #8a5a00; font-size: .8rem; }
.pm-permisos { margin: 0; color: #777; font-size: .78rem; line-height: 1.4; }
.pm-tarjeta footer { margin-top: auto; }
.pm-tarjeta a.btn { display: block; text-align: center; text-decoration: none; background: #1a1a1a; color: #fff; padding: 9px 14px; border-radius: 8px; font-size: .9rem; }
@media (prefers-color-scheme: dark) { .pm-tarjeta { background: #1e1e1e; } .pm-m { background: #2a2a2a; } .pm-tarjeta a.btn { background: #eee; color: #121212; } }
.pm-volver { font-size: .85rem; margin-right: 8px; color: inherit; }

/* Identidad de color de Manager: ámbar #f59e0b — el mismo que ya usa Superadmin para la familia
   manager (admin.html .badge.familia-manager). Texto oscuro sobre él: el blanco no pasa contraste. */
:root { --accent: #f59e0b; --on-accent: #1a1a1a; }
button, .pm-list a.btn, .pm-tarjeta a.btn, .pm-detalle a.btn { background: var(--accent); color: var(--on-accent); }
.pm-logout { background: none; color: #777; }
button:hover, .pm-tarjeta a.btn:hover { filter: brightness(.95); }
.pm-app h1 { border-left: 4px solid var(--accent); padding-left: 10px; }
.pm-kpi:last-child b { color: var(--accent); }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
@media (prefers-color-scheme: dark) { .pm-logout { background: none; color: #999; } }

/* RMP-044: invitar creadora (editor tipo mail) */
.pm-sec { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px #bbb; }
.pm-sec:hover { filter: none; background: rgba(128,128,128,.12); }
.hidden { display: none !important; }
.pm-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.pm-modal-box { background: #fff; color: #1a1a1a; border-radius: 14px; width: min(620px, 100%); max-height: 94vh; overflow: auto; padding: 18px; }
.pm-modal-box header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pm-modal-box h2 { margin: 0; font-size: 1.1rem; }
.pm-x { width: auto; background: none; color: inherit; font-size: 1.4rem; padding: 0 6px; }
.pm-mail { border: 1px solid #ddd; border-radius: 10px; overflow: hidden; }
.pm-fila { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #ddd; }
.pm-fila span { color: #777; font-size: .85rem; min-width: 30px; }
.pm-fila input { margin: 0; border: none; padding: 6px; flex: 1; min-width: 0; }
.pm-mail textarea { display: block; width: 100%; border: none; padding: 12px; font: inherit; font-size: .92rem; line-height: 1.5; resize: vertical; background: transparent; color: inherit; }
.pm-modal-box footer { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pm-modal-box footer button { width: auto; padding: 9px 16px; }
.pm-modal-box small { display: block; color: #777; margin-top: 8px; }
.pm-ok-msg { color: #17692e; font-size: .85rem; margin: 8px 0 0; }
.pm-modal-box .pm-error { margin: 8px 0 0; }
@media (prefers-color-scheme: dark) { .pm-modal-box { background: #1e1e1e; color: #eee; } .pm-mail, .pm-fila { border-color: #444; } .pm-ok-msg { color: #8fe3a8; } .pm-sec { box-shadow: inset 0 0 0 1px #555; } }

/* RMP-044: selector de paneles (nombre + ▾ arriba a la izquierda) */
.pm-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.pm-brandbox { position: relative; display: flex; align-items: center; gap: 4px; }
.pm-brand { font-weight: 600; font-size: 1.05rem; }
.pm-arrow { width: auto; background: none; color: var(--accent); font-size: 15px; padding: 2px 8px; border-radius: 6px; }
.pm-arrow:hover { background: rgba(245,158,11,.15); filter: none; }
.pm-dd { position: absolute; top: 100%; left: 0; min-width: 220px; margin-top: 6px; background: #fff; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.18); overflow: hidden; z-index: 40; }
.pm-dd-item { display: block; padding: 10px 14px; font-size: .9rem; color: inherit; text-decoration: none; cursor: pointer; }
.pm-dd-item:hover { background: rgba(245,158,11,.14); }
.pm-dd-item.on { color: #b45309; font-weight: 600; cursor: default; }
@media (prefers-color-scheme: dark) { .pm-dd { background: #262626; } .pm-dd-item.on { color: #f59e0b; } }
