/* ═══════════════════════════════════════════════════════════════════════════
   RURUSH FITNESS CLUB · Sistema visual del Control de Acceso
   Colores y tipografía tomados de la web de Rurush (web_rurush_v4).
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face {
    font-family: 'Archivo';
    src: url('../vendor/fonts/archivo-normal.woff2') format('woff2');
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Archivo';
    src: url('../vendor/fonts/archivo-italic.woff2') format('woff2');
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-style: italic;
    font-display: swap;
}

:root,
[data-bs-theme="dark"] {
    /* Marca */
    --rr-red:        #C8161D;
    --rr-red-hover:  #E01C24;
    --rr-red-glow:   #FF4A42;
    --rr-red-soft:   rgba(200, 22, 29, .14);
    --rr-black:      #0B0405;
    --rr-ink:        #120A0B;
    --rr-surface:    #170D0E;
    --rr-surface-2:  #1F1415;
    --rr-surface-3:  #2A1D1E;
    --rr-line:       rgba(242, 237, 232, .09);
    --rr-line-2:     rgba(242, 237, 232, .16);
    --rr-bone:       #F2EDE8;
    --rr-text-2:     #C9BEBA;
    --rr-muted:      #A3938F;

    /* Estados (distintos del rojo de marca para que "denegado" se lea como alerta) */
    --rr-ok:         #2FBF71;
    --rr-ok-soft:    rgba(47, 191, 113, .14);
    --rr-warn:       #F5B83D;
    --rr-warn-soft:  rgba(245, 184, 61, .14);
    --rr-bad:        #FF4A42;
    --rr-bad-soft:   rgba(255, 74, 66, .14);

    --rr-radius:     14px;
    --rr-radius-sm:  10px;
    --rr-shadow:     0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -18px rgba(0,0,0,.8);
    --rr-font:       'Archivo', 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Bootstrap → marca */
    --bs-body-bg:            var(--rr-black);
    --bs-body-color:         var(--rr-bone);
    --bs-body-font-family:   var(--rr-font);
    --bs-secondary-color:    var(--rr-muted);
    --bs-tertiary-color:     var(--rr-muted);
    --bs-border-color:       var(--rr-line);
    --bs-emphasis-color:     #fff;
    --bs-heading-color:      var(--rr-bone);
    --bs-link-color:         var(--rr-bone);
    --bs-link-color-rgb:     242, 237, 232;
    --bs-link-hover-color:   #fff;
    --bs-primary:            var(--rr-red);
    --bs-primary-rgb:        200, 22, 29;
    --bs-focus-ring-color:   rgba(200, 22, 29, .35);
    --bs-secondary-bg:       var(--rr-surface-2);
    --bs-tertiary-bg:        var(--rr-surface);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
html, body { background: var(--rr-black); }
body {
    font-family: var(--rr-font);
    color: var(--rr-bone);
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(1200px 500px at 85% -10%, rgba(200,22,29,.10), transparent 60%),
        var(--rr-black);
    min-height: 100vh;
}
::selection { background: var(--rr-red); color: #fff; }
a { text-decoration: none; }

.rr-display {
    font-family: var(--rr-font);
    font-stretch: 112%;
    font-weight: 850;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -.01em;
    line-height: 1;
}
.rr-eyebrow {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--rr-muted);
}
.text-muted, .text-secondary { color: var(--rr-muted) !important; }
.rr-mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ── Barra de navegación ─────────────────────────────────────────────────── */
.rr-nav {
    position: sticky; top: 0; z-index: 1030;
    background: rgba(11, 4, 5, .82);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid var(--rr-line);
}
.rr-nav::after {                       /* línea de velocidad roja */
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: linear-gradient(90deg, var(--rr-red) 0, var(--rr-red) 120px, transparent 420px);
}
.rr-brand { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.rr-brand img.rr-logo-mark { height: 34px; width: auto; }
.rr-brand img.word { height: 30px; width: auto; }
.rr-brand .divider { width: 1px; height: 26px; background: var(--rr-line-2); }
.rr-brand .product {
    font-size: .7rem; font-weight: 700; letter-spacing: .16em;
    text-transform: uppercase; color: var(--rr-muted); line-height: 1.25;
}

.rr-nav .nav-link {
    color: var(--rr-text-2) !important;
    font-weight: 600; font-size: .92rem;
    padding: 22px 14px !important;
    position: relative;
    display: flex; align-items: center; gap: 8px;
    transition: color .15s;
}
.rr-nav .nav-link i { font-size: 1.05rem; opacity: .85; }
.rr-nav .nav-link:hover { color: #fff !important; }
.rr-nav .nav-link.active { color: #fff !important; }
.rr-nav .nav-link.active::after {
    content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px;
    background: var(--rr-red); border-radius: 3px 3px 0 0;
    transform: skewX(-20deg);
}
.rr-user {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 6px 6px 12px; margin-left: 12px;
    border: 1px solid var(--rr-line); border-radius: 999px;
    background: var(--rr-surface);
}
.rr-user .who { font-size: .82rem; font-weight: 600; color: var(--rr-text-2); }
.rr-user .btn-logout {
    border: 0; background: var(--rr-surface-3); color: var(--rr-text-2);
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
}
.rr-user .btn-logout:hover { background: var(--rr-red); color: #fff; }
.navbar-toggler { border-color: var(--rr-line-2); }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }

@media (max-width: 991.98px) {
    .rr-nav .nav-link { padding: 12px 6px !important; }
    .rr-nav .nav-link.active::after { left: 0; right: auto; width: 3px; top: 10px; bottom: 10px; height: auto; transform: none; }
    .rr-user { margin: 8px 0 14px; justify-content: space-between; }
}

/* ── Página ──────────────────────────────────────────────────────────────── */
.rr-main { padding: 28px 0 48px; }
.rr-page-head {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 24px;
}
.rr-page-head h1 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); margin: 6px 0 0; }
.rr-page-head .sub { color: var(--rr-muted); margin: 8px 0 0; font-size: .95rem; }
.rr-page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Tarjetas ────────────────────────────────────────────────────────────── */
.rr-card, .card {
    --bs-card-bg: var(--rr-surface);
    --bs-card-color: var(--rr-bone);
    --bs-card-border-color: var(--rr-line);
    --bs-card-cap-bg: transparent;
    --bs-card-border-radius: var(--rr-radius);
    background: var(--rr-surface);
    color: var(--rr-bone);
    border: 1px solid var(--rr-line);
    border-radius: var(--rr-radius);
    box-shadow: var(--rr-shadow);
}
.rr-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--rr-line);
}
.rr-card-head h2 {
    font-size: .95rem; font-weight: 700; margin: 0;
    display: flex; align-items: center; gap: 10px;
}
.rr-card-head h2 i { color: var(--rr-red); font-size: 1.05rem; }
.rr-card-body { padding: 20px; }

/* KPIs */
.rr-kpi {
    position: relative; overflow: hidden;
    padding: 18px 20px;
    display: flex; align-items: center; gap: 16px;
}
.rr-kpi .icon {
    width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.rr-kpi .value { font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.rr-kpi .label { font-size: .8rem; color: var(--rr-muted); font-weight: 600; margin-top: 6px; }
.rr-kpi.ok   .icon { background: var(--rr-ok-soft);   color: var(--rr-ok); }
.rr-kpi.bad  .icon { background: var(--rr-bad-soft);  color: var(--rr-bad); }
.rr-kpi.info .icon { background: var(--rr-red-soft);  color: var(--rr-red-glow); }
.rr-kpi.sys  .icon { background: rgba(242,237,232,.06); color: var(--rr-bone); }
.rr-kpi::after {
    content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px;
    border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.035), transparent);
}

/* ── Botones ─────────────────────────────────────────────────────────────── */
.btn { font-weight: 650; border-radius: var(--rr-radius-sm); padding: .6rem 1.1rem; }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.btn-lg { padding: .85rem 1.4rem; font-size: 1.02rem; }
.btn-primary, .btn-rr {
    --bs-btn-bg: var(--rr-red); --bs-btn-border-color: var(--rr-red);
    --bs-btn-hover-bg: var(--rr-red-hover); --bs-btn-hover-border-color: var(--rr-red-hover);
    --bs-btn-active-bg: #A51218; --bs-btn-active-border-color: #A51218;
    --bs-btn-disabled-bg: var(--rr-surface-3); --bs-btn-disabled-border-color: var(--rr-surface-3);
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
    box-shadow: 0 8px 20px -10px rgba(200,22,29,.8);
}
.btn-ghost {
    --bs-btn-color: var(--rr-bone); --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--rr-line-2);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--rr-surface-3);
    --bs-btn-hover-border-color: var(--rr-line-2);
    --bs-btn-active-bg: var(--rr-surface-3); --bs-btn-active-color: #fff;
}
.btn-danger-ghost {
    --bs-btn-color: var(--rr-bad); --bs-btn-bg: transparent;
    --bs-btn-border-color: rgba(255,74,66,.35);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--rr-bad);
    --bs-btn-hover-border-color: var(--rr-bad);
    --bs-btn-active-bg: var(--rr-bad); --bs-btn-active-color: #fff;
}
.btn:focus-visible { box-shadow: 0 0 0 .22rem var(--bs-focus-ring-color); }

/* ── Formularios ─────────────────────────────────────────────────────────── */
.form-label { font-size: .82rem; font-weight: 650; color: var(--rr-text-2); margin-bottom: 6px; }
.form-control, .form-select {
    background: var(--rr-ink);
    border: 1px solid var(--rr-line-2);
    color: var(--rr-bone);
    border-radius: var(--rr-radius-sm);
    padding: .7rem .9rem;
}
.form-control::placeholder { color: rgba(163,147,143,.65); }
.form-control:focus, .form-select:focus {
    background: var(--rr-ink); color: #fff;
    border-color: var(--rr-red);
    box-shadow: 0 0 0 .22rem var(--bs-focus-ring-color);
}
.rr-input-icon { position: relative; }
.rr-input-icon > i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--rr-muted); pointer-events: none;
}
.rr-input-icon > .form-control { padding-left: 2.6rem; }
.form-text { color: var(--rr-muted); }

/* ── Alertas ─────────────────────────────────────────────────────────────── */
.rr-alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 14px; border-radius: var(--rr-radius-sm);
    border: 1px solid; font-size: .92rem; margin-bottom: 16px;
}
.rr-alert i { font-size: 1.1rem; line-height: 1.3; }
.rr-alert.ok  { background: var(--rr-ok-soft);  border-color: rgba(47,191,113,.35);  color: #BFF0D4; }
.rr-alert.bad { background: var(--rr-bad-soft); border-color: rgba(255,74,66,.35);   color: #FFD0CD; }
.rr-alert.warn{ background: var(--rr-warn-soft);border-color: rgba(245,184,61,.35);  color: #FCE3AE; }

/* ── Estados (píldoras) ──────────────────────────────────────────────────── */
.rr-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase;
    white-space: nowrap;
}
.rr-pill.ok   { background: var(--rr-ok-soft);  color: var(--rr-ok); }
.rr-pill.bad  { background: var(--rr-bad-soft); color: var(--rr-bad); }
.rr-pill.live { background: var(--rr-red); color: #fff; }
.rr-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rr-pill.live .dot { background: #fff; animation: rr-blink 1.4s infinite; }
@keyframes rr-blink { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* Avatar con inicial */
.rr-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .95rem; color: #fff;
    background: linear-gradient(135deg, #3A2425, #241617);
    border: 1px solid var(--rr-line-2);
    overflow: hidden;
}
.rr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rr-avatar.ok  { box-shadow: 0 0 0 2px var(--rr-ok); }
.rr-avatar.bad { box-shadow: 0 0 0 2px var(--rr-bad); }

/* ── Monitor ─────────────────────────────────────────────────────────────── */
.rr-video {
    position: relative; background: #000;
    border-radius: 0 0 var(--rr-radius) var(--rr-radius); overflow: hidden;
    aspect-ratio: 4 / 3;
}
.rr-video img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rr-video .corner {                        /* esquinas de visor */
    position: absolute; width: 34px; height: 34px; border-color: rgba(242,237,232,.55); border-style: solid;
    pointer-events: none;
}
.rr-video .c1 { top: 16px; left: 16px; border-width: 3px 0 0 3px; border-radius: 6px 0 0 0; }
.rr-video .c2 { top: 16px; right: 16px; border-width: 3px 3px 0 0; border-radius: 0 6px 0 0; }
.rr-video .c3 { bottom: 16px; left: 16px; border-width: 0 0 3px 3px; border-radius: 0 0 0 6px; }
.rr-video .c4 { bottom: 16px; right: 16px; border-width: 0 3px 3px 0; border-radius: 0 0 6px 0; }

.rr-result {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px; margin-top: 14px;
    border-radius: var(--rr-radius); border: 1px solid;
    animation: rr-in .25s ease;
}
.rr-result.ok  { background: linear-gradient(90deg, rgba(47,191,113,.18), rgba(47,191,113,.04)); border-color: rgba(47,191,113,.4); }
.rr-result.bad { background: linear-gradient(90deg, rgba(255,74,66,.18), rgba(255,74,66,.04)); border-color: rgba(255,74,66,.4); }
.rr-result .big-icon { font-size: 2.2rem; line-height: 1; }
.rr-result.ok .big-icon { color: var(--rr-ok); }
.rr-result.bad .big-icon { color: var(--rr-bad); }
.rr-result .title { font-size: 1.15rem; }
@keyframes rr-in { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

.rr-feed { list-style: none; margin: 0; padding: 0; }
.rr-feed li {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; border-bottom: 1px solid var(--rr-line);
}
.rr-feed li:last-child { border-bottom: 0; }
.rr-feed .name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-feed .time { font-size: .8rem; color: var(--rr-muted); }
.rr-feed-scroll { max-height: 560px; overflow-y: auto; }

/* ── Tablas ──────────────────────────────────────────────────────────────── */
.rr-table { --bs-table-bg: transparent; --bs-table-color: var(--rr-bone); --bs-table-hover-bg: rgba(242,237,232,.03);
            --bs-table-hover-color: var(--rr-bone); --bs-table-border-color: var(--rr-line); margin: 0; }
.rr-table thead th {
    font-size: .72rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase;
    color: var(--rr-muted); background: var(--rr-surface-2);
    padding: 12px 16px; border-bottom: 1px solid var(--rr-line);
}
.rr-table td { padding: 12px 16px; vertical-align: middle; }
.rr-thumb {
    width: 44px; height: 44px; border-radius: 10px; object-fit: cover;
    border: 1px solid var(--rr-line-2); cursor: zoom-in; transition: transform .15s;
}
.rr-thumb:hover { transform: scale(1.06); }

/* Filtros segmentados */
.rr-seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--rr-ink);
          border: 1px solid var(--rr-line); border-radius: 12px; }
.rr-seg button {
    border: 0; background: transparent; color: var(--rr-text-2);
    padding: 6px 14px; border-radius: 9px; font-weight: 650; font-size: .85rem;
}
.rr-seg button.active { background: var(--rr-surface-3); color: #fff; }
.rr-seg button .n { color: var(--rr-muted); margin-left: 6px; font-variant-numeric: tabular-nums; }

/* ── Trabajadores ────────────────────────────────────────────────────────── */
.rr-worker { height: 100%; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.rr-worker:hover { border-color: var(--rr-line-2); transform: translateY(-2px); }
.rr-worker .top { padding: 22px 20px 14px; display: flex; align-items: center; gap: 14px; }
.rr-worker .photo {
    width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0; overflow: hidden;
    background: linear-gradient(135deg, var(--rr-red), #6E0B10);
    display: flex; align-items: center; justify-content: center;
    font-weight: 850; font-size: 1.6rem; font-style: italic; color: #fff;
}
.rr-worker .photo img { width: 100%; height: 100%; object-fit: cover; }
.rr-worker .name { font-weight: 750; font-size: 1.02rem; line-height: 1.25; word-break: break-word; }
.rr-worker .meta { padding: 0 20px 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.rr-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 8px; font-size: .78rem; font-weight: 600;
    background: var(--rr-surface-2); color: var(--rr-text-2); border: 1px solid var(--rr-line);
}
.rr-worker .foot {
    margin-top: auto; padding: 12px 20px;
    border-top: 1px solid var(--rr-line);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

/* Estado vacío */
.rr-empty { text-align: center; padding: 56px 20px; }
.rr-empty .ico {
    width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center; font-size: 2rem;
    background: var(--rr-red-soft); color: var(--rr-red-glow);
}
.rr-empty h3 { font-size: 1.15rem; font-weight: 750; }
.rr-empty p { color: var(--rr-muted); max-width: 380px; margin: 8px auto 20px; }

/* ── Registro ────────────────────────────────────────────────────────────── */
.rr-cam {
    position: relative; background: #000; overflow: hidden;
    border-radius: 0 0 var(--rr-radius) var(--rr-radius); aspect-ratio: 4 / 3;
}
.rr-cam video, .rr-cam > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rr-cam video.mirror { transform: scaleX(-1); }
.rr-oval {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -52%);
    width: min(46%, 230px); aspect-ratio: 3 / 4; border-radius: 50%;
    border: 3px solid rgba(242,237,232,.75);
    box-shadow: 0 0 0 9999px rgba(11,4,5,.45);
    pointer-events: none; transition: border-color .25s, box-shadow .25s;
}
.rr-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.rr-steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--rr-text-2); font-size: .92rem; }
.rr-steps .n {
    width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--rr-red-soft); color: var(--rr-red-glow); font-weight: 800; font-size: .8rem;
}
.rr-tabs { display: flex; gap: 6px; }

/* ── Login / setup ───────────────────────────────────────────────────────── */
.rr-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.rr-auth .brand-side {
    position: relative; overflow: hidden;
    background:
        linear-gradient(160deg, rgba(200,22,29,.92), rgba(110,11,16,.96) 55%, #2A0507),
        var(--rr-red);
    display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
}
.rr-auth .brand-side::before {               /* líneas de velocidad */
    content: ''; position: absolute; inset: -20%;
    background: repeating-linear-gradient(-70deg, rgba(255,255,255,.06) 0 2px, transparent 2px 46px);
    pointer-events: none;
}
.rr-auth .brand-side .big-mark {
    position: absolute; right: -60px; bottom: -40px; width: 70%; max-width: 520px; opacity: .12;
}
.rr-auth .brand-side .content { position: relative; }
.rr-auth .brand-side h2 { font-size: clamp(2rem, 3.6vw, 3.2rem); color: #fff; margin: 0; }
.rr-auth .brand-side p { color: rgba(255,255,255,.8); max-width: 420px; margin-top: 16px; font-size: 1.02rem; }
.rr-auth .form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.rr-auth .form-box { width: 100%; max-width: 400px; }
.rr-auth .form-box h1 { font-size: 1.9rem; }
@media (max-width: 860px) {
    .rr-auth { grid-template-columns: 1fr; }
    .rr-auth .brand-side { padding: 28px 24px; min-height: 0; }
    .rr-auth .brand-side .hide-sm { display: none; }
    .rr-auth .brand-side h2 { font-size: 1.6rem; }
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-content { background: var(--rr-surface); border: 1px solid var(--rr-line-2); border-radius: var(--rr-radius); color: var(--rr-bone); }
.modal-header, .modal-footer { border-color: var(--rr-line); }

/* Scrollbar discreta */
* { scrollbar-width: thin; scrollbar-color: var(--rr-surface-3) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--rr-surface-3); border-radius: 8px; }

/* ── App móvil (escáner y registro desde el celular) ─────────────────────── */
.rr-m { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #000; }
.rr-m.scroll { height: auto; min-height: 100dvh; overflow: visible; background: var(--rr-black); }
.rr-m-top {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: rgba(11,4,5,.88); border-bottom: 1px solid var(--rr-line);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    position: relative; z-index: 5;
}
.rr-m-top .brand { display: flex; align-items: center; gap: 10px; }
.rr-m-top .brand img { height: 30px; }
.rr-m-top .brand .t { font-weight: 800; font-size: .95rem; line-height: 1.1; }
.rr-m-top .brand .s { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rr-muted); }
.rr-icon-btn {
    width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--rr-line-2);
    background: var(--rr-surface-2); color: var(--rr-bone); font-size: 1.15rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.rr-icon-btn:active { background: var(--rr-surface-3); }

.rr-m-cam { position: relative; flex: 1; overflow: hidden; background: #000; }
.rr-m-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rr-m-cam video.mirror { transform: scaleX(-1); }
.rr-m-oval {
    position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%);
    width: min(64vw, 260px); aspect-ratio: 3 / 4; border-radius: 50%;
    border: 3px solid rgba(242,237,232,.8);
    box-shadow: 0 0 0 9999px rgba(11,4,5,.5);
    transition: border-color .25s, box-shadow .25s; pointer-events: none;
}
.rr-m-oval.verifying { border-color: var(--rr-warn); box-shadow: 0 0 0 9999px rgba(11,4,5,.5), 0 0 28px rgba(245,184,61,.55); animation: rr-pulse 1s infinite; }
.rr-m-oval.ok        { border-color: var(--rr-ok);   box-shadow: 0 0 0 9999px rgba(11,4,5,.5), 0 0 34px rgba(47,191,113,.7); }
.rr-m-oval.denied    { border-color: var(--rr-bad);  box-shadow: 0 0 0 9999px rgba(11,4,5,.5), 0 0 34px rgba(255,74,66,.7); }
@keyframes rr-pulse { 0%,100% { opacity: 1 } 50% { opacity: .6 } }
.rr-m-label {
    position: absolute; left: 50%; transform: translateX(-50%);
    /* anclado por abajo: si el mensaje ocupa varias líneas crece hacia arriba, sin tapar el óvalo */
    bottom: calc(54% + min(64vw, 260px) * 2 / 3 + 14px);
    width: max-content; max-width: min(calc(100% - 32px), 340px); text-align: center;
    background: rgba(11,4,5,.82); border: 1px solid var(--rr-line-2);
    padding: 8px 16px; border-radius: 18px; font-size: .86rem; font-weight: 600; line-height: 1.35;
}
.rr-m-progress {
    position: absolute; left: 50%; transform: translateX(-50%);
    top: calc(46% + min(64vw, 260px) * 2 / 3 + 22px);
    width: min(64vw, 260px); height: 6px; border-radius: 6px;
    background: rgba(242,237,232,.18); overflow: hidden; display: none;
}
.rr-m-progress > div { height: 100%; width: 0; background: var(--rr-warn); border-radius: 6px; transition: width .25s; }

.rr-m-result {
    position: absolute; left: 12px; right: 12px; bottom: 12px;
    display: none; align-items: center; gap: 14px;
    padding: 16px 18px; border-radius: 18px; border: 1px solid;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    animation: rr-up .3s ease;
}
.rr-m-result.ok  { background: rgba(14,58,35,.92);  border-color: rgba(47,191,113,.6); }
.rr-m-result.bad { background: rgba(70,12,10,.92);  border-color: rgba(255,74,66,.6); }
.rr-m-result .ico { font-size: 2.4rem; line-height: 1; }
.rr-m-result.ok .ico { color: var(--rr-ok); }
.rr-m-result.bad .ico { color: var(--rr-bad); }
.rr-m-result .st { font-size: 1.15rem; }
.rr-m-result .nm { font-weight: 700; font-size: 1.02rem; margin-top: 4px; }
.rr-m-result .sm { font-size: .8rem; color: var(--rr-text-2); }
@keyframes rr-up { from { transform: translateY(30px); opacity: 0 } to { transform: none; opacity: 1 } }

.rr-m-nav {
    display: flex; gap: 4px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(11,4,5,.95); border-top: 1px solid var(--rr-line);
}
.rr-m-nav a {
    flex: 1; text-align: center; color: var(--rr-muted);
    font-size: .68rem; font-weight: 650; padding: 6px 2px; border-radius: 10px;
}
.rr-m-nav a i { display: block; font-size: 1.3rem; margin-bottom: 2px; }
.rr-m-nav a.active { color: #fff; background: var(--rr-surface-2); }
.rr-m-nav a.active i { color: var(--rr-red-glow); }

.rr-m-reg-cam { position: relative; height: 42vh; min-height: 260px; background: #000; overflow: hidden; }
.rr-m-reg-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rr-m-reg-cam video.mirror { transform: scaleX(-1); }
.rr-m-reg-cam .rr-m-oval { top: 50%; width: min(46vw, 190px); }
.rr-m-form { padding: 18px 16px 24px; display: flex; flex-direction: column; gap: 14px; flex: 1; }

/* KPIs en pantallas angostas: el contenido no debe desbordar la tarjeta */
.rr-kpi > div { min-width: 0; }
@media (max-width: 575.98px) {
    .rr-kpi { padding: 14px; gap: 12px; flex-direction: column; align-items: flex-start; }
    .rr-kpi .icon { width: 38px; height: 38px; font-size: 1.1rem; }
    .rr-kpi .value { font-size: 1.6rem; }
    .rr-kpi .rr-pill { font-size: .66rem; padding: 3px 8px; }
}
@media (max-width: 575.98px) {
    .rr-brand { gap: 10px; }
    .rr-brand img.rr-logo-mark { height: 30px; }
    .rr-brand img.word { height: 24px; }
}

/* Login / setup en celular: franja de marca compacta para que el formulario quepa completo */
@media (max-width: 860px) {
    .rr-auth { min-height: 100dvh; grid-template-rows: auto 1fr; }
    .rr-auth .brand-side {
        flex-direction: row; align-items: center; justify-content: flex-start; gap: 16px;
        padding: calc(16px + env(safe-area-inset-top)) 20px 16px;
    }
    .rr-auth .brand-side .content:nth-child(2) img { height: 42px !important; }
    .rr-auth .brand-side h2 { font-size: 1.2rem; line-height: 1.05; }
    .rr-auth .brand-side .rr-eyebrow { font-size: .62rem; }
    .rr-auth .brand-side h2.mt-2 { margin-top: 4px !important; }
    .rr-auth .brand-side .big-mark { width: 38%; right: -18px; bottom: -26px; opacity: .1; }
    .rr-auth .form-side { align-items: flex-start; padding: 28px 20px 32px; }
    .rr-auth .form-box h1 { font-size: 1.6rem; margin-bottom: 1.25rem !important; }
}

/* App instalada (pantalla completa en iPhone): respetar la zona del reloj/notch y la barra de inicio */
.rr-nav { padding-top: env(safe-area-inset-top); }
.rr-main { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
.rr-nav .container-xl, .rr-main .container-xl {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}
@media (display-mode: standalone) {
    body { overscroll-behavior-y: none; }        /* evita el "rebote" que delata al navegador */
    html, body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
    input, textarea { -webkit-user-select: text; user-select: text; }
}

/* Prueba de vida: flechas a cada lado del óvalo que se iluminan al girar la cabeza */
.rr-m-arrow {
    position: absolute; top: 46%; transform: translateY(-50%);
    font-size: 3.4rem; color: rgba(242,237,232,.35);
    opacity: 0; transition: opacity .2s, color .2s, transform .2s; pointer-events: none;
}
.rr-m-arrow.left  { left:  calc(50% - min(64vw, 260px) / 2 - 3.6rem); }
.rr-m-arrow.right { right: calc(50% - min(64vw, 260px) / 2 - 3.6rem); }
.rr-m-arrow.show  { opacity: 1; animation: rr-nudge 1s infinite; }
.rr-m-arrow.left.show  { --dx: -6px; }
.rr-m-arrow.right.show { --dx: 6px; }
.rr-m-arrow.on { color: var(--rr-ok); animation: none; text-shadow: 0 0 18px rgba(47,191,113,.8); }
@keyframes rr-nudge { 0%,100% { transform: translateY(-50%) } 50% { transform: translate(var(--dx), -50%) } }

/* Casillas con el rojo de la marca */
.form-check-input { background-color: var(--rr-ink); border-color: var(--rr-line-2); }
.form-check-input:checked { background-color: var(--rr-red); border-color: var(--rr-red); }
.form-check-input:focus { box-shadow: 0 0 0 .22rem var(--bs-focus-ring-color); border-color: var(--rr-red); }
