/* =========================================================
   REVOLT Portal: pantallas de Pases, Cuenta y Solicitudes.
   Usa los mismos tokens de portal.css; no define colores nuevos
   salvo los de estado (activo, vencido, pagado).
   Cargar DESPUÉS de portal.css.
   ========================================================= */

:root {
    --rv-ok: #1B7F4B;
    --rv-ok-bg: #E3F4EA;
    --rv-warn: #8A5A00;
    --rv-warn-bg: #FFF3D6;
    --rv-off: #55697D;
    --rv-off-bg: #E9EEF4;
}

/* ---------- Encabezado de sección con acción ---------- */

.rv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.rv-head .rv-title { margin: 0; }
.rv-head__action {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    min-height: 40px; padding: 8px 14px;
    background: var(--rv-nav); color: #FFFFFF;
    border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .95rem;
}

.rv-back { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--rv-nav); text-decoration: none; font-weight: 700; }

/* ---------- Tarjetas ---------- */

.rv-card {
    background: var(--rv-surface); border-radius: var(--rv-radius);
    padding: 16px; margin-bottom: 12px;
}
.rv-card--link { display: block; color: inherit; text-decoration: none; }
.rv-card--link:active { background: #F4F7FB; }

.rv-card__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rv-card__title { font-weight: 700; font-size: 1.05rem; margin: 0; }
.rv-card__meta { color: var(--rv-muted); font-size: .92rem; margin: 2px 0 0; }

.rv-section-title { font-size: 1rem; color: var(--rv-muted); font-weight: 700; margin: 24px 0 8px; }

/* ---------- Estados ---------- */

.rv-badge {
    flex: none; display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.rv-badge--ok { background: var(--rv-ok-bg); color: var(--rv-ok); }
.rv-badge--warn { background: var(--rv-warn-bg); color: var(--rv-warn); }
.rv-badge--danger { background: var(--rv-danger-bg); color: var(--rv-danger); }
.rv-badge--off { background: var(--rv-off-bg); color: var(--rv-off); }

/* ---------- Pestañas segmentadas ---------- */

.rv-seg {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
    padding: 4px; margin-bottom: 16px;
    background: var(--rv-off-bg); border-radius: 999px;
}
.rv-seg button {
    min-height: 40px; border: 0; border-radius: 999px; background: transparent;
    font: inherit; font-size: .95rem; color: var(--rv-muted); cursor: pointer;
}
.rv-seg button[aria-pressed="true"] { background: var(--rv-surface); color: var(--rv-ink); font-weight: 700; }

/* ---------- Pase: QR ---------- */

.rv-qr {
    background: var(--rv-surface); border-radius: var(--rv-radius-lg);
    padding: 20px 16px; text-align: center; margin-bottom: 16px;
}
.rv-qr img { width: min(260px, 70vw); height: auto; image-rendering: pixelated; }
.rv-qr__code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; color: var(--rv-muted); margin-top: 6px; }
.rv-qr--off img { opacity: .25; }

.rv-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rv-line); border-radius: var(--rv-radius); overflow: hidden; margin-bottom: 16px; }
.rv-facts > div { background: var(--rv-surface); padding: 12px 14px; }
.rv-facts dt { color: var(--rv-muted); font-size: .85rem; }
.rv-facts dd { margin: 2px 0 0; font-weight: 700; }

.rv-actions { display: grid; gap: 10px; margin: 16px 0; }
.rv-btn--ghost { background: var(--rv-surface); color: var(--rv-nav); border: 2px solid var(--rv-line); }
.rv-btn--danger { background: transparent; color: var(--rv-danger); border: 2px solid var(--rv-danger-bg); }
.rv-btn--whatsapp { background: #1F8F4E; color: #FFFFFF; }

/* ---------- Formularios ---------- */

.rv-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rv-grid2 .rv-field { margin-bottom: 0; }
.rv-hint { color: var(--rv-muted); font-size: .88rem; margin: -8px 0 16px; }
.validation-message { color: var(--rv-danger); font-size: .9rem; margin: -10px 0 14px; }

.rv-visitante { background: var(--rv-surface); border-radius: var(--rv-radius); padding: 14px 14px 2px; margin-bottom: 12px; }
.rv-visitante__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 700; }
.rv-visitante__quitar { border: 0; background: none; color: var(--rv-danger); font: inherit; cursor: pointer; padding: 6px; }

.rv-add {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    min-height: 48px; margin-bottom: 16px;
    border: 2px dashed var(--rv-line); border-radius: var(--rv-radius);
    background: transparent; color: var(--rv-nav); font: inherit; font-weight: 700; cursor: pointer;
}

.rv-counter { display: flex; align-items: center; justify-content: space-between; background: var(--rv-surface); border-radius: var(--rv-radius); padding: 10px 14px; margin-bottom: 10px; }
.rv-counter__ctl { display: flex; align-items: center; gap: 14px; }
.rv-counter__ctl button {
    width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--rv-line);
    background: var(--rv-surface); color: var(--rv-nav); font-size: 1.2rem; cursor: pointer;
}
.rv-counter__ctl output { min-width: 1.5em; text-align: center; font-weight: 700; }

/* ---------- Cuenta ---------- */

.rv-balance {
    background: var(--rv-nav); color: #FFFFFF; border-radius: var(--rv-radius-lg);
    padding: 20px; margin-bottom: 16px;
}
.rv-balance__label { opacity: .85; font-size: .95rem; }
.rv-balance__amount { font-size: 2rem; font-weight: 700; line-height: 1.15; margin: 4px 0; }
.rv-balance__sub { font-size: .92rem; opacity: .9; }
.rv-balance__sub strong { color: #FFD7D2; }

.rv-invoice { display: flex; gap: 12px; align-items: flex-start; background: var(--rv-surface); border-radius: var(--rv-radius); padding: 14px; margin-bottom: 8px; }
.rv-invoice input[type="checkbox"] { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--rv-nav); flex: none; }
.rv-invoice__body { flex: 1; min-width: 0; }
.rv-invoice__amount { font-weight: 700; white-space: nowrap; }

.rv-paybar {
    position: sticky; bottom: calc(var(--rv-tabs-h) + env(safe-area-inset-bottom, 0px) + 8px);
    background: var(--rv-surface); border-radius: var(--rv-radius);
    padding: 12px; box-shadow: 0 4px 18px rgba(19, 42, 62, .15);
    display: flex; align-items: center; gap: 12px;
}
.rv-paybar__total { flex: 1; }
.rv-paybar__total span { display: block; color: var(--rv-muted); font-size: .85rem; }
.rv-paybar__total strong { font-size: 1.15rem; }
.rv-paybar .rv-btn { width: auto; }

.rv-movs { list-style: none; margin: 0; padding: 0; background: var(--rv-surface); border-radius: var(--rv-radius); overflow: hidden; }
.rv-movs li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.rv-movs li + li { border-top: 1px solid var(--rv-line); }
.rv-movs__desc { min-width: 0; }
.rv-movs__desc small { display: block; color: var(--rv-muted); }
.rv-movs__amt { white-space: nowrap; font-weight: 700; }
.rv-movs__amt--abono { color: var(--rv-ok); }

.rv-result { text-align: center; padding: 32px 16px; }
.rv-result i { font-size: 3rem; display: block; margin-bottom: 12px; }
.rv-result--ok i { color: var(--rv-ok); }
.rv-result--bad i { color: var(--rv-danger); }
.rv-result--wait i { color: var(--rv-nav); }

/* ---------- Solicitudes ---------- */

.rv-thread { list-style: none; margin: 0 0 16px; padding: 0; }
.rv-thread li { background: var(--rv-surface); border-radius: var(--rv-radius); padding: 12px 14px; margin-bottom: 8px; }
.rv-thread li.rv-thread--admin { border-left: 4px solid var(--rv-nav); }
.rv-thread li.rv-thread--sys { background: transparent; color: var(--rv-muted); font-size: .9rem; padding: 4px 14px; }
.rv-thread__who { font-size: .85rem; color: var(--rv-muted); margin-bottom: 4px; }

.rv-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 16px; }
.rv-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--rv-off-bg); }

.rv-stars { display: flex; gap: 8px; justify-content: center; margin: 8px 0 16px; }
.rv-stars button { border: 0; background: none; font-size: 2rem; color: var(--rv-line); cursor: pointer; padding: 4px; }
.rv-stars button.on { color: #F2A900; }

.rv-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.rv-cats button {
    min-height: 56px; padding: 10px; text-align: left;
    background: var(--rv-surface); border: 2px solid var(--rv-line); border-radius: var(--rv-radius);
    font: inherit; color: var(--rv-ink); cursor: pointer;
}
.rv-cats button[aria-pressed="true"] { border-color: var(--rv-nav); background: #EAF2FA; font-weight: 700; }

.rv-ok-msg { margin: 0 0 16px; padding: 12px 14px; background: var(--rv-ok-bg); color: var(--rv-ok); border-radius: var(--rv-radius); }
