/* ==========================================================
   DESIGN SYSTEM - IUMP CONCÓN (RESPONSIVE MÓVIL Y ESCRITORIO PC)
   Tema Claro Corporativo, Alta Legibilidad y Experiencia Sin Fricción
   ========================================================== */

:root {
    /* Fondos Claros Corporativos */
    --bg-main: #F4F6F9;
    --bg-card: #FFFFFF;
    --bg-card-elevated: #F8FAFC;
    --bg-modal: #FFFFFF;
    --border-color: #E2E8F0;
    --border-subtle: #F1F5F9;
    --border-focus: #15803D;

    /* Verdes Corporativos IUMP */
    --brand-primary: #15803D;
    --brand-dark: #166534;
    --brand-deep: #14532D;
    --brand-light: #DCFCE7;
    --brand-glow: rgba(21, 128, 61, 0.2);

    /* Ingresos (Verde Corporativo) */
    --income-color: #15803D;
    --income-bg: #DCFCE7;
    --income-glow: rgba(21, 128, 61, 0.15);

    /* Egresos (Rojo Corporativo) */
    --expense-color: #DC2626;
    --expense-bg: #FEE2E2;
    --expense-glow: rgba(220, 38, 38, 0.15);

    /* Textos de Alta Legibilidad y Contraste */
    --text-primary: #0F172A;     /* Negro pizarra profundo */
    --text-secondary: #334155;   /* Pizarra oscuro */
    --text-muted: #64748B;       /* Gris medio para descripciones */
    --text-subtle: #94A3B8;

    /* Radios y Sombras Corporativas */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);

    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --header-height: 68px;
    --bottom-nav-height: 72px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: stretch;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

img, svg, video, canvas, audio, iframe, embed, object {
    max-width: 100%;
}

/* ==========================================================
   CONTENEDOR PRINCIPAL: CELULAR (< 768px) vs PC (>= 768px)
   ========================================================== */
.app-container {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    background-color: var(--bg-main);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    box-shadow: none;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    transition: max-width 0.25s ease;
}

/* Optimización para PC / Tablet / Escritorio */
@media (min-width: 768px) {
    body {
        padding: clamp(16px, 2.5vw, 28px) clamp(12px, 2vw, 24px);
        align-items: flex-start;
        background-color: #EAEFF5;
    }

    .app-container {
        max-width: min(1140px, 100%);
        min-height: calc(100vh - 48px);
        margin: 0 auto;
        border-radius: 20px;
        border: 1px solid var(--border-color);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
        background: #FFFFFF;
        overflow: hidden;
    }
}

/* ----------------------------------------------------------
   BARRA SUPERIOR (HEADER)
   ---------------------------------------------------------- */
.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(10px, 3.5vw, 20px);
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .app-header {
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        padding: 0 32px;
        height: 74px;
    }
}

.header-brand {
    display: flex;
    align-items: center;
    gap: clamp(6px, 2vw, 12px);
    min-width: 0;
    flex: 1;
}

.brand-icon {
    width: clamp(36px, 9vw, 42px);
    height: clamp(36px, 9vw, 42px);
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(21, 128, 61, 0.15);
    border: 1px solid var(--border-color);
    padding: 2px;
    flex-shrink: 0;
}

.brand-info {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.brand-info h1 {
    font-size: clamp(13px, 3.8vw, 17px);
    font-weight: 800;
    color: var(--brand-deep);
    letter-spacing: -0.3px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.brand-info span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* NAVEGACIÓN EN ESCRITORIO PC (TOP TABS) */
.desktop-nav {
    display: none;
    align-items: center;
    gap: 6px;
    background: #F1F5F9;
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
    }
}

.desktop-nav-btn {
    background: transparent;
    border: none;
    padding: 7px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.desktop-nav-btn:hover {
    color: var(--brand-primary);
}

.desktop-nav-btn.active {
    background: #FFFFFF;
    color: var(--brand-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover, .icon-btn:active {
    transform: scale(0.95);
    background: #E2E8F0;
    color: var(--brand-primary);
}

.role-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 700;
    letter-spacing: 0.3px;
}

.role-badge.pastor {
    background: var(--brand-light);
    color: var(--brand-dark);
    border: 1px solid rgba(21, 128, 61, 0.3);
}

.role-badge.admin {
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}

/* ----------------------------------------------------------
   CONTENIDO PRINCIPAL
   ---------------------------------------------------------- */
.app-content {
    flex: 1;
    padding: 16px 18px 96px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
    .app-content {
        padding: 28px 32px 40px 32px;
        background: #F8FAFC;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
    }
}

/* PESTAÑAS Y VISTAS */
.view-section {
    display: none;
    animation: fadeIn 0.25s ease-out;
}

.view-section.active {
    display: block;
}

/* ==========================================================
   DISEÑO RESPONSIVO PARA PC: GRID DE 2 COLUMNAS
   ========================================================== */
.responsive-grid-desktop {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .responsive-grid-desktop {
        display: grid;
        grid-template-columns: 1.1fr 0.9fr;
        gap: 26px;
        align-items: start;
    }

    .admin-columns-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        align-items: start;
    }
}

/* ----------------------------------------------------------
   TARJETA SALDO HERO (VERDE CORPORATIVO EJECUTIVO)
   ---------------------------------------------------------- */
.balance-hero-card {
    background: linear-gradient(135deg, #14532D 0%, #166534 55%, #15803D 100%);
    border-radius: var(--radius-lg);
    padding: clamp(16px, 4vw, 22px) clamp(14px, 3.5vw, 20px);
    margin-bottom: 20px;
    color: #FFFFFF;
    box-shadow: 0 10px 25px rgba(20, 83, 45, 0.25);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.balance-hero-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.balance-label {
    font-size: 13px;
    font-weight: 600;
    color: #DCFCE7;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.2px;
}

.visibility-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
}

.visibility-toggle:active {
    background: rgba(255, 255, 255, 0.3);
}

.balance-amount {
    font-size: clamp(26px, 7.5vw, 36px);
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.6px;
    margin-bottom: 18px;
    display: flex;
    align-items: baseline;
    gap: 4px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.balance-amount.hidden-amount {
    letter-spacing: 6px;
    font-size: clamp(20px, 6vw, 26px);
}

.balance-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(8px, 2.5vw, 12px);
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    width: 100%;
}

.metric-pill {
    display: flex;
    align-items: center;
    gap: clamp(6px, 2vw, 10px);
    min-width: 0;
}

.metric-icon-box {
    width: clamp(32px, 8vw, 36px);
    height: clamp(32px, 8vw, 36px);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-icon-box.income {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

.metric-icon-box.expense {
    background: rgba(254, 226, 226, 0.25);
    color: #FECACA;
}

.metric-details {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.metric-details span {
    font-size: 11.5px;
    font-weight: 600;
    color: #DCFCE7;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-details strong {
    font-size: clamp(13px, 3.8vw, 16px);
    font-weight: 800;
    display: block;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
    color: #FFFFFF;
}

.metric-details strong.expense {
    color: #FEE2E2;
}

/* ----------------------------------------------------------
   SELECTOR DE PERIODO / MES
   ---------------------------------------------------------- */
.period-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.period-nav-btn {
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
}

.period-nav-btn:active {
    background: var(--brand-light);
    color: var(--brand-primary);
}

.current-period-text {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: capitalize;
    letter-spacing: -0.2px;
}

/* ----------------------------------------------------------
   LOS 2 BOTONES GIGANTES DE ACCIÓN RÁPIDA (PASTOR)
   ---------------------------------------------------------- */
.quick-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(8px, 2.5vw, 14px);
    margin-bottom: 20px;
    width: 100%;
}

.action-btn-huge {
    border: none;
    border-radius: var(--radius-md);
    padding: clamp(14px, 3.5vw, 18px) clamp(8px, 2vw, 14px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 2vw, 10px);
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
    font-size: clamp(12px, 3.3vw, 14px);
    color: #FFFFFF;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    min-width: 0;
    width: 100%;
}

.action-btn-huge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.action-btn-huge:active {
    transform: scale(0.97);
}

.action-btn-huge.income {
    background: linear-gradient(135deg, #15803D 0%, #166534 100%);
    box-shadow: 0 6px 20px var(--brand-glow);
}

.action-btn-huge.expense {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    box-shadow: 0 6px 20px var(--expense-glow);
}

.action-btn-huge .btn-icon-circle {
    width: clamp(38px, 9vw, 44px);
    height: clamp(38px, 9vw, 44px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-btn-huge span {
    letter-spacing: -0.2px;
    text-align: center;
    line-height: 1.25;
}

/* ----------------------------------------------------------
   SECCIÓN DE MOVIMIENTOS RECIENTES
   ---------------------------------------------------------- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.section-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-primary);
    text-decoration: none;
    cursor: pointer;
}

/* Píldoras de filtro */
.filter-pills-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 100%;
}

.filter-pills-row::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 7px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.filter-pill.active {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-primary);
    box-shadow: 0 2px 8px var(--brand-glow);
}

/* Lista de Transacciones */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transaction-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: clamp(12px, 3vw, 14px) clamp(12px, 3.5vw, 16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.transaction-card:hover {
    box-shadow: var(--shadow-md);
}

.transaction-left {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2.5vw, 12px);
    flex: 1;
    min-width: 0;
}

.category-icon-bubble {
    width: clamp(36px, 9vw, 42px);
    height: clamp(36px, 9vw, 42px);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.transaction-meta {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.transaction-category {
    font-size: clamp(13px, 3.6vw, 14px);
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-category-name {
    font-size: clamp(13.5px, 3.8vw, 15px);
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

.tx-badge-tap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--brand-dark);
    background: var(--brand-light);
    border: 1px solid rgba(21, 128, 61, 0.25);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.transaction-card:hover .tx-badge-tap {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-primary);
}

.transaction-sub {
    font-size: clamp(11px, 3vw, 12px);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-right {
    text-align: right;
    margin-left: 8px;
    flex-shrink: 0;
}

.transaction-amount {
    font-size: clamp(13px, 3.8vw, 15px);
    font-weight: 800;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.transaction-amount.income {
    color: var(--income-color);
}

.transaction-amount.expense {
    color: var(--expense-color);
}

.swal2-tx-detail-popup {
    max-width: min(440px, 94vw) !important;
    padding: clamp(18px, 4vw, 24px) !important;
}

.transaction-actions-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    margin-top: 4px;
}

.transaction-actions-btn:hover {
    color: var(--brand-primary);
}

/* Estado Vacío */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: #FFFFFF;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}

.empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    color: var(--brand-primary);
    opacity: 0.6;
}

.empty-state p {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* ----------------------------------------------------------
   BARRA DE NAVEGACIÓN INFERIOR (BOTTOM NAV EN CELULARES)
   ---------------------------------------------------------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: var(--bottom-nav-height);
    background: #FFFFFF;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}

/* Ocultar barra inferior en PC ya que se usa la barra superior */
@media (min-width: 768px) {
    .bottom-nav {
        display: none !important;
    }
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    transition: all 0.2s;
}

.nav-item.active {
    color: var(--brand-primary);
}

.nav-item svg {
    width: 22px;
    height: 22px;
}

/* ----------------------------------------------------------
   MODALES Y BOTTOM SHEETS (RESPONSIVOS: MÓVIL Y PC)
   ---------------------------------------------------------- */
.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
    overflow-x: hidden;
}

.sheet-overlay.open {
    display: flex;
}

.sheet-container {
    width: 100%;
    max-width: 100%;
    background: #FFFFFF;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    border-top: 1px solid var(--border-color);
    padding: 16px clamp(14px, 4vw, 20px) max(28px, env(safe-area-inset-bottom)) clamp(14px, 4vw, 20px);
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: sheetSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

/* En PC el modal flota centrado con esquinas redondeadas */
@media (min-width: 768px) {
    .sheet-overlay {
        align-items: center;
        padding: 20px;
    }

    .sheet-container {
        max-width: min(540px, 92vw);
        border-radius: 20px;
        border: 1px solid var(--border-color);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
        animation: fadeIn 0.2s ease-out;
        padding: 24px 28px 28px 28px;
    }

    .sheet-handle {
        display: none;
    }
}

.sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 3px;
    background: #CBD5E1;
    margin: 0 auto 16px auto;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.sheet-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.sheet-close-btn {
    background: #F1F5F9;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Display de Monto Gigante */
.amount-display-box {
    background: #F8FAFC;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: clamp(12px, 3.5vw, 16px);
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.amount-display-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.amount-display-input-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
}

.amount-currency {
    font-size: clamp(24px, 7vw, 32px);
    font-weight: 800;
    color: var(--brand-primary);
    flex-shrink: 0;
}

.amount-input-hidden {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: clamp(26px, 8vw, 36px);
    font-weight: 800;
    width: 100%;
    max-width: 220px;
    text-align: left;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

/* SELECTOR DE CATEGORÍAS CON DESCRIPCIÓN */
.category-chips-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

.category-chip-btn {
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    transition: all 0.15s;
    box-shadow: var(--shadow-sm);
}

.category-chip-btn:hover {
    border-color: #94A3B8;
}

.category-chip-btn.selected {
    border-color: var(--brand-primary);
    background: #F0FDF4;
    box-shadow: 0 2px 10px rgba(21, 128, 61, 0.15);
}

.category-chip-btn .chip-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chip-content {
    flex: 1;
    min-width: 0;
}

.chip-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-primary);
    display: block;
    line-height: 1.25;
}

.chip-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
    line-height: 1.25;
}

.category-chip-btn.selected .chip-title {
    color: var(--brand-dark);
}

.category-chip-btn.selected .chip-desc {
    color: var(--brand-primary);
    font-weight: 600;
}

/* Campos de Formulario */
.form-field-group {
    margin-bottom: 16px;
}

.form-field-label {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 6px;
    display: block;
}

.date-shortcuts-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.date-chip {
    flex: 1 1 0;
    min-width: 70px;
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    font-size: clamp(12px, 3.2vw, 13px);
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    white-space: nowrap;
}

.date-chip.active {
    background: var(--brand-light);
    border-color: var(--brand-primary);
    color: var(--brand-dark);
}

.custom-date-input, .text-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: #FFFFFF;
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.text-input:focus, .custom-date-input:focus {
    border-color: var(--brand-primary);
}

/* Botón Grande Guardar */
.btn-submit-save {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    transition: all 0.2s;
}

.btn-submit-save:hover {
    transform: translateY(-2px);
}

.btn-submit-save:active {
    transform: scale(0.98);
}

.btn-submit-save.income {
    background: linear-gradient(135deg, #15803D 0%, #166534 100%);
    box-shadow: 0 6px 20px var(--brand-glow);
}

.btn-submit-save.expense {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    box-shadow: 0 6px 20px var(--expense-glow);
}

/* ----------------------------------------------------------
   PANTALLA DE ACCESO POR PIN (LOCK SCREEN)
   ---------------------------------------------------------- */
.pin-screen-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #F4F6F9;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 4vw, 24px);
    overflow-y: auto;
    overflow-x: hidden;
}

.pin-login-card {
    width: 100%;
    max-width: min(380px, 100%);
    background: #FFFFFF;
    padding: clamp(20px, 5vw, 32px) clamp(16px, 4vw, 24px);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: auto;
}

.pin-logo-box {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: contain;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(21, 128, 61, 0.15);
    border: 1px solid var(--border-color);
    background: #FFFFFF;
    padding: 6px;
}

.pin-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--brand-deep);
    margin-bottom: 4px;
    letter-spacing: -0.4px;
    text-align: center;
}

.pin-subtitle {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 22px;
    text-align: center;
    font-weight: 600;
}

/* 4 Bolitas del PIN */
.pin-dots-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #CBD5E1;
    background: #FFFFFF;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pin-dot.filled {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    box-shadow: 0 0 10px var(--brand-glow);
    transform: scale(1.15);
}

/* Teclado Numérico Táctil (Estilo Banco) */
.pin-numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    width: 100%;
    max-width: 270px;
    margin-bottom: 16px;
}

.numpad-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s;
}

.numpad-btn:hover {
    background: #F8FAFC;
    border-color: var(--brand-primary);
}

.numpad-btn:active {
    background: var(--brand-light);
    color: var(--brand-dark);
    transform: scale(0.92);
}

.numpad-btn.action-key {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    background: #F8FAFC;
}

.remember-session-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    cursor: pointer;
}

.remember-checkbox {
    accent-color: var(--brand-primary);
    width: 16px;
    height: 16px;
}

.pin-error-text {
    color: var(--expense-color);
    font-size: 13px;
    font-weight: 700;
    min-height: 20px;
    text-align: center;
    margin-bottom: 8px;
}

/* Botón de Envío Inmediato del PIN */
.btn-submit-pin {
    width: 100%;
    max-width: 270px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-dark) 100%);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--brand-glow);
    transition: all 0.2s ease;
    margin-top: 10px;
    outline: none;
}

.btn-submit-pin:hover {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-deep) 100%);
    box-shadow: 0 6px 20px var(--brand-glow);
    transform: translateY(-1px);
}

.btn-submit-pin:active {
    transform: scale(0.98);
}

.btn-submit-pin.ready {
    background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35), 0 8px 24px rgba(22, 163, 74, 0.3);
    animation: pulseReady 1.5s infinite;
}

.btn-submit-pin:disabled {
    opacity: 0.75;
    cursor: wait;
    transform: none;
}

@keyframes pulseReady {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35), 0 8px 24px rgba(22, 163, 74, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.5), 0 10px 30px rgba(22, 163, 74, 0.5);
    }
}

.desktop-pin-hint {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 10px;
    text-align: center;
}

@media (min-width: 768px) {
    .desktop-pin-hint {
        display: flex;
    }
}

/* ----------------------------------------------------------
   GRID RESPONSIVO PARA VISTA DEL PASTOR (PC vs CELULAR)
   ---------------------------------------------------------- */
.pastor-dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

@media (min-width: 768px) and (max-width: 991px) {
    .pastor-dashboard-grid {
        display: grid;
        grid-template-columns: minmax(290px, 350px) 1fr;
        gap: 20px;
        align-items: start;
    }
}

@media (min-width: 992px) {
    .pastor-dashboard-grid {
        display: grid;
        grid-template-columns: 410px 1fr;
        gap: 28px;
        align-items: start;
    }
}

.pastor-col-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

.pastor-col-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

@media (min-width: 768px) {
    .pastor-col-right {
        background: #FFFFFF;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 20px;
        box-shadow: var(--shadow-sm);
        min-height: 480px;
    }
}

.btn-pdf-quick {
    width: 100%;
    justify-content: center;
    margin-bottom: 22px;
    padding: 12px;
    font-weight: 700;
    border-color: var(--brand-primary);
    color: var(--brand-dark);
    background: var(--brand-light);
}

/* ----------------------------------------------------------
   GRID RESPONSIVO PARA VISTA DE REPORTES (PC vs CELULAR)
   ---------------------------------------------------------- */
.reports-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    width: 100%;
}

@media (min-width: 768px) {
    .reports-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

.kpi-metric-box {
    background: var(--bg-main);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    min-width: 0;
}

.kpi-metric-label {
    font-size: 11.5px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-metric-value {
    font-size: clamp(15px, 4vw, 18px);
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.kpi-metric-value.income { color: var(--income-color); }
.kpi-metric-value.expense { color: var(--expense-color); }
.kpi-metric-value.net { color: var(--brand-deep); }

.reports-two-col-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

@media (min-width: 860px) {
    .reports-two-col-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        align-items: start;
    }
}

.reports-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

/* ----------------------------------------------------------
   GRID RESPONSIVO PARA VISTA DE ADMINISTRACIÓN (PC vs CELULAR)
   ---------------------------------------------------------- */
.admin-dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

@media (min-width: 860px) {
    .admin-dashboard-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        align-items: start;
    }
}

.admin-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

/* ----------------------------------------------------------
   VISTA DE ADMINISTRACIÓN Y REPORTES
   ---------------------------------------------------------- */
.admin-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.admin-card-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #E2E8F0;
    color: var(--brand-primary);
}

.btn-primary-small {
    background: var(--brand-primary);
    color: #FFFFFF;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px var(--brand-glow);
    transition: all 0.2s;
}

.btn-primary-small:hover {
    background: var(--brand-dark);
}

/* Categorías en Admin */
.categories-manage-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cat-manage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.cat-manage-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.cat-manage-actions {
    display: flex;
    gap: 6px;
}

/* Reportes & Exportar */
.reports-summary-box {
    background: #F8FAFC;
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 14px;
}

.export-btn-full {
    width: 100%;
    background: var(--brand-primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--brand-glow);
    transition: all 0.2s;
}

.export-btn-full:hover {
    background: var(--brand-dark);
}

/* Notificación Flotante (Toast) */
.toast-notice {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #0F172A;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    z-index: 300;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast-notice.show {
    transform: translateX(-50%) translateY(0);
}

.toast-notice.success {
    background: #14532D;
    color: #FFFFFF;
}

.toast-notice.error {
    background: #7F1D1D;
    color: #FFFFFF;
}

/* Banner de Instalación PWA */
.pwa-install-banner {
    background: #FFFFFF;
    border: 1.5px solid var(--brand-light);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.pwa-banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-banner-text strong {
    font-size: 13px;
    color: var(--text-primary);
    display: block;
}

.pwa-banner-text span {
    font-size: 11.5px;
    color: var(--text-muted);
}

.pwa-install-btn {
    background: var(--brand-primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

/* ----------------------------------------------------------
   ESTILOS PERSONALIZADOS SWEETALERT2 - IUMP CONCÓN
   ---------------------------------------------------------- */
.swal2-container {
    z-index: 10000 !important;
}

.swal2-popup {
    font-family: var(--font-main) !important;
    border-radius: 22px !important;
    padding: 24px 22px !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16) !important;
    background: #FFFFFF !important;
}

.swal2-title {
    font-size: 19px !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    letter-spacing: -0.3px !important;
    margin-bottom: 8px !important;
}

.swal2-html-container {
    font-size: 14px !important;
    color: var(--text-secondary) !important;
    line-height: 1.5 !important;
    margin: 8px 0 18px 0 !important;
}

.swal2-actions {
    gap: 10px !important;
    margin-top: 14px !important;
}

.swal2-styled {
    border-radius: 12px !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    padding: 11px 20px !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-dark) 100%) !important;
    box-shadow: 0 4px 14px var(--brand-glow) !important;
}

.swal2-confirm:hover {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-deep) 100%) !important;
}

.swal2-cancel {
    background: #64748B !important;
}

.swal2-deny {
    background: #DC2626 !important;
}

/* SweetAlert2 Toast Flotante */
.swal2-toast {
    border-radius: 14px !important;
    padding: 12px 18px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18) !important;
    font-weight: 700 !important;
    font-size: 13.5px !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.swal2-toast .swal2-title {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    margin: 0 !important;
}

/* Estado de Botón de Notificaciones en Cabecera */
#btnNotifications.active {
    color: var(--brand-primary);
    background: var(--brand-light);
    border-color: var(--brand-primary);
    box-shadow: 0 0 12px var(--brand-glow);
}

/* ----------------------------------------------------------
   SELECTOR ESPECÍFICO DE PAGOS (LUZ, AGUA, INTERNET, ETC)
   ---------------------------------------------------------- */
.payment-service-group {
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: var(--radius-md);
    padding: 14px 14px;
    margin-bottom: 18px;
    transition: all 0.25s ease;
    animation: fadeIn 0.2s ease-out;
}

.payment-service-group .form-field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.payment-service-group select {
    font-size: 14.5px;
    font-weight: 600;
    border-color: #CBD5E1;
}

.payment-service-group select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.12);
}

.badge-hint {
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-dark);
    background: var(--brand-light);
    border: 1px solid rgba(21, 128, 61, 0.25);
    padding: 2px 8px;
    border-radius: 12px;
}

