/* Portal de clientes de CruVal LLC. Mismos colores y letras que la web. */
:root { --bg: #F7F5F0; --bg-2: #EFECE4; --ink: #0B1220; --muted: #3A4354; --line: #D9D4C7; --accent: #24365E; --deep: #16223F;
  --display: "Instrument Serif", Georgia, serif; --text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif; }
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 17px/1.45 var(--text); padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.p-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 60px; padding: 0 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
.p-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 20px; }
.p-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
.p-tools select { max-width: 46vw; padding: 8px 10px; border: 1.5px solid var(--ink); border-radius: 2px; background: #fff; font-weight: 600; font-size: 14px; }
.p-lang, .p-out { background: transparent; border: 1.5px solid var(--ink); border-radius: 999px; padding: 7px 11px; font-size: 13px; font-weight: 700; cursor: pointer; }
.p-main { max-width: 640px; margin: 0 auto; padding: 22px 18px 10px; }
.p-load { color: var(--muted); padding: 40px 0; text-align: center; }
h1 { font: 400 34px/1.05 var(--display); letter-spacing: -.01em; }
h2 { font: 400 26px/1.1 var(--display); margin-top: 30px; }
.sub { color: var(--muted); margin-top: 6px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px; margin-top: 14px; }
.k { font: 700 11px/1 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.big { font-weight: 700; font-size: 19px; line-height: 1.2; margin-top: 9px; }
.m { color: var(--muted); font-size: 15px; margin-top: 5px; overflow-wrap: anywhere; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #1E9E5A; margin-right: 8px; } .dot.wip { background: #D9962B; }
.steps { display: flex; gap: 4px; margin-top: 14px; } .steps div { flex: 1; font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--muted); padding-top: 8px; border-top: 4px solid var(--line); }
.steps .on { color: #11532F; border-top-color: #1E9E5A; } .steps .now { color: var(--accent); border-top-color: var(--accent); }
.meter { height: 10px; background: #ECE8DD; border-radius: 99px; margin-top: 11px; overflow: hidden; } .meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; } .meter.over i { background: #8A1F1F; }
.li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid #ECE8DD; } .li:first-of-type { border-top: 0; }
.li > div { min-width: 0; } .li b { font-weight: 600; font-size: 16px; line-height: 1.25; display: block; overflow-wrap: anywhere; } .li small { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; overflow-wrap: anywhere; white-space: pre-line; }
.tag { flex: none; font: 700 12px/1 var(--text); padding: 7px 10px; border-radius: 99px; white-space: nowrap; }
.ok { background: #D9F2E3; color: #11532F; } .run { background: #E3EEFF; color: #1B3A7A; } .new { background: #FFF1CC; color: #6B4E00; } .no { background: #ECE8DD; color: var(--muted); }
.btn { display: inline-block; text-align: center; background: var(--accent); color: #fff; font-weight: 600; font-size: 16px; line-height: 1; padding: 15px 20px; border: 2px solid var(--accent); border-radius: 3px; cursor: pointer; text-decoration: none; }
.btn.wide { display: block; width: 100%; margin-top: 14px; } .btn.ghost { background: transparent; color: var(--accent); } .btn.sm { padding: 9px 12px; font-size: 14px; } .btn.red { background: transparent; color: #8A1F1F; border-color: #8A1F1F; }
.btn[disabled] { opacity: .5; cursor: default; }
label { display: block; font-size: 14px; font-weight: 600; margin-top: 14px; }
input[type="text"], input[type="email"], input[type="date"], input[type="number"], input[type="url"], textarea, .card select { display: block; width: 100%; margin-top: 6px; padding: 13px; background: #fff; border: 1.5px solid var(--ink); border-radius: 2px; font-size: 16px; }
textarea { min-height: 96px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.msg { margin-top: 14px; padding: 12px 14px; border-radius: 3px; font-weight: 600; font-size: 15px; } .msg.good { background: #D9F2E3; color: #11532F; } .msg.bad { background: #FBE3E3; color: #8A1F1F; } .msg.info { background: #E3EEFF; color: #1B3A7A; }
.sug { background: var(--deep); color: #fff; border: 0; } .sug .k { color: #BFDBFE; } .sug .m { color: #DCE6F7; }
.drop { display: block; border: 2px dashed #9AA3B2; border-radius: 6px; padding: 20px 14px; text-align: center; color: var(--muted); font-weight: 600; margin-top: 12px; cursor: pointer; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.thumbs figure { position: relative; aspect-ratio: 1; background: var(--bg-2) center/cover; border-radius: 4px; overflow: hidden; font-size: 11px; color: var(--muted); display: flex; align-items: flex-end; }
.thumbs img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumbs figcaption { position: relative; z-index: 1; width: 100%; padding: 4px 6px; background: rgba(11,18,32,.6); color: #fff; display: flex; justify-content: space-between; gap: 4px; align-items: center; }
.thumbs button { background: none; border: 0; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: underline; }
/* Pestañas arriba también en el iPhone (14 Oct): abajo quedaban pegadas al borde y al tocarlas saltaba Siri / la barra de inicio. */
.p-tabs { position: sticky; top: 60px; z-index: 4; display: flex; background: var(--bg); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.p-tabs::-webkit-scrollbar { display: none; }
.p-tabs button { flex: 1 0 auto; background: none; border: 0; border-bottom: 3px solid transparent; padding: 14px 10px 12px; font-size: 14px; font-weight: 700; color: #6b7385; cursor: pointer; white-space: nowrap; }
.p-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.login { max-width: 420px; margin: 8vh auto 0; }
.adm { border-left: 4px solid #C9962B; } .adm .k { color: #6B4E00; }
details.adm summary { cursor: pointer; font-weight: 700; } details.adm[open] summary { margin-bottom: 4px; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; } .inline > * { flex: 1; min-width: 110px; } .inline .btn { flex: none; }
@media (min-width: 760px) { .p-tabs { max-width: 640px; margin: 0 auto; border: 0; border-bottom: 1px solid var(--line); } .p-tabs button { padding: 14px 4px; font-size: 13px; } .p-main { padding-top: 14px; padding-bottom: 60px; } }
button.card.ov { display: block; width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; }
button.card.ov:hover { border-color: var(--accent); box-shadow: 0 8px 18px -14px rgba(11,18,32,.5); }
.ov-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; } .ov-top b { font-size: 18px; line-height: 1.25; }
.ov-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
/* Logo del cliente: en la barra y arriba del Inicio (14 Oct) */
.p-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.p-who { display: flex; align-items: center; gap: 8px; min-width: 0; } .p-who > i { width: 1px; height: 26px; background: var(--line); flex: none; }
#p-who-logo { display: flex; align-items: center; height: 34px; padding: 0 10px; border-radius: 6px; min-width: 0; }
#p-who-logo img { height: 24px; width: auto; max-width: 100%; display: block; }
.cl-hero { margin-bottom: 22px; padding: 26px 18px 18px; border-radius: 8px; color: #fff; text-align: center; }
.cl-hero img { height: 86px; width: auto; max-width: 100%; display: block; margin: 0 auto; }
.cl-hero p { margin-top: 14px; font: 700 11px/1.3 var(--text); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.72); } .cl-hero b { color: #fff; }
/* Admin en iPhone: con el selector de clientes no caben marca, logo, idioma y salir; se quita la palabra CruVal y el logo del cliente (el selector ya dice cuál es) */
@media (max-width: 520px) { .p-bar:has(#p-client:not([hidden])) .p-brand b, .p-bar:has(#p-client:not([hidden])) .p-who { display: none; } .p-tools select { max-width: 40vw; } }
/* Métricas de la web del cliente (14 Oct) */
/* Tarjeta «Este mes en tu sitio» (rediseño 23 Oct): dos cifras con filete, estado en una línea y barras con valor */
.st-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-live { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--accent); background: #EEF3FB; border-radius: 999px; padding: 5px 11px 5px 9px; }
.st-live i { width: 8px; height: 8px; border-radius: 50%; background: #2E9E5B; box-shadow: 0 0 0 3px rgba(46,158,91,.18); }
.st-kpis { display: grid; grid-template-columns: 1fr 1fr; margin-top: 18px; }
.st-kpi { padding: 2px 0 2px 16px; border-left: 1px solid var(--line); } .st-kpi:first-child { padding-left: 0; border-left: 0; }
.st-kpi b { display: block; font: 400 52px/1 var(--display); letter-spacing: -.02em; color: var(--ink); }
.st-kpi span { display: block; margin-top: 8px; font-size: 14px; line-height: 1.25; color: var(--muted); }
.st-avg { display: grid; grid-template-columns: 1fr 1fr; margin-top: 16px; padding-top: 14px; border-top: 1px solid #ECE8DD; }
.st-avg div { padding-left: 16px; border-left: 1px solid var(--line); } .st-avg div:first-child { padding-left: 0; border-left: 0; }
.st-avg b { display: block; font: 400 30px/1 var(--display); } .st-avg span { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.st-note { margin-top: 16px; padding-top: 12px; border-top: 1px solid #ECE8DD; font-size: 13px; color: var(--muted); }
.st-chart { margin-top: 18px; padding-top: 14px; border-top: 1px solid #ECE8DD; }
.st-bars { display: flex; gap: 8px; height: 132px; margin-top: 14px; } .st-bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 5px; }
.st-bars em { font: 700 12px/1 var(--text); font-style: normal; text-align: center; color: var(--muted); min-height: 12px; }
.st-bars i { display: block; background: #C5D5F0; border-radius: 3px 3px 0 0; } .st-bars i.now { background: var(--accent); } .st-bars small { font-size: 11px; color: var(--muted); text-align: center; line-height: 1; text-transform: capitalize; }
.st-since { font-size: 13px; margin-top: 12px; }
/* Pestaña Métricas: informe mensual (14 Oct) */
.rp-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rp-sec { margin-top: 18px; padding-top: 14px; border-top: 1px solid #ECE8DD; } .rp-sec.first { border: 0; padding-top: 4px; margin-top: 10px; }
.rp-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.rp-tiles div, .rp-two div { background: var(--bg); border-radius: 4px; padding: 11px 10px; } .rp-tiles b, .rp-two b { display: block; font: 400 30px/1 var(--display); } .rp-tiles span, .rp-two span { display: block; color: var(--muted); font-size: 13px; line-height: 1.25; margin-top: 6px; }
.rp-small { font-size: 13px; }
.rp-q { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; padding: 6px 0; } .rp-q span { color: var(--muted); white-space: nowrap; }
.rp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-list { margin: 8px 0 0 18px; font-size: 15px; line-height: 1.45; } .rp-list li { margin-top: 4px; }
.rp-read { margin-top: 10px; font-size: 15px; line-height: 1.5; background: #F3F6FC; border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: 0 4px 4px 0; }
.rp-old { margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--line); }
/* Seis pestañas en el iPhone: un poco más compactas para que quepan sin desplazarse */
@media (max-width: 759px) { .p-tabs button { padding: 14px 6px 12px; font-size: 13px; } }

/* Aviso de cobro (16 Oct): factura vencida o pago fallido */
.card.alert { border-color: #E2A3A3; background: #FBE3E3; color: #8A1F1F; } .card.alert p { margin: 0; font-weight: 600; } .card.alert .btn { margin-top: 12px; }
