@import url('https://fonts.cdnfonts.com/css/segoe-ui-4');

/* Mapeo explícito para usar Segoe UI Semibold local en Windows cuando se solicita peso 600 */
@font-face {
    font-family: 'Segoe UI';
    font-style: normal;
    font-weight: 600;
    src: local('Segoe UI Semibold'), local('SegoeUI-Semibold');
}

/* Reset y estructura básica */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a,
button,
[role="button"],
input,
select,
textarea,
img,
[onclick],
.nav-tab,
.selector-option,
.fila_transaccion,
.shared-expense-mobile-card,
.receipt-thumbnail,
.user-avatar,
#user-header-avatar,
#user-modal-avatar,
.user-header-profile {
    -webkit-tap-highlight-color: transparent;
}

img {
    -webkit-touch-callout: none;
}

body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #E4E4E4;
}

/* Clases auxiliares para pesos de Segoe UI */
.font-regular {
    font-weight: 400;
    /* Regular */
}

.font-semibold {
    font-weight: 600;
    /* Semibold */
}

/* Header - Color Gris Claro de la foto (#E4E4E4) */
#sheets-header {
    background-color: #E4E4E4;
    width: 100%;
    padding: 15px 20px 15px 50px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: auto;
    flex-shrink: 0; /* Evita que la cabecera se encoja */
}

/* Selector MES / ANUAL */
.view-selector {
    display: flex;
    gap: 20px;
    user-select: none;
    padding-left: 27px;
    margin-bottom: 15px;
    /* Alínea "MES" perfectamente con las etiquetas de la tarjeta KPI (16px de padding-left + 1px de borde) */
}

.selector-option {
    font-size: 13px;
    color: #555555;
    cursor: pointer;
    letter-spacing: 0.8px;
    transition: color 0.15s ease;
}

.selector-option:hover {
    color: #000000;
}

.selector-option.active {
    color: #000000;
}

/* Tarjeta de KPIs de Gastos y Egresos */
.kpi-card {
    background-color: #ffffff;
    border-radius: 12px;
    width: 675px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 3px 8px rgb(0 0 0 / 15%);
}

.kpi-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 27px;
    background-color: #ffffff;
}

#kpi-row-ingresos {
    padding-top: 14px;
    ;
}

#kpi-row-gastos {
    padding-top: 2px;
    padding-bottom: 11px;
}

#kpi-row-diferencia {
    background-color: #ffffff;
    box-shadow: 0 1px 11px rgb(0 0 0 / 38%);
    padding-bottom: 10px;
}

#kpi-row-diferencia .kpi-label,
#kpi-row-diferencia .kpi-value {
    /* === EDITAR ESTE VALOR DIRECTAMENTE PARA MODIFICAR EL GROSOR DE LA FUENTE (ej. 400 = Regular, 600 = Semibold, 700 = Bold) === */
    font-weight: 600;
    font-size: 14px;
    /* Aumentado 2px (de 12px a 14px) */
}

.kpi-label {
    color: #202124;
    font-size: 13px;
}

.kpi-value {
    color: #202124;
    font-size: 12px;
    text-align: right;
}

#sheets-grid-container {
    display: flex;
    flex-direction: row;
    flex: 1 1 0; /* Crece y se encoge exactamente dentro del espacio disponible */
    min-height: 0; /* Permite a los paneles flex encogerse y activar el scroll interno */
    width: 100%;
    background-color: #E4E4E4;
}

/* Estilo común para los paneles */
.sheet-pane {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 32px;
    font-weight: bold;
}

/* B1 - Color Gris Claro (mismo que el header) */
#pane-b1 {
    background-color: #E4E4E4;
    width: 745px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 40px 20px 20px 50px;
    gap: 15px;
    overflow-y: auto;
    scrollbar-width: none; /* Ocultar barra en Firefox */
    -ms-overflow-style: none;  /* Ocultar barra en IE y Edge Legacy */
    font-size: initial;
    font-weight: initial;
    color: initial;
}

/* Ocultar barra en Chrome, Safari y navegadores basados en WebKit */
#pane-b1::-webkit-scrollbar {
    display: none;
}

/* Tarjeta Gastos / Ingresos */
.tarjeta_gastos_ingresos {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 17%);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
    user-select: none;
    width: 675px;
}

.tarjeta_gastos_ingresos:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.titulo_tarjeta_GI {
    font-family: "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 400;
    /* Regular */
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    border-radius: 12px 12px 0 0;
}

.total_tarjeta_GI {
    font-family: "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 400;
    /* Regular */
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 12px 12px;
}

/* Contenedor interno que se abre al hacer click */
.contenido_tarjeta_GI {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    padding: 0 20px;
    font-size: 13px;
    color: #333333;
    background-color: #ffffff;
    scrollbar-width: none; /* Ocultar barra en Firefox */
    -ms-overflow-style: none;  /* Ocultar barra en IE/Edge */
}

.contenido_tarjeta_GI::-webkit-scrollbar {
    display: none; /* Ocultar barra en Chrome/Safari */
}

.tarjeta_gastos_ingresos.abierta .contenido_tarjeta_GI {
    max-height: 733px;
    overflow-y: auto;
    padding: 20px 20px 0px 20px;
    border-top: 1px solid #eeeeee;
    border-bottom: 1px solid #eeeeee;
}

/* Colores específicos de títulos y totales (Fondo de color, letras blancas/negras) */
#tarjeta-visa .titulo_tarjeta_GI,
#tarjeta-visa .total_tarjeta_GI {
    background-color: #DE3D49;
    color: #ffffff;
}

#tarjeta-amex .titulo_tarjeta_GI,
#tarjeta-amex .total_tarjeta_GI {
    background-color: #DE3D49;
    color: #ffffff;
}

#tarjeta-mercado-credito .titulo_tarjeta_GI,
#tarjeta-mercado-credito .total_tarjeta_GI {
    background-color: #FFE600;
    color: #000000;
    /* Letras negras para contraste sobre fondo amarillo */
}

#tarjeta-naranja .titulo_tarjeta_GI,
#tarjeta-naranja .total_tarjeta_GI {
    background-color: #F6B26B;
    color: #ffffff;
}

#tarjeta-work .titulo_tarjeta_GI,
#tarjeta-work .total_tarjeta_GI {
    background-color: #6FA8DC;
    color: #ffffff;
}

#tarjeta-lcw .titulo_tarjeta_GI,
#tarjeta-lcw .total_tarjeta_GI {
    background-color: #000000;
    color: #ffffff;
}

#tarjeta-garage .titulo_tarjeta_GI,
#tarjeta-garage .total_tarjeta_GI {
    background-color: #40B398;
    color: #ffffff;
}

#tarjeta-alquileres .titulo_tarjeta_GI,
#tarjeta-alquileres .total_tarjeta_GI {
    background-color: #40B398;
    color: #ffffff;
}

#tarjeta-otros-ingresos .titulo_tarjeta_GI,
#tarjeta-otros-ingresos .total_tarjeta_GI {
    background-color: #40B398;
    color: #ffffff;
}

/* Cabecera y Filas de Transacciones dentro de la tarjeta expandida */
.cabecera_transaccion,
.fila_transaccion {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-family: "Segoe UI", sans-serif;
    font-size: 11px;
}

.cabecera_transaccion {
    font-weight: 600;
    color: #5f6368;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 6px;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.fila_transaccion {
    border-radius: 6px;
    margin-bottom: 4px;
    color: #202124;
}

.fila_transaccion:nth-of-type(odd) {
    background-color: #ffffff;
}

.fila_transaccion:nth-of-type(even) {
    background-color: #F6F6F6;
}

/* Ancho y alineación de columnas */
.col_detalle_unificado {
    flex-basis: 70%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col_vacio_income {
    flex-basis: 16%;
}

.col_fecha {
    flex-basis: 12%;
    text-align: left;
}

.col_detalle1 {
    flex-basis: 22%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col_detalle2 {
    flex-basis: 18%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col_categoria {
    flex-basis: 18%;
    text-align: center;
}

.col_valor {
    flex-basis: 14%;
    text-align: right;
    font-weight: 600;
}

.col_valor_usd {
    flex-basis: 10%;
    text-align: right;
}

.col_cuotas {
    flex-basis: 6%;
    text-align: center;
}

/* Selector de Categorías (Píldora Azul estilo dropdown) */
.selector_categoria {
    border: none;
    border-radius: 12px;
    padding: 3px 8px;
    font-family: "Segoe UI", sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: #ffffff;
    background-color: #3b82f6;
    /* Fondo azul */
    cursor: pointer;
    outline: none;
    appearance: none;
    text-align: center;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='10' viewBox='0 0 24 24' width='10' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 18px;
    display: inline-block;
}


#pane-b2 {
    background-color: #E4E4E4;
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 45px 20px 20px 60px;
    font-size: initial;
    font-weight: initial;
    color: initial;
    overflow-y: auto;
    scrollbar-width: none; /* Ocultar barra en Firefox */
    -ms-overflow-style: none;  /* Ocultar barra en IE y Edge Legacy */
}

#pane-b2::-webkit-scrollbar {
    display: none; /* Ocultar barra en Chrome, Safari y WebKit */
}

/* Card de Total Tarjetas Santander en B2 */
.card_total_santander {
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 16px 20px;
    width: 100%;
    max-width: 320px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.titulo_total_santander {
    font-family: "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #202124;
}

.valor_total_santander {
    font-family: "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #202124;
}

/* Card de Resumen de Categorías en B2 */
.card_resumen_categorias {
    background-color: #e4e4e4;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 10px 15px;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 80px;
}

.fila_categoria_resumen {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pill_categoria {
    width: 132px;
    height: 22px;
    border-radius: 11px;
    color: #ffffff;
    font-family: "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.total_categoria_resumen {
    font-family: "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #202124;
    text-align: right;
}

/* Colores de las píldoras de categorías y selectores */
.pill_categoria.cat_auto, .selector_categoria.cat_auto { background-color: #4285F4; }
.pill_categoria.cat_nafta, .selector_categoria.cat_nafta { background-color: #4285F4; }
.pill_categoria.cat_peajes, .selector_categoria.cat_peajes { background-color: #11734B; }
.pill_categoria.cat_estacionamiento, .selector_categoria.cat_estacionamiento { background-color: #11734B; }
.pill_categoria.cat_plataformas, .selector_categoria.cat_plataformas { background-color: #C04CFF; }
.pill_categoria.cat_servicios, .selector_categoria.cat_servicios { background-color: #E06666; }
.pill_categoria.cat_ropa, .selector_categoria.cat_ropa { background-color: #3D3D3D; }
.pill_categoria.cat_ocio, .selector_categoria.cat_ocio { background-color: #FF00FF; }
.pill_categoria.cat_casa, .selector_categoria.cat_casa { background-color: #F1C232; }
.pill_categoria.cat_chatarra, .selector_categoria.cat_chatarra { background-color: #B10202; }
.pill_categoria.cat_delivery, .selector_categoria.cat_delivery { background-color: #B10202; }
.pill_categoria.cat_kiosko, .selector_categoria.cat_kiosko { background-color: #B10202; }
.pill_categoria.cat_comida, .selector_categoria.cat_comida { background-color: #11734B; }
.pill_categoria.cat_work, .selector_categoria.cat_work { background-color: #2753AF; }
.pill_categoria.cat_restaurant, .selector_categoria.cat_restaurant { background-color: #741B47; }
.pill_categoria.cat_vacaciones, .selector_categoria.cat_vacaciones { background-color: #FF9900; }
.pill_categoria.cat_nc, .selector_categoria.cat_nc { background-color: #B7B7B7; }
.pill_categoria.cat_none, .selector_categoria.cat_none { background-color: #cfcfcf; }
.pill_categoria.cat_credito, .selector_categoria.cat_credito { background-color: #45818e; }

/* Colores de las opciones de categorías dentro del select */
.selector_categoria option {
    color: #ffffff;
    font-weight: 500;
}
.selector_categoria option[value="Auto"] { background-color: #4285F4; }
.selector_categoria option[value="Nafta"] { background-color: #4285F4; }
.selector_categoria option[value="Peajes"] { background-color: #11734B; }
.selector_categoria option[value="Estacionamiento"] { background-color: #11734B; }
.selector_categoria option[value="Plataformas"] { background-color: #C04CFF; }
.selector_categoria option[value="Servicios"] { background-color: #E06666; }
.selector_categoria option[value="Ropa"] { background-color: #3D3D3D; }
.selector_categoria option[value="Ocio"] { background-color: #FF00FF; }
.selector_categoria option[value="Casa"] { background-color: #F1C232; }
.selector_categoria option[value="Chatarra"] { background-color: #B10202; }
.selector_categoria option[value="Delivery"] { background-color: #B10202; }
.selector_categoria option[value="Kiosko"] { background-color: #B10202; }
.selector_categoria option[value="Comida"] { background-color: #11734B; }
.selector_categoria option[value="Work"] { background-color: #2753AF; }
.selector_categoria option[value="Restaurant"] { background-color: #741B47; }
.selector_categoria option[value="Vacaciones"] { background-color: #FF9900; }
.selector_categoria option[value="Nc"] { background-color: #B7B7B7; }
.selector_categoria option[value="None"] { background-color: #cfcfcf; }
.selector_categoria option[value="Credito"] { background-color: #45818e; }

/* B3 - Color Gris Claro */
#pane-b3 {
    background-color: #E4E4E4;
    flex: 2;
    min-width: 450px;
    flex-shrink: 0;
}

/* Responsive / Media Queries para evitar superposición */

/* Ocultar B3 cuando la pantalla es menor a 1350px (primer elemento en ocultarse) */
@media (max-width: 1350px) {
    #pane-b3 {
        display: none !important;
    }
}

/* Ajustes para Celulares (Mobile) */
@media (max-width: 768px) {
    body {
        height: auto !important;
        min-height: 100dvh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    #sheets-grid-container {
        height: auto !important;
        flex: none !important;
    }
    #pane-b1 {
        height: auto !important;
        overflow-y: visible !important;
        width: 100%;
        max-width: 100%;
        padding: 15px 15px 80px 15px !important;
    }
    #pane-b2 {
        display: none !important;
    }
    #pane-b3 {
        display: none !important;
    }
    #sheets-header {
        padding: 15px 15px 10px 15px !important;
    }
    .kpi-card {
        width: 100%;
    }
    .tarjeta_gastos_ingresos {
        width: 100%;
    }
}

/* Nav Inferior - Barra de Pestañas estilo Google Sheets */
.nav-section {
    height: 55px;
    width: 100%;
    display: flex;
    align-items: flex-end; /* Alineado al fondo para acomodar pestañas */
    padding-left: 10px;
    padding-bottom: 0;
    flex-shrink: 0; /* Evita que la barra de navegación se encoja o desaparezca */
    user-select: none;
    background-color: #f1f3f4;
    border-top: 1px solid #dadce0;
}

/* Botón Agregar Pestaña (+) */
.nav-add-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-bottom: 8px; /* Centrado vertical con el texto de las pestañas */
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-add-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: #202124;
}

.nav-import-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-bottom: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-import-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: #1a73e8;
}

/* Separador vertical */
.nav-divider {
    width: 1px;
    height: 20px;
    background-color: #bdc1c6;
    margin: 0 10px;
    margin-bottom: 12px; /* Centrado vertical con el texto de las pestañas */
}

/* Contenedor de Pestañas Desplazable */
.nav-tabs-container {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    height: 100%;
    overflow-x: auto;
    flex-grow: 1;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.nav-tabs-container::-webkit-scrollbar {
    display: none; /* WebKit */
}

/* Pestaña Individual */
.nav-tab {
    font-family: "Segoe UI", sans-serif;
    font-size: 14px;
    color: #3c4043;
    padding: 0 22px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: transparent;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.nav-tab:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.nav-tab.active {
    background-color: #ffffff;
    color: #202124;
    font-weight: 600;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.05);
}

/* Reglas para tarjetas sin Detalle 2 */
.tarjeta_gastos_ingresos.sin_detalle2 .col_detalle2 {
    display: none !important;
}
.tarjeta_gastos_ingresos.sin_detalle2 .col_detalle1 {
    flex-basis: 40% !important;
}

/* Interactividad de filas editables */
.fila_tarjeta_GI {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.fila_tarjeta_GI:hover {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

.fila_tarjeta_GI select {
    cursor: default;
}

/* Modal de Edición */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: none; /* Se activa mediante JS */
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 450px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: modalAppear 0.2s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 12px;
}

.modal-title {
    font-family: "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #202124;
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #5f6368;
    font-size: 20px;
    line-height: 1;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-label {
    font-family: "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #5f6368;
}

.modal-input {
    font-family: "Segoe UI", sans-serif;
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    outline: none;
    color: #202124;
}

.modal-input:focus {
    border-color: #1a73e8;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.modal-btn {
    font-family: "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.modal-btn-cancel {
    background-color: transparent;
    color: #5f6368;
}

.modal-btn-cancel:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.modal-btn-save {
    background-color: #1a73e8;
    color: #ffffff;
}

.modal-btn-save:hover {
    background-color: #1557b0;
}

.modal-btn-delete {
    background-color: #DE3D49;
    color: #ffffff;
    margin-right: auto;
}

.modal-btn-delete:hover {
    background-color: #C02F3A;
}

/* Custom Confirmation Modal Styles */
.confirm-modal-overlay {
    z-index: 1100;
    background-color: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
}

.confirm-modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    width: 320px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

.confirm-modal-message {
    font-family: "Segoe UI", sans-serif;
    font-size: 14px;
    color: #202124;
    font-weight: 500;
    line-height: 1.4;
}

.confirm-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.confirm-btn {
    font-family: "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.confirm-btn-yes {
    background-color: #DE3D49;
    color: #ffffff;
}

.confirm-btn-yes:hover {
    background-color: #C02F3A;
}

.confirm-btn-no {
    background-color: #f1f3f4;
    color: #5f6368;
}

.confirm-btn-no:hover {
    background-color: #e8eaed;
}

/* Card Add Row (+) Button Styles */
.card-add-row-btn-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 9px 0px 8px 0;
    width: 100%;
    background-color: #ffffff;
}

.add-row-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9aa0a6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, transform 0.15s ease;
    outline: none;
}

.add-row-btn:hover {
    color: #1a73e8;
    transform: scale(1.15);
}

.add-row-btn svg {
    width: 18px;
    height: 18px;
}

/* Custom Context Menu Styles */
.context-menu {
    position: fixed;
    top: 0;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 6px 12px rgb(0 0 0 / 35%);
    padding: 6px 0;
    display: none;
    z-index: 10000;
    min-width: 130px;
    transform: translateY(-100%);
}

.context-menu-item {
    padding: 8px 16px;
    font-family: "Segoe UI", sans-serif;
    font-size: 13px;
    color: #3c4043;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu-item:hover {
    background-color: #f1f3f4;
    color: #1a73e8;
}

.context-menu-item#context-delete-tab:hover {
    background-color: #fce8e6;
    color: #DE3D49;
}

/* Alquileres may26-or-later layout */
#tarjeta-alquileres.may26-or-later .col_detalle_unificado {
    flex-basis: 40%;
}
#tarjeta-alquileres.may26-or-later .col_mensualidad {
    flex-basis: 25%;
    text-align: right;
    font-weight: 500;
    color: #5f6368;
}
#tarjeta-alquileres.may26-or-later .col_valor {
    flex-basis: 20%;
    text-align: right;
}
#tarjeta-alquileres.may26-or-later .col_vacio_income {
    flex-basis: 15%;
}

/* Transición durante el arrastre */
.fila_transaccion.dragging {
    opacity: 0.45;
    border: 1px dashed #1a73e8;
    background-color: #f1f3f4 !important;
}

/* Card de Gráfico de Categorías en B3 */
.card_grafico_categorias {
    background-color: transparent;
    width: 100%;
    max-width: 600px;
    height: 100%;
    max-height: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 10px;
}

/* Flechas de Navegación de B3 */
.b3-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: #5f6368;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
}

.b3-nav-arrow:hover {
    color: #202124;
    transform: translateY(-50%) scale(1.2);
}

.b3-nav-left {
    left: 8px;
}

.b3-nav-right {
    right: 8px;
}

/* Card de Calculadora en B3 */
.card_calculadora {
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 20px;
    width: 100%;
    max-width: 380px;
    height: 90%;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    color: #202124;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

.calc_header {
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    text-align: center;
    border-bottom: 1px solid #f1f3f4;
    padding-bottom: 8px;
    color: #1a73e8;
}

.calc_input_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.calc_input_row label {
    font-size: 13px;
    font-weight: 600;
}

.input-money-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 8px;
    font-size: 13px;
    font-weight: bold;
    color: #5f6368;
}

.input-money-wrapper input {
    padding: 6px 8px 6px 20px;
    font-size: 13px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    width: 110px;
    text-align: right;
    font-weight: 600;
}

.calc_payments_section {
    border-top: 1px solid #f1f3f4;
    padding-top: 10px;
    margin-bottom: 12px;
}

.calc_section_title {
    font-size: 11px;
    font-weight: bold;
    color: #5f6368;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.calc_payment_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.calc_payment_row label {
    font-size: 12px;
    font-weight: 500;
    color: #3c4043;
}

.calc-day-input {
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    width: 60px;
    text-align: center;
}

.calc_timeline_container {
    border-top: 1px solid #f1f3f4;
    padding-top: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.calc_timeline_title {
    font-size: 11px;
    font-weight: bold;
    color: #5f6368;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.calc_timeline_list {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    -ms-overflow-style: none;  /* IE y Edge */
    scrollbar-width: none;  /* Firefox */
}

.calc_timeline_list::-webkit-scrollbar {
    display: none; /* Chrome, Safari y Opera */
}

.timeline_day_block {
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
    border-left: 2px solid #e8eaed;
}

.timeline_day_block::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #1a73e8;
    border: 2px solid #ffffff;
}

.timeline_date {
    font-size: 11px;
    font-weight: bold;
    color: #202124;
    margin-bottom: 4px;
}

.timeline_events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.timeline_event_item {
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}

.timeline_event_item.income {
    color: #137333;
}

.timeline_event_item.payment {
    color: #c5221f;
}

.timeline_event_item.initial-balance {
    color: #1a73e8;
    font-weight: bold;
}

.timeline_balance_row {
    font-size: 11px;
    font-weight: bold;
    color: #1a73e8;
    border-top: 1px dashed #f1f3f4;
    padding-top: 2px;
    text-align: right;
}

/* Modal de Detalles de Categoría en B2 */
.category-details-content {
    max-width: 900px !important;
    width: 90% !important;
    height: 85vh !important;
    max-height: 85vh !important;
    display: flex;
    flex-direction: column;
}

.category-modal-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    border: 1px solid #e8eaed;
}

.category-modal-summary-row strong {
    font-size: 16px;
    color: #1a73e8;
}

.category-modal-list-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    border: 1px solid #dadce0;
    border-radius: 8px;
}

.category-modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.category-modal-table th {
    background-color: #f1f3f4;
    color: #5f6368;
    font-weight: 600;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    border-bottom: 1px solid #dadce0;
    z-index: 1;
}

.category-modal-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f3f4;
    color: #3c4043;
}

.category-modal-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Efecto hover y cursor en el Resumen de Categorías (B2) */
.card_resumen_categorias .fila_categoria_resumen {
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s ease-out;
    padding: 4px 4px;
    margin: 0;
}

.card_resumen_categorias .fila_categoria_resumen:hover {
    background-color: rgba(26, 115, 232, 0.08);
    transform: translateX(4px);
}

/* Selector/Input inline para Cotización de Dólar */
.dolar-inline-input {
    width: 80px;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    border: 1px solid #1a73e8;
    border-radius: 4px;
    padding: 2px 4px;
    outline: none;
    color: #1a73e8;
    background-color: #ffffff;
    font-family: inherit;
}

/* Botón de Acción Flotante (FAB) */
.floating-fab {
    position: fixed;
    bottom: 85px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #1a73e8;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.2s, background-color 0.2s;
}

.floating-fab:hover {
    background-color: #1557b0;
    transform: scale(1.08);
}

.floating-fab:active {
    transform: scale(0.95);
}

/* Botón de alternancia de KPIs en móvil */
.shared-kpi-toggle-btn {
    display: none;
}

/* Tabla de Gastos Compartidos */
.shared-table-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dadce0;
}

.shared-expenses-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.shared-expenses-table th {
    background-color: #f1f3f4;
    color: #5f6368;
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid #dadce0;
}

.shared-expenses-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e8eaed;
    color: #3c4043;
    vertical-align: middle;
}

.shared-expenses-table tbody tr.fila-gasto-compartido {
    cursor: pointer;
    transition: background-color 0.15s;
}

.shared-expenses-table tbody tr.fila-gasto-compartido:hover {
    background-color: rgba(26, 115, 232, 0.05);
}

.shared-expense-mobile-card {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.shared-expense-mobile-card:active {
    transform: scale(0.98);
}

/* Modales personalizados para Gastos Compartidos */
.shared-options-content {
    max-width: 340px !important;
    width: 90% !important;
}

.shared-form-content {
    max-width: 500px !important;
    width: 90% !important;
}

.shared-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    background-color: #1a73e8;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
}

.shared-menu-btn:hover {
    background-color: #1557b0;
    transform: translateY(-2px);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #3c4043;
}

.form-group input, .form-group select {
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    background-color: #ffffff;
    color: #202124;
}

.form-group input:focus, .form-group select:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* Subida de Archivos */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 46px;
    border: 2px dashed #1a73e8;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(26, 115, 232, 0.04);
    cursor: pointer;
    transition: background-color 0.2s;
}

.file-upload-wrapper:hover {
    background-color: rgba(26, 115, 232, 0.08);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-info {
    font-size: 13px;
    font-weight: 600;
    color: #1a73e8;
}

/* Previsualización y Miniaturas */
.receipts-preview-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.receipt-preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border: 1px solid #dadce0;
    border-radius: 6px;
}

.receipt-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.receipt-thumbnail {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #dadce0;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.receipt-thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Botones de formulario */
.btn-cancel {
    padding: 10px 18px;
    border: 1px solid #dadce0;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: #5f6368;
    font-size: 13px;
    transition: background-color 0.2s;
}

.btn-cancel:hover {
    background-color: #f1f3f4;
}

.btn-save {
    padding: 10px 18px;
    border: none;
    background-color: #1a73e8;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background-color 0.2s;
}

.btn-save:hover {
    background-color: #1557b0;
}

.shared-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #5f6368;
    padding: 6px;
    border-radius: 4px;
    transition: color 0.15s, background-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shared-delete-btn:hover {
    color: #d93025;
    background-color: rgba(217, 48, 37, 0.08);
}

/* Vista Móvil de Tarjetas */
.shared-mobile-list {
    display: none;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.shared-expense-mobile-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.shared-expense-mobile-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 5px solid #1a73e8;
    min-height: 76px;
}

.shared-card-image-side {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.shared-card-image-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.shared-card-image-side svg {
    width: 24px;
    height: 24px;
}

.shared-card-info-side {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: center;
    min-width: 0;
    gap: 3px;
}

.shared-card-desc {
    font-weight: 600;
    font-size: 14px;
    color: #202124;
}

.shared-card-amount {
    font-weight: 700;
    font-size: 15px;
    color: #1a73e8;
}

.shared-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #5f6368;
}

.shared-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f3f4;
    padding-top: 10px;
    margin-top: 4px;
}

.shared-card-receipts {
    display: flex;
    gap: 6px;
}

/* RESPONSIVE MEDIA QUERIES (Celular) */
@media (max-width: 768px) {
    #shared-kpi-container {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100%;
    }

    .shared-kpi-row-wrapper {
        flex-direction: row-reverse !important;
        gap: 10px !important;
        width: 100% !important;
        align-items: stretch !important;
    }

    .shared-kpi-toggle-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        min-width: 32px;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #70757a !important;
        cursor: pointer;
        outline: none;
        padding: 0 !important;
    }

    .shared-kpi-toggle-btn:active {
        opacity: 0.6;
    }

    #shared-kpi-card-individual {
        display: none !important;
    }

    #shared-kpi-card-individual.show {
        display: flex !important;
    }

    #shared-kpi-card-summary {
        display: flex !important;
    }

    #shared-kpi-card-summary.hide {
        display: none !important;
    }

    #shared-kpi-container .kpi-card {
        width: 100% !important;
    }

    #shared-expenses-container {
        height: auto !important;
        overflow-y: visible !important;
        padding: 15px 15px 140px 15px !important;
    }

    .shared-table-card {
        display: none;
    }

    .shared-mobile-list {
        display: flex;
        margin-bottom: 130px !important;
    }

    /* Formulario de carga como cuadro modal flotante en celular (no pantalla completa) */
    .shared-form-content {
        width: 75% !important;
        max-width: 440px !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 12px !important;
        padding: 20px 16px 16px 16px !important;
        display: flex;
        flex-direction: column;
    }

    .shared-form-content form {
        height: auto !important;
        max-height: calc(90vh - 60px) !important;
        display: flex;
        flex-direction: column;
    }

    .shared-form-content .modal-body {
        flex-grow: 1;
        overflow-y: auto;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }

    .shared-form-content .modal-body::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .floating-fab {
        bottom: 75px;
        right: 20px;
    }

    /* Agrandar botones de navegación (+ agregar pestaña) en móvil */
    .nav-section {
        align-items: center !important;
        padding-bottom: 0 !important;
        height: 48px !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        z-index: 9000 !important;
    }

    .nav-tabs-container {
        align-items: center !important;
    }

    .nav-tab {
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .nav-add-btn {
        width: 44px !important;
        height: 44px !important;
        margin-bottom: 0 !important;
    }

    .nav-add-btn svg {
        width: 18px !important;
        height: 18px !important;
    }

    .nav-divider {
        margin-bottom: 0 !important;
    }

    .nav-import-btn {
        margin-bottom: 0 !important;
        width: 44px !important;
        height: 44px !important;
    }

    .nav-import-btn svg {
        width: 18px !important;
        height: 18px !important;
    }
}

/* ==========================================================================
   SISTEMA DE AUTENTICACIÓN Y ROLES (Vistas de Login, Selector y Admin Panel)
   ========================================================================== */

.full-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15000;
    overflow-y: auto;
    padding: 20px;
}

.auth-card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    border: 1px solid #dadce0;
}

.auth-title {
    font-size: 24px;
    font-weight: 600;
    color: #202124;
    margin: 0;
}

.auth-subtitle {
    font-size: 14px;
    color: #5f6368;
    line-height: 1.5;
    margin: 0;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.google-btn:hover {
    background-color: #f8f9fa;
    border-color: #d2e3fc;
    box-shadow: 0 1px 3px rgba(60,64,67, 0.3), 0 4px 8px 3px rgba(60,64,67, 0.15);
}

.google-btn:active {
    background-color: #eeeeee;
}

.auth-error-msg {
    color: #DE3D49;
    font-size: 13px;
    line-height: 1.4;
    background-color: #fce8e6;
    padding: 10px 16px;
    border-radius: 8px;
    width: 100%;
    text-align: left;
}

/* PORTAL SELECTOR */
.portal-card {
    max-width: 480px;
    padding: 36px 28px;
}

.portal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid #1a73e8;
    object-fit: cover;
}

.portal-title {
    font-size: 22px;
    font-weight: 600;
    color: #202124;
    margin: 0;
}

.portal-subtitle {
    font-size: 14px;
    color: #5f6368;
    margin: 0;
}

.portal-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.portal-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 20px;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
}

.portal-btn:hover {
    border-color: #1a73e8;
    background-color: rgba(26, 115, 232, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.1);
}

.portal-btn-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a73e8;
    margin-bottom: 4px;
}

.portal-btn-desc {
    font-size: 13px;
    color: #5f6368;
}

.admin-portal-btn .portal-btn-title {
    color: #e02424;
}

.admin-portal-btn:hover {
    border-color: #e02424;
    background-color: rgba(224, 36, 36, 0.04);
    box-shadow: 0 4px 12px rgba(224, 36, 36, 0.1);
}

.portal-logout-btn {
    background: none;
    border: none;
    color: #5f6368;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.portal-logout-btn:hover {
    background-color: rgba(0,0,0,0.05);
    color: #202124;
}

/* PANEL DE ADMINISTRACION */
.admin-dashboard-card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 900px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border: 1px solid #dadce0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f3f4;
    padding-bottom: 16px;
}

.admin-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #202124;
    margin: 0;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-desc {
    font-size: 14px;
    color: #5f6368;
    margin: 0;
}

.admin-table-wrapper {
    overflow-x: auto;
    border: 1px solid #dadce0;
    border-radius: 8px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.admin-table th, .admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #dadce0;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #3c4043;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background-color: #f8f9fa;
}

.admin-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-editor {
    background-color: #e6f4ea;
    color: #137333;
}

.badge-visitante {
    background-color: #fef7e0;
    color: #b06000;
}

.badge-none {
    background-color: #f1f3f4;
    color: #5f6368;
}

.badge-admin {
    background-color: #e8f0fe;
    color: #1a73e8;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background-color: #ffffff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background-color: #3c4043;
}

.mobile-section-title {
    display: none;
}

.mobile-side-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(32, 33, 36, 0.34);
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 15990;
}

.mobile-side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 60vw;
    max-width: 320px;
    min-width: 240px;
    height: 100vh;
    height: 100dvh;
    background-color: #ffffff;
    box-shadow: 5px 0 22px rgba(60, 64, 67, 0.24);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    z-index: 16000;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #dadce0;
}

.mobile-side-menu.open {
    transform: translateX(0);
}

.mobile-side-menu-overlay.open {
    display: block;
    opacity: 1;
}

.mobile-side-menu-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 14px 14px 16px;
    border-bottom: 1px solid #f1f3f4;
}

.mobile-menu-user-name {
    font-size: 15px;
    font-weight: 600;
    color: #202124;
    line-height: 1.25;
}

.mobile-menu-user-email {
    font-size: 12px;
    color: #5f6368;
    line-height: 1.35;
    word-break: break-all;
    margin-top: 3px;
}

.mobile-menu-close {
    border: none;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    width: 32px;
    height: 32px;
    padding: 0;
}

.mobile-side-menu-nav {
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 4px;
}

.mobile-side-menu-item {
    width: 100%;
    min-height: 44px;
    border: none;
    border-radius: 8px;
    background-color: transparent;
    color: #202124;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    padding: 0 12px;
    cursor: pointer;
}

.mobile-side-menu-item:hover,
.mobile-side-menu-item.active {
    background-color: #f1f3f4;
}

.mobile-side-menu-item.danger {
    color: #d93025;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .auth-card {
        padding: 30px 20px;
    }
    .mobile-menu-btn {
        display: flex;
        position: absolute;
        top: 14px;
        left: 12px;
        z-index: 1000;
    }
    .header-top-bar {
        margin-bottom: 30px;
        min-height: 42px;
        justify-content: center !important;
        flex-wrap: nowrap !important;
    }
    .header-top-bar .view-selector {
        display: none !important;
    }
    .mobile-section-title {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        padding: 3px 58px 0 58px;
        text-align: center;
        pointer-events: none;
    }
    .mobile-section-eyebrow {
        font-size: 10px;
        font-weight: 600;
        color: #5f6368;
        line-height: 1;
        text-transform: uppercase;
        letter-spacing: 0.8px;
    }
    .mobile-section-name {
        margin-top: 4px;
        font-size: 18px;
        font-weight: 700;
        color: #202124;
        line-height: 1.1;
    }
    .admin-dashboard-card {
        padding: 20px;
    }
    .admin-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-toolbar button {
        width: 100%;
    }
    #receipt-zoom-img {
        max-height: 75% !important;
    }
    .user-header-profile {
        position: absolute !important;
        top: 14px !important;
        right: 12px !important;
        margin: 0 !important;
        z-index: 1000 !important;
        background-color: transparent !important;
    }
    .user-header-profile #user-header-name,
    .user-header-profile #btn-header-portal {
        display: none !important;
    }
    .user-header-profile #user-header-avatar {
        width: 38px !important;
        height: 38px !important;
        border: 2px solid #1a73e8 !important;
        box-shadow: 0 2px 8px rgba(26, 115, 232, 0.2) !important;
    }
}

#receipt-zoom-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: transform 0.2s ease;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4.5px solid #f1f3f4;
    border-top: 4.5px solid #1a73e8;
    border-radius: 50%;
    animation: loading-spin 0.8s linear infinite;
}

.month-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1800;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.month-loading-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.month-loading-box {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(218, 220, 224, 0.8);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 28px rgba(60, 64, 67, 0.18);
    color: #3c4043;
    font-size: 14px;
    font-weight: 600;
}

.month-loading-box .loading-spinner {
    width: 24px;
    height: 24px;
    border-width: 3px;
}

@keyframes loading-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
