/* ==========================================================================
   procuIA · sistema de diseño de la web (área de cliente y administración)
   Colores y tipografía de la marca (los mismos de index.html / planes.html):
   azul #101529, oro #B08E52 / #C9A66B / #8F6E37, papel #F5F2EC, verde #0E7C5C.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600&family=Spectral:wght@400;500&display=swap');

:root {
  --navy: #101529;
  --navy-2: #1A2140;
  --navy-3: #262E52;
  --gold: #B08E52;
  --gold-light: #C9A66B;
  --gold-deep: #8F6E37;
  --gold-bg: #F6EEDF;
  --paper: #F5F2EC;
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #FAF8F4;
  --line: #E7E2D8;
  --line-2: #D9D3C6;
  --ink: #101529;
  --ink-2: #3B4157;
  --muted: #6B7084;
  --green: #0E7C5C;
  --green-bg: #E3F2EB;
  --red: #B23B2A;
  --red-bg: #F8E6E2;
  --amber: #A66B12;
  --amber-bg: #FBF0DC;
  --blue: #2F5D9E;
  --blue-bg: #E6EEF8;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-1: 0 1px 2px rgba(16, 21, 41, .06), 0 1px 1px rgba(16, 21, 41, .03);
  --shadow-2: 0 8px 24px rgba(16, 21, 41, .10), 0 2px 6px rgba(16, 21, 41, .06);
  --shadow-3: 0 24px 64px rgba(16, 21, 41, .22);
  --sidebar: 252px;
  --topbar: 60px;
  --font: 'Jost', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
[v-cloak] { display: none; }
#app { min-height: 100vh; }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--gold-bg); }

/* ---------- arranque ---------- */
.arranque { position: fixed; inset: 0; display: grid; place-items: center; background: var(--navy); }
.arranque img { height: 34px; opacity: .9; animation: latido 1.4s ease-in-out infinite; }
@keyframes latido { 50% { opacity: .45; } }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-marca { background: radial-gradient(1200px 600px at 10% 10%, var(--navy-3), var(--navy) 60%); color: var(--paper); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-marca img { height: 34px; align-self: flex-start; }
.login-marca h1 { font-weight: 300; font-size: 38px; line-height: 1.15; margin: 0 0 14px; letter-spacing: -.01em; }
.login-marca p { font-family: 'Spectral', serif; color: rgba(245, 242, 236, .72); font-size: 16px; max-width: 440px; margin: 0; }
.login-marca .pie { font-size: 12px; color: rgba(245, 242, 236, .45); }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-caja { width: 100%; max-width: 380px; }
.login-caja .sobre { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; }
.login-caja h2 { font-size: 26px; font-weight: 500; margin: 6px 0 6px; }
.login-caja .ayuda { color: var(--muted); margin: 0 0 26px; }
.login-dev { margin-top: 28px; padding-top: 20px; border-top: 1px dashed var(--line-2); }
.login-dev .p-btn { width: 100%; justify-content: flex-start; margin-bottom: 8px; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-marca { display: none; } }

/* ---------- estructura de la aplicación ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100%; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--navy); color: rgba(245, 242, 236, .78); display: flex; flex-direction: column; z-index: 30; }
.sidebar-marca { height: var(--topbar); display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sidebar-marca img { height: 24px; }
/* Versión beta: junto al logo en todas las páginas (quitar al salir de la beta). */
.beta { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; color: #C9A66B; border: 1px solid rgba(201, 166, 107, .45); border-radius: 999px; padding: 2px 8px; line-height: 1.4; white-space: nowrap; }
.login-marca .marca-beta { display: flex; align-items: center; gap: 12px; }
.sidebar-marca .entorno { margin-left: auto; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-light); border: 1px solid rgba(201, 166, 107, .4); border-radius: 999px; padding: 2px 8px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-grupo { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(245, 242, 236, .38); padding: 16px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: inherit; font-size: 14px; cursor: pointer; text-align: left; position: relative; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.activo { background: rgba(201, 166, 107, .14); color: #fff; }
.nav-item.activo::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-light); }
.nav-item .p-icono { opacity: .8; }
.nav-item.activo .p-icono { opacity: 1; color: var(--gold-light); }
.nav-item .contador { margin-left: auto; background: var(--gold); color: var(--navy); font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 7px; }
.sidebar-usuario { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .06); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-light), var(--gold-deep)); color: var(--navy); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.sidebar-usuario .nombre { color: #fff; font-size: 13.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-usuario .rol { font-size: 11.5px; color: rgba(245, 242, 236, .5); }
.sidebar-usuario .p-btn-icono { margin-left: auto; color: rgba(245, 242, 236, .6); }
.sidebar-version { padding: 0 16px 10px; font-size: 10.5px; color: rgba(245, 242, 236, .32); }
.sidebar-usuario .p-btn-icono:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.principal { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 28px; }
.topbar .migas { font-size: 12.5px; color: var(--muted); }
.topbar h1 { font-size: 18px; font-weight: 500; margin: 0; }
.topbar .acciones { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar .menu-movil { display: none; }
.pagina { padding: 24px 28px 48px; max-width: 1680px; width: 100%; }
.pagina-cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.pagina-cabecera p { margin: 0; color: var(--muted); max-width: 760px; }
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar); transform: translateX(-100%); transition: transform .2s; }
  .shell.menu-abierto .sidebar { transform: none; box-shadow: var(--shadow-3); }
  .p-tabla-pie { flex-wrap: wrap; }
  .topbar .menu-movil { display: inline-flex; }
  .pagina, .topbar { padding-left: 16px; padding-right: 16px; }
}

/* ---------- iconos ---------- */
.p-icono { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- botones ---------- */
.p-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s, opacity .12s; }
.p-btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }
.p-btn:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
a.p-btn { text-decoration: none; }
.p-btn:disabled { opacity: .42; cursor: not-allowed; }
.p-btn .p-icono { width: 16px; height: 16px; }
.p-btn.primario { background: var(--navy); border-color: var(--navy); color: #fff; }
.p-btn.primario:hover:not(:disabled) { background: var(--navy-3); border-color: var(--navy-3); }
.p-btn.oro { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.p-btn.oro:hover:not(:disabled) { background: var(--gold-light); border-color: var(--gold-light); }
.p-btn.peligro { color: var(--red); border-color: #E6BDB5; }
.p-btn.peligro:hover:not(:disabled) { background: var(--red-bg); border-color: var(--red); }
.p-btn.peligro-lleno { background: var(--red); border-color: var(--red); color: #fff; }
.p-btn.fantasma { border-color: transparent; background: transparent; }
.p-btn.fantasma:hover:not(:disabled) { background: rgba(16, 21, 41, .05); border-color: transparent; }
.p-btn.pequeno { height: 30px; padding: 0 10px; font-size: 12.5px; }
.p-btn.bloque { width: 100%; height: 42px; font-size: 14.5px; }
.p-btn-icono { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: none; cursor: pointer; color: var(--muted); }
.p-btn-icono:hover { background: rgba(16, 21, 41, .06); color: var(--ink); }
.cargando-giro { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- formularios ---------- */
.p-campo { margin-bottom: 16px; }
.p-campo > label, .p-etiqueta { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.p-campo .ayuda { font-size: 12px; color: var(--muted); margin-top: 5px; }
.p-entrada, .p-select, .p-area { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.p-area { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; }
.p-entrada:focus, .p-select:focus, .p-area:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 142, 82, .18); }
.p-entrada:disabled, .p-select:disabled, .p-area:disabled { background: var(--surface-2); color: var(--muted); }
.p-entrada::placeholder { color: #A2A5B3; }
.p-buscar { position: relative; }
.p-buscar .p-icono { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.p-buscar .p-entrada { padding-left: 34px; height: 36px; }
.p-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.p-check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--navy); }
.rejilla-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.rejilla-form .completo { grid-column: 1 / -1; }
@media (max-width: 640px) { .rejilla-form { grid-template-columns: 1fr; } }
.p-error { background: var(--red-bg); color: var(--red); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; margin: 4px 0 12px; }
.p-autocompletar { position: relative; }
/* La lista va en <body> con posición fija (ver PAutocompletar), por encima de las ventanas. */
.p-autocompletar-lista { position: fixed; z-index: 150; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-2); overflow-y: auto; padding: 4px; animation: aparecer .1s ease-out; }
.p-autocompletar-lista .opcion { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px; text-align: left; cursor: pointer; font-size: 13.5px; font-family: var(--font); color: var(--ink); }
.p-autocompletar-lista .opcion:hover, .p-autocompletar-lista .opcion.activa { background: var(--gold-bg); }
.p-autocompletar-lista .opcion small { color: var(--muted); }

/* interruptor */
.p-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; display: inline-block; }
.p-switch input { opacity: 0; width: 0; height: 0; }
.p-switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: .18s; cursor: pointer; }
.p-switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .18s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.p-switch input:checked + span { background: var(--green); }
.p-switch input:checked + span::before { transform: translateX(18px); }

/* ---------- tarjetas ---------- */
.tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.tarjeta-cabecera { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tarjeta-cabecera h3 { font-size: 14.5px; font-weight: 600; margin: 0; }
.tarjeta-cabecera .sub { color: var(--muted); font-size: 12.5px; }
.tarjeta-cabecera .derecha { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.tarjeta-cuerpo { padding: 18px; }
.rejilla { display: grid; gap: 16px; }
.r-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.r-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.r-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.r-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.c-3 { grid-column: span 3; } .c-4 { grid-column: span 4; } .c-5 { grid-column: span 5; } .c-6 { grid-column: span 6; } .c-7 { grid-column: span 7; } .c-8 { grid-column: span 8; } .c-12 { grid-column: span 12; }
@media (max-width: 1200px) { .r-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .c-3, .c-4, .c-5, .c-7 { grid-column: span 6; } .c-8 { grid-column: span 12; } }
@media (max-width: 760px) { .r-2, .r-3, .r-4 { grid-template-columns: 1fr; } .r-12 > * { grid-column: span 12 !important; } }
.lista-datos { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; font-size: 13.5px; }
.lista-datos dt { color: var(--muted); }
.lista-datos dd { margin: 0; font-weight: 500; text-align: right; }

/* ---------- indicadores (KPI) ---------- */
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .titulo { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .titulo .p-icono { width: 15px; height: 15px; color: var(--gold-deep); }
.kpi .valor { font-size: 28px; font-weight: 500; letter-spacing: -.02em; margin-top: 6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .valor small { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.kpi .pie { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; border-radius: 999px; padding: 1px 7px; font-size: 11.5px; }
.delta .p-icono { width: 13px; height: 13px; }
.delta.sube { color: var(--green); background: var(--green-bg); }
.delta.baja { color: var(--red); background: var(--red-bg); }
.delta.igual { color: var(--muted); background: #EEECE7; }
.kpi .mini { position: absolute; right: 14px; top: 38px; width: 92px; height: 36px; opacity: .9; }
.grafico { width: 100%; height: 300px; }
.grafico.alto { height: 360px; }
.grafico.bajo { height: 240px; }

/* segmentador de periodo (tipo Power BI) */
.segmentos { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 3px; gap: 2px; }
.segmentos button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
.segmentos button.activo { background: var(--navy); color: #fff; }
.segmentos button:hover:not(.activo) { color: var(--ink); background: var(--surface-2); }

/* pestañas internas */
.p-pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.p-pestanas button { border: 0; background: none; padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.p-pestanas button.activa { color: var(--ink); border-bottom-color: var(--gold); }
.p-pestanas .n { background: #EEECE7; color: var(--ink-2); border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 600; }
.p-pestanas button.activa .n { background: var(--gold-bg); color: var(--gold-deep); }

/* ---------- etiquetas de estado ---------- */
.p-badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: #EEECE7; color: var(--ink-2); }
.p-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.p-badge.verde { background: var(--green-bg); color: var(--green); }
.p-badge.rojo { background: var(--red-bg); color: var(--red); }
.p-badge.ambar { background: var(--amber-bg); color: var(--amber); }
.p-badge.azul { background: var(--blue-bg); color: var(--blue); }
.p-badge.oro { background: var(--gold-bg); color: var(--gold-deep); }
.p-badge.sin-punto::before { display: none; }

/* ---------- tabla de datos ---------- */
.p-tabla { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); min-width: 0; }
.p-tabla-barra { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: var(--topbar); z-index: 6; }
.p-tabla-barra .separador { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.p-tabla-barra .derecha { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.p-tabla-barra .p-buscar { width: 260px; }
.p-tabla-barra .seleccion { font-size: 12.5px; color: var(--gold-deep); font-weight: 600; background: var(--gold-bg); padding: 4px 10px; border-radius: 999px; }
.p-tabla-scroll { overflow: auto; max-height: calc(100vh - 250px); min-height: 160px; }
.p-tabla table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.p-tabla thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 0 12px; height: 38px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.p-tabla thead th.ordenable { cursor: pointer; }
.p-tabla thead th.ordenable:hover { color: var(--ink); }
.p-tabla thead th .p-icono { width: 13px; height: 13px; vertical-align: -2px; margin-left: 4px; }
.p-tabla tbody td { padding: 0 12px; height: 44px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.p-tabla.ajustado tbody td { white-space: normal; height: auto; padding-top: 10px; padding-bottom: 10px; }
.p-tabla tbody tr { cursor: pointer; transition: background .08s; }
.p-tabla tbody tr:hover td { background: #FBF9F5; }
.p-tabla tbody tr.marcada td { background: #F7EFDF; }
.p-tabla tbody tr.marcada td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.p-tabla .col-check { width: 44px; padding: 0 0 0 14px; position: sticky; left: 0; z-index: 2; background: inherit; }
.p-tabla thead .col-check { z-index: 4; background: var(--surface-2); }
.p-tabla tbody td.col-check { background: var(--surface); }
.p-tabla tbody tr:hover td.col-check { background: #FBF9F5; }
.p-tabla tbody tr.marcada td.col-check { background: #F7EFDF; }
.p-tabla input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; vertical-align: middle; }
.p-tabla.agrupada tbody tr:not(.fila-grupo) td:nth-child(2) { padding-left: 30px; }
.p-tabla tbody tr.fila-grupo td { background: var(--surface-2); height: 38px; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.p-tabla tbody tr.fila-grupo:hover td { background: #F3EFE7; }
.p-tabla tbody tr.fila-grupo td.col-check { background: var(--surface-2); }
.p-tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.p-tabla .mono { font-family: var(--mono); font-size: 12.5px; }
.p-tabla .sec { color: var(--muted); font-size: 12.5px; }
.p-tabla .nulo { color: #A2A5B3; font-style: italic; }
.p-tabla-pie { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.p-tabla-pie .derecha { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.p-tabla-pie .p-select { height: 30px; width: auto; padding: 0 8px; font-size: 12.5px; }
.p-vacio { padding: 48px 20px; text-align: center; color: var(--muted); }
.p-vacio .p-icono { width: 34px; height: 34px; color: var(--line-2); margin-bottom: 8px; }
.p-vacio h4 { margin: 0 0 4px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; }
.esqueleto { background: linear-gradient(90deg, #EFECE6 25%, #F7F5F1 50%, #EFECE6 75%); background-size: 200% 100%; animation: brillo 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes brillo { to { background-position: -200% 0; } }

/* ---------- modales y paneles laterales ---------- */
.p-capa { position: fixed; inset: 0; background: rgba(16, 21, 41, .55); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: aparecer .15s ease-out; }
.p-modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-3); width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: subir .18s ease-out; }
.p-modal.ancho { max-width: 760px; }
.p-modal-cabecera { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.p-modal-cabecera h3 { margin: 0; font-size: 17px; font-weight: 600; }
.p-modal-cabecera .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.p-modal-cabecera .p-btn-icono { margin: -4px -8px 0 auto; }
.p-modal-cuerpo { padding: 18px 22px; overflow-y: auto; }
.p-modal-pie { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.p-modal .icono-aviso { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--amber-bg); color: var(--amber); }
.p-modal .icono-aviso.peligro { background: var(--red-bg); color: var(--red); }
.p-cajon-capa { position: fixed; inset: 0; background: rgba(16, 21, 41, .45); z-index: 90; animation: aparecer .15s ease-out; }
.p-cajon { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--bg); z-index: 91; box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: deslizar .2s ease-out; }
.p-cajon .p-modal-cabecera { background: var(--surface); }
.p-cajon .p-modal-cuerpo { flex: 1; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes deslizar { from { transform: translateX(40px); opacity: 0; } }

/* ---------- avisos flotantes ---------- */
.p-avisos { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.p-aviso { display: flex; gap: 10px; align-items: flex-start; background: var(--navy); color: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow-2); font-size: 13.5px; animation: subir .2s ease-out; }
.p-aviso .p-icono { color: var(--gold-light); margin-top: 1px; }
.p-aviso.exito .p-icono { color: #6FD3AE; }
.p-aviso.error { background: #5B1D14; }
.p-aviso.error .p-icono { color: #FFB4A6; }
.p-aviso button { margin-left: auto; background: none; border: 0; color: rgba(255, 255, 255, .6); cursor: pointer; padding: 0; }

/* ---------- varios ---------- */
.texto-sec { color: var(--muted); }
.serif { font-family: 'Spectral', serif; }
.fila-flex { display: flex; align-items: center; gap: 10px; }
.mt-16 { margin-top: 16px; } .mb-16 { margin-bottom: 16px; } .mt-8 { margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--gold-bg); color: var(--ink); font-size: 13px; margin: 0 6px 6px 0; }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; }
.chip button:hover { background: rgba(178, 59, 42, .12); color: var(--red); }
.estrellas { display: inline-flex; gap: 2px; }
.estrellas button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--line-2); }
.estrellas button.llena { color: var(--gold); }
.estrellas button .p-icono { width: 17px; height: 17px; }
.estrellas button.llena .p-icono { fill: currentColor; }
.estrellas .cero { font-size: 12px; font-weight: 600; width: 22px; color: var(--muted); }
.estrellas .cero.llena { color: var(--red); }
.planes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .planes { grid-template-columns: 1fr; } }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; position: relative; }
.plan:hover { border-color: var(--gold); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.plan.actual { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); cursor: default; transform: none; }
.plan .nombre { font-weight: 600; font-size: 15px; }
.plan .precio { font-size: 28px; font-weight: 500; margin: 8px 0 2px; letter-spacing: -.02em; }
.plan .precio small { font-size: 13px; color: var(--muted); }
.plan ul { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.plan li { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.plan li .p-icono { width: 15px; height: 15px; color: var(--green); }
.plan .marca-actual { position: absolute; top: -10px; right: 14px; }
.barra-uso { height: 8px; background: #EEECE7; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.barra-uso span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); border-radius: 999px; }
.aviso-linea { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--blue-bg); color: #24477A; font-size: 13.5px; }
.aviso-linea.oro { background: var(--gold-bg); color: var(--gold-deep); }
.aviso-linea.verde { background: var(--green-bg); color: var(--green); }
.aviso-linea .p-icono { margin-top: 1px; }
.codigo { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.enlace-copiar { display: flex; gap: 8px; }
.enlace-copiar .p-entrada { font-family: var(--mono); font-size: 12.5px; }
.lista-bd { max-height: calc(100vh - 210px); overflow-y: auto; padding: 6px; }
.lista-bd button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 7px; font-size: 13px; cursor: pointer; text-align: left; font-family: var(--mono); }
.lista-bd button:hover { background: var(--surface-2); }
.lista-bd button.activa { background: var(--navy); color: #fff; }
.lista-bd button small { color: var(--muted); font-family: var(--font); font-size: 11.5px; }
.lista-bd button.activa small { color: rgba(255, 255, 255, .6); }
.bd-rejilla { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .bd-rejilla { grid-template-columns: 1fr; } }
.obligatorio { color: var(--red); font-weight: 700; margin-left: 3px; }
.campo-falta .p-entrada, .campo-falta .p-select, .campo-falta .p-area { border-color: var(--red); background: #FFF8F6; }
.pk { font-size: 9.5px; font-weight: 700; color: var(--gold-deep); background: var(--gold-bg); border-radius: 4px; padding: 1px 4px; margin-left: 5px; letter-spacing: .04em; }
.fk { font-size: 10.5px; color: var(--blue); margin-left: 5px; text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ==========================================================================
   Móvil (hasta 760 px)
   ========================================================================== */
.solo-movil { display: none; }
.shell-capa { position: fixed; inset: 0; background: rgba(16, 21, 41, .5); z-index: 25; }
@media (max-width: 760px) {
  .solo-movil { display: block; }
  .solo-escritorio { display: none !important; }
  .bd-rejilla > .tarjeta { padding-top: 10px; }

  /* Barra superior: título en una línea; el selector de periodo, debajo. */
  .topbar { height: auto; min-height: var(--topbar); flex-wrap: wrap; row-gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .topbar .migas { display: none; }
  .topbar h1 { font-size: 17px; white-space: nowrap; }
  .topbar .acciones { order: 3; width: 100%; margin-left: 0; }
  .topbar .acciones .segmentos { width: 100%; }
  .topbar .acciones .segmentos button { flex: 1; padding: 0 4px; }
  .pagina { padding-top: 16px; }

  /* Indicadores de dos en dos y más compactos. */
  .rejilla.r-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi .valor { font-size: 22px; }
  .kpi .mini { display: none; }
  .kpi .pie { flex-wrap: wrap; }
  .grafico, .grafico.alto { height: 260px; }
  .tarjeta-cuerpo { padding: 12px; }

  /* Pestañas: desplazables, con algo menos de relleno. */
  .p-pestanas button { padding: 10px 10px; font-size: 13px; }

  /* Tablas en tarjetas: cada fila es un bloque con «campo: valor». */
  .p-tabla-barra { position: static; gap: 6px; }
  .p-tabla-barra .p-btn { height: 34px; padding: 0 10px; font-size: 13px; }
  .p-tabla-barra .separador { display: none; }
  .p-tabla-barra .derecha { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .p-tabla-barra .p-buscar { width: 100%; flex: 1 1 100%; order: 3; }
  .p-tabla-barra .derecha > select { flex: 1; }
  .p-tabla-scroll { max-height: none; overflow: visible; }
  .p-tabla table, .p-tabla tbody { display: block; }
  .p-tabla thead { display: none; }
  .p-tabla tbody tr { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .p-tabla tbody tr.marcada { background: #F7EFDF; box-shadow: inset 3px 0 0 var(--gold); }
  .p-tabla tbody tr.marcada td, .p-tabla tbody tr:hover td { background: transparent; }
  .p-tabla tbody td { grid-column: 2; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; height: auto; min-height: 0; padding: 3px 0; border: 0; white-space: normal; max-width: none; overflow: visible; text-align: right; word-break: break-word; }
  .p-tabla tbody td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex-shrink: 0; max-width: 45%; }
  .p-tabla tbody td.num { text-align: right; }
  .p-tabla tbody td.col-check { grid-column: 1; grid-row: 1 / span 30; position: static; padding: 3px 0 0; justify-content: flex-start; background: transparent !important; }
  .p-tabla tbody td.col-check::before { content: none; }
  /* La primera columna de datos hace de título de la tarjeta. */
  .p-tabla tbody td.col-check + td, .p-tabla.sin-casillas tbody td:first-child { font-weight: 600; font-size: 14px; text-align: left; justify-content: flex-start; }
  .p-tabla tbody td.col-check + td::before, .p-tabla.sin-casillas tbody td:first-child::before { content: none; }
  .p-tabla.agrupada tbody tr:not(.fila-grupo) td:nth-child(2) { padding-left: 0; }
  /* Filas especiales (cargando, vacío, cabeceras de grupo). */
  .p-tabla tbody tr td[colspan] { grid-column: 1 / -1; display: block; text-align: left; }
  .p-tabla tbody td[colspan]::before { content: none; }
  .p-tabla tbody tr.fila-grupo { background: var(--surface-2); }
  .p-tabla tbody tr.fila-grupo td:not(.col-check) { justify-content: flex-start; text-align: left; }
  .p-tabla tbody tr.fila-grupo td::before { content: none; }
  .p-tabla-pie { justify-content: space-between; }

  /* Ventanas emergentes: desde abajo, a lo ancho de la pantalla. */
  .p-capa { padding: 0; place-items: end stretch; }
  .p-modal, .p-modal.ancho { max-width: none; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .p-modal-pie { border-radius: 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .p-modal-pie .p-btn { flex: 1; }
  .rejilla-form { grid-template-columns: 1fr; }
  .p-cajon { width: 100%; }
  .p-avisos { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .planes { grid-template-columns: 1fr; }
  .lista-datos dd { word-break: break-word; }
}


/* Partidos judiciales: acordeón de provincias con casilla de «toda la provincia». */
.acordeon-barra { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.acordeon-barra .p-buscar { flex: 1 1 260px; max-width: 380px; }
.acordeon-barra .p-check { align-items: center; }
.acordeon-barra .p-check input { margin-top: 0; }
.acordeon-provincia + .acordeon-provincia { border-top: 1px solid var(--line); }
.acordeon-cabecera { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 48px; }
.acordeon-cabecera input { width: 17px; height: 17px; accent-color: var(--navy); flex: none; cursor: pointer; }
.acordeon-boton { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: left; padding: 0; }
.acordeon-nombre { flex: 1; min-width: 0; font-weight: 500; }
.acordeon-cuenta { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.acordeon-cuenta.con { color: var(--gold-deep); font-weight: 600; }
.acordeon-flecha { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; flex: none; }
.acordeon-provincia.abierta .acordeon-flecha { transform: rotate(180deg); }
.acordeon-provincia.abierta .acordeon-cabecera { background: var(--surface-2); }
.acordeon-cabecera:hover { background: var(--surface-2); }
.acordeon-partidos-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; padding: 8px 16px 14px 45px; background: var(--surface-2); }
.acordeon-partido { align-items: center; min-height: 34px; }
.acordeon-partido input { margin-top: 0; }
@media (max-width: 640px) { .acordeon-partidos-lista { grid-template-columns: 1fr; padding-left: 45px; } .acordeon-barra .p-buscar { max-width: none; } }

/* Detalle de una alerta del admin: texto tal cual, con saltos de línea. */
.detalle-alerta { margin: 0; white-space: pre-wrap; word-break: break-word; font: 13.5px/1.6 var(--font); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }

/* ==========================================================================
   App en el móvil (dentro de WhatsApp): pestañas abajo, Inicio y Más
   ========================================================================== */
.pestanas-app { display: none; }
@media (max-width: 760px) {
  /* Solo donde hay pestañas abajo (área de cliente); el admin sigue con su menú. */
  body:has(.pestanas-app) .topbar .menu-movil { display: none; }
  .pagina { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .pestanas-app { display: grid; grid-template-columns: repeat(var(--n-pestanas, 5), 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px -12px rgba(16, 21, 41, .35);
    padding: 6px max(4px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); }
  .pestanas-app button { display: grid; justify-items: center; gap: 2px; background: none; border: 0; color: var(--muted); font-size: 11px; font-weight: 500; padding: 4px 0; cursor: pointer; }
  .pestanas-app button .p-icono { width: 22px; height: 22px; }
  .pestanas-app button.activa { color: var(--navy); font-weight: 600; }
  .pestanas-app button.principal-accion .p-icono { color: var(--gold-deep); }
}
.inicio { display: grid; gap: 14px; max-width: 760px; }
.inicio-accion { display: flex; gap: 10px; flex-wrap: wrap; }
.inicio-accion .p-btn { flex: 1 1 200px; height: 44px; font-size: 14.5px; }
.inicio h2 { font-size: 15px; font-weight: 600; margin: 4px 0 0; display: flex; align-items: center; gap: 8px; }
.inicio h2 .n { font-size: 12px; font-weight: 600; background: var(--gold-bg); color: var(--gold-deep); border-radius: 999px; padding: 1px 8px; }
.inicio-lista { display: grid; gap: 8px; }
.inicio-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; }
.inicio-item .fila { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.inicio-item .codigo { font-weight: 600; font-variant-numeric: tabular-nums; }
.inicio-item .sec { color: var(--muted); font-size: 13px; }
.inicio-item .acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.inicio-vacio { color: var(--muted); font-size: 13.5px; margin: 0; }
.inicio-ver { justify-self: start; }
.mas-lista { display: grid; gap: 8px; max-width: 560px; }
.mas-lista button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; font-size: 14.5px; color: var(--ink); cursor: pointer; }
.mas-lista button .p-icono:last-child { margin-left: auto; color: var(--muted); }
.mas-usuario { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
@media (max-width: 760px) {
  /* Cabecera de tarjeta: el título arriba y la explicación debajo. */
  .tarjeta-cabecera { flex-wrap: wrap; row-gap: 4px; }
  .tarjeta-cabecera .sub { flex-basis: 100%; }
}

/* Sustituciones en el móvil: chips de filtro y tarjetas con sus botones. */
.sust-movil { display: none; }
@media (max-width: 760px) {
  .sust-movil { display: grid; gap: 12px; }
  .sust-chips { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 5px; }
  .sust-chips button { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2, var(--ink)); border-radius: 999px; padding: 6px 4px; font-size: 12.5px; font-weight: 500; display: inline-flex; gap: 4px; align-items: center; justify-content: center; cursor: pointer; white-space: nowrap; min-width: 0; }
  .sust-chips button .n { font-size: 11px; background: var(--gold-bg); color: var(--gold-deep); border-radius: 999px; padding: 0 6px; }
  .sust-chips button.activo { background: var(--navy); border-color: var(--navy); color: #fff; }
  .sust-chips button.activo .n { background: rgba(255,255,255,.18); color: #fff; }
  .sust-lista { display: grid; gap: 10px; }
  .sust-tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; font-size: 14px; }
  .sust-tarjeta .fila { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .sust-tarjeta .codigo { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 15px; }
  .sust-tarjeta .sec { color: var(--muted); font-size: 13px; }
  .sust-tarjeta .chips-estado { display: flex; gap: 6px; flex-wrap: wrap; }
  .sust-tarjeta .chips-estado:empty { display: none; }
  .sust-tarjeta .botones { display: flex; gap: 8px; margin-top: 6px; }
  .sust-tarjeta .botones:empty { display: none; }
  .sust-tarjeta .botones .p-btn { flex: 1; height: 38px; padding: 0 8px; }
  .sust-recuperar { justify-self: start; }
}

/* Favoritos y bloqueados: una fila por procurador con ⭐ y 🚫. */
.contactos { display: grid; gap: 12px; max-width: 760px; }
.contactos-barra { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.contactos-barra .p-buscar { flex: 1 1 200px; }
.contactos-chips { display: flex !important; gap: 6px; }
.contactos-chips button { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.contactos-chips button .n { font-size: 11px; background: var(--gold-bg); color: var(--gold-deep); border-radius: 999px; padding: 0 6px; }
.contactos-chips button.activo { background: var(--navy); border-color: var(--navy); color: #fff; }
.contactos-chips button.activo .n { background: rgba(255,255,255,.18); color: #fff; }
.contactos-ayuda { margin: 0; font-size: 13px; display: grid; gap: 2px; }
.contactos-lista { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.contacto { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.contacto:first-child { border-top: 0; }
.contacto-nombre { flex: 1; min-width: 0; display: grid; }
.contacto-nombre .texto-sec { font-size: 12.5px; }
.contacto.bloqueado .contacto-nombre b { color: var(--muted); text-decoration: line-through; }
.contacto-boton { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; }
.contacto-boton .p-icono { width: 20px; height: 20px; }
.contacto-boton:disabled { opacity: .35; cursor: not-allowed; }
.contacto-boton.estrella.activo { color: var(--gold-deep); background: var(--gold-bg); border-color: var(--gold-light); }
.contacto-boton.estrella.activo .p-icono { fill: currentColor; }
.contacto-boton.bloqueo.activo { color: var(--red); background: var(--red-bg); border-color: var(--red); }

/* Ficha de la sustitución como en WhatsApp: un dato por línea con su icono. */
.sust-tarjeta .dato { display: block; line-height: 1.45; overflow-wrap: anywhere; padding-left: 1.6em; text-indent: -1.6em; }
.sust-tarjeta .dato .mono { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); font-size: 12.5px; }
.sust-tarjeta .codigo .mono { font-size: 14px; }
.sust-tarjeta.apagada { background: var(--surface-2); }
.sust-tarjeta.apagada .dato { opacity: .7; }

/* Plan y facturación: «Tu plan» compacta, los datos en una línea. */
.plan-resumen { display: flex; flex-wrap: wrap; gap: 6px 28px; font-size: 14px; }

/* Estado de la sustitución: última línea de la tarjeta, a todo el ancho y en mayúsculas. */
.sust-tarjeta .fila { align-items: center; }
.sust-tarjeta .codigo { flex: none; }
.sust-estado { margin-top: 6px; padding: 7px 12px; border-radius: 8px; background: #F9E9E6; color: #A2463A; font-size: 12.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; line-height: 1.35; }
.sust-estado.verde { background: var(--green-bg); color: var(--green); }
.sust-estado.oro { background: var(--gold-bg); color: var(--gold-deep); }
.sust-estado.azul { background: var(--blue-bg, #E8EEF8); color: var(--blue, #2F5A9E); }
.sust-estado.gris { background: #EEECE7; color: var(--ink-2); }
.sust-tarjeta .enlace-mapa { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

/* Mis avisos: a quién se le cambian (titular: él y su equipo). Chips también en el ordenador. */
.avisos-personas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.avisos-personas button { flex: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.avisos-personas button .n { font-size: 11.5px; background: var(--gold-bg); color: var(--gold-deep); border-radius: 999px; padding: 0 6px; }
.avisos-personas button.activo { background: var(--navy); border-color: var(--navy); color: #fff; }
.avisos-personas button.activo .n { background: rgba(255,255,255,.18); color: #fff; }
.avisos-quien { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Entrar: móvil y contraseña; contraseña olvidada con código por WhatsApp. */
.login-logo { height: 30px; display: block; margin: 0 0 22px; }
@media (min-width: 901px) { .login-logo { display: none; } }
.login-separador { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 18px 0 14px; }
.login-separador::before, .login-separador::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login-alta { text-align: center; color: var(--muted); font-size: 14px; margin: 18px 0 0; }
.login-alta a { color: var(--navy); font-weight: 600; }
.codigo-entrar { font-size: 26px; letter-spacing: .08em; text-align: center; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.esperando-codigo { justify-content: center; margin-top: 14px; font-size: 13.5px; }
.mt-8 { margin-top: 8px; }
.acceso-panel { display: grid; gap: 14px; max-width: 560px; }
.acceso-titulo { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.ayuda-campo { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.texto-pre { white-space: pre-line; }
/* Historial de la cuenta */
.historial-mes { margin-top: 14px; }
.historial-titulo { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.historial-fila { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.historial-icono { flex: none; width: 22px; text-align: center; }
.historial-fecha { font-size: 12px; margin-top: 2px; }
.soporte-botones { display: grid; gap: 8px; }
/* Solicito (móvil): quién se ha ofrecido, con WhatsApp, Llamar y Asignar. */
.sustitutos { border: 1px solid var(--gold-bg); background: #FDFAF3; border-radius: var(--radius); padding: 10px 12px; margin-top: 4px; }
.sustitutos-titulo { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 4px; }
.sustituto { padding: 8px 0; border-top: 1px solid var(--line); }
.sustituto:first-of-type { border-top: 0; }
.sustituto-nombre { font-size: 15px; margin-bottom: 6px; }
.sustituto-botones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sustituto-botones .p-btn { justify-content: center; }
/* WhatsApp y Llamar junto a un teléfono (tablas). */
.contacto-iconos { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.contacto-iconos .p-btn.pequeno { padding: 0 7px; }
.sustituto-botones.dos { grid-template-columns: repeat(2, 1fr); }
.sustitutos.verde { border-color: var(--green-bg); background: #F3FAF6; }
.sustitutos.verde .sustitutos-titulo { color: var(--green); }
.sustitutos.azul { border-color: var(--blue-bg); background: #F4F7FC; }
.sustitutos.azul .sustitutos-titulo { color: var(--blue); }
/* Enviar sustitución: el resumen para revisar antes de enviarla. */
.resumen-envio { list-style: none; margin: 0; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 8px; font-size: 15px; }
.resumen-envio li { display: flex; gap: 10px; align-items: flex-start; }
.resumen-envio span { flex: none; width: 22px; text-align: center; }
