/* Portal de Clientes Servicheck — mismos tokens que el CRM (assets/css/tokens.css). */
:root {
    --pc-navy: #092042;
    --pc-navy-2: #0f2d5a;
    --pc-gold: #DBA214;
    --pc-bg: #f5f7fa;
    --pc-surface: #ffffff;
    --pc-border: #dfe6ee;
    --pc-border-strong: #c7d2de;
    --pc-text: #101828;
    --pc-muted: #5b6b7f;
    --pc-ok: #0a7a3d; --pc-ok-bg: #e6f6ec;
    --pc-warn: #a15c00; --pc-warn-bg: #fff3e0;
    --pc-info: #0c5aa6; --pc-info-bg: #eaf3fc;
    --pc-danger: #b42318; --pc-danger-bg: #fdecec;
    --pc-radius: 10px;
    --pc-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--pc-bg); color: var(--pc-text); font: 15px/1.5 var(--pc-font); }
a { color: var(--pc-navy); }
h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .35rem; color: var(--pc-navy); }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; color: var(--pc-navy); }
h3 { font-size: .95rem; margin: 1.25rem 0 .4rem; }
.pc-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* Cabecera */
.pc-header { background: var(--pc-navy); color: #fff; border-bottom: 3px solid var(--pc-gold); }
.pc-header-inner { max-width: 1440px; margin: 0 auto; padding: 12px clamp(16px, 3vw, 40px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pc-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.pc-brand img { background: #fff; border-radius: 8px; padding: 2px; }
.pc-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.pc-brand strong { font-size: 1rem; letter-spacing: .2px; }
.pc-brand small { font-size: .78rem; color: #c9d3e3; }
.pc-user { display: flex; align-items: center; gap: 12px; }
.pc-user-name { font-size: .9rem; color: #dbe3ef; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-user form { margin: 0; }
.pc-btn-ghost { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.pc-btn-ghost:hover { border-color: var(--pc-gold); }
.pc-nav { max-width: 1440px; margin: 0 auto; padding: 0 calc(clamp(16px, 3vw, 40px) - 12px); display: flex; gap: 2px; }
.pc-nav a { display: flex; align-items: center; gap: 7px; padding: 10px 12px; color: #c9d3e3; text-decoration: none; font-size: .9rem; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.pc-nav a:hover { color: #fff; }
.pc-nav a.is-active { color: #fff; border-bottom-color: var(--pc-gold); font-weight: 600; }

/* Contenido */
.pc-main { max-width: 1440px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 40px) 48px; }
.pc-footer { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px) 32px; color: var(--pc-muted); font-size: .8rem; }
.pc-section { background: var(--pc-surface); border: 1px solid var(--pc-border); border-radius: var(--pc-radius); padding: 20px 22px; margin-bottom: 16px; }
.pc-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: .75rem; }
.pc-section-head h1, .pc-section-head h2 { margin: 0; }
.pc-section-head > a:not(.pc-btn) { font-size: .88rem; }
.pc-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pc-back { margin: 0 0 10px; font-size: .88rem; }
.pc-back a { text-decoration: none; color: var(--pc-muted); }
.pc-muted { color: var(--pc-muted); }
.pc-small { font-size: .85rem; }
.pc-empty { color: var(--pc-muted); margin: 0; }
.pc-prewrap { white-space: pre-wrap; margin: 0; }
.pc-notice { background: var(--pc-info-bg); border-left: 4px solid var(--pc-gold); color: var(--pc-navy); padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; }
.pc-error { background: var(--pc-danger-bg); color: var(--pc-danger); padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.pc-error ul { margin: 0; padding-left: 18px; }
.pc-message { border-left: 4px solid var(--pc-gold); }

/* Resumen */
.pc-summary { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--pc-surface); border: 1px solid var(--pc-border); border-radius: var(--pc-radius); margin-bottom: 16px; }
.pc-summary a { padding: 16px 20px; text-decoration: none; color: var(--pc-text); display: flex; flex-direction: column; }
.pc-summary a + a { border-left: 1px solid var(--pc-border); }
.pc-summary strong { font-size: 1.6rem; color: var(--pc-navy); line-height: 1.1; }
.pc-summary span { color: var(--pc-muted); font-size: .88rem; }
.pc-summary a:hover strong { color: var(--pc-gold); }

/* Listas */
.pc-list { list-style: none; margin: 0; padding: 0; }
.pc-list li + li { border-top: 1px solid var(--pc-border); }
.pc-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; text-decoration: none; color: var(--pc-text); }
.pc-list a:hover strong { color: var(--pc-navy); text-decoration: underline; text-decoration-color: var(--pc-gold); }
.pc-list-main { display: flex; flex-direction: column; min-width: 0; }
.pc-list-main small { color: var(--pc-muted); }
.pc-list .pc-icon { color: var(--pc-muted); }
.pc-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 24px; margin: 0; }
.pc-facts dt { font-size: .8rem; color: var(--pc-muted); }
.pc-facts dd { margin: 2px 0 0; font-weight: 600; }

/* Tablas */
.pc-table-wrap { overflow-x: auto; }
.pc-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pc-table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; color: var(--pc-muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--pc-border-strong); }
.pc-table td { padding: 11px 10px; border-bottom: 1px solid var(--pc-border); vertical-align: top; }
.pc-table tr:last-child td { border-bottom: 0; }

/* Estados */
.pc-status { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pc-status-ok { background: var(--pc-ok-bg); color: var(--pc-ok); }
.pc-status-warn { background: var(--pc-warn-bg); color: var(--pc-warn); }
.pc-status-info { background: var(--pc-info-bg); color: var(--pc-info); }
.pc-status-muted { background: #eef1f5; color: var(--pc-muted); }

/* Botones y formularios */
.pc-btn, .pc-btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 16px; border-radius: 8px; font: inherit; font-weight: 600; font-size: .92rem; text-decoration: none; cursor: pointer; }
.pc-btn { background: var(--pc-navy); color: #fff; border: 1px solid var(--pc-navy); }
.pc-btn:hover { background: var(--pc-navy-2); box-shadow: inset 0 -3px 0 var(--pc-gold); }
.pc-btn-secondary { background: #fff; color: var(--pc-navy); border: 1px solid var(--pc-border-strong); }
.pc-btn-secondary:hover { border-color: var(--pc-navy); }
.pc-form { display: flex; flex-direction: column; gap: 8px; }
.pc-form label { font-weight: 600; font-size: .9rem; }
.pc-form .pc-sub { font-weight: 400; color: var(--pc-muted); font-size: .85rem; margin-top: 6px; }
.pc-form input[type=email], .pc-form input[type=text], .pc-form input:not([type]), .pc-form input[type=date], .pc-form textarea { width: 100%; min-height: 40px; padding: 9px 12px; border: 1px solid var(--pc-border-strong); border-radius: 8px; font: inherit; background: #fff; color: var(--pc-text); }
.pc-form input:focus, .pc-form textarea:focus { outline: 2px solid var(--pc-gold); outline-offset: 1px; border-color: var(--pc-navy); }
.pc-form button { margin-top: 8px; }
.pc-form fieldset { border: 0; border-top: 1px solid var(--pc-border); padding: 14px 0 4px; margin: 6px 0 0; }
.pc-form legend { font-weight: 700; color: var(--pc-navy); padding: 0 6px 0 0; }
.pc-checks, .pc-radios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin-top: 6px; }
.pc-radios { grid-template-columns: 1fr; }
.pc-checks label, .pc-radios label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.pc-checks input, .pc-radios input { margin-top: 4px; accent-color: var(--pc-navy); }
.pc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pc-grid-2 > div { display: flex; flex-direction: column; gap: 6px; }
.pc-form-actions { display: flex; gap: 10px; margin-top: 10px; }
.pc-form-actions .pc-btn { margin-top: 0; }
.pc-req { color: var(--pc-danger); }
.pc-form-wide { max-width: 760px; }

/* Acceso */
.pc-auth-panel { max-width: 420px; margin: 40px auto 0; background: var(--pc-surface); border: 1px solid var(--pc-border); border-top: 3px solid var(--pc-gold); border-radius: var(--pc-radius); padding: 28px; }
.pc-auth-panel .pc-form { margin: 18px 0; }
.pc-code-input { font-size: 1.5rem !important; letter-spacing: 8px; text-align: center; }

/* Móvil */
@media (max-width: 760px) {
    .pc-main { padding: 16px 12px 96px; }
    .pc-header-inner { padding: 10px 14px; }
    .pc-user-name { display: none; }
    .pc-btn-ghost span { display: none; }
    .pc-nav { position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; max-width: none; padding: 0; background: var(--pc-navy); border-top: 3px solid var(--pc-gold); justify-content: space-around; padding-bottom: env(safe-area-inset-bottom); }
    .pc-nav a { flex-direction: column; gap: 2px; font-size: .7rem; padding: 8px 4px 9px; border-bottom: 0; margin: 0; flex: 1; text-align: center; }
    .pc-nav a.is-active { color: var(--pc-gold); }
    .pc-section { padding: 16px; }
    .pc-summary { grid-template-columns: 1fr; }
    .pc-summary a { flex-direction: row; align-items: baseline; gap: 10px; padding: 12px 16px; }
    .pc-summary a + a { border-left: 0; border-top: 1px solid var(--pc-border); }
    .pc-facts, .pc-checks, .pc-grid-2 { grid-template-columns: 1fr; }
    .pc-hero .pc-actions, .pc-hero .pc-actions a { width: 100%; }
    .pc-table thead { display: none; }
    .pc-table, .pc-table tbody, .pc-table tr, .pc-table td { display: block; width: 100%; }
    .pc-table tr { border-bottom: 1px solid var(--pc-border); padding: 8px 0; }
    .pc-table tr:last-child { border-bottom: 0; }
    .pc-table td { border: 0; padding: 3px 0; display: flex; gap: 10px; }
    .pc-table td::before { content: attr(data-label); min-width: 104px; color: var(--pc-muted); font-size: .82rem; }
    .pc-auth-panel { margin-top: 16px; padding: 22px 18px; }
    .pc-footer { padding-bottom: 90px; }
}

/* ---- v1.1: identidad por sección, columnas y elementos de seguimiento ---- */
.pc-page-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 20px; flex-wrap: wrap; }
.pc-page-title { flex: 1; min-width: 220px; }
.pc-page-title h1 { margin: 0; font-size: 1.6rem; }
.pc-page-title p { margin: 4px 0 0; color: var(--pc-muted); }
.pc-mark { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 12px; background: var(--pc-navy); color: #fff; overflow: hidden; }
.pc-mark::after { content: ""; position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; background: var(--pc-gold); border-top-left-radius: 9px; }
.pc-mark .pc-icon { width: 26px; height: 26px; stroke-width: 1.7; }
.pc-mark.is-sm { width: 40px; height: 40px; border-radius: 10px; }
.pc-mark.is-sm::after { width: 11px; height: 11px; border-top-left-radius: 7px; }
.pc-mark.is-sm .pc-icon { width: 20px; height: 20px; }

.pc-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.pc-metrics a { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--pc-surface); border: 1px solid var(--pc-border); border-radius: var(--pc-radius); text-decoration: none; color: var(--pc-muted); font-size: .9rem; transition: border-color .15s; }
.pc-metrics a > span:last-child { display: flex; flex-direction: column; }
.pc-metrics strong { font-size: 1.7rem; line-height: 1.1; color: var(--pc-navy); }
.pc-metrics a:hover { border-color: var(--pc-gold); }

.pc-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pc-cols > .pc-section { margin-bottom: 16px; }

.pc-rich-list a { gap: 14px; padding: 14px 4px; }
.pc-rich-list .pc-list-main { flex: 1; gap: 2px; }
.pc-row-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 9px; background: #eef2f8; color: var(--pc-navy); }
.pc-row-icon.is-lg { width: 46px; height: 46px; }
.pc-row-icon.is-sm { width: 28px; height: 28px; border-radius: 7px; }
.pc-row-icon.is-sm .pc-icon { width: 15px; height: 15px; }
.pc-rich-list a:hover .pc-row-icon { background: var(--pc-navy); color: #fff; }
.pc-grid-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.pc-grid-list li + li { border-top: 0; }
.pc-grid-list li { border-bottom: 1px solid var(--pc-border); }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pc-chip { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #eef2f8; color: var(--pc-navy); white-space: nowrap; }
.pc-chip.is-gold { background: #fbf1d6; color: #7a5800; }
.pc-chip.is-muted { background: #f1f3f6; color: var(--pc-muted); font-weight: 500; }

.pc-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--pc-surface); border: 1px solid var(--pc-border); border-radius: var(--pc-radius); margin-bottom: 16px; }
.pc-figures > div { display: flex; align-items: center; gap: 12px; padding: 16px 20px; }
.pc-figures > div + div { border-left: 1px solid var(--pc-border); }
.pc-figures span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pc-figures small { color: var(--pc-muted); font-size: .8rem; }
.pc-figures strong { color: var(--pc-text); font-size: 1rem; }
.pc-figures strong.is-xl { font-size: 1.35rem; color: var(--pc-navy); }

.pc-progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pc-progress progress { flex: 1; height: 8px; border: 0; border-radius: 99px; background: #e8edf4; overflow: hidden; -webkit-appearance: none; appearance: none; }
.pc-progress progress::-webkit-progress-bar { background: #e8edf4; border-radius: 99px; }
.pc-progress progress::-webkit-progress-value { background: var(--pc-navy); border-radius: 99px; }
.pc-progress progress::-moz-progress-bar { background: var(--pc-navy); border-radius: 99px; }
.pc-progress.is-ending progress::-webkit-progress-value { background: var(--pc-gold); }
.pc-progress.is-ending progress::-moz-progress-bar { background: var(--pc-gold); }
.pc-progress small { color: var(--pc-muted); font-size: .78rem; white-space: nowrap; }
.pc-progress.is-compact { max-width: 320px; margin-top: 6px; }
.pc-progress.is-compact progress { height: 5px; }
.pc-timeline-dates { display: flex; justify-content: space-between; font-weight: 600; }
.pc-timeline-dates span { display: flex; flex-direction: column; }
.pc-timeline-dates span + span { text-align: right; }
.pc-timeline-dates small { color: var(--pc-muted); font-weight: 400; font-size: .8rem; }
.pc-period { display: block; min-width: 180px; }

.pc-file-icon { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 46px; color: var(--pc-navy); }
.pc-file-icon .pc-icon { width: 38px; height: 38px; stroke-width: 1.3; }
.pc-file-icon b { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: .55rem; letter-spacing: .3px; background: #b42318; color: #fff; padding: 1px 4px; border-radius: 3px; }
.pc-download { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--pc-navy); white-space: nowrap; }
.pc-rich-list a:hover .pc-download { color: #7a5800; }
.pc-table-title { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; }
.pc-table-title:hover { text-decoration: underline; text-decoration-color: var(--pc-gold); }

.pc-steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 6px 0 4px; padding: 0; counter-reset: s; }
.pc-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: .85rem; color: var(--pc-muted); text-align: center; }
.pc-steps li::before { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 3px; background: #e2e8f0; z-index: 0; }
.pc-steps li:first-child::before { display: none; }
.pc-steps li > span { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid #d5dde8; }
.pc-steps li.is-done, .pc-steps li.is-current { color: var(--pc-navy); font-weight: 600; }
.pc-steps li.is-done::before, .pc-steps li.is-current::before { background: var(--pc-navy); }
.pc-steps li.is-done > span { background: var(--pc-navy); border-color: var(--pc-navy); }
.pc-steps li.is-current > span { border-color: var(--pc-navy); box-shadow: 0 0 0 4px #fbf1d6; background: var(--pc-gold); }
.pc-steps li.is-waiting > span { background: #fff3e0; border-color: var(--pc-warn); }
.pc-message { display: flex; gap: 14px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; background: #fbf8ee; border-left: 4px solid var(--pc-gold); border-radius: 8px; }
.pc-message strong { color: var(--pc-navy); }
.pc-message p { margin: 4px 0 0; }

.pc-urgency { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; white-space: nowrap; }
.pc-urgency i { width: 9px; height: 9px; border-radius: 50%; background: #9aa7b8; }
.pc-urgency-max i { background: var(--pc-danger); box-shadow: 0 0 0 3px var(--pc-danger-bg); }
.pc-urgency-high i { background: #e07b00; }
.pc-urgency-normal i { background: var(--pc-info); }
.pc-facts.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pc-notice-soft { display: flex; align-items: center; gap: 8px; color: var(--pc-muted); font-size: .88rem; margin: -6px 0 16px; }
.pc-empty-state { display: flex; align-items: center; gap: 16px; color: var(--pc-muted); }
.pc-empty-state p { margin: 0; }

@media (max-width: 1080px) {
    .pc-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pc-figures > div:nth-child(3) { border-left: 0; }
    .pc-figures > div:nth-child(n+3) { border-top: 1px solid var(--pc-border); }
}
@media (max-width: 900px) {
    .pc-cols, .pc-grid-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .pc-page-head { gap: 12px; margin-bottom: 14px; }
    .pc-page-title h1 { font-size: 1.3rem; }
    .pc-mark { width: 44px; height: 44px; }
    .pc-page-head .pc-actions { width: 100%; }
    .pc-page-head .pc-actions a { flex: 1; }
    .pc-metrics { grid-template-columns: 1fr; gap: 8px; }
    .pc-metrics a { padding: 12px 14px; }
    .pc-metrics strong { font-size: 1.35rem; }
    .pc-figures { grid-template-columns: 1fr 1fr; }
    .pc-figures > div { padding: 12px 14px; }
    .pc-download { font-size: 0; gap: 0; }
    .pc-download .pc-icon { width: 20px; height: 20px; }
    .pc-steps li { font-size: .72rem; }
    .pc-facts.is-2 { grid-template-columns: 1fr; }
    .pc-period { min-width: 0; }
}
.pc-grid-list li:last-child, .pc-grid-list li:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
@media (max-width: 900px) { .pc-grid-list li:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--pc-border); } }
@media (max-width: 900px) { .pc-cols { gap: 0; } }
