/* =========================================================
   REVOLT - Panel de administración (GaritaQR.Web)
   Mismo lenguaje visual que el Portal de residentes:
   tokens, tipografía, radios, botones y estados.

   Cárguelo DE ÚLTIMO en index.html (después de bootstrap,
   app.css y revolt.css). Muchas páginas viejas traen un
   <style> propio con los colores de Pueblo Bávaro marcados
   !important; las reglas con "html body" de este archivo
   les ganan sin tener que tocar esas páginas.
   ========================================================= */

:root {
    --rv-nav: #0F4C81;
    --rv-nav-ink: #FFFFFF;
    --rv-nav-hover: rgba(255, 255, 255, .10);
    --rv-bg: #E4EBF3;
    --rv-surface: #FFFFFF;
    --rv-soft: #F3F7FB;
    --rv-ink: #132A3E;
    --rv-muted: #55697D;
    --rv-line: #C9D6E3;
    --rv-accent: #29B6F6;
    --rv-danger: #C62828;
    --rv-danger-bg: #FDECEA;
    --rv-ok: #1B7F4B;
    --rv-ok-bg: #E3F4EA;
    --rv-warn: #8A5A00;
    --rv-warn-bg: #FFF3D6;

    --rv-radius: 12px;
    --rv-radius-lg: 18px;
    --rv-side-w: 256px;
    --rv-font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Bootstrap 5 lee estas variables */
    --bs-body-font-family: var(--rv-font);
    --bs-body-color: var(--rv-ink);
    --bs-body-bg: var(--rv-bg);
    --bs-primary: #0F4C81;
    --bs-primary-rgb: 15, 76, 129;
    --bs-link-color: #0F4C81;
    --bs-link-hover-color: #0B3A63;
    --bs-border-radius: 10px;
}

/* Las páginas de garita usan --color-green / --color-orange. */
html:root {
    --color-green: #0F4C81 !important;
    --color-orange: #29B6F6 !important;
    --color-blue: #0F4C81 !important;
}

html, body {
    background: var(--rv-bg);
    color: var(--rv-ink);
    font-family: var(--rv-font);
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 { color: var(--rv-ink); font-family: var(--rv-font); font-weight: 700; }
h3 { font-size: 1.5rem; }
a { color: var(--rv-nav); }
:focus-visible { outline: 3px solid var(--rv-accent); outline-offset: 2px; }

/* =========================================================
   Estructura: barra lateral + contenido
   ========================================================= */

.rv-app { min-height: 100vh; display: flex; }

.rv-side {
    position: fixed; inset: 0 auto 0 0; z-index: 30;
    width: var(--rv-side-w);
    display: flex; flex-direction: column;
    background: var(--rv-nav); color: var(--rv-nav-ink);
}

.rv-side__brand { padding: 22px 20px 16px; }
.rv-side__name { display: block; font-size: 1.45rem; font-weight: 700; letter-spacing: .02em; color: #FFFFFF; text-decoration: none; }
.rv-side__name:hover { color: #FFFFFF; }
.rv-side__tenant { display: block; margin-top: 2px; font-size: .92rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rv-side__nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.rv-side__group { margin: 16px 8px 6px; font-size: .82rem; opacity: .7; }

.rv-side__nav .nav-link {
    display: flex; align-items: center; gap: 12px;
    min-height: 42px; padding: 8px 12px; margin: 1px 0;
    color: rgba(255, 255, 255, .92); text-decoration: none;
    border-radius: 10px; font-size: .97rem;
}
.rv-side__nav .nav-link i { width: 20px; text-align: center; opacity: .9; }
.rv-side__nav .nav-link:hover { background: var(--rv-nav-hover); color: #FFFFFF; }
.rv-side__nav .nav-link.active { background: #FFFFFF; color: var(--rv-nav); font-weight: 700; }
.rv-side__nav .nav-link.active i { opacity: 1; }

.rv-side__foot { padding: 12px 20px 18px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .92rem; }
.rv-side__foot a, .rv-side__foot button, .rv-side__foot .nav-link, .rv-side__foot span { color: #FFFFFF !important; }
.rv-side__foot .btn { border-color: rgba(255, 255, 255, .5); background: transparent; }

.rv-app__main { flex: 1; min-width: 0; margin-left: var(--rv-side-w); }
.rv-app__content { padding: 28px 32px 48px; max-width: 1400px; }

/* Barra superior: solo en pantallas chicas */
.rv-topbar { display: none; }

@media (max-width: 991.98px) {
    .rv-topbar {
        position: sticky; top: 0; z-index: 25;
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 12px 16px; background: var(--rv-nav); color: #FFFFFF;
    }
    .rv-topbar__name { font-weight: 700; font-size: 1.1rem; }
    .rv-topbar__toggle {
        min-height: 40px; padding: 6px 14px; border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, .5); background: transparent; color: #FFFFFF; font: inherit;
    }
    .rv-side { transform: translateX(-100%); transition: transform .2s ease; }
    .rv-side.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(19, 42, 62, .45); }
    .rv-app { display: block; }
    .rv-app__main { margin-left: 0; }
    .rv-app__content { padding: 20px 16px 40px; }
}

/* =========================================================
   Bootstrap con el tema
   ========================================================= */

.card { border: 0; border-radius: var(--rv-radius); background: var(--rv-surface); box-shadow: none; }
.card-header {
    background: var(--rv-surface); border-bottom: 1px solid var(--rv-line);
    border-radius: var(--rv-radius) var(--rv-radius) 0 0 !important;
    font-weight: 700; color: var(--rv-ink);
}
.card-header h3, .card-header h4, .card-header h5 { margin: 0; }

.btn { border-radius: 10px; font-weight: 700; min-height: 40px; }
.btn-sm { min-height: 32px; border-radius: 8px; }
.btn-primary { background: var(--rv-nav); border-color: var(--rv-nav); }
.btn-primary:hover, .btn-primary:focus { background: #0B3A63; border-color: #0B3A63; }
.btn-outline-primary { color: var(--rv-nav); border-color: var(--rv-nav); }
.btn-outline-primary:hover { background: var(--rv-nav); border-color: var(--rv-nav); }
.btn-success { background: var(--rv-ok); border-color: var(--rv-ok); }
.btn-warning { background: #F2A900; border-color: #F2A900; color: var(--rv-ink); }
.btn-danger { background: var(--rv-danger); border-color: var(--rv-danger); }
.btn-outline-danger { color: var(--rv-danger); border-color: var(--rv-danger); }
.btn-info { background: var(--rv-accent); border-color: var(--rv-accent); color: var(--rv-nav); }

.form-control, .form-select { min-height: 44px; border: 2px solid var(--rv-line); border-radius: 10px; color: var(--rv-ink); }
.form-control:focus, .form-select:focus { border-color: var(--rv-accent); box-shadow: none; }
.form-control-sm, .form-select-sm { min-height: 34px; }
.form-label { font-weight: 700; font-size: .95rem; }
.form-check-input:checked { background-color: var(--rv-nav); border-color: var(--rv-nav); }

.table { --bs-table-bg: transparent; color: var(--rv-ink); }
.table > :not(caption) > * > * { padding: .7rem .75rem; border-bottom-color: var(--rv-line); }
.table-responsive { background: var(--rv-surface); border-radius: var(--rv-radius); }
.table thead th, .table-dark th, thead.table-dark th {
    background: var(--rv-soft) !important; color: var(--rv-muted) !important;
    font-weight: 700; font-size: .88rem; border-bottom: 1px solid var(--rv-line) !important;
}
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: var(--rv-soft); }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: #EAF2FA; }

.badge { border-radius: 999px; font-weight: 700; padding: .4em .75em; }
.bg-primary { background-color: var(--rv-nav) !important; }
.bg-success { background-color: var(--rv-ok) !important; }
.bg-danger { background-color: var(--rv-danger) !important; }

.alert { border: 0; border-radius: var(--rv-radius); }
.alert-info { background: #EAF2FA; color: var(--rv-nav); }
.alert-success { background: var(--rv-ok-bg); color: var(--rv-ok); }
.alert-warning { background: var(--rv-warn-bg); color: var(--rv-warn); }
.alert-danger { background: var(--rv-danger-bg); color: var(--rv-danger); }

.nav-tabs { border-bottom: 2px solid var(--rv-line); }
.nav-tabs .nav-link { border: 0; color: var(--rv-muted); font-weight: 700; }
.nav-tabs .nav-link.active { color: var(--rv-nav); background: transparent; border-bottom: 3px solid var(--rv-nav); }

.page-link { color: var(--rv-nav); }
.page-item.active .page-link { background: var(--rv-nav); border-color: var(--rv-nav); }

.spinner-border.text-primary { color: var(--rv-nav) !important; }

/* Modales (Blazored.Modal y Bootstrap) */
.blazored-modal, .modal-content { border: 0 !important; border-radius: var(--rv-radius-lg) !important; font-family: var(--rv-font); }
.blazored-modal-title { font-weight: 700; }

/* SweetAlert2 */
.swal2-popup { border-radius: var(--rv-radius-lg) !important; font-family: var(--rv-font) !important; }
.swal2-styled.swal2-confirm { background-color: var(--rv-nav) !important; border-radius: 10px !important; }

/* =========================================================
   Colores heredados de Pueblo Bávaro (verde, naranja, celeste)
   que traen las páginas viejas en su propio <style>.
   ========================================================= */

html body .bg-custom-green,
html body .bg-custom-blue { background-color: var(--rv-nav) !important; color: #FFFFFF !important; }

html body .bg-custom-orange,
html body thead.bg-custom-orange th { background-color: var(--rv-soft) !important; color: var(--rv-muted) !important; }

html body .card-header.bg-custom-green,
html body .card-header.bg-custom-blue,
html body .card-header.bg-custom-orange { background-color: var(--rv-surface) !important; color: var(--rv-ink) !important; }
html body .card-header.bg-custom-green *,
html body .card-header.bg-custom-blue *,
html body .card-header.bg-custom-orange * { color: var(--rv-ink) !important; }

html body .text-custom-green,
html body .text-custom-blue,
html body .text-custom-orange { color: var(--rv-nav) !important; }

html body .btn-custom-green { background-color: var(--rv-nav) !important; border-color: var(--rv-nav) !important; color: #FFFFFF !important; transform: none !important; }
html body .btn-custom-blue { background-color: var(--rv-surface) !important; border: 2px solid var(--rv-nav) !important; color: var(--rv-nav) !important; transform: none !important; }
html body .btn-custom-orange { background-color: var(--rv-accent) !important; border-color: var(--rv-accent) !important; color: var(--rv-nav) !important; transform: none !important; }
html body .card { box-shadow: none !important; }

/* =========================================================
   Clases rv- del panel de inicio (PerfilIndex)
   ========================================================= */

html body .rv-page-title { font-size: 1.7rem; font-weight: 700; margin: 0 0 4px; color: var(--rv-ink); }
html body .rv-page-sub { color: var(--rv-muted); margin: 0 0 20px; }

html body .rv-section-head { display: flex; align-items: center; gap: 12px; margin: 28px 0 12px; }
html body .rv-eyebrow { text-transform: none !important; letter-spacing: 0 !important; font-size: 1rem; font-weight: 700; color: var(--rv-muted); }
html body .rv-rule { flex: 1; height: 1px; background: var(--rv-line); }

html body .rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
html body .rv-tile {
    position: relative; display: flex; flex-direction: column; gap: 4px;
    padding: 18px; min-height: 120px;
    background: var(--rv-surface); border: 2px solid transparent; border-radius: var(--rv-radius);
    color: var(--rv-ink); text-decoration: none;
}
html body .rv-tile:hover { border-color: var(--rv-line); }
html body .rv-tile.is-pending { border-color: #F2A900; }
html body .rv-tile.is-urgent { border-color: var(--rv-danger); }
html body .rv-tile-icon { font-size: 1.4rem; color: var(--rv-nav); margin-bottom: 6px; }
html body .rv-tile-name { font-weight: 700; font-size: 1.05rem; }
html body .rv-tile-hint { color: var(--rv-muted); font-size: .9rem; }
html body .rv-tile-count {
    position: absolute; top: 12px; right: 12px; min-width: 26px; padding: 2px 8px;
    border-radius: 999px; background: var(--rv-nav); color: #FFFFFF; font-size: .85rem; font-weight: 700; text-align: center;
}
html body .rv-tile.is-urgent .rv-tile-count { background: var(--rv-danger); }

html body .rv-status {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px; background: var(--rv-line); border-radius: var(--rv-radius); overflow: hidden;
}
html body .rv-status-cell { background: var(--rv-surface); padding: 16px 18px; text-decoration: none; color: var(--rv-ink); }
html body .rv-status-cell:hover { background: var(--rv-soft); }
html body .rv-figure { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--rv-nav); }
html body .rv-figure.is-zero { color: var(--rv-line); }
html body .rv-figure.is-alert { color: var(--rv-danger); }
html body .rv-figure.is-warn { color: #B07800; }
html body .rv-figure.is-ok { color: var(--rv-ok); }
html body .rv-figure-label { color: var(--rv-muted); font-size: .92rem; }

/* =========================================================
   Pantalla de entrada (Index.razor), igual al login del Portal
   ========================================================= */

.rv-login {
    min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
    padding: 32px 20px; background: var(--rv-nav); color: #FFFFFF;
}
.rv-login__panel { width: 100%; max-width: 400px; margin: 0 auto; }
.rv-login__brand { font-size: 2.2rem; line-height: 1.1; margin: 0 0 8px; color: #FFFFFF; letter-spacing: .02em; }
.rv-login__lead { margin: 0 0 28px; opacity: .85; font-size: 1.05rem; }
.rv-login__btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 52px; margin-bottom: 12px;
    border: 0; border-radius: var(--rv-radius);
    background: var(--rv-accent); color: var(--rv-nav);
    font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; text-decoration: none;
}
.rv-login__alt { display: block; text-align: center; color: #FFFFFF; opacity: .85; margin-top: 18px; }
.rv-login__alt:hover { color: #FFFFFF; opacity: 1; }
.rv-login__foot { margin-top: 40px; text-align: center; font-size: .85rem; opacity: .65; }

@media (prefers-reduced-motion: reduce) {
    .rv-side { transition: none !important; }
}


/* Logo de REVOLT (blanco, sobre el azul de la barra y de la entrada) */
.rv-side__logo { display: block; width: 132px; height: auto; margin: 2px 0 6px; }
.rv-topbar__name { display: inline-flex; align-items: center; gap: 8px; }
.rv-topbar__logo { width: 28px; height: 28px; }
.rv-login__logo { display: block; width: 168px; max-width: 60%; height: auto; margin: 0 0 4px; }


/* =========================================================
   Pantalla de entrada: foto de la garita con el azul de REVOLT encima.
   Computadora: foto horizontal. Teléfono y app: foto vertical.
   El azul es más fuerte arriba (logo y texto) y deja ver la garita abajo.
   ========================================================= */

.rv-login {
    background-color: #0F4C81;
    background-image:
        linear-gradient(180deg, rgba(15, 76, 129, .90) 0%, rgba(15, 76, 129, .86) 38%, rgba(15, 76, 129, .68) 100%),
        url("../img/fondo-entrada-horizontal.webp");
    background-size: cover;
    background-position: center 62%;
    background-repeat: no-repeat;
}

@media (max-width: 767px), (orientation: portrait) {
    .rv-login {
        background-image:
            linear-gradient(180deg, rgba(15, 76, 129, .90) 0%, rgba(15, 76, 129, .86) 38%, rgba(15, 76, 129, .66) 100%),
            url("../img/fondo-entrada-vertical.webp");
        background-position: center 70%;
    }
}

.rv-login__lead { text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }

/* =========================================================
   Balance del mes (mismo formato que el balance en Excel de la administradora)
   ========================================================= */
.rv-balance { font-size: .92rem; }
.rv-balance__titulo { text-align: center; font-size: 1.35rem; font-weight: 700; border: 1px solid #222; padding: 8px; }
.rv-balance__sub { text-align: center; font-weight: 700; border: 1px solid #222; border-top: none; padding: 4px; }
.rv-balance__nota { text-align: center; color: #555; font-size: .85rem; margin: 4px 0 14px; }
.rv-balance__tabla { width: 100%; border-collapse: collapse; }
.rv-balance__tabla td { border: 1px solid #222; padding: 4px 8px; }
.rv-balance__seccion { background: #A9D08E; text-align: center; font-weight: 700; }
.rv-balance__cols td { background: #E7E6E6; text-align: center; font-weight: 700; }
.rv-balance__total td { background: #E7E6E6; font-weight: 700; }
.rv-balance__total td:first-child { text-align: center; }
.rv-balance__manual { background: #FFF2CC; }
.rv-balance__resultado td:first-child { text-align: center; width: 60%; }
.rv-balance__negativo td { background: #F8CBAD; }
.rv-balance__positivo td { background: #C6E0B4; }
.rv-balance__gris td { background: #E7E6E6; }
/* =========================================================
   Selector de condominio (usuarios de una administradora)
   ========================================================= */

.rv-cambio {
    margin-top: 12px;
}

.rv-cambio__actual {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0 8px;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    background: rgba(255, 255, 255, .10);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, .30);
    border-radius: 10px;
}

    .rv-cambio__actual:hover {
        background: rgba(255, 255, 255, .16);
    }

    .rv-cambio__actual[aria-expanded="true"] {
        background: #FFFFFF;
        color: var(--rv-nav);
        border-color: #FFFFFF;
    }

    .rv-cambio__actual:disabled {
        opacity: .7;
        cursor: wait;
    }

.rv-cambio__label {
    grid-column: 1;
    font-size: .75rem;
    opacity: .75;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.rv-cambio__nombre {
    grid-column: 1;
    font-weight: 700;
    font-size: .98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rv-cambio__chev {
    grid-column: 2;
    grid-row: 1 / span 2;
    font-size: .8rem;
}

.rv-cambio__panel {
    margin-top: 6px;
    padding: 6px;
    background: #FFFFFF;
    color: var(--rv-ink);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

.rv-cambio__buscar {
    width: 100%;
    margin-bottom: 6px;
    padding: 6px 10px;
    font-size: .9rem;
    border: 1px solid var(--rv-line);
    border-radius: 8px;
    color: var(--rv-ink);
}

.rv-cambio__lista {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
}

.rv-cambio__item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: none;
    border: 0;
    border-radius: 8px;
    text-align: left;
    color: var(--rv-ink);
    font-size: .93rem;
}

    .rv-cambio__item:hover {
        background: var(--rv-soft);
    }

    .rv-cambio__item.is-actual {
        font-weight: 700;
        color: var(--rv-nav);
        background: var(--rv-soft);
    }

.rv-cambio__item-nombre {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rv-cambio__estado {
    font-size: .72rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--rv-warn-bg);
    color: var(--rv-warn);
}

.rv-cambio__estado--vencido, .rv-cambio__estado--suspendido {
    background: var(--rv-danger-bg);
    color: var(--rv-danger);
}

.rv-cambio__vacio {
    padding: 8px 10px;
    font-size: .88rem;
    color: var(--rv-muted);
}

.rv-cambio-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    background: rgba(16, 29, 46, .55);
}

.rv-cambio-overlay__caja {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 26px;
    background: #FFFFFF;
    color: var(--rv-ink);
    border-radius: var(--rv-radius-lg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .3);
}

    .rv-cambio-overlay__caja p {
        margin: 0;
    }

    .rv-cambio-overlay__caja .spinner-border {
        color: var(--rv-nav);
    }