: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; --accent-2: #fb923c; --accent-rgb: 245,158,11; }
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(var(--accent-rgb),.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(var(--accent-rgb),.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: var(--accent); } }

/* RMP-098 Etapa 5: «Comisiones» (wizard de 4 pasos + lo devengado) */
.pm-ancho-com { width: min(720px, 100%); }
.pm-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.pm-tabs button { width: auto; padding: 7px 14px; font-size: .88rem; background: transparent; color: inherit; box-shadow: inset 0 0 0 1px rgba(128,128,128,.45); }
.pm-tabs button.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.pm-pasos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; list-style: none; margin: 0 0 14px; padding: 0; }
.pm-pasos button { width: 100%; padding: 8px 6px; font-size: .8rem; background: transparent; color: inherit; box-shadow: inset 0 0 0 1px rgba(128,128,128,.4); text-align: center; }
.pm-pasos button:disabled { opacity: .45; cursor: default; }
.pm-pasos li.actual button { box-shadow: inset 0 0 0 2px var(--accent); }
.pm-pasos li.hecho b { color: #17a34a; }
.pm-terminos { max-height: 280px; overflow: auto; white-space: pre-wrap; font-size: .85rem; line-height: 1.5; padding: 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(128,128,128,.4); margin-bottom: 8px; }
.pm-borrador { background: rgba(245,158,11,.16); border-radius: 10px; padding: 8px 12px; font-size: .85rem; margin: 0 0 10px; }
.pm-check { display: flex; align-items: center; gap: 8px; font-size: .9rem; margin: 12px 0; }
.pm-check input { width: auto; margin: 0; }
.pm-tipo { border: 0; padding: 0; margin: 0 0 12px; display: flex; gap: 16px; flex-wrap: wrap; }
.pm-tipo legend { font-size: .9rem; margin-bottom: 6px; padding: 0; }
.pm-tipo label { display: flex; align-items: center; gap: 6px; margin: 0; }
.pm-tipo input { width: auto; margin: 0; }
.pm-modal-box select { display: block; width: 100%; margin-top: 4px; padding: 10px; border-radius: 8px; font-size: 1rem; background: transparent; color: inherit; border: 1px solid rgba(128,128,128,.5); }
.pm-pie { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pm-pie button { width: auto; padding: 9px 18px; }
.pm-reparto { margin: 12px 0; }
.pm-etq { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 6px; gap: 8px; flex-wrap: wrap; }
.pm-barra { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: rgba(128,128,128,.25); }
.pm-barra span { display: block; height: 100%; transition: width .3s ease; }
.pm-barra-com { background: var(--accent); }
.pm-barra-desc { background: #8b5cf6; }
.pm-reparto input[type=range] { width: 100%; margin: 12px 0 6px; padding: 0; border: 0; accent-color: var(--accent); }
.pm-rapidos { display: flex; gap: 6px; flex-wrap: wrap; }
.pm-rapidos button { width: auto; padding: 6px 12px; font-size: .8rem; }
.pm-estim { font-size: .85rem; margin: 10px 0 0; opacity: .85; }
.pm-total td { font-weight: 600; border-top: 2px solid rgba(128,128,128,.4); }
@media (prefers-reduced-motion: reduce) { .pm-barra span { transition: none; } }
@media (max-width: 600px) { .pm-pasos { grid-template-columns: 1fr 1fr; } }
.pm-tabla-com { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 6px; }
.pm-tabla-com th { text-align: left; font-weight: 500; font-size: .8rem; padding: 6px 8px; opacity: .7; }
.pm-tabla-com td { padding: 10px 8px; border-top: 1px solid rgba(128,128,128,.3); font-variant-numeric: tabular-nums; }
.pm-com-cuerpo .pm-error { margin: 0 0 10px; }
@media (max-width: 480px) { .pm-tabla-com { font-size: .8rem; } .pm-tabla-com th, .pm-tabla-com td { padding: 8px 4px; } }
.pm-resumen { font-size: 1rem; margin: 12px 0 8px; }
.pm-ejemplo { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 12px 0 0; font-size: .88rem; }
.pm-ejemplo dt { margin: 0; opacity: .85; }
.pm-ejemplo dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.pm-ejemplo .pm-yo { font-weight: 600; opacity: 1; color: var(--accent); }
/* RMP-044 (Vértice, pieza C2): facturas de los cierres (pestaña «Cierres» de Comisiones). */
.pm-com-cuerpo h3 { margin: 18px 0 6px; font-size: 1rem; }
#com-factura { display: grid; gap: 8px; margin: 6px 0; }
#com-factura label { display: grid; gap: 4px; font-size: .85rem; }

/* === Marca (RMP-044) · logotipo del Panel de Manager. Solo existe si el Manager tiene uno; el acento va por variables (--accent…). === */
.pm-logo { height: 28px; width: auto; max-width: 140px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.pm-app h1 .pm-logo { height: 36px; }